<?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>Stack overflow</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72986/stack-overflow</link><description>Hello, 
 I have been running this program without any problem then I added some code to read and write to flash using NVS when the error shown below appeared. 
 I am running a single ( main() ) thread application in Segger Embedded Studio v5.34a. 
 *</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Apr 2021 12:35:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72986/stack-overflow" /><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/306109?ContentTypeID=1</link><pubDate>Wed, 21 Apr 2021 12:35:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a340d72-d687-4507-a129-baffac883e92</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;The MPU fault&amp;nbsp; is due to a data access violation, however when browsing DevZone/Google/Zephyr-GitHub, a stack overflow is almost always the cause of an MPU fault in Zephyr. This is the case for you too, since &amp;quot;&lt;span&gt;Stack overflow&lt;/span&gt;&amp;quot; was logged first, followed by the MPU Fault. I think the MPU fault happens because it tries to access an invalid memory address outside the stack.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To be honest, I don&amp;#39;t have too much experience debugging hardfaults, but if you want to understand it better I would recommend you to take a look at the &lt;a href="https://developer.arm.com/documentation/100235/0003/the-cortex-m33-processor/fault-handling"&gt;Arm Cortex-M33 documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/306063?ContentTypeID=1</link><pubDate>Wed, 21 Apr 2021 11:04:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0396da19-fe7b-4dbe-9d4d-7a551617f38d</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I rolled back to an old version of the firmware which ran fine without any stack crash. I then started adding gradually the new code that I had experienced the stack crash error with. I have now completed adding all the code (I think) but there is no sign of the stack crash&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;. I am rather puzzled by this because I wanted the crash to occur again so that I can identify the line(s) of code that caused it in the first place.&lt;/p&gt;
&lt;p&gt;I still would like you to send me more information on &lt;span&gt;MPU FAULT&lt;/span&gt;&lt;span&gt;,&amp;nbsp;&lt;/span&gt;&lt;span&gt;Stacking error (context area might be not valid)&lt;/span&gt;&lt;span&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;span&gt;Data Access Violation and how to debug such problems.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mohamed&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/305630?ContentTypeID=1</link><pubDate>Mon, 19 Apr 2021 15:42:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6817eab3-071a-40e8-a1b3-21c619fdcf7d</guid><dc:creator>Simon</dc:creator><description>[quote user="Learner"]Could it be that the thread where the fault is occurring is the workqueue thread&amp;nbsp;&lt;strong&gt;&lt;span&gt;main_work_pid4&lt;/span&gt;&lt;/strong&gt;?[/quote]
&lt;p&gt;Yes, of course. I was way too fast to answer you earlier. My apologies for that. If the fault occured in the work item handler, it is the system work queue thread that is running and I think the&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/kconfig/CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE.html"&gt;CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE&lt;/a&gt; should get modified to increase the stack size.&lt;/p&gt;
&lt;p&gt;If it doesn&amp;#39;t help to increase that config, I&amp;#39;ll get back to you tomorrow about how to to debug the MPU fault.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/305608?ContentTypeID=1</link><pubDate>Mon, 19 Apr 2021 14:29:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:361cfbc3-67ce-4611-8e9e-79eef67e4fe7</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
[quote userid="72692" url="~/f/nordic-q-a/72986/stack-overflow/305512#305512"]&lt;span&gt;You could also set&lt;/span&gt;&lt;span style="font-family:inherit;"&gt;&amp;nbsp;CONFIG_THREAD_NAME=y,&lt;/span&gt;[/quote]
&lt;p&gt;Thank you. I will add the config line above in prj.conf.&lt;/p&gt;
&lt;p&gt;I did a quick search for the string &amp;quot;STACK&amp;quot; in .config and found the following occurrences.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt; CONFIG_MAIN_STACK_SIZE=4096&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; CONFIG_PRIVILEGED_STACK_SIZE=1024&lt;/strong&gt;&lt;br /&gt; CONFIG_BT_HCI_TX_STACK_SIZE=1536&lt;br /&gt; &lt;strong&gt;CONFIG_BT_RX_STACK_SIZE=1024&lt;/strong&gt;&lt;br /&gt; CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048&lt;br /&gt; CONFIG_SDC_RX_STACK_SIZE=1024&lt;br /&gt; &lt;strong&gt;CONFIG_MPSL_SIGNAL_STACK_SIZE=1024&lt;/strong&gt;&lt;br /&gt; CONFIG_STACK_ALIGN_DOUBLE_WORD=y&lt;br /&gt; CONFIG_ARM_STACK_PROTECTION=y&lt;br /&gt; CONFIG_MPU_STACK_GUARD=y&lt;br /&gt; CONFIG_IDLE_STACK_SIZE=320&lt;br /&gt; CONFIG_ISR_STACK_SIZE=2048&lt;br /&gt; CONFIG_TEST_EXTRA_STACKSIZE=0&lt;br /&gt; CONFIG_HW_STACK_PROTECTION=y&lt;br /&gt; CONFIG_GEN_PRIV_STACKS=y&lt;br /&gt; # CONFIG_STACK_GROWS_UP is not set&lt;br /&gt; CONFIG_ARCH_HAS_STACK_PROTECTION=y&lt;br /&gt; CONFIG_THREAD_STACK_INFO=y&lt;br /&gt; # CONFIG_INIT_STACKS is not set&lt;br /&gt; # CONFIG_STACK_CANARIES is not set&lt;br /&gt; CONFIG_STACK_POINTER_RANDOM=0&lt;br /&gt; # CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT is not set&lt;br /&gt; CONFIG_BT_HCI_ECC_STACK_SIZE=1100&lt;br /&gt; # CONFIG_STACK_USAGE is not set&lt;br /&gt; # CONFIG_STACK_SENTINEL is not set&lt;br /&gt; CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=768&lt;/p&gt;
&lt;p&gt;As you can see the main stack is indeed 4096 but there are three other stack sizes of 1024. We cam ignore&amp;nbsp;&lt;strong&gt;CONFIG_BT_RX_STACK_SIZE=1024&amp;nbsp;&lt;/strong&gt;because the BT code is disabled. That leaves only these two, which threads are they specifying the stack size for?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CONFIG_PRIVILEGED_STACK_SIZE=1024&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CONFIG_MPSL_SIGNAL_STACK_SIZE=1024&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The code that is crashing is not a sample example, it is our proprietary code under development. So, I am not allowed to share it.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Since the fault is occurring in the function&amp;nbsp;&lt;/span&gt;&lt;strong&gt;&lt;span&gt;k_work_handler_t pid4_tasks( void )&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&amp;nbsp;which is setup in main() as follows,&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;static struct k_work main_work_pid4;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;void main( void )&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;k_work_init( &amp;amp;main_work_pid4, pid4_tasks );&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while (1)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;k_work_submit( &amp;amp;main_work_pid4 );&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Could it be that the thread where the fault is occurring is the workqueue thread&amp;nbsp;&lt;strong&gt;&lt;span&gt;main_work_pid4&lt;/span&gt;&lt;/strong&gt;?&lt;/p&gt;
&lt;p&gt;Where can I find more details about&amp;nbsp;&lt;span&gt;&lt;span style="color:#ff0000;"&gt;MPU FAULT&lt;/span&gt;,&amp;nbsp;&lt;span style="color:#ff0000;"&gt;Stacking error (context area might be not valid)&lt;/span&gt; and &lt;span style="color:#ff0000;"&gt;Data Access Violation&lt;/span&gt;?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I have now disabled the new code that I added recently and the fault has disappeared. So, next I am going to add the new code back in gradually and see when the fault re-appears.&lt;/p&gt;
&lt;p&gt;Kind regards&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/305512?ContentTypeID=1</link><pubDate>Mon, 19 Apr 2021 11:55:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba34895b-aeaa-4e69-bff6-1f232e2acf85</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Hi Mohamed&lt;/p&gt;
&lt;p&gt;It may be helpful to set CONFIG_THREAD_NAME=y, then you will see the names of the threds instead of just a hex number.&lt;/p&gt;
&lt;p&gt;It seems like the thread&amp;nbsp;&lt;span&gt;&lt;span style="color:rgba(0, 128, 0, 1);"&gt;&lt;strong&gt;0x20002860&lt;/strong&gt;&lt;/span&gt; caused the&amp;nbsp;MPU fault (&amp;quot;&lt;/span&gt;&lt;span&gt;&lt;em&gt;Current thread: &lt;span style="color:rgba(0, 128, 0, 1);"&gt;&lt;strong&gt;0x20002860&lt;/strong&gt;&lt;/span&gt; (unknown)&amp;quot;&lt;/em&gt;). I think an MPU fault may be a consequence of a stack overflow, and I can see that&lt;/span&gt;&lt;span&gt;&amp;nbsp;the size of that thread is&amp;nbsp;1024 bytes (&lt;em&gt;&amp;quot;&lt;span style="color:rgba(0, 128, 0, 1);"&gt;&lt;strong&gt;0x20002860&lt;/strong&gt;&lt;/span&gt; : STACK: unused 348 usage 676 / 1024...&amp;quot;&lt;/em&gt;). It seems like this is the main thread (based on your findings), so I&amp;#39;m not sure why the size is only 1024 when you set&amp;nbsp;CONFIG_MAIN_STACK_SIZE=4096. You could try to take a look at the file &amp;lt;sample&amp;gt;/build/zephyr/.config and check what&amp;nbsp;CONFIG_MAIN_STACK_SIZE is equal to. You could also set&lt;/span&gt;&lt;span style="font-family:inherit;"&gt;&amp;nbsp;CONFIG_THREAD_NAME=y,&amp;nbsp;and figure out exactly which thread is causing the issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;If this didn&amp;#39;t help, could you upload the sample in zipped format and I&amp;#39;ll take a look at it.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/305336?ContentTypeID=1</link><pubDate>Fri, 16 Apr 2021 16:08:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:999a573b-1282-449a-b408-5f1ead5bdfd0</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;The stack overflow problem is showing its ugly head again.&lt;/p&gt;
&lt;p&gt;The fault is occurring in the function&amp;nbsp;&lt;strong&gt;&lt;span style="color:#0000ff;"&gt;k_work_handler_t pid4_tasks( void )&lt;/span&gt;&lt;/strong&gt; which is setup in main() as follows,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color:#0000ff;"&gt;static struct k_work main_work_pid4;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color:#0000ff;"&gt;void main( void )&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#0000ff;"&gt;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#0000ff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;k_work_init( &amp;amp;main_work_pid4, pid4_tasks );&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#0000ff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color:#0000ff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while (1)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#0000ff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#0000ff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color:#0000ff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;k_work_submit( &amp;amp;main_work_pid4 );&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color:#0000ff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color:#0000ff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color:#0000ff;"&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The main() stack is configured in the overlay file and so is the THREAD_ANALYZER stack,&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#0000ff;"&gt;&lt;strong&gt;CONFIG_MAIN_STACK_SIZE=4096&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#0000ff;"&gt;&lt;strong&gt;CONFIG_THREAD_ANALYZER_AUTO_STACK_SIZE=2048&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The stack analyzer output is shown below in &lt;strong&gt;bold&lt;/strong&gt;. Although I am&amp;nbsp;configuring&amp;nbsp;the main to be 4096, the stack analyzer is showing stack sizes of 2048, 1024 320 and 4096, why is this?&lt;/p&gt;
&lt;p&gt;The stack analyzer is not showing stack usage greater than 4096. In fact, I doubled the size of the main stack but the fault is still occurring. So, it could the stack overflow is the consequence of&amp;nbsp;this&amp;nbsp; error &lt;span style="color:#ff0000;"&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;&lt;span style="color:#ff0000;"&gt;Stacking error (context area might be not valid)&amp;quot;&lt;/span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I am attaching a picture of the&amp;nbsp;debugger status at the point the fault occurs.&lt;/p&gt;
&lt;p&gt;I did not want to increase&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Below is a trace capture of the Debug Terminal in SES IDE.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please help.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;*** Booting Zephyr OS build v2.4.99-ncs1-rc1 ***&lt;br /&gt;&lt;strong&gt;Thread analyze:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002780 : STACK: unused 1448 usage 600 / 2048 (29 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002fc8 : STACK: unused 1636 usage 412 / 2048 (20 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002db8 : STACK: unused 628 usage 396 / 1024 (38 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002860 : STACK: unused 348 usage 676 / 1024 (66 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002f08 : STACK: unused 288 usage 32 / 320 (10 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002e60 : STACK: unused 3508 usage 588 / 4096 (14 %); CPU: 99 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Thread analyze:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002780 : STACK: unused 1208 usage 840 / 2048 (41 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002fc8 : STACK: unused 1636 usage 412 / 2048 (20 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002db8 : STACK: unused 628 usage 396 / 1024 (38 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002860 : STACK: unused 348 usage 676 / 1024 (66 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002f08 : STACK: unused 36 usage 284 / 320 (88 %); CPU: 19 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002e60 : STACK: unused 3508 usage 588 / 4096 (14 %); CPU: 80 %&lt;/strong&gt;&lt;br /&gt;LR1110 Driver Version: v2.0.1&lt;br /&gt;LR1110 Firmware Version: HW: 22 Type: 01, FW: 03.03&lt;br /&gt;System Errors = 0x20&lt;br /&gt;System Errors = 0x0&lt;br /&gt;Counter = 1&lt;br /&gt;LR1110 Modem Packet Type = 1&lt;br /&gt;Counter = 2&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thread analyze:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002780 : STACK: unused 1208 usage 840 / 2048 (41 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002fc8 : STACK: unused 1636 usage 412 / 2048 (20 %&lt;/strong&gt;MCU TEMP = -588.24 0.000660 21.95 &amp;deg;C&lt;br /&gt;&lt;strong&gt;); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;--- 8 messages dropped ---&lt;br /&gt;delta_time_ms = 0&lt;br /&gt;&lt;strong&gt;Thread analyze:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002780 : STACK: unused 1208 usage 840 / 2048 (41 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002fc8 : STACK: unused 1036 usage 1012 / 2048 (49 %); CPU: 42 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002db8 : STACK: unused 628 usage 396 / 1024 (38 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002860 : STACK: unused 300 usage 724 / 1024 (70 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002f08 : STACK: unused 36 usage 284 / 320 (88 %); CPU: 16 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002e60 : STACK: unused 2988 usage 1108 / 4096 (27 %); CPU: 41 %&lt;/strong&gt;&lt;br /&gt;MCU TEMP = -588.24 0.000660 21.95 &amp;deg;C&lt;br /&gt;[00:01:03.042,20[00:01:03.042,20delta_time_ms = 0&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;[00:01:23.802,246] &lt;span style="color:#ff0000;"&gt;&amp;lt;err&amp;gt; os: ***** MPU FAULT *****&lt;/span&gt;&lt;br /&gt;[00:01:23.802,276] &lt;span style="color:#ff0000;"&gt;&amp;lt;err&amp;gt; os: Stacking error (context area might be not valid)&lt;/span&gt;&lt;br /&gt;[00:01:23.802,276] &lt;span style="color:#ff0000;"&gt;&amp;lt;err&amp;gt; os: Data Access Violation&lt;/span&gt;&lt;br /&gt;[00:01:23.802,307] &lt;span style="color:#ff0000;"&gt;&amp;lt;err&amp;gt; os: MMFAR Address: 0x200056dc&lt;/span&gt;&lt;br /&gt;[00:01:23.802,307] &lt;span style="color:#ff0000;"&gt;&amp;lt;err&amp;gt; os: r0/a1: 0x00000000 r1/a2: 0xaaaaaaaa r2/a3: 0xe288c458&lt;/span&gt;&lt;br /&gt;[00:01:23.802,337] &lt;span style="color:#ff0000;"&gt;&amp;lt;err&amp;gt; os: r3/a4: 0xdafdd530 r12/ip: 0x568e7d0e r14/lr: 0x3c74b9ef&lt;/span&gt;&lt;br /&gt;[00:01:23.802,337] &lt;span style="color:#ff0000;"&gt;&amp;lt;err&amp;gt; os: xpsr: 0xf48f4a00&lt;/span&gt;&lt;br /&gt;[00:01:23.802,368] &lt;span style="color:#ff0000;"&gt;&amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x6052b7d0&lt;/span&gt;&lt;br /&gt;[00:01:23.802,368] &lt;span style="color:#ff0000;"&gt;&amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0&lt;/span&gt;&lt;br /&gt;[00:01:23.802,398] &lt;span style="color:#ff0000;"&gt;&amp;lt;err&amp;gt; os: Current thread: 0x20002860 (unknown)&lt;/span&gt;&lt;br /&gt;[00:01:24.103,271] &lt;span style="color:#ff0000;"&gt;&amp;lt;err&amp;gt; fatal_error: Resetting system&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;*** Booting Zephyr OS build v2.4.99-ncs1-rc1 ***&lt;br /&gt;&lt;strong&gt;Thread analyze:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002780 : STACK: unused 1448 usage 600 / 2048 (29 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002fc8 : STACK: unused 1636 usage 412 / 2048 (20 %); CPU: 1 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002db8 : STACK: unused 628 usage 396 / 1024 (38 %); CPU: 1 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002860 : STACK: unused 348 usage 676 / 1024 (66 %); CPU: 18 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002f08 : STACK: unused 288 usage 32 / 320 (10 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002e60 : STACK: unused 3508 usage 588 / 4096 (14 %); CPU: 78 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Thread analyze:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002780 : STACK: unused 1208 usage 840 / 2048 (41 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002fc8 : STACK: unused 1636 usage 412 / 2048 (20 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002db8 : STACK: unused 628 usage 396 / 1024 (38 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002860 : STACK: unused 348 usage 676 / 1024 (66 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002f08 : STACK: unused 36 usage 284 / 320 (88 %); CPU: 99 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002e60 : STACK: unused 3508 usage 588 / 4096 (14 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;LR1110 Driver Version: v2.0.1&lt;br /&gt;LR1110 Firmware Version: HW: 22 Type: 01, FW: 03.03&lt;br /&gt;System Errors = 0x20&lt;br /&gt;System Errors = 0x0&lt;br /&gt;Counter = 1&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;LR1110 Modem Packet Type = 1&lt;br /&gt;Counter = 2&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Thread analyze:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002780 : STACK: unused 1208 usage 840 / 2048 (41 %); CPU: 0 %&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; 0x20002fc8 : STACK: unused 1636 usage &lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/301839?ContentTypeID=1</link><pubDate>Thu, 25 Mar 2021 09:57:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:110c5d5e-9a33-402e-8594-f163755cefbc</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Thank you Simon.&lt;/p&gt;
&lt;p&gt;Yes, the Thread analyzer has proved to be very useful.&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s just hope that it will not occur again.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/301781?ContentTypeID=1</link><pubDate>Wed, 24 Mar 2021 21:44:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:675b0769-c1f1-4704-8490-be381cdf9838</guid><dc:creator>Simon</dc:creator><description>[quote user="Learner"]Is there anything in the map file that could give me pointers when the stack size is not big enough?[/quote]
&lt;p&gt;I&amp;#39;m not totally sure about this. You could search for the faulting address in the map file and figure out what&amp;#39;s causing the fault stack overflow, and set a break point at that location to see what thread it&amp;#39;s running from, and then increase the stack size of that thread.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/zephyr/guides/flash_debug/thread-analyzer.html#thread-analyzer"&gt;Thread analyzer&lt;/a&gt;&amp;nbsp;is probably the best way of&amp;nbsp;analyzing the stack usage of the threads.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Learner"]I think changes to any configuration settings (prj.conf, overlay, Kconfig...) necessitates to re-open nRF Connect SDK project via File... I did&amp;nbsp; not think SES had to be restarted.[/quote]
&lt;p&gt;Yes, you are correct about this. But reopening SES follows that you run File.. again, and that might&amp;nbsp;include new dts/overlay/Kconfig changes that wasn&amp;#39;t present before you reopened SES. However, something completely different might have triggered the fault, and let&amp;#39;s hope it doesn&amp;#39;t show up again.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/301523?ContentTypeID=1</link><pubDate>Tue, 23 Mar 2021 16:31:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49df1c4b-a4e6-455d-910a-dd7746a1358f</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Thank you Simon.&lt;/p&gt;
&lt;p&gt;I think changes to any configuration settings (prj.conf, overlay, Kconfig...) necessitates to re-open nRF Connect SDK project via File... I did&amp;nbsp; not think SES had to be restarted.&lt;/p&gt;
&lt;p&gt;Anyway, the problem has disappeared for now. Let&amp;#39;s hope it will not show its ugly head again.&lt;/p&gt;
&lt;p&gt;Is there anything in the map file that could give me pointers when the stack size is not big enough?&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/301401?ContentTypeID=1</link><pubDate>Tue, 23 Mar 2021 11:25:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b638fd8-98fd-4c60-af45-18232c65f1c0</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Hmm.. Maybe it was the fact that you reopened SES that changed the behaviour? Be aware that changes in the overlay or Kconfig will not be taken into effect before restarting SES (or re-running the CMake logic again in some way).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/301095?ContentTypeID=1</link><pubDate>Sun, 21 Mar 2021 22:06:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13d1e53b-3078-4811-b5bc-0954f03c0f46</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Thank you Simon for your help over the weekend. Your help is really appreciated.&lt;/p&gt;
&lt;p&gt;It has been few days since I last rebooted my laptop. So, I rebooted&amp;nbsp;it yesterday and enabled the stack analyzer module in prj.cong then started&amp;nbsp;to debug my application in SES and found that in fact the stack usage is not a problem at all. I have plenty of unused stack in the main thread. The application also runs without any problems. So, it looks like my laptop was causing the problem I was seeing in SES/zephyr/application. I am rather confused as to how a problem with my laptop could cause an embedded application running on a separate target to fail with a stack overflow error. Maybe you can enlighten me and tell how this can be possible.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/301094?ContentTypeID=1</link><pubDate>Sun, 21 Mar 2021 21:50:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b13fa8b5-9ecf-4272-8dc2-3d78b3e66f56</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Could you first try to do the following?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;cd &amp;lt;application folder&amp;gt;/&amp;lt;build_folder&amp;gt;/zephyr&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;addr2line -e zephyr.elf 0x&lt;span&gt;aec010&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&amp;#39;m using addr2line that comes with MinGW. That command will provide you with the exact place that causes the fault. I got the address 0xaec010 from here:&amp;nbsp;&lt;span&gt;&lt;em&gt;[00:00:41.795,074] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x00aec010&lt;/em&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Then start a debug session, and put a break point on the place that caused the fault, and you will find the corresponding thread at the bottom of the call stack, like in the call stack in&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70100/ecdsa-signing-crashes-when-implemented-with-bluetooth/288468#288468"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/70100/ecdsa-signing-crashes-when-implemented-with-bluetooth/288468#288468&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If the issue is due to a stack overflow, increasing the stack size of the thread you found should solve the problem.&lt;/p&gt;
&lt;p&gt;There may be some more efficient ways of resolving this, but this should work.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/301023?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 23:17:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da25198f-a964-4c81-b13a-bf337d94b982</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I have had a look at the &lt;span&gt;thread-analyzer&amp;nbsp;&lt;/span&gt;link and it looks like it could help debug the stack overflow I am seeing. However, I am not sure how to use it. Can you please provide an example C code using&amp;nbsp;&lt;span&gt;thread_analyzer_run() and&amp;nbsp;thread_analyzer_print().&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mohamed&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/301002?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 16:41:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b61d1f15-bc29-4ea2-a6c0-686c3def58ae</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I increased the stack size to 8192 in prj.conf&lt;/p&gt;
&lt;p&gt;CONFIG_MAIN_STACK_SIZE=8192&lt;/p&gt;
&lt;p&gt;But I am still seeing this error &lt;span style="text-decoration:underline;"&gt;upon entering main and before executing&lt;/span&gt; any of the application instructions.&lt;/p&gt;
&lt;p&gt;In the SES debugger, the yellow arrow points to the first curly bracket&amp;nbsp; &amp;#39;{&amp;#39; in main(). I then click Go (F5) to move the cursor to the first instruction in main() then the error appears.&lt;/p&gt;
&lt;p&gt;*** Booting Zephyr OS build v2.4.99-ncs1-rc1 ***&lt;br /&gt;[00:00:41.795,043] &amp;lt;err&amp;gt; os: ***** USAGE FAULT *****&lt;br /&gt;[00:00:41.795,043] &amp;lt;err&amp;gt; os: Stack overflow (context area not valid)&lt;br /&gt;[00:00:41.795,043] &amp;lt;err&amp;gt; os: r0/a1: 0x245bc4ae r1/a2: 0x77fb5ffe r2/a3: 0x05821210&lt;br /&gt;[00:00:41.795,074] &amp;lt;err&amp;gt; os: r3/a4: 0xbdd9cba6 r12/ip: 0x0405a049 r14/lr: 0x77faebb6&lt;br /&gt;[00:00:41.795,074] &amp;lt;err&amp;gt; os: xpsr: 0x9ed6fa00&lt;br /&gt;[00:00:41.795,074] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x00aec010&lt;br /&gt;[00:00:41.795,074] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0&lt;br /&gt;[00:00:41.795,074] &amp;lt;err&amp;gt; os: Current thread: 0x20000668 (unknown)&lt;br /&gt;[00:00:42.056,854] &amp;lt;err&amp;gt; fatal_error: Resetting system&lt;/p&gt;
&lt;p&gt;It looks like something is going before main() starts running.&lt;/p&gt;
&lt;p&gt;Please help.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/300988?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 14:59:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edcf416e-c5fa-470a-9bea-bbde5384a2d1</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Thank you Simon.&lt;/p&gt;
&lt;p&gt;I will have a look at the suggested links.&lt;/p&gt;
&lt;p&gt;Will the .map file reveal the source of the problem?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/300936?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 13:05:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a12b101-9abf-44bc-b173-aa17dbefa77a</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;If the function is called further down the tree, but still &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/4ce908a2342494c19df09f347ce79ab81b415185/kernel/init.c#L260-L264"&gt;within the main thread&lt;/a&gt;, you should still increase CONFIG_MAIN_STACK_SIZE. If you the function is called from within another thread, you should increas the stack size of that thread.&lt;/p&gt;
&lt;p&gt;E.g. take a look at this DevZone case&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70100/ecdsa-signing-crashes-when-implemented-with-bluetooth/288468#288468"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/70100/ecdsa-signing-crashes-when-implemented-with-bluetooth/288468#288468&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;where the hci_rx_thread was the cause and increasing&amp;nbsp;CONFIG_BT_RX_STACK_SIZE solved the problem.&lt;/p&gt;
&lt;p&gt;You may look into Ozone 3.22c as well, which makes it possible to do thread aware debugging.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;These may be useful as well:&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/nrf/app_memory.html#memory-footprint-optimization"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/nrf/app_memory.html#memory-footprint-optimization&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/zephyr/guides/flash_debug/thread-analyzer.html#thread-analyzer"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/zephyr/guides/flash_debug/thread-analyzer.html#thread-analyzer&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/59838/why-there-is-no-main-in-zephyr-thread-sample-codes"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/59838/why-there-is-no-main-in-zephyr-thread-sample-codes&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/300921?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 12:32:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52cdfcd3-e5a1-4e25-a818-e5e0eb465b6b</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Thank you Simon.&lt;/p&gt;
&lt;p&gt;What is the solution if the function that is causing the stack overflow is not called from main() but few levels down the function call tree?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow</title><link>https://devzone.nordicsemi.com/thread/300907?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 11:47:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70625d2a-f53e-490e-87ea-7cb2af9426e9</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;If the function that caused the stack overflow is called from main, increasing &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/kconfig/CONFIG_MAIN_STACK_SIZE.html"&gt;CONFIG_MAIN_STACK_SIZE&lt;/a&gt;&amp;nbsp;would be the solution then.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>