<?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/"><channel><title>ROM and RAM Management</title><link>/nordic/nordic-blog/b/blog/posts/rom-and-ram-management</link><description>Introduction
Here are some tips and tricks to manage your application size.
RAM and ROM usage
The total RAM usage is:
ZI-data + RW-data

The total flash usage is:
Code + RO-data + RW-data



ZI-data - Zero initialized data, data variables </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><item><title>RE: ROM and RAM Management</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/rom-and-ram-management</link><pubDate>Sun, 17 Dec 2017 16:53:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39bd02d1-8b79-4246-b406-0dcd970a1335</guid><dc:creator>paul_tanner</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Thx @eliotstock.  I should have thought of that.  It works fine when run as you suggest.&lt;/p&gt;
&lt;p&gt;I suspect that the stack is too small (8K).  I am compiling for nRF52 with SDK12.2, S132 and armgcc which does not use arm_startup_nrf52.s (mentioned above).  Stack size is not mentioned in the provided linker script.&lt;/p&gt;
&lt;p&gt;What is the recommended way of increasing the stack pls?&lt;/p&gt;
&lt;pre&gt;SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)

MEMORY
{
  FLASH (rx) : ORIGIN = 0x1f000, LENGTH = 0x61000
  RAM (rwx) :  ORIGIN = 0x20002128, LENGTH = 0xded8	
}

SECTIONS
{
  .fs_data :
  {
    PROVIDE(__start_fs_data = .);
    KEEP(*(.fs_data))
    PROVIDE(__stop_fs_data = .);
  } &amp;gt; RAM
  .pwr_mgmt_data :
  {
    PROVIDE(__start_pwr_mgmt_data = .);
    KEEP(*(.pwr_mgmt_data))
    PROVIDE(__stop_pwr_mgmt_data = .);
  } &amp;gt; RAM
} INSERT AFTER .data;

INCLUDE &amp;quot;nrf5x_common.ld&amp;quot;
&lt;/pre&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1121&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: ROM and RAM Management</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/rom-and-ram-management</link><pubDate>Thu, 14 Dec 2017 21:47:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39bd02d1-8b79-4246-b406-0dcd970a1335</guid><dc:creator>Eliot Stock</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;@paul_tanner It no longer works if you run it from Github web hosting, but if you git clone the repo and open the HTML file in your browser, it should. Try that and submit a bug if not. Paste in your console output. Thanks.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1121&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: ROM and RAM Management</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/rom-and-ram-management</link><pubDate>Wed, 13 Dec 2017 10:05:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39bd02d1-8b79-4246-b406-0dcd970a1335</guid><dc:creator>paul_tanner</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;@eliotstock I was hopeful using your tool to understand the .map file for nRF52 produced by armgcc.
however, when I browse to my map file I get a blank screen.
Should this still work?
Thx.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1121&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: ROM and RAM Management</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/rom-and-ram-management</link><pubDate>Sun, 20 Aug 2017 13:43:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39bd02d1-8b79-4246-b406-0dcd970a1335</guid><dc:creator>coolnumber9</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;@eliotstock : Does your tool work with &lt;strong&gt;nrf52832&lt;/strong&gt; project and a map file generated by &lt;strong&gt;Keil MDK ARMCC&lt;/strong&gt;? I tried uploading my map file but it did not show me the visualization. Kindly help. Thanks.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1121&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: ROM and RAM Management</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/rom-and-ram-management</link><pubDate>Sun, 20 Aug 2017 13:38:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39bd02d1-8b79-4246-b406-0dcd970a1335</guid><dc:creator>coolnumber9</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;@hkn, @oyvakar : What is the difference between the ROM/RAM usage on &amp;#39;build output window&amp;#39; log we see in uVision IDE compared to the generated map file? They have different size values for Code, RO Data, RW Data, and ZI Data when added up.  I am using Keil MDK.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Build output window:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;Program Size: Code=82628 RO-data=65012 RW-data=1136 ZI-data=54672
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;But in the generated map file (&lt;em&gt;nrf52832_xxaa_s132.map&lt;/em&gt;), the total figures do not match compared to the above:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;Code (inc. data)   RO Data    RW Data    ZI Data      Debug   

 70816       5458      63684        976      46016    1206351   Grand Totals
 70816       5458      63684        212      46016    1206351   ELF Image Totals (compressed)
 70816       5458      63684        212          0          0   ROM Totals

Total RO  Size (Code + RO Data)               134500 ( 131.35kB)
Total RW  Size (RW Data + ZI Data)             46992 (  45.89kB)
Total ROM Size (Code + RO Data + RW Data)     134712 ( 131.55kB)
&lt;/pre&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1121&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: ROM and RAM Management</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/rom-and-ram-management</link><pubDate>Wed, 20 Apr 2016 12:45:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39bd02d1-8b79-4246-b406-0dcd970a1335</guid><dc:creator>Brook Gebremedhin</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;@hkn, @oyvakar&lt;/p&gt;
&lt;p&gt;I tried you setting for custom board 16k:&lt;/p&gt;
&lt;p&gt;FLASH (rx) : ORIGIN = 0x0001C000, LENGTH = 0x24000
RAM (rwx) :  ORIGIN = 0x20002800, LENGTH =  0x1800&lt;/p&gt;
&lt;p&gt;with the setting you mentioned above for the example  ble_notification
i get the error shown below after &amp;quot;make&amp;quot;&lt;/p&gt;
&lt;pre&gt;/usr/local/Cellar/gcc-arm-none-eabi/20140805/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: region RAM overflowed with stack
collect2: error: ld returned 1 exit status
make: *** [nrf51422_xxac_s130] Error 1
&lt;/pre&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1121&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: ROM and RAM Management</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/rom-and-ram-management</link><pubDate>Fri, 04 Dec 2015 14:09:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39bd02d1-8b79-4246-b406-0dcd970a1335</guid><dc:creator>Eliot Stock</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I&amp;#39;ve put a little tool for visualising your memory usage here:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="https://github.com/eliotstock/memory"&gt;github.com/.../memory&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It uses D3.js for the chart. You can use it right on Github without downloading anything. Just select your *.Map file. Pull requests welcome.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1121&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: ROM and RAM Management</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/rom-and-ram-management</link><pubDate>Wed, 29 Jul 2015 06:46:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39bd02d1-8b79-4246-b406-0dcd970a1335</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hi Alex,&lt;/p&gt;
&lt;p&gt;Only IAR can comment on this particular compiler optimisation and how it works under-the-hood.
I&amp;#39;ve not seen that much issues with high optimisation in IAR (including enabling static clustering), but I&amp;#39;ve seen some issues when you enable &amp;quot;Multi-file Compilation&amp;quot;.&lt;/p&gt;
&lt;p&gt;Cheers,
Håkon&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1121&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: ROM and RAM Management</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/rom-and-ram-management</link><pubDate>Tue, 28 Jul 2015 13:59:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39bd02d1-8b79-4246-b406-0dcd970a1335</guid><dc:creator>Alex</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Can Nordic comment on code optimization in IAR? Static clustering has mentioned &lt;a href="https://devzone.nordicsemi.com/question/15947/build-with-optimization-does-not-work-with-dfu/"&gt;here&lt;/a&gt; as a problem if optimization is enabled with DFU. Is there any other limitations?&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1121&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>