<?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>ld: region RAM overflowed with stack</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1222/ld-region-ram-overflowed-with-stack</link><description>I have a project in which I&amp;#39;ve started from the proximity app example code and added some UART stuff using app_uart.c. The linker is giving me this error immediately after building app_uart.c: 
 ld: region RAM overflowed with stack 
 Can this be true</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Apr 2015 20:21:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1222/ld-region-ram-overflowed-with-stack" /><item><title>RE: ld: region RAM overflowed with stack</title><link>https://devzone.nordicsemi.com/thread/5655?ContentTypeID=1</link><pubDate>Wed, 22 Apr 2015 20:21:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bbe5646-34d0-4513-8bcc-2ed237fa9193</guid><dc:creator>bishop</dc:creator><description>&lt;p&gt;Maybe exists another solution?for example to edit .ld file, increase RAM length?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ld: region RAM overflowed with stack</title><link>https://devzone.nordicsemi.com/thread/5654?ContentTypeID=1</link><pubDate>Fri, 03 Jan 2014 11:52:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df03c7c9-5344-4268-a384-ece67da2948f</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;You may also have use in taking a look at &lt;a href="https://devzone.nordicsemi.com/index.php/putting-my-app-on-a-ram-memory-diet"&gt;this question&lt;/a&gt;. In particular, you can safely set the heap size to 0 if you don&amp;#39;t use malloc and friends in your application; neither the SDK nor the softdevices use it.&lt;/p&gt;
&lt;p&gt;Also, a GCC-specific optimization is to use newlib-nano, by adding --specs=nano.specs to LDFLAGS. This requires GCC 4.7 or later.&lt;/p&gt;
&lt;p&gt;Edit: Add link.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ld: region RAM overflowed with stack</title><link>https://devzone.nordicsemi.com/thread/5653?ContentTypeID=1</link><pubDate>Mon, 30 Dec 2013 14:19:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:361605ca-6589-40ae-832a-63fd145eddf1</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Making the heap smaller did the trick. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ld: region RAM overflowed with stack</title><link>https://devzone.nordicsemi.com/thread/5652?ContentTypeID=1</link><pubDate>Sun, 29 Dec 2013 23:10:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:401d7050-9e61-4781-ad9f-07d74c400167</guid><dc:creator>Erland Lewin</dc:creator><description>&lt;p&gt;I had a similar problem.&lt;/p&gt;
&lt;p&gt;One thing I did was to decrease the heap size by changing the default heap size to 512 bytes from 2048 in gcc_startup_nrf51.S (saves 1.5k, I don&amp;#39;t use malloc):&lt;/p&gt;
&lt;p&gt;#ifdef __HEAP_SIZE
.equ    Heap_Size, __HEAP_SIZE
#else
.equ    Heap_Size, 512 // was 2048
#endif&lt;/p&gt;
&lt;p&gt;I also noticed that some C library functions (such as sprintf) pull in C library parts that use significant amounts of RAM.&lt;/p&gt;
&lt;p&gt;You could also try decreasing the stack size in the same file.&lt;/p&gt;
&lt;p&gt;To exactly see what&amp;#39;s eating your RAM, you&amp;#39;d have to post your entire map file, or at least everything related to the .bss segment.&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;
&lt;p&gt;/Erland&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ld: region RAM overflowed with stack</title><link>https://devzone.nordicsemi.com/thread/5651?ContentTypeID=1</link><pubDate>Sun, 29 Dec 2013 15:17:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c14b193f-805d-4459-95a0-bff834d0365d</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;More detail from my map file:&lt;/p&gt;
&lt;p&gt;...
.bss           0x0000000020002e69        0x0 /Users/Eliot/dev/gcc-arm/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/lib/armv6-m/libc.a(lib_a-strlen.o)
.bss           0x0000000020002e69        0x0 /Users/Eliot/dev/gcc-arm/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/lib/armv6-m/libc.a(lib_a-strncpy.o)
.bss           0x0000000020002e69        0x0 /Users/Eliot/dev/gcc-arm/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/lib/armv6-m/libc.a(lib_a-__call_atexit.o)
.bss           0x0000000020002e69        0x0 /Users/Eliot/dev/gcc-arm/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/lib/armv6-m/libc.a(lib_a-atexit.o)
.bss           0x0000000020002e69        0x0 /Users/Eliot/dev/gcc-arm/bin/../lib/gcc/arm-none-eabi/4.7.4/armv6-m/crtend.o
.bss           0x0000000020002e69        0x0 /Users/Eliot/dev/gcc-arm/bin/../lib/gcc/arm-none-eabi/4.7.4/armv6-m/crtn.o
*(COMMON)
0x0000000020002e6c                . = ALIGN (0x4)
&lt;em&gt;fill&lt;/em&gt;         0x0000000020002e69        0x3 00
0x0000000020002e6c                &lt;strong&gt;bss_end&lt;/strong&gt; = .&lt;/p&gt;
&lt;p&gt;.heap           0x0000000020002e70      0x800
0x0000000020002e70                &lt;strong&gt;end&lt;/strong&gt; = .
0x0000000020002e70                end = &lt;strong&gt;end&lt;/strong&gt;
&lt;em&gt;(.heap&lt;/em&gt;)
.heap          0x0000000020002e70      0x800 ./lib/startup_nrf51.o
0x0000000020002e70                __HeapBase
0x0000000020003670                __HeapLimit = .&lt;/p&gt;
&lt;p&gt;.stack_dummy    0x0000000020002e70      0x800
&lt;em&gt;(.stack&lt;/em&gt;)
.stack         0x0000000020002e70      0x800 ./lib/startup_nrf51.o
0x0000000020004000                __StackTop = (ORIGIN (RAM) + 0x2000)
0x0000000020003800                __StackLimit = (__StackTop - SIZEOF (.stack_dummy))
0x0000000020004000                PROVIDE (__stack, __StackTop)
0x0000000000000001                ASSERT ((__StackLimit &amp;gt;= __HeapLimit), region RAM overflowed with stack)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ld: region RAM overflowed with stack</title><link>https://devzone.nordicsemi.com/thread/5650?ContentTypeID=1</link><pubDate>Sun, 29 Dec 2013 03:37:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c972c1b3-f61c-4456-9093-b24a9cc5ab98</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Original linker script uploads helpfully denied by server. Renamed.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/mem.ld.txt"&gt;mem.ld.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/sections.ld.txt"&gt;sections.ld.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>