This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Thingy52 debugging under SES

I am new to Arm and Nordic devices and I am trying to port the Thingy52 firmware to SES so we can add some additional sensors.

I have got the Thingy52 firmware to compile under SES and I have attempted to run it using an external jlink. I get the following output after building

Preparing target for download
Executing script TargetInterface.resetAndStop()
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Downloading ‘s132_nrf52_4.0.2_softdevice.hex’ to J-Link
Programming 2.3 KB of addresses 00000000 — 00000963
Programming 117.9 KB of addresses 00001000 — 0001e7bf
J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
Download successful
Downloading ‘ble_app_thingy52_s132_pca20020.elf’ to J-Link
Programming 250.5 KB of addresses 00023000 — 00061a3f
Programming 0.2 KB of addresses 00061a40 — 00061b3b
Programming 0.0 KB of addresses 00061b3c — 00061b4b
J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
Download successful
Stopped by vector catch

The vector catch address is  0x0000E022. I cant get the debugger to run or to display logs. Also looking at the flash window It doesn't seem to be located in the correct range. I would have expected it to start at 0 with the soft device at the top end. Any help would be appreciated

Parents
  • I solved this by changing the section placement macro in project options to 

    FLASH_START=0x1F000

    RAM_START=0x20004170

    I can now get the debugger running with the following output

    [0mmain :INFO:[1;32m===== Thingy started! =====
    [0m[0mdrv_ext_light :DEBUG:Initialized
    [0m[0mdrv_ext_light :DEBUG:Light off
    [0m[0mdrv_ext_light :DEBUG:m_ioext_osc_status_change, LED ID: 0, old status: 0, new status 1
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 754, code 7
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 858, code 7
    [0m[0mdrv_ext_light :DEBUG:Light off
    [0m[0mdrv_ext_light :DEBUG:m_ioext_osc_status_change, LED ID: 1, old status: 0, new status 1
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 754, code 7
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 858, code 7
    [0m[0mm_env :INFO:Init:
    [0m[0mm_motion :INFO:Init
    [0m[0mm_sound :INFO:Sound_init
    [0m[0mm_batt_meas :DEBUG:Init
    [0m[0mSDH:DEBUG:RAM start at 0x20004170.
    [0m[1;33mm_ble :WARNING:Too few random bytes available. Trying again
    [0m[1;33mm_ble :WARNING:Too few random bytes available. Trying again
    [0m[1;33mm_ble :WARNING:Too few random bytes available. Trying again
    [0m[0mm_ble :INFO:Available random bytes: 23
    [0m[0mm_ble :INFO:Random value (hex): [0m2x[0m2x[0m2x[0m2x[0m
    [0m[0mm_ble_flash :INFO:Initialization
    [0m[0mm_ble_flash :INFO:garbage collect success
    [0m[0mm_ble_flash :INFO:Loading configuration
    [0m[0mm_ble :INFO:[1;32mm_ble: Current FW: v255.255.255
    [0m[0mm_env_flash :INFO:Initialization
    [0m[0mm_env_flash :INFO:Loading configuration
    [0m[0mm_env_flash :DEBUG:Loading baseline
    [0m[0mm_env :INFO:Init: ble_tes_init
    [0m[0mdrv_ext_light :DEBUG:Light off
    [0m[0mdrv_ext_light :DEBUG:m_ioext_osc_status_change, LED ID: 0, old status: 1, new status 1
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 754, code 7
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 858, code 7
    [0m[0mm_motion_flash:DEBUG:Initialization
    [0m[0mm_motion_flash:DEBUG:Loading configuration
    [0m[0mm_motion :INFO:motion_service_init: ble_tms_init
    [0m[0mm_ui_flash :INFO:Initialization
    [0m[0mm_ui_flash :INFO:Loading configuration
    [0m[0mm_sound :INFO:sound_service_init: ble_tss_init
    [0m[0mm_batt_meas :DEBUG:battery_service_init: ble_bas_init
    [0m[0mm_ble :INFO:on_adv_evt: BLE_ADV_EVT_FAST
    [0mMAC addr-> 2x:2x:2x:2x:2x:2x
    [0m[0mm_ble :INFO:nfc string: 2x:2x:2x:2x:2x:2x 2x2x2x2x
    [0m[0mdrv_nfc :INFO:NFC total message size 256 bytes
    [0m[0mdrv_nfc :INFO:NFC used message size 117 bytes
    [0m[0madv_beacon_...:INFO:app_beacon_init:
    [0m[0madv_beacon_...:INFO:app_beacon_start:
    [0m[0mdrv_ext_light :DEBUG:Light off
    [0m[0mdrv_ext_light :DEBUG:m_ioext_osc_status_change, LED ID: 1, old status: 1, new status 1
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 754, code 7
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 858, code 7
    [0m[1;33mm_ui :WARNING:Err code returned in file: C:\Nordic\thingy52\source\modules\m_ui.c, line: 154, code 7
    [0m[1;33mm_ui :WARNING:Err code returned in file: C:\Nordic\thingy52\source\modules\m_ui.c, line: 398, code 7
    [0m[1;31mmain :ERROR: id = 16385, pc = 0, file = C:\Nordic\thingy52\project\pca20020_s132\main.c, line number: 307, error code = 7 = NRF_ERROR_INVALID_PARAM
    [0m[0mdrv_ext_light :DEBUG:Light off
    [0m[0mdrv_ext_light :DEBUG:m_ioext_osc_status_change, LED ID: 1, old status: 1, new status 1
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 754, code 7
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 858, code 7
    [0m[1;33mm_ui :WARNING:Err code returned in file: C:\Nordic\thingy52\source\modules\m_ui.c, line: 154, code 7
    [0m[1;33mm_ui :WARNING:Err code returned in file: C:\Nordic\thingy52\source\modules\m_ui.c, line: 403, code 7

Reply
  • I solved this by changing the section placement macro in project options to 

    FLASH_START=0x1F000

    RAM_START=0x20004170

    I can now get the debugger running with the following output

    [0mmain :INFO:[1;32m===== Thingy started! =====
    [0m[0mdrv_ext_light :DEBUG:Initialized
    [0m[0mdrv_ext_light :DEBUG:Light off
    [0m[0mdrv_ext_light :DEBUG:m_ioext_osc_status_change, LED ID: 0, old status: 0, new status 1
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 754, code 7
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 858, code 7
    [0m[0mdrv_ext_light :DEBUG:Light off
    [0m[0mdrv_ext_light :DEBUG:m_ioext_osc_status_change, LED ID: 1, old status: 0, new status 1
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 754, code 7
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 858, code 7
    [0m[0mm_env :INFO:Init:
    [0m[0mm_motion :INFO:Init
    [0m[0mm_sound :INFO:Sound_init
    [0m[0mm_batt_meas :DEBUG:Init
    [0m[0mSDH:DEBUG:RAM start at 0x20004170.
    [0m[1;33mm_ble :WARNING:Too few random bytes available. Trying again
    [0m[1;33mm_ble :WARNING:Too few random bytes available. Trying again
    [0m[1;33mm_ble :WARNING:Too few random bytes available. Trying again
    [0m[0mm_ble :INFO:Available random bytes: 23
    [0m[0mm_ble :INFO:Random value (hex): [0m2x[0m2x[0m2x[0m2x[0m
    [0m[0mm_ble_flash :INFO:Initialization
    [0m[0mm_ble_flash :INFO:garbage collect success
    [0m[0mm_ble_flash :INFO:Loading configuration
    [0m[0mm_ble :INFO:[1;32mm_ble: Current FW: v255.255.255
    [0m[0mm_env_flash :INFO:Initialization
    [0m[0mm_env_flash :INFO:Loading configuration
    [0m[0mm_env_flash :DEBUG:Loading baseline
    [0m[0mm_env :INFO:Init: ble_tes_init
    [0m[0mdrv_ext_light :DEBUG:Light off
    [0m[0mdrv_ext_light :DEBUG:m_ioext_osc_status_change, LED ID: 0, old status: 1, new status 1
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 754, code 7
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 858, code 7
    [0m[0mm_motion_flash:DEBUG:Initialization
    [0m[0mm_motion_flash:DEBUG:Loading configuration
    [0m[0mm_motion :INFO:motion_service_init: ble_tms_init
    [0m[0mm_ui_flash :INFO:Initialization
    [0m[0mm_ui_flash :INFO:Loading configuration
    [0m[0mm_sound :INFO:sound_service_init: ble_tss_init
    [0m[0mm_batt_meas :DEBUG:battery_service_init: ble_bas_init
    [0m[0mm_ble :INFO:on_adv_evt: BLE_ADV_EVT_FAST
    [0mMAC addr-> 2x:2x:2x:2x:2x:2x
    [0m[0mm_ble :INFO:nfc string: 2x:2x:2x:2x:2x:2x 2x2x2x2x
    [0m[0mdrv_nfc :INFO:NFC total message size 256 bytes
    [0m[0mdrv_nfc :INFO:NFC used message size 117 bytes
    [0m[0madv_beacon_...:INFO:app_beacon_init:
    [0m[0madv_beacon_...:INFO:app_beacon_start:
    [0m[0mdrv_ext_light :DEBUG:Light off
    [0m[0mdrv_ext_light :DEBUG:m_ioext_osc_status_change, LED ID: 1, old status: 1, new status 1
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 754, code 7
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 858, code 7
    [0m[1;33mm_ui :WARNING:Err code returned in file: C:\Nordic\thingy52\source\modules\m_ui.c, line: 154, code 7
    [0m[1;33mm_ui :WARNING:Err code returned in file: C:\Nordic\thingy52\source\modules\m_ui.c, line: 398, code 7
    [0m[1;31mmain :ERROR: id = 16385, pc = 0, file = C:\Nordic\thingy52\project\pca20020_s132\main.c, line number: 307, error code = 7 = NRF_ERROR_INVALID_PARAM
    [0m[0mdrv_ext_light :DEBUG:Light off
    [0m[0mdrv_ext_light :DEBUG:m_ioext_osc_status_change, LED ID: 1, old status: 1, new status 1
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 754, code 7
    [0m[1;33mdrv_ext_light :WARNING:Err code returned in file: C:\Nordic\thingy52\source\drivers\drv_ext_light.c, line: 858, code 7
    [0m[1;33mm_ui :WARNING:Err code returned in file: C:\Nordic\thingy52\source\modules\m_ui.c, line: 154, code 7
    [0m[1;33mm_ui :WARNING:Err code returned in file: C:\Nordic\thingy52\source\modules\m_ui.c, line: 403, code 7

Children
No Data
Related