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

What's the difference between this hex files with _mbr suffix and how do you generate them?

in SDK/examples/peripheral/blinky/hex

there is one file

blinky_pca10056_mbr.hex

in

SDK/examples/peripheral/blinky/pca10056/mbr/ses/Output/Release/Exe

there's one file

blinky_pca10056_mbr.hex

I have compared the content of these two hex files, they are very different.

However when i flashed them onto nRF52840DK through usb port J-3 (not J-link one) via nRF connect, both of them work.

1.So how did the first file (the one in hex folder) get generated?

2. I tried to flash the hex file (blinky_pca10056.hex) from SDK/examples/peripheral/blinky/pca10056/blank/ses/Output/Release/Exe via nRF connect, the board did not blink. Obviously this hex file  (blinky_pca10056.hex) lacks mbr or bootloader which is essential for the DFU operation to succeed.

How to generate a hex file through segger that has _mbr suffix and can be flashed with nRF connect? In other words what different settings in project at  SDK/examples/peripheral/blinky/pca10056/mbr/ses/ made the hex file contain the mbr?

Thanks.

  • Hi,

    I will answer in reversed order.

    2. The blinky_pca10056_mbr.hex that is generated under <SDK>/examples/peripheral/blinky/pca10056/mbr/ses/Output/Release/Exe is the result when building the SES project blinky_pca10056_mbr.emProject. This includes only the blinky application, but it starts at page 1 (FLASH_START=0x1000), making room for the MBR in page 0. It also reserves the first 8 bytes of RAM for the MBR, so RAM_START is set to 0x20000008 (instead of 0x20000000 as is the case for the non-mbr project). Code execution always starts from address 0, so this will only work if you also flash the MBR .hex file.

    1. The blinky_pca10056_mbr.hex from <SDK>/examples/peripheral/blinky/hex is the result of merging the .hex file generated as described above and the MBR .hex file from <SDK>\components\softdevice\mbr\hex\. This is done for convenience since that allows you to just flash that single file to test, instead of having to flash both .hex files separately (or merge them yourself).

    You can merge the files yourself if you want using the mergehex tool that is part of nRF Command Line Tools.

Related