<?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 (context area not valid) on ncs v2.4.2</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106169/stack-overflow-context-area-not-valid-on-ncs-v2-4-2</link><description>I use nRF5340 DK to test NOR flash writing. But it failed due to stack overflow. What is meaning of context area not valid and do you have any suggestion to debug this issue?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Nov 2023 11:21:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106169/stack-overflow-context-area-not-valid-on-ncs-v2-4-2" /><item><title>RE: Stack overflow (context area not valid) on ncs v2.4.2</title><link>https://devzone.nordicsemi.com/thread/458052?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2023 11:21:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae124b78-2abb-45a7-9ad3-30c8d42ab285</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Thanks for your great support! No stack overflow issue after increasing stack size of flash thread to 8192.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow (context area not valid) on ncs v2.4.2</title><link>https://devzone.nordicsemi.com/thread/458049?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2023 11:18:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bceb9da-7d3b-4626-bf6d-674c1a2f4835</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;There is&amp;nbsp; no generic answer to the stack size as it always depends on your application and can vary between application to application. You always need to know the stack sizes needed by different contexts when doing the application architecture. Check if enabling the &lt;a href="https://docs.zephyrproject.org/latest/services/debugging/thread-analyzer.html"&gt;Thread Analyzer&lt;/a&gt;&amp;nbsp;can give you more hints on which thread is using up most of its stack so that you can increase it with something your software architect can suggest.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow (context area not valid) on ncs v2.4.2</title><link>https://devzone.nordicsemi.com/thread/458047?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2023 11:04:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:153a2c63-935b-41db-8133-0e9600c5ded1</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Thanks for your reply! Do you have suggestions about stack size?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow (context area not valid) on ncs v2.4.2</title><link>https://devzone.nordicsemi.com/thread/458046?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2023 11:03:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a0f3435-8f61-4da6-be47-e129a6703c86</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;check what you have for the below in your \build\zephyr\.config and increase those values in prj.conf&lt;/p&gt;
&lt;p&gt;CONFIG_MAIN_STACK_SIZE for main stack and&amp;nbsp;&lt;/p&gt;
&lt;p&gt;increase the stack size for the thread named &amp;quot;flash thread&amp;quot; as it shows in your log.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow (context area not valid) on ncs v2.4.2</title><link>https://devzone.nordicsemi.com/thread/458029?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2023 10:01:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:985ac71e-d841-431b-9301-c1f7ef2ed1cf</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Thanks for your reply! How to increase the main and ISR stack size in per. conf file?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stack overflow (context area not valid) on ncs v2.4.2</title><link>https://devzone.nordicsemi.com/thread/458028?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2023 09:57:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:149b4c14-422d-4b59-9796-9ecc75f6ae84</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Stack overflows tend to destroy important informtion for the RTOS to work.&lt;/p&gt;
&lt;p&gt;Usually fixed by either turning the log level down (logs can use a ton of extra stack space) or increase the main and isr stack size in the project config.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>