2019-04-02 02:36 AM
Hello,
I activated the IWDG on a STM32L431 device and a watchdog occurs.
How could I trap it to find the issue?
This watchdog resets the device so I do not know how to find the stack values when this watchdog occurred.
Is there a way to send this IRQ to a IRQ_handler to be able to save the stack content?
How is this issue usually handled on STM32L4xx devices?
Any advices?
Best regards
Mich
2019-04-02 04:00 AM
So use a TIM/SYSTICK instead of the IWDG so you can figure out what's going on in your own system while debugging. Instrument the code flow so you can focus in on the problem paths.
The reset doesn't clear the SRAM, so you can fish around it for the stack content, or waypoint/checkpoint data you record in SRAM at specific addresses.
2019-04-02 04:02 AM
Have the SysTick record the last 100 return addresses in a loop, review to see if stuck in a specific subroutine or while() loop.
2019-04-03 02:43 AM
Thanks a lot for the advice.
If I correctly understand, the best way is to avoid using the IWDG but another timer and to trig a reset from this timer irq handler when a problem occurs.
2019-06-20 04:20 AM
how do you read the LR register to save it to a variable?