-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] If an OTA is interrupted, will the bootloader detect the invalid image? always? (IDFGH-10921) #12115
Comments
The relevant code seems to be in
It does appear to calculate a checksum of the entire app, so incomplete OTA should always be detected, perhaps. edit: the checksum appears to be a single byte? why so small? |
It looks like in non-secure mode we also check the appended SHA256
But I do not understand this comment, which seems to contradict the above statement. Edit: nevermind this comment appears to be about checking the SHA256 of the bootloader itself, not the app
So in summary, it seems we should always (*) detect an incomplete OTA update during the next boot. Can anyone confirm? (*) apart from SHA256 hash collisions (i.e. extremely improbable) |
Hope this helps! |
@mahavirj thanks it does help!
I have a weird setup with a "main" app and "firmware update" app. I always reset otadata back to "main" after boot. So it's possible I try to boot an incomplete image. this is why i wanted to confirm the validity check is reliable :) |
General issue report
I have read the documentation here:
Question:
If the main OTA update did not complete (i.e. due to power loss), I want to:
I have a custom bootloader, so number '2' is no issue, I'm concerned about how reliable number '1' is. Will the bootloader detect the invalid image? always?
The text was updated successfully, but these errors were encountered: