-
Notifications
You must be signed in to change notification settings - Fork 1
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
Lack of scratch page may result in lost data at power loss #1
Comments
This is referred to in Line 2 in efadc79
|
Yes, I can confirm this is a problem, which is why I didn't advertise the stateful exchange as a feature (yet). The scratchpad would need to have a size of PAGE_SIZE. This would obviously reduce the usable size for the firmware, but IMO that is a very good tradeoff to make it an always included feature. Could this be realised as part of the bootloader via some macro/linker magic, without modifying the linker script? We could get into problems if this ever supports different memory devices (e.g. external flash/EEPROM). Where will the scratchpad be stored then? |
See #2 for a proposal on how to get the bootloader power-interrupt safe. As for external flash, perhaps we should change |
During the exchange of pages a page may be lost at brownout because it only exists in RAM. This can happen during or shortly after this statement:
moonboot/src/boot/mod.rs
Lines 252 to 254 in efadc79
Fixing this would require an intermediate scratch page to write each page to, as well as an appropriate representation of this intermediate state in the State page.
The text was updated successfully, but these errors were encountered: