I'm currently investigating a watchdog reset, and I want to watch some variables and registers once watchdog reset occurs. My current MCU doesn't have a Watchdog Interrupt handler, is it possible to add a breakpoint once the watchdog reset execution starts. If yes, where should I add it?
Best regards
Carlo Gravador
Solved! Go to Solution.
Hi
You can disable the watchdog and, in its place, use a HW timer with the same delay (re-triggered at the same locations as you would re-trigger the watchdog).
When this HW timer interrupt fires its ISR (assuming it still works) can be handled as if it were the ISR of the watchdog. (It is also possible to use both watchdog and a HW timer with a very slightly shorter delay so that the HW timer effectively functions as a "watchdog interrupt").
Generally watchdog resets are due to the code being stuck in a loop (forever) or due to a hard fault. Therefore it may be simplest to simply disable the watchdog, wait for the processor to stop working 'normally' and then pause the debugger to 'see what is going on'.
Regards
Mark
Hi @carlogravador ,
No, since the COP watchdog can only generate a reset, there is no place to put a breakpoint before reset.
Regards,
Jing
In that case I don't see a way you would be able to set a breakpoint just before the reset happens. I would leave some breakcrums behind (writing a log to RAM) and set a breakpoint in the reset ISR, because this is what will be called after the watchdog expires.
I hope this helps,
Erich
Hi
You can disable the watchdog and, in its place, use a HW timer with the same delay (re-triggered at the same locations as you would re-trigger the watchdog).
When this HW timer interrupt fires its ISR (assuming it still works) can be handled as if it were the ISR of the watchdog. (It is also possible to use both watchdog and a HW timer with a very slightly shorter delay so that the HW timer effectively functions as a "watchdog interrupt").
Generally watchdog resets are due to the code being stuck in a loop (forever) or due to a hard fault. Therefore it may be simplest to simply disable the watchdog, wait for the processor to stop working 'normally' and then pause the debugger to 'see what is going on'.
Regards
Mark
This works for me, the current CoP config we have is that it is still enabled even during debug mode, that's why I wasn't able to halt the process once I observed that the MCU is not responding anymore. By disabling it, and halting the process, I was able to locate where is the last line of execution.