You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a complex piece of code (display panel, RS485, PWM, etc.) that I fought for hours with and could never figure out why it kept throwing "attempt to modify read only flash" error when the app would try to initiate a safe boot. Presumably, I just wasn't getting something shut down correctly... so the result was that my attempt to safe boot, would simply crash and reboot my app. Actually, with enough testing, I discovered there were times when it would work, but it wasn't reliable.
At some point I hit upon the idea that I could simply stow a safe boot flag in EEPROM along with a build date/time, and, first thing in my app setup, before starting up any complexity, check that flag and if I'm in reboot mode for this build (build date/time matches), initiate a safe boot. That worked like a charm. So when it's time to safe boot, I still do it the normal way, but also set that reboot flag. That way, if it crashes, it'll still do a safe boot immediately after rebooting from the crash.
Another benefit I found to this little addition was a sort of fail safe in case a mod I made prevented me from getting through setup. At the start of setup, I set the safe boot flag, and at the end of SETUP I clear it. If I crash during SETUP, on next boot, the app will kick into SAFE BOOT, allowing me to fix whatever it was I broke.
Just mentioning this workaround for anyone else who stumbles into this situation like I did.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I had a complex piece of code (display panel, RS485, PWM, etc.) that I fought for hours with and could never figure out why it kept throwing "attempt to modify read only flash" error when the app would try to initiate a safe boot. Presumably, I just wasn't getting something shut down correctly... so the result was that my attempt to safe boot, would simply crash and reboot my app. Actually, with enough testing, I discovered there were times when it would work, but it wasn't reliable.
At some point I hit upon the idea that I could simply stow a safe boot flag in EEPROM along with a build date/time, and, first thing in my app setup, before starting up any complexity, check that flag and if I'm in reboot mode for this build (build date/time matches), initiate a safe boot. That worked like a charm. So when it's time to safe boot, I still do it the normal way, but also set that reboot flag. That way, if it crashes, it'll still do a safe boot immediately after rebooting from the crash.
Another benefit I found to this little addition was a sort of fail safe in case a mod I made prevented me from getting through setup. At the start of setup, I set the safe boot flag, and at the end of SETUP I clear it. If I crash during SETUP, on next boot, the app will kick into SAFE BOOT, allowing me to fix whatever it was I broke.
Just mentioning this workaround for anyone else who stumbles into this situation like I did.
Beta Was this translation helpful? Give feedback.
All reactions