<?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>how to set fixed address for variables/functions&amp;#160; at compiling stage in ADS?</title><link>https://community.arm.com/developer/tools-software/tools/f/armds-forum/673/how-to-set-fixed-address-for-variables-functions-at-compiling-stage-in-ads</link><description> Note: This was originally posted on 18th September 2009 at http://forums.arm.com in ads 1.2, I set fixed address for a variable like this: int&amp;#160;&amp;#160;&amp;#160; file_len&amp;#160; __attribute__((_at_(0x16000))) = 0;&amp;#160;&amp;#160; but compile error, how can i do? thank you very much! </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: how to set fixed address for variables/functions  at compiling stage in ADS?</title><link>https://community.arm.com/thread/1720?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2013 10:59:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1082c20f-f30c-41f9-a5c5-2adb4f68a761</guid><dc:creator>zart zurt</dc:creator><description>&lt;div&gt;&lt;i&gt;Note: This was originally posted on 18th September 2009 at &lt;a href="http://forums.arm.com"&gt;http://forums.arm.com&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;in ads 1.2, I set fixed address for a variable like this:&lt;br /&gt;&lt;br /&gt;int&amp;#160;&amp;#160;&amp;#160; file_len&amp;#160; __attribute__((_at_(0x16000))) = 0;&amp;#160;&amp;#160; &lt;br /&gt;&lt;br /&gt;but compile error, how can i do?&lt;br /&gt;&lt;br /&gt;thank you very much!&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;You can use this but you have to set the initial value manually...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;#define file_len&amp;#160;&amp;#160; (*(int *)(0x00016000))&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;On second thought, this address is most likely in the on-chip NV (flash) memory region...&lt;/span&gt;&lt;br /&gt;&lt;span&gt;So , you can NOT have a variable at this particular address. Maybe the compiler was&lt;/span&gt;&lt;br /&gt;&lt;span&gt;trying to tell you this simple fact :-) What error does compiler give you anyway ?&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to set fixed address for variables/functions  at compiling stage in ADS?</title><link>https://community.arm.com/thread/1718?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2013 10:59:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c78ba717-6841-4ec6-b4e0-76f89520804a</guid><dc:creator>jameer mulani</dc:creator><description>&lt;div&gt;&lt;i&gt;Note: This was originally posted on 13th November 2009 at &lt;a href="http://forums.arm.com"&gt;http://forums.arm.com&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Can Any body tell me how to place a function at specified location in RVDS? __at__ has got limitations. I don&amp;#39;t want to change my linker file hence i am looking for trick or hack in code.&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to set fixed address for variables/functions  at compiling stage in ADS?</title><link>https://community.arm.com/thread/1717?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2013 10:59:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:552bcd19-0fb7-4ff6-b9f5-918bf213fbcf</guid><dc:creator>Peter Harris</dc:creator><description>&lt;div&gt;&lt;i&gt;Note: This was originally posted on 18th September 2009 at &lt;a href="http://forums.arm.com"&gt;http://forums.arm.com&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;You can do this directly using linker tricks, but it&amp;#39;s not really designed for placement of individual variables. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;If you really need this, I&amp;#39;d suggested storing a pointer to the location rather than the value itself:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;static int * const pFileLen = (int *)(0x00016000);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;/* Store value. */&lt;/span&gt;&lt;br /&gt;&lt;span&gt;*pFileLen = uiMyValue;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;/* Get value. */&lt;/span&gt;&lt;br /&gt;&lt;span&gt;uiMyValue = *pFileLen;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to set fixed address for variables/functions  at compiling stage in ADS?</title><link>https://community.arm.com/thread/1719?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2013 10:59:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3b9e1f18-7415-4c77-8f04-ba5136ec0703</guid><dc:creator>momo momo</dc:creator><description>&lt;div&gt;&lt;i&gt;Note: This was originally posted on 18th September 2009 at &lt;a href="http://forums.arm.com"&gt;http://forums.arm.com&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;You can use this but you have to set the initial value manually...&lt;br /&gt;&lt;br /&gt;#define file_len&amp;#160;&amp;#160; (*(int *)(0x00016000))&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;-----ohh,thanks.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;But in my program, I need &amp;quot;file_len&amp;quot; located at 0x00016000 and occupy 4bytes memory,&lt;/span&gt;&lt;br /&gt;&lt;span&gt;how can I do?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;best regards,&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>