AnsweredAssumed Answered

STM32F4: Catch the last PC address before WD reset

Question asked by sade.yonatan on Sep 20, 2016
Latest reply on Sep 20, 2016 by Clive One
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