Mark image as invalid from within the application #1240
-
In a scenario where you want to trigger a rollback from the application, how would you mark an image as invalid? Scenario: For example, after a DFU, a peripheral stops working because a custom communication protocol has been incorrectly updated. You can't detect this until you start the application. After some checks, the application could trigger a rollback by marking the running image as invalid. Is there an established way to do that? I can imagine some solutions, but they seem to me to be workarounds, for example modifying the magic number of the image. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The old image still exists in the secondary slot after a successful upgrade, so you could just mark it for upgrade again and confirm once it boots. |
Beta Was this translation helpful? Give feedback.
-
This would only work if rollback protection is not enabled. But, to clarify, there isn't really a way to unmark an image as valid after it has been marked as Ok. To do so would require erasing the flash sector, which could result in the loss of the other data in that sector. |
Beta Was this translation helpful? Give feedback.
This would only work if rollback protection is not enabled.
But, to clarify, there isn't really a way to unmark an image as valid after it has been marked as Ok. To do so would require erasing the flash sector, which could result in the loss of the other data in that sector.