It would be good to have some functionality on the Photon that boots it into safe mode so it can be flashed with replacement/fixed firmware once it has hard faulted 3 times within a set amount of time.
Has anyone done this?
Any ideas for how it could be done?
We would need to increment a counter stored in EEPROM/SRAM each time the Photon Hard faults but i’m not sure how this would be done? After this we can check the counter in code and reboot into the safe mode or clear the count if the Photon has been running for a set amount of time.
Sadly, I don’t think there is any way to currently figure out the restart syndrome.
Preserving and communicating this kind of info would most likely require the co-operation of the bootloader, which makes things more complicated.
I think this is something Particle should definitely think about adding as Hard faults and the resulting boot loop can be easily caused by external hardware that is damaged or flashing untested firmware.