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

Flashing secure bootloader on the nRF52840 works with SEGGER Embedded but not with nrfjprog

Hi,

I'm trying to flash the secure_bootloader example onto a nrf52840 DK, after generating a private key, flashing with SEGGER embedded studio worked, the device entered DFU mode successfully with LED1/LED2 light up. 

However, when I erase the flash and tried to flash the secure_bootloader hex file using nrfjprog, the process said to have been successful but device does not enter DFU, no LEDs light up.

$ nrfjprog -f nrf52 --program secure_bootloader_usb_mbr_pca10056.hex --sectorerase --verify
Parsing hex file.
Erasing page at address 0x0.
Erasing page at address 0xF4000.
Erasing page at address 0xF5000.
Erasing page at address 0xF6000.
Erasing page at address 0xF7000.
Erasing page at address 0xF8000.
Erasing page at address 0xF9000.
Erasing page at address 0xFA000.
Erasing page at address 0xFB000.
Erasing page at address 0xFC000.
Applying system reset.
Checking that the area to write is not protected.
Programming device.
Verifying programming.
Verified OK.

I also tried with make/make flash, and the same issue is occuring

$ make
mkdir _build
cd _build && mkdir nrf52840_xxaa
Assembling file: gcc_startup_nrf52840.S
Compiling file: nrf_dfu_serial_usb.c
....
....
....
Compiling file: oberon_backend_hmac.c
Linking target: _build/nrf52840_xxaa.out
   text    data     bss     dec     hex filename
  35772     196   24600   60568    ec98 _build/nrf52840_xxaa.out
Preparing: _build/nrf52840_xxaa.hex
Preparing: _build/nrf52840_xxaa.bin
DONE nrf52840_xxaa

$ make flash

DONE nrf52840_xxaa
Flashing: _build/nrf52840_xxaa.hex
nrfjprog -f nrf52 --program _build/nrf52840_xxaa.hex --sectorerase
Parsing hex file.
Erasing page at address 0x0.
Erasing page at address 0xF4000.
Erasing page at address 0xF5000.
Erasing page at address 0xF6000.
Erasing page at address 0xF7000.
Erasing page at address 0xF8000.
Erasing page at address 0xF9000.
Erasing page at address 0xFA000.
Erasing page at address 0xFB000.
Erasing page at address 0xFC000.
Applying system reset.
Checking that the area to write is not protected.
Programming device.
nrfjprog -f nrf52 --reset
Applying system reset.
Run.

Parents Reply
  • The Thread and Zigbee SDK is based on SDK v15.3.0 where there is a known issue with the bootloader. It writes the bootloader start address and MBR parameter page address to the MBR section, so if one uses nrfjprog with the sectorerase option, then the MBR page will be erased so that the addresses can be written to the page. This has been fixed in SDK v16.0.0 where the bootloader now writes the addresses to the MBR at run-time the first time the bootloader runs. 

    Best regards

    Bjørn

Children
No Data
Related