Could not power on normally after programming softdevice, bootloader, and application hex files

I am testing programming secure bootloader. But J-Link Commander reports Could not start CPU core. (ErrorCode: -1) after programming softdevice, bootloader, and application hex files. And nRF52832 device can't power on normally. Where can I download nRF52832 bootloader hex file. I would like to recover it.

D:\Temp\Jlink>flash_nrf52832_hex.bat

D:\Temp\Jlink>"D:\Program Files (x86)\SEGGER\JLink_V632i\JLink.exe" -Device NRF52832_XXAA -if SWD -speed 4000 -CommanderScript D:\Temp\Jlink\flash_nrf52832_hex.jlink
SEGGER J-Link Commander V6.32i (Compiled Jul 24 2018 15:20:49)
DLL version V6.32i, compiled Jul 24 2018 15:19:55


J-Link Command File read successfully.
Processing script file...

J-Link connection not established yet but required for command.
Connecting to J-Link via USB...O.K.
Firmware: J-Link OB-STM32F072-CortexM compiled Mar  8 2020 11:15:54
Hardware version: V1.00
S/N: -1
License(s): GDB, RDI, FlashBP, FlashDL, JFlash, RDDI
VTref=3.300V
Target connection not established yet but required for command.
Device "NRF52832_XXAA" selected.


Connecting to target via SWD
Found SW-DP with ID 0x2BA01477
Found SW-DP with ID 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x02880000)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
Cortex-M4 identified.
Erasing device (nRF52832_xxAA)...
J-Link: Flash download: Total time needed: 0.317s (Prepare: 0.047s, Compare: 0.000s, Erase: 0.264s, Program: 0.000s, Verify: 0.000s, Restore: 0.005s)
Erasing done.

Downloading file [D:\Temp\Jlink\softdevice_s132.hex]...
J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (155648 bytes)
J-Link: Flash download: Total time needed: 2.890s (Prepare: 0.097s, Compare: 0.016s, Erase: 0.000s, Program: 2.709s, Verify: 0.005s, Restore: 0.062s)
O.K.

Downloading file [D:\Temp\Jlink\bootloader_s132.hex]...
J-Link: Flash download: Bank 0 @ 0x00000000: 2 ranges affected (28672 bytes)
J-Link: Flash download: Total time needed: 0.587s (Prepare: 0.081s, Compare: 0.005s, Erase: 0.013s, Program: 0.442s, Verify: 0.002s, Restore: 0.042s)
O.K.

Downloading file [D:\Temp\Jlink\nrf52832_xxaa.hex]...
J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (94208 bytes)
J-Link: Flash download: Total time needed: 1.820s (Prepare: 0.098s, Compare: 0.009s, Erase: 0.000s, Program: 1.647s, Verify: 0.002s, Restore: 0.062s)
O.K.

Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.

Script processing completed.



Type "connect" to establish a target connection, '?' for help
J-Link>q

****** Error: Could not start CPU core. (ErrorCode: -1)

D:\Temp\Jlink>

Parents
  • Hi, 

    Can you use j-link debugger whose chip made by SEGGER and try again?

    -Amanda

  • Thanks for your suggestion! I will try it on next monday.

  • The following is log messages of J-Link RTT Viewer. But I can't find any log messages of bootloader.

    LOG: J-Link RTT Viewer V7.68c: Logging started.
    LOG: Terminal 0 added.
    LOG: Connecting to J-Link via USB...
    LOG: Device "NRF52832_XXAA" selected.
    LOG: InitTarget() start
    LOG: InitTarget() end
    LOG: Found SW-DP with ID 0x2BA01477
    LOG: DAP error while determining CoreSight SoC version
    LOG: InitTarget() start
    LOG: InitTarget() end
    LOG: Found SW-DP with ID 0x2BA01477
    LOG: DPIDR: 0x2BA01477
    LOG: CoreSight SoC-400 or earlier
    LOG: Scanning AP map to find all available APs
    LOG: AP[2]: Stopped AP scan as end of AP map has been reached
    LOG: AP[0]: AHB-AP (IDR: 0x24770011)
    LOG: AP[1]: JTAG-AP (IDR: 0x02880000)
    LOG: Iterating through AP map to find AHB-AP to use
    LOG: AP[0]: Core found
    LOG: AP[0]: AHB-AP ROM base: 0xE00FF000
    LOG: CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    LOG: Found Cortex-M4 r0p1, Little endian.
    LOG: FPUnit: 6 code (BP) slots and 2 literal slots
    LOG: CoreSight components:
    LOG: ROMTbl[0] @ E00FF000
    LOG: RTT Viewer connected.

  • I can see RTT log messages if I use nRF5_SDK_16.0.0\examples\dfu\secure_bootloader\pca10040_s132_ble_debug. What is difference between pca10040_s132_ble and pca10040_s132_ble_debug project?

     0> <info> app: Inside main
     0> <debug> app: In nrf_bootloader_init
     0> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
     0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
     0> <debug> nrf_dfu_settings: Using settings page.
     0> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
     0> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
     0> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
     0> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
     0> <debug> app: Enter nrf_bootloader_fw_activate
     0> <info> app: No firmware to activate.
     0> <info> app: Boot validation failed. No valid app to boot.
     0> <debug> app: DFU mode because app is not valid.
     0> <info> nrf_bootloader_wdt: WDT is not enabled
     0> <debug> app: in weak nrf_dfu_init_user
     0> <debug> app: timer_stop (0x20005980)
     0> <debug> app: timer_activate (0x20005980)
     0> <info> app: Entering DFU mode.
     0> <debug> app: Initializing transports (found: 1)
     0> <debug> nrf_dfu_ble: Initializing BLE DFU transport
     0> <debug> nrf_dfu_ble: Setting up vector table: 0x00072000
     0> <debug> nrf_dfu_ble: Enabling SoftDevice.
     0> <debug> nrf_dfu_ble: Configuring BLE stack.
     0> <debug> nrf_dfu_ble: Enabling the BLE stack.
     0> <debug> nrf_dfu_ble: No advertising name found
     0> <debug> nrf_dfu_ble: Using default advertising name
     0> <debug> nrf_dfu_ble: Advertising...
     0> <debug> nrf_dfu_ble: BLE DFU transport initialized.
     0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
     0> <debug> app: Enter main loop

  • Hi, 

    The pca10040_s132_ble_debug is enabled with log module for debugging. The others are the same. 

    -Amanda

Reply Children
Related