Skip to main content
Mich1
Associate III
April 2, 2019
Question

IWDG trapping

  • April 2, 2019
  • 3 replies
  • 1099 views

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

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
April 2, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Guru
April 2, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..
Mich1
Mich1Author
Associate III
April 3, 2019

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
Mich1Author
Associate III
June 20, 2019

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