<?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>memory address for a variable</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/23026/memory-address-for-a-variable</link><description> 
How is it possible to tell a variable / or struct array their
specific memory address? 

 
e.g. I store the whole c-file in the internal ram (linker-script)
and only this one variable I want to store it in the external SRAM at
the address 0x10000000</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: memory address for a variable</title><link>https://community.arm.com/thread/124277?ContentTypeID=1</link><pubDate>Tue, 04 Dec 2007 07:07:45 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b3ffa86d-efa4-4d22-b86b-52296806864b</guid><dc:creator>Per Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
It will try, but thankfully the linker will (hopefully always)
complain about incompatible segments.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: memory address for a variable</title><link>https://community.arm.com/thread/113461?ContentTypeID=1</link><pubDate>Tue, 04 Dec 2007 05:02:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:16404b68-fa6d-4a40-9ffc-e949e6a5f44d</guid><dc:creator>Robert &amp;#160;</dc:creator><description>&lt;p&gt;&lt;p&gt;
I disagree with you Per. It will not fail.&lt;/p&gt;

&lt;p&gt;
When using &amp;quot;__at&amp;quot; the linker will place it at the absolute address
and nothing else will be put there.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: memory address for a variable</title><link>https://community.arm.com/thread/113475?ContentTypeID=1</link><pubDate>Tue, 04 Dec 2007 02:38:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c9c0e94c-eda4-4686-b0ae-350fdb9a8b13</guid><dc:creator>Frank Bering</dc:creator><description>&lt;p&gt;&lt;p&gt;
I&amp;#39;ve a similar question: I want to store a global char array in
the external memory. At the moment the char array is stored in the
flash memory, because the compiler don&amp;#39;t see that the values of the
array will be changed during the programm.&lt;/p&gt;

&lt;p&gt;
Because this array will be filled with the values receiving by the
usb interface. How could I tell the compiler to store this array in
the ram not in the flash memory?&lt;/p&gt;

&lt;p&gt;
best regards&lt;br /&gt;
Frank&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: memory address for a variable</title><link>https://community.arm.com/thread/100003?ContentTypeID=1</link><pubDate>Tue, 04 Dec 2007 01:04:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9ef6045d-fcfb-45f7-85d9-9f62c84db200</guid><dc:creator>Per Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
That is a good way to access a processor SFR or similar. But it
may fail very badly if the address happens to be in a memory area
that the linker has access to. Then the application may try to store
multiple information on the same location.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: memory address for a variable</title><link>https://community.arm.com/thread/75778?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2007 22:30:59 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7bb8d361-5c36-4436-840b-22c2ac575d36</guid><dc:creator>Robert &amp;#160;</dc:creator><description>&lt;p&gt;&lt;p&gt;
Even simpler would be:&lt;/p&gt;

&lt;pre&gt;
#include &amp;lt;absacc.h&amp;gt;

int x __at (0x10000000); // variable at address 0x10000000
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: memory address for a variable</title><link>https://community.arm.com/thread/49074?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2007 14:29:59 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:457e9ef0-21b6-40a4-aec5-80f8e5242144</guid><dc:creator>Per Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
The best way to control such things is to use multiple source
files, and then write a link script that specifically orders data
and/or code from the individual source files into specific memory
areas.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>