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

MCUboot does not boot image

Hello All,

I am using NCS 1.3.1 and trying to get the SMP Server sample up and running. I am able to successfully complete a multi-image build and boot MCUboot after flashing merged.hex. But I encounter an issue when MCUboot attempts to boot the SMP Server app. I see the output below and then the nRF52840 resets.

[00:00:15.001,281] <inf> mcuboot: Primary image: magic=bad, swap_type=0x1, copy_done=0x2, image_ok=0x2
[00:00:15.001,281] <inf> mcuboot: Boot source: none
[00:00:15.001,373] <inf> mcuboot: Swap type: none

Seeing magic=bad led me to believe something might be wrong with the image header so I examined the starting address of the slot0 partition, in my case <0x11000>. Contents are below. It seems like the magic number is there but the flags might not be set correct and the rest of the header is not defined (the hex editor tool fills undefined space with 0xff). The image seems to be there and starts where it should, after the image header at <0x11200>.

I had to expand the MCUboot partition similar to described here (https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/software/posts/device-firmware-update-dfu-with-mcuboot-bootloader). Additionally, I needed to offset the MCUboot from 0 to 0x1000 to avoid overwriting the MBR (the Secure Bootloader is booting MCUboot). Lastly, I increased the size of the main stack after reading this thread (https://devzone.nordicsemi.com/f/nordic-q-a/67896/problem-with-signing-images-for-ota-dfu). Other than these items, MCUboot and the SMP Server sample haven't been modified.

It would appear MCUboot is not looking for the magic number at the correct address? What am I missing here?

Regards,

Kiran

Parents Reply Children
Related