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

Secure DFU: Bootloader Settings

Hi,

I am trying to create a combined Bootloader + Bootloader Settings + Application hex file to flash the same into the devices during the production.

Bootloader Project:

pca10056_uart

Bootloader Settings:

nrfutil settings generate --family NRF52840 --application Firmware_PD52840V1R1.hex --application-version 0 --bootloader-version 0 --bl-settings-version 2 bootloader_settings.hex

Please note that I didn't give --no-backup as a parameter when creating settings.

Merging Files:

Bootloader and Settings

mergehex --merge secure_bootloader_uart_mbr_pca10056.hex bootloader_settings.hex --output BL_And_Settings.hex

BL+Settings and Applcation

mergehex --merge BL_And_Settings.hex Firmware_PD52840V1R1.hex --output finalMergedFile.hex

I noticed that, this is just updating the Bootloader settings in bank_0 and bank1 is filled by null. As the BL checks for the settings in Bank 1, even with the valid applicaton present, the BL isn't jumping to the application.

May I know what should I do to get the BL settings in Bank1?

Parents Reply
  • Hi,

    The combinedHex.hex did not include the MBR section. Here's how I checked it with nrfjprog:

    $ nrfjprog --program combinedHex.hex --chiperase -r
    Parsing hex file.
    Erasing user available code and UICR flash areas.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    Applying system reset.
    Run.

    $ nrfjprog --memrd 0
    0x00000000: FFFFFFFF                              |....|  /* Flash at address 0x0 is erased */

    The MBR hex file can be found in <sdk_root>\components\softdevice\mbr\hex\

Children
  • Thanks Vidar. Indeed, this is the problem.

    Here's how I fixed the problem:

    Merging MBR, BL Settings and BL Hex files

    mergehex -m mbr_nrf52_2.4.1_mbr.hex bootloader_settings.hex secure_bootloader_uart_mbr_pca10056.hex -o bl_mbr_blSettings.hex

    Merging the App with BL

    mergehex -m bl_mbr_blSettings.hex Firmware_PD52840V1R1.hex -o combinedHex.hex

    After flashing the combinedHex.hex, nRF is booting up as expected. Thanks for the help. I appreciate the help.

Related