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

Secured DFU Bootloader Compilation

Dear Nordic Team and Community,

I am trying hard to compile and run the bootloader_secure example provided in SDK12.1. Here is the steps I follow :

  • Compilation runs smoothly and as a result I have a HEX file. I am using the same key as provided in the example

Linking target: _build/nrf52832_xxaa_s132.out

text data bss dec hex filename

33816 144 8368 42328 a558 _build/nrf52832_xxaa_s132.out

  • I create the bootloader_settings.hex.

  • I merge (using mergehex) the nrf52832_xxaa_s132.hex, bootloader_settings.hex and s132_nrf52_3.0.0_softdevice.hex to create the HEX I am installing on my nrf52.

The device is installed and the LED3 is lit.

However, I can't perform any DFU. The Android nrfConnect stops with an error Remote DFU error: REMOTE DFU OPERATION FAILED.

My point is that with provided hex file everything runs smoothly.

Also, my final hex file is 442kB whereas the provided one is 445kB.

I am missing some magic somewhere.

I would appreciate some hints, help or solution.

Thanks,

David

  • At the end, I spent some time re-reading the tutorial here and I think what completely messed me up is point 4 regarding bootloader settings HEX. It should be clearly stated that this should be generated from the application (not the bootloader) and then merged with the flashed bootloader. And that might be obvious, but it took me a long time to understand exactly the process of the DFU. Also, stating that the boot loading settings comprehends the CRC of the application, and the latter should not be modified until it is uploaded (the first time) might be worthy. Apart from that tricky point, the tutorial is clear. Again, great work !!!!

  • It is stated in the bootloader documentation, found here, that the bootloader settings page should be generated using the application. However, I agree that this is not clearly stated in the tutorial and I will pass this on so that the tutorial is improved.

Related