avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] preserve state during watchdog reset


From: Gavin Jackson
Subject: RE: [avr-gcc-list] preserve state during watchdog reset
Date: Wed, 04 Feb 2004 09:43:15 +1300

-----Original Message-----
From: Simon Han [mailto:address@hidden 
Sent: Wednesday, 4 February 2004 9:30 a.m.
To: address@hidden
Subject: [avr-gcc-list] preserve state during watchdog reset


Hi all,
        Does anyone figure out a way to preserve state during watchdog
reset?
        I am using watchdog to monitor for some of my functions.  Before and

after function calls, I do a watchdog reset.  Now the problem is how I 
can figure out which function caused the watchdog timeout.  I was 
thinking to store this information in EEPROM, but the delay of doing 
this is way too high.  Will it be possible to assume certain registers 
are not reset?

Any suggestions?
Simon

-----------------------------------------------------------------------

Hi Simon

Store whatever it is you want to remember in the SRAM.

Just remember to either place it in the .noinit section as below:

static int KeepTrack __attribute__ ((section (".noinit")));

so that it's not set to 0x00 at startup or you can declare a 'normal'
static variable and check it's value before the startup code runs
that clears all static variables to 0x00.

To .noinit option is the easiest to do.

Regards
Gavin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]