<?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>Placing array tables in ARM flash?</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/25659/placing-array-tables-in-arm-flash</link><description> 
I have some Const array tables that i want place in the flash/code
memory of ARM controller. we can place array in code memory of C51
using &amp;quot;code&amp;quot; keyword. but how to place const array in ARM? 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Placing array tables in ARM flash?</title><link>https://community.arm.com/thread/136164?ContentTypeID=1</link><pubDate>Mon, 31 May 2010 22:58:19 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f5f966a9-d13c-44b1-b5fb-e81b0ad7dd9d</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Because they do not &amp;quot;do the same thing&amp;quot;!&lt;/p&gt;

&lt;p&gt;
They achieve the same end, but by doing &lt;i&gt;different&lt;/i&gt;
things!&lt;/p&gt;

&lt;p&gt;
Look again at those numbers, carefully: it&amp;#39;s not just the code
size that changes, is it...?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Placing array tables in ARM flash?</title><link>https://community.arm.com/thread/126207?ContentTypeID=1</link><pubDate>Mon, 31 May 2010 22:35:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2eb93f05-a468-4069-9804-e9f53468b50a</guid><dc:creator>Ravinder Singh</dc:creator><description>&lt;p&gt;&lt;p&gt;
I wrote a small program to Test the keywords, here the results
are&lt;/p&gt;

&lt;p&gt;
with&lt;/p&gt;

&lt;pre&gt;
const unsigned char a[3] __attribute__( (at(0x0010) ) )={&amp;#39;1&amp;#39;,&amp;#39;2&amp;#39;,&amp;#39;3&amp;#39;};
&lt;/pre&gt;

&lt;p&gt;
Result is:&lt;br /&gt;
&lt;b&gt;Program Size: &lt;i&gt;Code=5126&lt;/i&gt; RO-data=66 RW-data=16
ZI-data=560&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
with&lt;/p&gt;

&lt;pre&gt;
const unsigned char a[3]={&amp;#39;1&amp;#39;,&amp;#39;2&amp;#39;,&amp;#39;3&amp;#39;};
&lt;/pre&gt;

&lt;p&gt;
Result is:&lt;br /&gt;
&lt;b&gt;Program Size: &lt;i&gt;Code=5130&lt;/i&gt; RO-data=66 RW-data=16
ZI-data=560&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
with&lt;/p&gt;

&lt;pre&gt;
unsigned char a[3]={&amp;#39;1&amp;#39;,&amp;#39;2&amp;#39;,&amp;#39;3&amp;#39;};
&lt;/pre&gt;

&lt;p&gt;
Result:&lt;br /&gt;
&lt;b&gt;Program Size: Code=5130 RO-data=62 RW-data=20 ZI-data=556&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
if both attribute keyword and const keyword do the same thing,
then why there is the variation in Code size?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Placing array tables in ARM flash?</title><link>https://community.arm.com/thread/115788?ContentTypeID=1</link><pubDate>Mon, 31 May 2010 07:57:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9fb08493-12f5-4684-8c05-aa1e012921c7</guid><dc:creator>Non Keil Related</dc:creator><description>&lt;p&gt;&lt;p&gt;
Whew. I read the response and was wondering whether I was missing
some important knowledge.&lt;/p&gt;

&lt;p&gt;
Putting &lt;b&gt;const&lt;/b&gt; puts the tables into a code segment. If the
code is in flash, then so are the tables.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Placing array tables in ARM flash?</title><link>https://community.arm.com/thread/104003?ContentTypeID=1</link><pubDate>Mon, 31 May 2010 05:11:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f13130e7-914f-4005-8474-f5607dec4c77</guid><dc:creator>Mike Kleshov</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;do i have to give address to all the arrays individually? Is
there any way in which the compiler picks the address
automatically?&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
I have no idea why Tamir gave you this example. You didn&amp;#39;t say
that you wanted to place your data at a particular address, so it&amp;#39;s
safe to assume that you don&amp;#39;t need the &lt;b&gt;at&lt;/b&gt; attribute.&lt;br /&gt;
All you need to do is declare your variables as &lt;b&gt;const&lt;/b&gt;. This
will put them in ROM. Compiler/linker will take care of assigning
addresses, as usual.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Placing array tables in ARM flash?</title><link>https://community.arm.com/thread/103994?ContentTypeID=1</link><pubDate>Mon, 31 May 2010 03:38:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2d962623-a088-4ef4-b66d-65ff9e071d6b</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
You need to read the linker manual. A short outline: you probably
want to use a separate section, and to place that section using a
scatter file. not elementary stuff I agree - but well documented.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Placing array tables in ARM flash?</title><link>https://community.arm.com/thread/103998?ContentTypeID=1</link><pubDate>Mon, 31 May 2010 03:30:17 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f2ce91eb-7e8a-4a73-a4c8-4a416778ad98</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Note that it&amp;#39;s not the Compiler that picks addresses; it&amp;#39;s the
&lt;b&gt;Linker&lt;/b&gt; - therefore, you need to be looking in the
&lt;b&gt;&lt;i&gt;Linker&lt;/i&gt; Manual&lt;/b&gt;...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Placing array tables in ARM flash?</title><link>https://community.arm.com/thread/78374?ContentTypeID=1</link><pubDate>Mon, 31 May 2010 03:26:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:462cfc4c-f1c8-4ac4-8d5e-35ea75598125</guid><dc:creator>Ravinder Singh</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thankyou Tamir,&lt;/p&gt;

&lt;p&gt;
__attribute__( (at(BOOTLOADER_TOKEN_ADDR) ) ) keyword will work
for 1 or 2 const arrays. but I want to place approximately 50 const
arrays of different sizes, do i have to give address to all the
arrays individually? Is there any way in which the compiler picks the
address automatically?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Placing array tables in ARM flash?</title><link>https://community.arm.com/thread/58247?ContentTypeID=1</link><pubDate>Mon, 31 May 2010 03:09:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:703a7c38-3b29-4ae8-950c-0c764cb95ee1</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;pre&gt;
const unsigned char boot_version_string[16]  __attribute__( (at(BOOTLOADER_TOKEN_ADDR) ) ) =&amp;quot;FEMBOOT 1.8&amp;quot;;
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>