<?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>z_arm_exc_spurious</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75052/z_arm_exc_spurious</link><description>Hi. I use NCS SDK 1.5.1 with NRF5340 . 
 I took the project from: \zephyr\samples\portability\cmsis_rtos_v2\philosophers\ as base and try to add two additional tasks. 
 Application works when: 1) Optimization for size and the the main has infinite loop</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 May 2021 12:57:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75052/z_arm_exc_spurious" /><item><title>RE: z_arm_exc_spurious</title><link>https://devzone.nordicsemi.com/thread/310167?ContentTypeID=1</link><pubDate>Tue, 18 May 2021 12:57:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:523a821d-45c0-4ab6-8e30-d98856a95661</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Setting&amp;nbsp;&lt;span&gt;CONFIG_IDLE_STACK_SIZE&lt;/span&gt;&lt;span&gt;=2048 in the prj.conf file should resolve this issue.&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;Explanation:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I was able to reproduce this by setting&amp;nbsp;&lt;code&gt;&lt;span&gt;CONFIG_NO_OPTIMIZATIONS&lt;/span&gt;&lt;span&gt;=y, &lt;/span&gt;&lt;/code&gt;&lt;span&gt;I also set these:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_LOG=y
CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_THREAD_NAME=y&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Which provided me with this log:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.4.99-ncs2  ***
[1B][2J[1B][15;1HDemo Description
----------------
An implementation of a solution to the Dining Philosophers
problem (a classic multi-thread synchronization problem) using
CMSIS RTOS V2 APIs. This particular implementation demonstrates the
usage of multiple preemptible threads of differing
priorities, as well as semaphores and thread sleeping.
[00:00:00.570,739] [1B][1;31m&amp;lt;err&amp;gt; os: ***** USAGE FAULT *****[1B][0m
[00:00:00.570,800] [1B][1;31m&amp;lt;err&amp;gt; os:   Stack overflow (context area not valid)[1B][0m
[00:00:00.570,831] [1B][1;31m&amp;lt;err&amp;gt; os: r0/a1:  0x0000da2e  r1/a2:  0x41000200  r2/a3:  0xaaaaaaaa[1B][0m
[00:00:00.570,831] [1B][1;31m&amp;lt;err&amp;gt; os: r3/a4:  0x20005f88 r12/ip:  0xaaaaaaaa r14/lr:  0x20001520[1B][0m
[00:00:00.570,861] [1B][1;31m&amp;lt;err&amp;gt; os:  xpsr:  0xaaaaaa00[1B][0m
[00:00:00.570,861] [1B][1;31m&amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x00000000[1B][0m
[00:00:00.570,892] [1B][1;31m&amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0[1B][0m
[00:00:00.570,922] [1B][1;31m&amp;lt;err&amp;gt; os: Current thread: 0x200015c8 (idle 00)[1B][0m
[00:00:00.628,997] [1B][1;31m&amp;lt;err&amp;gt; os: Halting system[1B][0m
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As you can see, a stack overflow occured in the idle thread, and increasing CONFIG_IDLE_STACK_SIZE solves the problem.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: z_arm_exc_spurious</title><link>https://devzone.nordicsemi.com/thread/309902?ContentTypeID=1</link><pubDate>Sun, 16 May 2021 14:09:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf02672f-59bf-4932-9238-a8999a134c0b</guid><dc:creator>VadymS</dc:creator><description>&lt;p&gt;I can&amp;#39;t reproduce the initial trouble. It started to work. I reinstall the SDK and upload the project. May be tried different Scheduler configuration.&lt;br /&gt;In any case, I get the&amp;nbsp;z_arm_exc_spurious if I run the projects without optimization:&amp;nbsp;Optimize nothing.&lt;br /&gt;For example, project&amp;nbsp;\v1.5.1\zephyr\samples\portability\cmsis_rtos_v2 or the same project for SDK v1.4.99-dev1.&lt;/p&gt;
&lt;p&gt;When optimization for Size of Debugging, it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: z_arm_exc_spurious</title><link>https://devzone.nordicsemi.com/thread/309808?ContentTypeID=1</link><pubDate>Fri, 14 May 2021 13:49:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3057f8d7-f4b5-469a-8218-ea620232d8d5</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Would you ble able to upload your modified sample in a zipped file? Then I can reproduce it myself and it&amp;#39;s easier to investigate.&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>