[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Diagnosing reboots
From: |
Bernard Fouché |
Subject: |
[avr-gcc-list] Diagnosing reboots |
Date: |
Wed, 16 Mar 2005 18:37:17 +0100 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
Hi there.
I'm trying to figure why an application reboot sometimes. I'd like to
store a changing value (according to what the product does) in a byte
untouched when the cpu reboots, to be able to retreive it later.
It seems that the ram is used by data and bss segments from 0x100 (on
the atmega128) and that the stack goes down from top to bottom. So I'm
looking for a byte just after the last used byte of the bss. (correct me
if I'm wrong)
I'd like this byte to be selected by the compiler at compile time. I'm
thinking of something like:
void *BootByte;
void f(void)
{
extern void *__noinit_start;
BootByte=__noinit_start;
}
and then I would use for instance:
*BootByte=0xAA;
to tell me that the the system was in sector 'AA' the last time it wrote
*BootByte before rebooting.
Is __noinit_start the correct symbol to use? (Or is __bss_end better
for instance? Or something else?)
Any hint welcome!
Bernard
- [avr-gcc-list] Diagnosing reboots,
Bernard Fouché <=