I have MCU boot running successfully in my project using NCS 2.8.0 and sysbuild. I'm now trying to add hardware downgrade protection as described here:
My sysbuild.conf in the project root now looks like this:
SB_CONFIG_BOOTLOADER_MCUBOOT=y
SB_CONFIG_BOOT_SIGNATURE_KEY_FILE={my private key file}
SB_CONFIG_MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION=y
SB_CONFIG_MCUBOOT_HW_DOWNGRADE_PREVENTION_COUNTER_SLOTS=240
SB_CONFIG_MCUBOOT_HW_DOWNGRADE_PREVENTION_COUNTER_VALUE=1
I load the updated bootloader and app using JTAG, then create a new app version with the counter value incremented to 2, and it loads OK.
I then try to load the original app with counter=1 and it also loads OK with no error message. Clearly downgrade prevention is not happening.
Is there another setting somewhere that I'm missing? The MCUboot startup looks like this with no indication of doing any downgrade check:
*** Booting MCUboot v2.1.0-dev-4594a8693738 ***
*** Using nRF Connect SDK v2.8.0-a2386bfc8401 ***
*** Using Zephyr OS v3.7.99-0bc3393fb112 ***
I: Starting bootloader
I: Primary image: magic=good, swap_type=0x2, copy_done=0x1, image_ok=0x1
I: Secondary image: magic=good, swap_type=0x2, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Image index: 0, Swap type: test
I: Starting swap using move algorithm.
I: Bootloader chainload address offset: 0xc000
ÿ: Jumping to the first image slot
Simon