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

Bootloader HEX modification for BIN conversion

What I am trying to do is update bootloader by DFU OTA. I slightly modified bootloader found in SDK 8.0.0 and I want to upload it to device which currently is on the field.

I found document How to generate the INIT file for the DFU which says (page 4) that I need to modify HEX file of the bootloader a bit to generate proper BIN file.

It seems to work properly on tested device, I can upgrade and downgrade bootloader without problems, but I want to make sure what problem can be caused by deleting these two lines from HEX file? I don't have physical access to device which bootloader I want to change, so I have to minimize the risk of making it unable to update later or something.

Could You confirm that method in that document is recommended by Nordic?

BR

Wojtek

  • Hi Wojtek,

    Yes, the document is provided by Nordic. As all the repositories in the github.com/.../ is posted and maintained by Nordic staff.

    The 2 last line in the bootloader hex file is where we write into UICR the address of the bootloader.

    The main difference between the hex file and the binary file is that the hex file handle data base on the address. When the bin file has no address index or anything, simply pure data as a long array. The UICR located in a far remote address (0x10001000) compare to the flash address (end at 0x40000) This will cause the binary, when converted, without the removal of the 2 last line to be very big (256MB? ).

    When we do DFU, we don't rewrite the UICR (because we can't) so the UICR part is not needed.

    So you can be sure that's nothing wrong with this approach.

    However, as mentioned in the doc, that instruction is deprecated. Now you can do the task to generate .zip file with nrf.exe tool. The tool will take care of the 2 lines for you.

Related