<?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>Application stack overflow during SoftDevice execution</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46917/application-stack-overflow-during-softdevice-execution</link><description>Chip: nRF52832 
 SDK: 15.0.0 
 SoftDevice: S132 6.0.0 
 IDE: IAR EWARM 8.30 
 I have a peripheral-role application with __ICFEDIT_size_cstack__ = 0x800 (application call stack size set to 2048 bytes). What I&amp;#39;m seeing on occasion is very shortly after</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 31 Dec 2020 21:32:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46917/application-stack-overflow-during-softdevice-execution" /><item><title>RE: Application stack overflow during SoftDevice execution</title><link>https://devzone.nordicsemi.com/thread/287066?ContentTypeID=1</link><pubDate>Thu, 31 Dec 2020 21:32:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac92b9f5-e73a-4499-85c8-4cef26e76b73</guid><dc:creator>swlnk</dc:creator><description>&lt;p&gt;Hi Matt! This was from a couple of years ago so I don&amp;#39;t remember all of the details, but I think the key point here (that I didn&amp;#39;t realize when I wrote the question) is that the soft device and the application are sharing the same runtime stack. The &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/mem_usage/mem_resource_reqs.html#mem_resource_reqs"&gt;&amp;quot;memory resource requirements&amp;quot; page in the&amp;nbsp;soft device spec&lt;/a&gt;&amp;nbsp;gives guidance on how much call stack usage you can expect from the soft device. You then need to look at your application and consider whether you have set the boundary to be large enough to handle the soft device &amp;quot;worst case&amp;quot; plus your application &amp;quot;worst case&amp;quot;. In my application, the stack size was too small to handle this, and at times it would overflow causing corruption of my static variables. Simply increasing the stack size resolved the issue. My guess is that you are seeing something similar.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Application stack overflow during SoftDevice execution</title><link>https://devzone.nordicsemi.com/thread/286888?ContentTypeID=1</link><pubDate>Tue, 29 Dec 2020 21:17:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d1a4b33-fcfd-4ec7-a31c-0c1c91d10cf0</guid><dc:creator>matt_wilson</dc:creator><description>&lt;p&gt;I am experiencing very similar issues where on connection my application static variables are being over written from what I&amp;#39;m guessing is stack overflow. &amp;nbsp;How did you go about resolving this issue and do you have any advice on this?&lt;/p&gt;
&lt;p&gt;- Matt&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Application stack overflow during SoftDevice execution</title><link>https://devzone.nordicsemi.com/thread/185563?ContentTypeID=1</link><pubDate>Mon, 06 May 2019 17:22:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cbff935-dbb2-42b1-b04d-c5e1270c8d67</guid><dc:creator>swlnk</dc:creator><description>&lt;p&gt;That makes sense. Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Application stack overflow during SoftDevice execution</title><link>https://devzone.nordicsemi.com/thread/185292?ContentTypeID=1</link><pubDate>Sat, 04 May 2019 13:36:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7df0fcfb-549a-490d-8dcf-054e09ef8044</guid><dc:creator>Turbo J</dc:creator><description>[quote userid="69046" url="~/f/nordic-q-a/46917/application-stack-overflow-during-softdevice-execution"]I have used IAR&amp;#39;s stack usage analysis features[/quote]
&lt;p&gt;These cannot see how much stack the softdevice uses, because it is not compiled with your applicartion.&lt;/p&gt;
&lt;p&gt;But the SD internal stack usage is documented (in the softdevice specifications) to be 2KB. With your on apps &amp;lt;=2KB stack usage, I would set up 4KB or 0x1000 bytes for stack.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>