Hi, I'm developing an application on the LPC2368 that stores configuration data in the battery backed area of the processor. I have managed to locate the data structure at the correct address in memory, but even though i have specified the area as "NoInit" in the "options for target" dialog, the area always gets zeroed on reset. I have also set the
stdMyStruct stData __attribute__((section("IRAM2")));
line in the code to correctly locate the variable in the correct area. I have looked at the scatter file and it seems ok.
As far as i can tell the i have setup the system correctly, but the structure is always zero'd out.
#pragma NOINIT, did n't work either!! Any help would be gratefully received Dean
Please see: http://www.keil.com/support/docs/3290.htm You shoiuld use the "zero_init" attribute when you declare variables.
There seems to be an hardware issue with the battery backed memory on LPC23xx/24xx devices.
You can write only 32-bit values to the battery RAM (variables declared as int/float/double).
8-bit/16-bit write operations seem to fail. We are currently checking with NXP.
Hi Reinhard, Thanks for the reply. This method does not work either. The variable is still cleared to 0, and it is placed in at 0x4000000b which is not in the battery backed ram section i require. I have found that the variable is cleared in a call to decompress, which is just after the the bx main instruction in startup.s.
The reason i used the __attribute__(section("IRAM2")) previously was to get the linker to locate the variable in the battery backed area, this was the only way i could find.
The only way i can get data into the battery area and have it backed up is to create a ptr to the battery ram and write it via the pointer.
Again any guidance would greatly appreciated. Thanks Dean.