Description
@anecdata 's stuff is cool, I wish it was standard functionality, like came for free with circuitpython. (add a safemode.py that saves the reset reason to mem, the boot.py to catch errors and check reason for bootup and save to file if required, and a code.py with the 3lines printing boot reason plus something circuitpythony/hello-worldy)
It's linked from some general advice about programming for long-term reliability on circuitpython here.
The safemode.py gist has 3 files at the top, plus a bit nearer the bottom, and would need a minor adjustment or two, but basically it's really unfriendly for everyone when something goes wrong and it's not recorded as to why or what went wrong, so we could all benefit massively from this one.
There could even be a new adafruit IO example that submits new reset reasons to an error feed with device-name/mac-address included.
I am aware of reasons one can't have this on every board, but most, so could a simple memsize/feature/board check be enough? I'm using esp32s2/s3's so lucky with space, but maybe recording the last 10 boot + 10 safemode reasons+timestamps+tracebacks would be about the right balance between utility and space consumption.