<?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>Defaulting variables in HDATA</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/16431/defaulting-variables-in-hdata</link><description> Hi all, 
 
I have an existing C-code base that we need to re-use in a new product(DS80C400). I&amp;#39;m running into an issue where uVision is throwing all of the variables into XDATA (thus overflowing and causing an error). 
 
Declaring all of the vars as</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Defaulting variables in HDATA</title><link>https://community.arm.com/thread/40614?ContentTypeID=1</link><pubDate>Mon, 04 Aug 2003 07:05:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:739ae920-d9ad-49ab-b8d9-466a968b21ad</guid><dc:creator>HansBernhard Broeker</dc:creator><description>&lt;p&gt;You will have to add &lt;i&gt;far&lt;/i&gt; keywords to your project, I think.  Keil doesn&amp;#39;t place any objects in HDATA by default, in any memory model.&lt;br /&gt;
Some others you&amp;#39;ll want to declare as &lt;i&gt;const far&lt;/i&gt; to have them in HCONST (ROM)&lt;br /&gt;
&lt;br /&gt;
For the sake of keeping the code sane and usable by other compilers, you&amp;#39;ll want to hide that keyword behind a macro, i.e.&lt;br /&gt;
&lt;pre&gt;
#if __CX51__
# define FAR far
#else
# define FAR /* nothing */
#endif
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Defaulting variables in HDATA</title><link>https://community.arm.com/thread/71688?ContentTypeID=1</link><pubDate>Tue, 29 Jul 2003 07:01:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:935c68e7-ce0b-4662-bf1b-1f027a49bbea</guid><dc:creator>Andy N.</dc:creator><description>&lt;p&gt;FYI Philip&lt;br /&gt;
&lt;br /&gt;
The address space for XDATA is only 64k. The DS80C400 is an extended 8051 variant that extends the address space for variables to 16MB i.e., HDATA&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Defaulting variables in HDATA</title><link>https://community.arm.com/thread/40623?ContentTypeID=1</link><pubDate>Mon, 28 Jul 2003 15:14:26 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:64c60675-2950-49c0-987e-8c1ecbff23aa</guid><dc:creator>Philip Garman</dc:creator><description>&lt;p&gt;The memory model selected for your target determines where the default storage area is.  By default, a project is configured for a Small memory model in which if the datatype is not defined, it will be stored in the DATA area.  Other options include Compact (PDATA) or Large (XDATA).&lt;br /&gt;
&lt;br /&gt;
So it sounds like your configured for the large memory model.&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;ve never heard of &amp;quot;HDATA&amp;quot;....but, I think your only option would be to do a bit of conditional compilation.&lt;br /&gt;
&lt;br /&gt;
Philip&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>