<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/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/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to monitor flash and RAM usage after compilation?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4844/how-to-monitor-flash-and-ram-usage-after-compilation</link><description>Is there a window in Keil uVision available to monitor how much flash and RAM I&amp;#39;ve consumed? I&amp;#39;m not seeing anything in the build output and am not sure where else to look.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Jan 2015 22:02:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4844/how-to-monitor-flash-and-ram-usage-after-compilation" /><item><title>RE: How to monitor flash and RAM usage after compilation?</title><link>https://devzone.nordicsemi.com/thread/17114?ContentTypeID=1</link><pubDate>Wed, 14 Jan 2015 22:02:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f52830b8-5fe1-4b30-9330-3afeb97fb465</guid><dc:creator>la-ble</dc:creator><description>&lt;p&gt;This is helpful in teaching me more, thank you.  I was hoping for kind of usage gauage on the Keil GUI or a simpler way to just keep that in mind after each build.  I&amp;#39;ve enjoyed MPLABX&amp;#39;s data memory and program memory usage gauges in the past.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to monitor flash and RAM usage after compilation?</title><link>https://devzone.nordicsemi.com/thread/17113?ContentTypeID=1</link><pubDate>Wed, 14 Jan 2015 10:52:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f96213f-1945-42cb-b623-60074cc89fe2</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;The total RAM consumption is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ZI-data + RW-data
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The total flash consumption is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Code + RO-data + RW-data
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;These values should be listed when you compile your project (atleast in Keil, use &amp;#39;arm-none-eabi-size myapplication.out&amp;#39; for GCC) or located in the .map file generated by the compiler/linker.&lt;/p&gt;
&lt;p&gt;Why is RW-data listed in RAM and code? This is because this section holds the non-zero initialized values. for instance:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static int g_test = 0xFF1234FF;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will consume 4 bytes of RAM, and 4 bytes of flash to store it&amp;#39;s initial value (0xFF1234FF).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;More details about RAM usage:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The total RAM consumption also holds the application stack for auto-variables, which variables inside a scope, such as &lt;code&gt;int func(){int a; int b;}&lt;/code&gt;, where &amp;#39;a&amp;#39; and &amp;#39;b&amp;#39; here are auto-variables.
The default &lt;em&gt;stack_size&lt;/em&gt; set in your &lt;em&gt;arm_startup.s&lt;/em&gt; file is set to 2048 bytes.&lt;/p&gt;
&lt;p&gt;If the stack grows outside it&amp;#39;s area (2048 bytes in this case), meaning that your auto-variables in scope is greater than the &lt;em&gt;stack_size&lt;/em&gt; set, you will run into a stack overflow.
if you google &amp;quot;stack usage monitoring&amp;quot; or similar you&amp;#39;ll find methods for evaluating the stack usage for a given application. Note that the overall stack usage must be evaluated run-time, with the application running in all corner-cases.&lt;/p&gt;
&lt;p&gt;Sorry if I&amp;#39;ve confused you,
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to monitor flash and RAM usage after compilation?</title><link>https://devzone.nordicsemi.com/thread/17112?ContentTypeID=1</link><pubDate>Wed, 14 Jan 2015 07:56:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e72de08-23fb-4cb5-9dd7-ec6ecccf1975</guid><dc:creator>leo b.</dc:creator><description>&lt;p&gt;I don&amp;#39;t know if there is another way to view those information in the IDE.  To view the information, I usually just open and view the map file in the IDE itself.&lt;/p&gt;
&lt;p&gt;Leo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to monitor flash and RAM usage after compilation?</title><link>https://devzone.nordicsemi.com/thread/17111?ContentTypeID=1</link><pubDate>Tue, 13 Jan 2015 05:45:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91306e0b-bb48-4276-9e46-f4e8fb45a30d</guid><dc:creator>la-ble</dc:creator><description>&lt;p&gt;That is helpful.  I find at the bottom total &lt;code&gt;RO&lt;/code&gt;, &lt;code&gt;RW&lt;/code&gt; and &lt;code&gt;ROM&lt;/code&gt; sizes.  I&amp;#39;m not sure how that translates to flash/program memory and RAM/data memory though.  There is also no way to quickly see this via the IDE?  It&amp;#39;s a bit of work to navigate to the file, scroll to the bottom, then check after each compilation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to monitor flash and RAM usage after compilation?</title><link>https://devzone.nordicsemi.com/thread/17110?ContentTypeID=1</link><pubDate>Tue, 16 Dec 2014 06:09:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3068812c-b08f-4dc5-a8e6-ac9be785c816</guid><dc:creator>leo b.</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you tried looking at the map file that is generated when you compile your code?  It is located in the subfolder &amp;quot;arm_build&amp;quot; in your project folder.&lt;/p&gt;
&lt;p&gt;Leo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>