I'm using the LM4F232H5QD and want to reserve a memory location in SRAM. The problem is whenever I do a reset in the Code Composer Debugger the memory location always is reset to zero. I did the following in the linker command file:
SECTIONS
{
.intvecs: > 0x00000000
.text : > FLASH
.const : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.vtable : > 0x20000000
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
.reserved > 0x20007FF0
}
The .reserved at 0x0x20007FF0 I want to preserve a value after reset.
In C I have the following:
#pragma SET_DATA_SECTION (".reserved")
static unsigned long foo;
#pragma SET_DATA_SECTION ()
void main(void)
{
foo = 123;
while (1) ;
}
In the memory browser this value will be set to zero after a reset.
In looking at the disassembly and stepping through a reset I see a label __TI_auto_init . Is this the routine that initializes ram? Where is the source to this?
Help will be appreciated.
Bob