-
Notifications
You must be signed in to change notification settings - Fork 848
Closed
Labels
Description
Dublication from zephyrproject-rtos/zephyr#54373
Describe the bug
When installing an image with mcuboot swap using move, the installation can fail if the image is too big.
In that case the old image is loaded again.
If we ask the image for its swap type using the mcuboot_swap_type-function we expect it to say none, but we get test instead.
#include <stdbool.h>
#include <dfu/dfu_target.h>
#include <dfu/dfu_target_mcuboot.h>
#include <dfu/mcuboot.h>
void main(void)
{
mcuboot_swap_type();
}
To Reproduce
Steps to reproduce the behavior:
- Make mcuboot update swap using move fail by providing an image that is too big
- use the
mcuboot_swap_type();function somewhere in the firmware.
Expected behavior
After the upgrade failed, mcuboot reverts to the previous image. It is expected to be of swap type none but instead it is of type test
Impact
If someone is using the flag to check for a "healthy" boot, they get unexpected behavior. Reset cycles for example.
Logs and console output
*** Booting Zephyr OS build v3.1.99-ncs1-12-gaa84ba70d601 ***
<inf> mcuboot_util: Swap type: none
Let me know if additional context is needed.