I built an Internet connected clock 2 years ago and it's been working perfectly until this weekend. This weekend it started going through the cycle of "Connecting to WiFi" then "Connected to MikesNetwork24" and then stopping. When I connected it back to my PC and got the Serial Monitor working it was repeatedly resetting via the WDT. I got the original code intending to track down where it was crashing but when I compiled the code everything worked fine again. This leads me to suspect flash corruption. However, it's been powered for most of the two years - probably two short power cuts in that time.
Anyone any ideas or suggestions to work out what happened?
Maybe one of those photon/neutron thingies buzzed it and flipped a bit or two upsetting the program?
To be serious, about the only thing I've ever had that got a micro confused was glitches on the power supply and I don't recall ever having to reprogram the device to get it going again.
I tried power cycling a few times without success. I was expecting to find a bug in the code due to something (a time server) moving on the internet and it using a part of the code it hadn't previously used. However, the fact that reprogramming fixed it suggests a flash error. Maybe I'll have to wait another two years to find out.
Had to look it up, but it seems there have been a few eruptions from the sun over the last few weeks and headed stuff in our direction, another one due last night/today from all reports
Flash memories do leak away their data and eventually stop working. Re-flashing will usually correct the situation. Today's flash memories seem to hold up a lot longer than those produced 10 ago and prior.
I have had two AVR controllers become "stupid" as their flash memories leaked away the charges stored on the flash memory gates. It is just a matter of time and temperature, in addition to damage from too may write/erase cycles.
ESP32, some versions dual core. Could write code to compare two cores running
same code, and if necessary using onchip bootloader rewrite the code stored in
non active FLASH. One possibility.
I'm using the 8266 with 4Meg flash. The OTA code loads a new version via wifi and copies it over the lower region. I figured, copy code to second meg of flash, run it and it copies the code from the first meg to the third meg before copying it back to the first meg. I'm thinking that doing this every 6 months should fix any flash leakage problems.
I'm using the 8266 with 4Meg flash. The OTA code loads a new version via wifi and copies it over the lower region. I figured, copy code to second meg of flash, run it and it copies the code from the first meg to the third meg before copying it back to the first meg. I'm thinking that doing this every 6 months should fix any flash leakage problems.