SWD flashing slot 0 partially results in unwanted behavior
If, after performing upgrades through mcuboot (writing to slot 1, rebooting, etc), a hardware tool, such as SWD, or JTAG is used to write a new image to slot 0, and that tool does not erase the entire partition, it results in unwanted behavior.
This is most noticeable if the image has not been maked as "Image OK", a subsequent boot with a replaced image can result in even a crash depending on the size of the image. In any case, MCUboot will attempt to revert the swap.
This originated as #zephyrproject-rtos/zephyr#37495, although it appears to entirely be an MCUboot issue.
The easiest workaround is to add --pad to the imgtool.py invocation so that the entire partition is written. Another solution is to always erase the entire flash with the jtag tool before adding new images.
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.