<?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>MPU Fault : Stacking error &amp;amp; Data access violation, when a sensor device is added</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104080/mpu-fault-stacking-error-data-access-violation-when-a-sensor-device-is-added</link><description>Good day, 
 
 I have a project including BLE, two i2c sensors and several timers to handle led and switches. I want to add the third sensor which is LIS2DH (actually LIS3DH but the driver is the same), using the zephyr sensor driver. I&amp;#39;ve tested the driver</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 Sep 2023 20:03:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104080/mpu-fault-stacking-error-data-access-violation-when-a-sensor-device-is-added" /><item><title>RE: MPU Fault : Stacking error &amp; Data access violation, when a sensor device is added</title><link>https://devzone.nordicsemi.com/thread/447820?ContentTypeID=1</link><pubDate>Tue, 26 Sep 2023 20:03:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d95940b-b7d6-403c-a5ef-38457c16df00</guid><dc:creator>Hossein Kasaei</dc:creator><description>&lt;p&gt;Wow! I I just remembered that this error is the same as the error I had&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/102139/restart-after-system-off-if-the-sensor-driver-is-not-suspended-zephyr-os"&gt;here&lt;/a&gt;. Actually my program put the cpu to system off mode at the startup for power management and the user can wake it up later, and that&amp;#39;s why the sensor driver is causing this error cause I don&amp;#39;t put it to sleep mode before system off :&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;pm_device_action_run(sensor, PM_DEVICE_ACTION_SUSPEND);&lt;/pre&gt;&lt;br /&gt; Although I don&amp;#39;t understand why I have to suspend lis2dh driver before entering system off cause that&amp;#39;s not the case for other sensors. that&amp;#39;s still a mystery for me!&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MPU Fault : Stacking error &amp; Data access violation, when a sensor device is added</title><link>https://devzone.nordicsemi.com/thread/447758?ContentTypeID=1</link><pubDate>Tue, 26 Sep 2023 13:57:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9f18f0d-e593-4595-b224-851eb7a28223</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Using &amp;quot;st,lis2dh&amp;quot; should work, as it supports lis3dh as you mentioned.&lt;/p&gt;
&lt;p&gt;These configs are used in the zephyr sample, have you tried them?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_STDOUT_CONSOLE=y
CONFIG_CBPRINTF_FP_SUPPORT=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Have you tried the other trigger modes?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;LIS2DH_TRIGGER_NONE=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;LIS2DH_TRIGGER_OWN_THREAD=y
LIS2DH_THREAD_STACK_SIZE=8192&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MPU Fault : Stacking error &amp; Data access violation, when a sensor device is added</title><link>https://devzone.nordicsemi.com/thread/447572?ContentTypeID=1</link><pubDate>Mon, 25 Sep 2023 18:41:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e01c4d22-45c8-439b-919d-abb01c416533</guid><dc:creator>Hossein Kasaei</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tested this config and it didn&amp;#39;t help.&lt;/p&gt;
&lt;p&gt;I decided to use &amp;lt;st,lis3dh&amp;gt; compatible but now I get the compile error&amp;nbsp;undefined reference to `__device_dts_ord_108&amp;#39; which I couldn&amp;#39;t resolve cause there is no CONFIG_LIS3DH :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MPU Fault : Stacking error &amp; Data access violation, when a sensor device is added</title><link>https://devzone.nordicsemi.com/thread/447549?ContentTypeID=1</link><pubDate>Mon, 25 Sep 2023 16:23:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0537385e-fda2-40c1-949d-cadef2dea3af</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you try increasing your the size of your main stack?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_MAIN_STACK_SIZE=16384&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If this works, this size is probably overkill, so experiment with different sizes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>