MCU Boot for secondary slot, fw_validation_info magic

Hello,

I'm using a combination of B0 and MCU Boot.

I want to build MCU Boot for secondary slot to try upgrading it.

I pass CONFIG_BUILD_S1_VARIANT=y to the build system and it produces the following .elf files in the build/mcuboot:

/build/mcuboot/zephyr/zephyr_prebuilt.elf
./build/mcuboot/zephyr/s1_image_prebuilt.elf
./build/mcuboot/zephyr/zephyr.elf
./build/mcuboot/zephyr/s1_image.elf

As I understand, the last file, s1_image.elf, is the image that should be written to the secondary slot. If I write it there, B0 sees it, but fails to verify: "Could not find valid firmware validation info". Note, I build mcuboot for slot 1 with version which is bigger than that of the mcuboot in slot 0, so B0 tries to boot it first.

Indeed, magic array in the fw_validation_info contains 0xFFFFFFFF instead of expected 0x281ee6de, 0x86518483, 0x00013502.

At what stage is this validation magic code written?
Is it done via validation_data.py?

What is the correct way to generate mcuboot image for slot 1?

Thanks

Related