<?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>&amp;quot;region RAM overflowed with stack&amp;quot; error while using TLS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18548/region-ram-overflowed-with-stack-error-while-using-tls</link><description>Hello everyone, 
 I am using nrf52832 with SDK version 11.0 for an IoT application. I am communicating with Atmel ATWINC 1500 module through SPI in order to connect to Wifi. First I faced memory issues using SPI which were fixed by setting heap size</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Jan 2017 08:18:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18548/region-ram-overflowed-with-stack-error-while-using-tls" /><item><title>RE: "region RAM overflowed with stack" error while using TLS</title><link>https://devzone.nordicsemi.com/thread/71586?ContentTypeID=1</link><pubDate>Mon, 02 Jan 2017 08:18:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7401b7f3-794c-44ed-90e2-03975f11a23a</guid><dc:creator>Jawad</dc:creator><description>&lt;p&gt;Hi Petter, I have posted the issue as a new question &lt;a href="https://devzone.nordicsemi.com/question/109071/mqtt-stops-responding-after-fixed-number-of-subscribe-and-publish/"&gt;here&lt;/a&gt;. Could you please comment there about what should I do?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "region RAM overflowed with stack" error while using TLS</title><link>https://devzone.nordicsemi.com/thread/71585?ContentTypeID=1</link><pubDate>Mon, 02 Jan 2017 07:55:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edfba548-e3a4-418a-a2e8-96d0bae578d1</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Great! I converted my comment to an answer, please consider accepting it by clicking the grey circle next to it. If you have unrelated questions please add them separately, so you should add a new question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "region RAM overflowed with stack" error while using TLS</title><link>https://devzone.nordicsemi.com/thread/71582?ContentTypeID=1</link><pubDate>Fri, 30 Dec 2016 10:53:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8c1d4b3-ed3c-4071-bcb0-17b1ebd99a4f</guid><dc:creator>Jawad</dc:creator><description>&lt;p&gt;Thanks Petter, I changed the heap to zero and I dont get the region RAM overflowed with stack anymore but now I am facing another issue. While running mqtt I can only do a fixed number (15) of mqtt publish or subscribe requests and then mqtt stops responding to received messages. I am suspecting this as a memory issue where stack pointer reaches an undefined location. Do you have any suggestion to debug such an issue while the project is running?
Thanks a lot&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "region RAM overflowed with stack" error while using TLS</title><link>https://devzone.nordicsemi.com/thread/71584?ContentTypeID=1</link><pubDate>Fri, 30 Dec 2016 10:09:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2acc7720-a5cd-40fe-bf77-5cd3502670f4</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m testing with \examples\iot\mqtt\subscriber\boards\pca10040\armgcc&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "region RAM overflowed with stack" error while using TLS</title><link>https://devzone.nordicsemi.com/thread/71583?ContentTypeID=1</link><pubDate>Fri, 30 Dec 2016 10:08:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2bd9562-e1bf-448d-bf00-04e59a65176c</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;If I set ASMFLAGS += -D__HEAP_SIZE=0 I get:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.heap           0x2000e1e8        0x0
                0x2000e1e8                __end__ = .
                0x2000e1e8                end = __end__
 *(.heap*)
 .heap          0x2000e1e8        0x0 _build/gcc_startup_nrf52.o
                0x2000e1e8                __HeapLimit = .

.stack_dummy    0x2000e1e8     0x1200
 *(.stack*)
 .stack         0x2000e1e8     0x1200 _build/gcc_startup_nrf52.o
                0x20010000                __StackTop = (ORIGIN (RAM) + 0xd800)
                0x2000ee00                __StackLimit = (__StackTop - SIZEOF (.stack_dummy))
                0x20010000                PROVIDE (__stack, __StackTop)
                0x00000001                ASSERT ((__StackLimit &amp;gt;= __HeapLimit), region RAM overflowed with stack)
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "region RAM overflowed with stack" error while using TLS</title><link>https://devzone.nordicsemi.com/thread/71581?ContentTypeID=1</link><pubDate>Fri, 30 Dec 2016 10:05:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39f7bdab-3ea3-4d3e-b06c-d8c7f7e698cb</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I don&amp;#39;t have too much experience with gcc, but you can find it here:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.heap           0x2000fd40      0x200
                0x2000fd40                __end__ = .
                0x2000fd40                PROVIDE (end, .)
 *(.heap*)
 .heap          0x2000fd40      0x200 _build/gcc_startup_nrf52.o
                0x2000fd40                __HeapBase
                0x2000ff40                __HeapLimit = .

.stack_dummy    0x2000fd40     0x3c00
 *(.stack*)
 .stack         0x2000fd40     0x3c00 _build/gcc_startup_nrf52.o
                0x20010000                __StackTop = (ORIGIN (RAM) + LENGTH (RAM))
                0x2000c400                __StackLimit = (__StackTop - SIZEOF (.stack_dummy))
                0x20010000                PROVIDE (__stack, __StackTop)
                0x00000000                ASSERT ((__StackLimit &amp;gt;= __HeapLimit), region RAM overflowed with stack)
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "region RAM overflowed with stack" error while using TLS</title><link>https://devzone.nordicsemi.com/thread/71578?ContentTypeID=1</link><pubDate>Fri, 30 Dec 2016 08:18:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d299a51-a407-4d3e-8277-f99f548eb6ea</guid><dc:creator>Jawad</dc:creator><description>&lt;p&gt;Hi Petter,
Thanks a lot for the helpful feedback. Could you please elaborate where I can see the heap size in .map file and how can I modify heap size to 0? I am doing it this way in Makefile
ASMFLAGS += -D__STACK_SIZE=8192
ASMFLAGS += -D__HEAP_SIZE=0
is it correct?
Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "region RAM overflowed with stack" error while using TLS</title><link>https://devzone.nordicsemi.com/thread/71580?ContentTypeID=1</link><pubDate>Thu, 29 Dec 2016 13:28:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f43423c-cd9b-4c9f-86b3-254ae2e25d05</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;From your .map file it seems that heap is 0x200 not 0, and because (__StackLimit &amp;gt;= __HeapLimit) evaluates to 0 you get an assert.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "region RAM overflowed with stack" error while using TLS</title><link>https://devzone.nordicsemi.com/thread/71579?ContentTypeID=1</link><pubDate>Tue, 27 Dec 2016 09:54:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4798c98-c77b-408a-b9cc-c7c2dd53d9ed</guid><dc:creator>Jawad</dc:creator><description>&lt;p&gt;Thanks Petter, I checked the link and it doesn&amp;#39;t seem very relevant.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "region RAM overflowed with stack" error while using TLS</title><link>https://devzone.nordicsemi.com/thread/71577?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 11:36:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:890e8fe8-f4c6-49a4-b4f2-dc7338636c9b</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure why you are getting this assert. Have you seen &lt;a href="https://devzone.nordicsemi.com/question/47404/gnu-toolchain-region-ram-overflowed-with-stack/"&gt;this&lt;/a&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>