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

nrf52840 bootloader test

Hi,

I am trying to use bootloader and following  https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/getting-started-with-nordics-secure-dfu-bootloader

In Step D1, For bootloader binary, I built examples\dfu\secure_bootloader\pca10056_ble\armgcc. But, I can't see DfuTarg in the nrfConnect app after flashing softdevice and bootloader. 

[ command for flash softdevice and bootloader ]

1. flash softdevice

  nrfjprog -f nrf52 --program $(SDK_ROOT)/components/softdevice/s140/hex/s140_nrf52_6.1.1_softdevice.hex --sectorerase
  nrfjprog -f nrf52 --reset
2. flash bootloader
  nrfjprog -f nrf52 --program nrf52840_xxaa_s140.hex --sectorerase
  nrfjprog -f nrf52 --reset
What can I do for debugging this? And Can I see debug logs of boot loader through uart?
Thank you.
  • Hi,

    Which SDK version are you using? I ask because SDK 15.3 puts the bootloader start address in the end of the MBR page. And if you first program the SoftDevice (which includes the MBR), and then program the bootloader with the "--sectorerase" option, this will then effectively delete the MBR. And without the MBR, the device will not execute any code. To avoid this problem you should make sure to not program the bootloader with sectorerase after programming the SoftDevice, and vise versa (which would delete the bootloader start address instead). The workaround is to first do a full chip erase (nrfjprog -e), and then program both the SoftDevice and bootloader without the "--sectorerase" option.

    If you use another SDK version, we need to look in a different direction.

    What can I do for debugging this? And Can I see debug logs of boot loader through uart?

    The best way to debug bootloader issues is to use a debug bootloader with RTT logging enabled. All bootloader examples come in two variants, with and without logging. The one with logging is suffixed with "_debug".

  • Hi,

    I am using SDK15.3, I verified DfuTarg can be connected after flashing without sector erase option.

    Thank you for your help.

Related