We are developing using LPC1768, we using a number of subsystems, TCP, SD card, SPI.
For some reason that we don’t understand occasionally we have some failure in the software that causes the system resets itself.
My question is what mechanism we could use to log the reason of the failure? we need to know at which precise moment the software failed so we could examine that after and correct the issue.
Thank you.
If he can't attach something as simple as a serial cable and a laptop, hanging a JTAG pod isn't going to be an option. Presume also he doesn't have a TRACE pod, or means to log in situ.
The watchdog wasn't suggested as a solution, but as a cause of a reset.
Isn't this LPC part using a Cortex-M3? What kind of fault handler and instrumentation have you added here? The processor has a whole bunch of magic registers (M3 TRM) describing the cause and location of faults, but it's transient and likely lost if you continue ploughing through the debris field.
Flash is next to useless here, the amount of data you'd want to save is too high, and the slowness will impact the system. Sure, you could put a small ring buffer in SRAM and log check points into that, then in ResetHandler record the reset event cause (again probably a magic register documented by NXP), and last block of trace data from the ring buffer.
Mark your stacks, and have a clear idea of maximal utilization on the bench.