<?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 determine the actual usage for XDATA?</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/20482/how-to-determine-the-actual-usage-for-xdata</link><description> 
Hello, 

 
I have a project with 512K flash for code and 64K SRAM for XDATA.
After compiling with PK51, I got following infos about program
size: 
&amp;quot;data=188.0 xdata=51140 const=166971 code=203033&amp;quot;. 

 
My question is: does this mean the MAXIMUM usage</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: How to determine the actual usage for XDATA?</title><link>https://community.arm.com/thread/84541?ContentTypeID=1</link><pubDate>Wed, 27 Sep 2006 23:10:13 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3ef798f2-2874-4fb6-ba98-b17000f88d06</guid><dc:creator>His wife could eat no lean</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;Are there tools or hints you could share for diagnosing this
kind of issue?&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Tools like lint (e.g., PC-Lint) come to mind.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;quot;Why I am asking is becasue I am having some quite strange
phenomena which I can not find the root cause. But I think the
logical of my code is ok. There are some SRAM consuming protocols in
my code.&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
200K is quite a bit of code for a &amp;#39;51. Why isn&amp;#39;t your program&amp;#39;s
memory usage better understood? Are you the author? Was this program
originally designed for an 8051 derivative? If not, the mere fact
that an unusual and limited target processor architecture like the
8051 wasn&amp;#39;t a design criterion could account for a lot of
misbehavior.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to determine the actual usage for XDATA?</title><link>https://community.arm.com/thread/74395?ContentTypeID=1</link><pubDate>Wed, 27 Sep 2006 22:11:42 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e08ad251-0dc3-4829-ac43-f6f3f783abc5</guid><dc:creator>henry ye</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks a lot, Dan.&lt;/p&gt;

&lt;p&gt;
But how could I detemine if the remaining SRAM(64K - 51K) is
enough for code to run? Or how could I determine if some strange
issue is casued by the lack of SRAM? Are there tools or hints you
could share for diagnosing this kind of issue?&lt;/p&gt;

&lt;p&gt;
Why I am asking is becasue I am having some quite strange
phenomena which I can not find the root cause. But I think the
logical of my code is ok. There are some SRAM consuming protocols in
my code.&lt;/p&gt;

&lt;p&gt;
Best regards,&lt;br /&gt;
Henry&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to determine the actual usage for XDATA?</title><link>https://community.arm.com/thread/46904?ContentTypeID=1</link><pubDate>Wed, 27 Sep 2006 22:08:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9d5c8fcc-05d0-4a96-b885-2f5710249ff4</guid><dc:creator>Neil Kurzmam</dc:creator><description>&lt;p&gt;&lt;p&gt;
Not A PC.&lt;/p&gt;

&lt;p&gt;
If you did not Use Malloc.&lt;br /&gt;
Did not use any ASM Tricks.&lt;br /&gt;
Are alway using pointers to properly declared data objects,&lt;/p&gt;

&lt;p&gt;
Then the value is correct Amount of RAM to the Byte.&lt;/p&gt;

&lt;p&gt;
If you play games, then you have to figure out how much you
added.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to determine the actual usage for XDATA?</title><link>https://community.arm.com/thread/46903?ContentTypeID=1</link><pubDate>Wed, 27 Sep 2006 21:56:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7957e08d-5043-49f3-847f-21974666c291</guid><dc:creator>His wife could eat no lean</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;does this mean the MAXIMUM usage for xdata is 51140?&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
It means that the sum of the storage requirements for objects
having static storage duration plus the Keil-specific LARGE model (if
appropriate for your configuration) data objects having automatic
storage duration total to 51140 bytes.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;quot;Or the actual space for xdata will increase when the code is
up and running if there are pointer?&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
That&amp;#39;s for you to determine. Memory accesses through pointers are
not accounted for by the toolchain.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;quot;How can I calculate the maximum/worst space requirement for
xdata?&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
That&amp;#39;s the kind of question that if it&amp;#39;s not obvious to you and
you have to ask, then we couldn&amp;#39;t possibly tell you either.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>