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 have almost 50 variables defined in my program. Now I want values of those variables to be retained by controller after power cycle. I am using LPC2378 controller and it has battery back up RAM facility.
From KEIL manual I can found only way to give specific address is by _at or by defining pointer pointing to address in battery backup RAM. Using the above mentioned process I need to specifically mention address to every variable.
Can any one suggest me some other option by which I can define all those variable in battery back up RAM at a time?
Thanks in advance for help!
Regards, Prasad
Have the variables in a separate source file and let the linker place all data from that file into the RAM-backuped memory region.
Do you mean to use something like mentioned in this link? http://www.keil.com/support/man/docs/ca/ca_ap_linkerloc.htm
If yes, then I am not very much sure about using the LA so I would like to summarize the steps below, would you please validate the same?
1. Define all those variables in single C file. 2. This will give segments defined for each variable in map file. 3. Then use such a line e.g. 'LA ... almctrl.obj SEGMENTS(?DT0?ALMCTRL(0x00108000)) ...' to define that segment in specific address. 4. But where should I place this line in KEIL? (Linker section of project options? ) 5. Do I need to insert this line for every variable? Or can I just place the newly created file.o in battery backup area directly?
Please guide.
Thanks, Prasad
HI.
<quote> Do I need to insert this line for every variable? </quote>
sorry i dont know the answer to it.
if u need it for evry variable and u have lot of variables it can be a lot of work.
but if u do u can put all yo're non volatile variables into a structure. and then u have one variable and only one adress.
Always yo're freind.
Zeusti.
Hi Prasad Deshpande,
Right-click on a Source File and select Options for File from the context menu to specify the properties and compiler or assembler options for that file.
specify the Memory Assignment
http://www.keil.com/support/man/docs/uv3/uv3_dg_property.htm
Memory Assignment
Only available for RealView ARM: assign a file or group to specify memory regions. Code/Const (RO), Zero Initialized Data (ZI), and standard data (RW) areas can be selected. Note that you should enter the available memory regions in the Target dialog and enable Use Memory Layout from Target Dialog in the Linker dialog.