<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Storing variables at Battery back up RAM</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/38454/storing-variables-at-battery-back-up-ram</link><description> 
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</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Storing variables at Battery back up RAM</title><link>https://community.arm.com/thread/125598?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2009 02:27:09 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:42de00bd-fd75-47f5-8f5f-89da6ed1102c</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Prasad Deshpande,&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.keil.com/support/man/docs/uv3/uv3_dg_property.htm"&gt;http://www.keil.com/support/man/docs/uv3/uv3_dg_property.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;Memory Assignment&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
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 &lt;b&gt;Target dialog&lt;/b&gt; and enable
Use Memory Layout from Target Dialog in the &lt;b&gt;Linker dialog&lt;/b&gt;.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Storing variables at Battery back up RAM</title><link>https://community.arm.com/thread/115101?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2009 02:17:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:67813b10-a1e1-4b52-b519-8a5b041dd41f</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Prasad Deshpande,&lt;/p&gt;

&lt;p&gt;
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.&lt;/p&gt;

&lt;p&gt;
specify the &lt;b&gt;Memory Assignment&lt;/b&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Storing variables at Battery back up RAM</title><link>https://community.arm.com/thread/103281?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2009 23:25:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d14c3691-9583-4ce6-af57-d8eae62b31c6</guid><dc:creator>Advanced Zeusti</dc:creator><description>&lt;p&gt;&lt;p&gt;
HI.&lt;/p&gt;

&lt;p&gt;
&amp;lt;quote&amp;gt;&lt;br /&gt;
Do I need to insert this line for every variable?&lt;br /&gt;
&amp;lt;/quote&amp;gt;&lt;/p&gt;

&lt;p&gt;
sorry i dont know the answer to it.&lt;/p&gt;

&lt;p&gt;
if u need it for evry variable and u have lot of variables it can
be a lot of work.&lt;/p&gt;

&lt;p&gt;
but if u do u can put all yo&amp;#39;re non volatile variables into a
structure. and then u have one variable and only one adress.&lt;/p&gt;

&lt;p&gt;
Always yo&amp;#39;re freind.&lt;/p&gt;

&lt;p&gt;
Zeusti.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Storing variables at Battery back up RAM</title><link>https://community.arm.com/thread/77605?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2009 22:49:26 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7feba95e-cdc4-407a-b475-2da468efb77a</guid><dc:creator>Prasad Deshpande</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi,&lt;/p&gt;

&lt;p&gt;
Do you mean to use something like mentioned in this link? &lt;a href="http://www.keil.com/support/man/docs/ca/ca_ap_linkerloc.htm"&gt;http://www.keil.com/support/man/docs/ca/ca_ap_linkerloc.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
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?&lt;/p&gt;

&lt;p&gt;
1. Define all those variables in single C file.&lt;br /&gt;
2. This will give segments defined for each variable in map file.&lt;br /&gt;
3. Then use such a line e.g. &amp;#39;LA ... almctrl.obj
SEGMENTS(?DT0?ALMCTRL(0x00108000)) ...&amp;#39; to define that segment in
specific address.&lt;br /&gt;
4. But where should I place this line in KEIL? (Linker section of
project options? )&lt;br /&gt;
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?&lt;/p&gt;

&lt;p&gt;
Please guide.&lt;/p&gt;

&lt;p&gt;
Thanks,&lt;br /&gt;
Prasad&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Storing variables at Battery back up RAM</title><link>https://community.arm.com/thread/56467?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2009 06:41:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:68577b8f-c548-44ff-94f0-b5681445cdcc</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Have the variables in a separate source file and let the linker
place all data from that file into the RAM-backuped memory
region.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>