-
Hi, I’ve successfully set up MCUboot with two image slots (slot-0 and slot-1) using the default configuration:
My application acts like However, for testing purposes, I manually corrupted the first few bytes of the slot-1 image before rebooting. When I reboot the device, the bootloader hangs at this point:
Only after manually resetting the device again does the bootloader finally revert back to the image in |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
Cc @nordicjm |
Beta Was this translation helpful? Give feedback.
-
Was answered on discord:
|
Beta Was this translation helpful? Give feedback.
I identified the root cause: the bootloader isn’t actually hanging. In the version Zephyr currently points to, MCUboot detects that the image in the secondary slot is invalid. However, before printing the message
"mcuboot: Image in the secondary slot is not valid!"
, it first erases the entire secondary slot. This erasure process takes time, which gives the false impression that the bootloader is unresponsive.In the latest upstream Zephyr, there’s an available option:
MCUBOOT_MINIMAL_SCRAMBLE
. Enabling this significantly reduces the delay by minimizing or skipping the full erase operation, allowing MCUboot to fall back to the primary slot much faster.