cancel
Showing results for 
Search instead for 
Did you mean: 

IWDG trapping

Mich1
Associate III

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

4 REPLIES 4

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Have the SysTick record the last 100 return addresses in a loop, review to see if stuck in a specific subroutine or while() loop.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Mich1
Associate III

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.

Mich1
Associate III

how do you read the LR register to save it to a variable?