<?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>Const address in bank not &amp;quot;linked&amp;quot; by LX51</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/31417/const-address-in-bank-not-linked-by-lx51</link><description> 
I am trying to locate const in a file into a particular bank and
access it in the same bank but from a different file. From the map
file const is located correctly at the specified address in the bank.
However the compiled code to access this const</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Const address in bank not "linked" by LX51</title><link>https://community.arm.com/thread/106915?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2013 03:36:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d043a39b-bf73-48f7-a9cd-68712d84ffc3</guid><dc:creator>Dominic Fandrey</dc:creator><description>&lt;p&gt;&lt;p&gt;
I think your only choice is to define your own memory class for
each bank in which you want to share globals.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Const address in bank not "linked" by LX51</title><link>https://community.arm.com/thread/81033?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2013 02:49:34 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:577721b7-9d8b-4fac-8173-6d37ac882fbd</guid><dc:creator>Gautam R</dc:creator><description>&lt;p&gt;&lt;p&gt;
From my understanding the linker has located the const (message0)
in B0, as it appears from the map file. But is not able to link it
correctly.&lt;/p&gt;

&lt;p&gt;
By moving const data into a particular bank I am trying to ensure
space for this data is utilized only when needed. The const data is
never used outside the bank, so it would not be ideal to locate it in
common area.&lt;br /&gt;
I can include it in the C file that it is being used in (which solves
the problem), but there may be multiple C files in the future and it
makes it clunky.&lt;/p&gt;

&lt;p&gt;
You can find example banking code in
Keil\C51\Examples\CodeBanking&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Const address in bank not "linked" by LX51</title><link>https://community.arm.com/thread/61724?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2013 02:23:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:fc4d44c1-847f-474e-968d-afd8fc63818a</guid><dc:creator>Dominic Fandrey</dc:creator><description>&lt;p&gt;&lt;p&gt;
The issue here seems to me that the linker cannot tell from the
declaration where to locate the const buffer. I would have expected
it to end up in the common, unbanked area.&lt;/p&gt;

&lt;p&gt;
As far as I understand XBANKING.A51 in the Cx51 documentation,
&amp;quot;far const&amp;quot; is used to put global constants into the common area. I
don&amp;#39;t think forcing into a specific bank is actually supported. I.e.
banked const should only be accessed from the same .c file, because
others may be put into a different bank.&lt;/p&gt;

&lt;p&gt;
As long as you don&amp;#39;t run out of common, unbanked space, it seems
to me &amp;quot;far const&amp;quot; is your best bet for working code.&lt;/p&gt;

&lt;p&gt;
Note that this is purely speculative &amp;mdash; I don&amp;#39;t have banked
code to test this.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>