Skip to content

Conversation

@ofirshe
Copy link
Contributor

@ofirshe ofirshe commented May 22, 2025

Previously, boot_set_next() would perform a full slot erase when
BOOT_MAGIC_BAD was detected. This is no longer done, as the
decision on how to handle a corrupted image should be left to user code.

@ofirshe ofirshe requested a review from davidvincze as a code owner May 22, 2025 16:56
@ofirshe
Copy link
Contributor Author

ofirshe commented May 23, 2025

@de-nordic

Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is from the user application side, the image would not be scrambled because this function does not run from MCUboot

@de-nordic
Copy link
Collaborator

de-nordic commented May 23, 2025

this is from the user application side, the image would not be scrambled because this function does not run from MCUboot

Shouldn't we leave the decision what to do to a user code? User may want to just re-start DFU so will erase or attempt to erase the area anyway. We report here bad image, so user will know that there is a problem.

Previously, boot_set_next() would perform a full slot erase when
BOOT_MAGIC_BAD was detected. This is no longer done, as the
decision on how to handle a corrupted image should be left to user code.

Signed-off-by: Ofir Shemesh <ofirshemesh777@gmail.com>
@ofirshe ofirshe force-pushed the ofirshe-bootutil-avoid-full-erase-bad-magic branch from 4f3d019 to 9f73145 Compare May 23, 2025 09:39
@ofirshe
Copy link
Contributor Author

ofirshe commented May 23, 2025

this is from the user application side, the image would not be scrambled because this function does not run from MCUboot

@nordicjm You're right - this function runs from the user application, so the image won't be scrambled at that point. What I meant is that the invalid image will be detected on the next reboot, and MCUboot will take the appropriate action.
I agree with @de-nordic that the decision on how to handle this should be left to the user, which is the motivation behind this PR. I've changed the commit message accordingly.

@ofirshe ofirshe requested a review from nordicjm May 23, 2025 09:42
@de-nordic de-nordic merged commit 68a4c96 into mcu-tools:main Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants