Re: RE: How to obtain and save the return address inside an interrupt?

"Onestone [email protected] [msp430]" <[email protected]> Wed, 21 Jan 2015 13:25:57 +1030
Newsgroups gmane.comp.hardware.texas-instruments.msp430.discuss
Message-ID <[email protected]>
What do you think your strategy will achieve? You are getting a Watchdog 
failure occasionally, or you assume that you are. You are not getting a 
timer issue, and the function of the WDT is totally different in timer 
mode to watchdog mode, so you will only trap this if you are using 
watchdog mode. What makes you think this is a WDT failure? I presume 
that you are examining the WDTIFG flag in IFG1 at power on, rather than 
just making an assumption.

In Practice the only way I think you are going to be able to do this is 
to intercept the RESET_VECTOR, which means changing the start up 
function your compiler produces, literally at the first instruction, so 
you should add either as breakpoint here or a loop in place to indicate 
the fail and preserve the critical data.

Al


On 21/01/2015 12:50 PM, [email protected] [msp430] wrote:
>
>
> Thank you for all the suggestions.
>
> I have tried the suggestions of using a break point at the reset 
> vector. Unfortunately, the problem has not occurred while using the 
> debugger.
>
> When my device is off the debugger and running on its own, then I do 
> get a watchdog reset from time to time.
>
> What  I want to try next is to use the watchdog in timer mode, create 
> an interrupt and inside the interrupt save the Stack Pointer. Once I 
> understand how to read the stack, I can use the IAR intrinsic function:
>
> __get_SP_register() to get the Stack Pointer and then I will save it 
> in flash.
>
> I will report back if I make this work.
>
> Thank you.
>
>
>