<?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>Problems with XDATA</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/22383/problems-with-xdata</link><description> 
Hi, 

 
I try to accces external Memory using XDATA. 

 
I use the following code: 

 
extern volatile unsigned char xdata interface_register _at_
0x3; 

 
This is the variable I want to acces, like this: 

 
interface_register = 0x82; 

 
Everything</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Problems with XDATA</title><link>https://community.arm.com/thread/99777?ContentTypeID=1</link><pubDate>Mon, 15 Oct 2007 04:26:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c5c36af8-7a07-4083-80ec-7a9e9492f75a</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;i defined interface_register in a header file&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
That&amp;#39;s a really bad idea!&lt;/p&gt;

&lt;p&gt;
By doing that, every file that #includes the header will produce
another &lt;i&gt;&lt;b&gt;definition&lt;/b&gt;&lt;/i&gt; of the register.&lt;br /&gt;
Multiple &lt;i&gt;&lt;b&gt;definitions&lt;/b&gt;&lt;/i&gt; are not allowed.&lt;/p&gt;

&lt;p&gt;
Your header should contain only &lt;b&gt;extern &lt;i&gt;declarations&lt;/i&gt;&lt;/b&gt;
of the variables&lt;/p&gt;

&lt;p&gt;
See: &lt;a href="http://c-faq.com/decl/decldef.html"&gt;c-faq.com/.../decldef.html&lt;/a&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problems with XDATA</title><link>https://community.arm.com/thread/99779?ContentTypeID=1</link><pubDate>Mon, 15 Oct 2007 04:21:48 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8863a219-1beb-4832-8f9a-f29867a9c0a3</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;But why does this not work with xdata variables?&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
I doubt it&amp;#39;s anything to do with xdata - it&amp;#39;ll be the &lt;b&gt;_at_&lt;/b&gt;
that&amp;#39;s causing the problem!&lt;/p&gt;

&lt;p&gt;
Think about it: &lt;b&gt;_at_&lt;/b&gt; is only really relevant in a data
&lt;i&gt;&lt;b&gt;definition&lt;/b&gt;&lt;/i&gt; - it is at best irrelevant in an &lt;b&gt;extern
&lt;i&gt;declaration&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problems with XDATA</title><link>https://community.arm.com/thread/75595?ContentTypeID=1</link><pubDate>Mon, 15 Oct 2007 04:01:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4cb0424b-edf2-4ac1-8e65-83e73fa169b0</guid><dc:creator>Hans Wurst</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi,&lt;/p&gt;

&lt;p&gt;
in this moment I discovered exactly the same :D&lt;/p&gt;

&lt;p&gt;
I&amp;#39;m very happy now. Because, I tried to find the error for approx
2 ours.&lt;/p&gt;

&lt;p&gt;
The reason for the &amp;quot;extern&amp;quot; is, that i defined interface_register
in a header file and I want acces to this memory place as well from
other C Source files. So I defined them as extern. Like I do it with
functions. I know that &amp;quot;extern&amp;quot; doesn&amp;#39;t mean in the external memory,
or something like that.&lt;/p&gt;

&lt;p&gt;
But why does this not work with xdata variables?&lt;/p&gt;

&lt;p&gt;
Thank you very much!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problems with XDATA</title><link>https://community.arm.com/thread/48764?ContentTypeID=1</link><pubDate>Mon, 15 Oct 2007 03:46:45 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5bd46716-3cd8-40b0-8f3e-a887220b9637</guid><dc:creator>average joe</dc:creator><description>&lt;p&gt;&lt;p&gt;
omit the word &amp;#39;extern&amp;#39;; i.e.,&lt;/p&gt;

&lt;pre&gt;
volatile unsigned char xdata interface_register _at_ 0x3;
&lt;/pre&gt;

&lt;p&gt;
Not sure of the precise language semantics (I&amp;#39;m sure the manual or
others could guide you on that), but this works for me.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>