STM32F4: Catch the last PC address before WD reset
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2016-09-20 2:20 AM
Posted on September 20, 2016 at 11:20
Hi all.
I am trying to catch the last PC value before WD reset. For doing that I am configuring the WWDG and enabling its interrupt. then, while the WD interrupt fire I am writing the important information (i.e., the PC value before the the exception occurs), in dedicated location, and then the reset occurs. I was thinking that the LR register will do for me the job but it seems useless (something like 0xFFFFFFE1). So I changed my mind back to the old and good - the stack and SP register. Indeed, I managed to find the last value of PC at address SP + 0x20 1. Is there more convenient way to do that? 2. Does the offset of 0x20 will be consistent? Thank you very much Yonatan Sade #!stm32f4 #iwdg #wwdg #watchdog
Labels:
- Labels:
-
IWDG-WWDG
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2016-09-20 7:19 AM
Posted on September 20, 2016 at 16:19
The SRAM is preserved, but I don't think there is any behaviour about a RESET here that is defined to carry through. You could track most recent PC seen in say a SysTick, and revisit that to see if it is a loop that the code is stuck in. You could also instrument your code to understand the flow that's causing the watchdog to fire.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
