We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
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.