mcuboot icon indicating copy to clipboard operation
mcuboot copied to clipboard

SWD flashing slot 0 partially results in unwanted behavior

Open d3zd3z opened this issue 4 years ago • 1 comments

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.

d3zd3z avatar Aug 23 '21 23:08 d3zd3z

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.

github-actions[bot] avatar Feb 21 '22 01:02 github-actions[bot]