houtson
Well-known member
I'm trying to track an intermittent fault on a teensy (micromod) project that runs off USB for most of the time.
The fault only happens very occasionally, when it does it locks-up then auto reboots after the 8 seconds.
CrashReport looks great and I imagine will be very helpful in tracking the problem down but as I'm off USB by the time I get it connected up the CrashReport is gone and I haven't been lucky enough to catch it while connected to USB.
I don't have an SD card on the project. I was thinking I could check for a CrashReport at startup and dump it to EEPROM and then later print it to Serial once I connect to USB?
Has anyone done that already or is there anything I have mis-understood CrashReport?
Would something like this in setup()work to dump the report at the end of EEPROM (adapted from one of defragster's comments):
If I did this any thoughts on how I could then print to serial, the project has lots of buttons so easy to initiate a diagnostics dump to serial when connect to USB but how would I recover the start point for the CrashReport on EEPROM and stream it to serial?
Would I be better allocating a fixed location to start the report (and if so any guide on what a reasonable sizeof would be?
Thanks for any help, Paul
The fault only happens very occasionally, when it does it locks-up then auto reboots after the 8 seconds.
CrashReport looks great and I imagine will be very helpful in tracking the problem down but as I'm off USB by the time I get it connected up the CrashReport is gone and I haven't been lucky enough to catch it while connected to USB.
I don't have an SD card on the project. I was thinking I could check for a CrashReport at startup and dump it to EEPROM and then later print it to Serial once I connect to USB?
Has anyone done that already or is there anything I have mis-understood CrashReport?
Would something like this in setup()work to dump the report at the end of EEPROM (adapted from one of defragster's comments):
Code:
if (CrashReport) {
EEPROM.put( EEPROM.end()-(1+sizeof(CrashReport)), CrashReport );
}
If I did this any thoughts on how I could then print to serial, the project has lots of buttons so easy to initiate a diagnostics dump to serial when connect to USB but how would I recover the start point for the CrashReport on EEPROM and stream it to serial?
Would I be better allocating a fixed location to start the report (and if so any guide on what a reasonable sizeof would be?
Thanks for any help, Paul