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

Generating Settings and Bootlaoder Files

I am a little bit confused on the steps I need to follow to program the settings and the bootloader files. According to Secure DFU over Serial example instructions (https://infocenter.nordicsemi.com/index.jsp) I am supposed to program the settings hex file using the following cmd (nrfjprog --program --sectorerase settings.hex) but then in step 5 we are asked to program the bootloader which also asks us to erase the whole device deleting the settings page! Am I missing something? It would be great if someone lists the steps I need to follow to generate bootloader and settings files and how to program them.

Also according to nrfutil settings generate documentation, we could pass the application.hex file. Why would we do that and what would it use the file for?

Thanks!

Mustafa

  • Hi Mustafa, 

    the bootloader settings contains the version numbers as well as the CRC of the application,  so you need to provide the application hex to nrfutil when generating the bootloader settings page so that the application CRC can be calculated and included in the settings hex. 

    See Generating and displaying bootloader settings under the nRF Util documentation for more information

    When you have generated the settings hex then you only need to make sure that you flash the settings hex after you have flashed the bootloader hex with the nrfjprog command you posted

    nrfjprog --program settings.hex --sectorerase

    It does not matter if you flash the SoftDevice and Application before or after the bootloader and the settings hex have been flashed. 

    Best regards

    Bjørn

  • Thank you. The order you suggested works (erase all, program the bootloader and then program the settings file). However the provided programming command did not work for me. I had to use this syntax instead "nrfjprog --program settings.hex --sectorerase"

    Also, it would be great to update the secure serial bootloader example instructions. Today it lists the settings programming step before the erase all/bootloader programming steps.

  • That was a typo from my side. You are correct it should be "nrfjprog --program settings.hex --sectorerase" and not "nrfjprog --program  --sectorerase settings.hex". I have edited my answer. 

    Will report it internally.

Related