<?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>Kscan callback triggers fault during interrupt handling</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97592/kscan-callback-triggers-fault-during-interrupt-handling</link><description>Application is communicating with a touch controller (FT5336) over I2C and registering a callback with kscan_config() and kscan_enable_callback() . Every few minutes a &amp;quot;ZEPHYR FATAL ERROR 0: CPU exception on CPU 0&amp;quot; (Fault during interrupt handling) occurs</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Apr 2023 08:32:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97592/kscan-callback-triggers-fault-during-interrupt-handling" /><item><title>RE: Kscan callback triggers fault during interrupt handling</title><link>https://devzone.nordicsemi.com/thread/421961?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 08:32:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a87a302b-38fd-498d-9b4e-cb7bceaf592e</guid><dc:creator>adelebrown68</dc:creator><description>&lt;p&gt;&lt;span&gt;When I added Micro-ROS to the software stack, the&amp;nbsp;&lt;/span&gt;&lt;em&gt;interrupts&lt;/em&gt;&lt;span&gt;&amp;nbsp;started causing the halting&amp;nbsp;&lt;/span&gt;&lt;em&gt;error&lt;/em&gt;&lt;span&gt;&amp;nbsp;below when the first&amp;nbsp;&lt;/span&gt;&lt;em&gt;interrupt&lt;/em&gt;&lt;span&gt;&amp;nbsp;is&amp;nbsp;&lt;/span&gt;&lt;em&gt;triggered&lt;/em&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#ffffff;"&gt;&lt;a style="color:#ffffff;" href="https://papas-games.io"&gt;papa&amp;#39;s games&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Kscan callback triggers fault during interrupt handling</title><link>https://devzone.nordicsemi.com/thread/416151?ContentTypeID=1</link><pubDate>Sat, 18 Mar 2023 18:45:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fe90a8a-fe39-4b32-94f6-82e1fdcad751</guid><dc:creator>nategreco</dc:creator><description>&lt;p&gt;Hello Hakon,&lt;br /&gt;I believe the increase of&amp;nbsp;&lt;span&gt;CONFIG_MAIN_STACK_SIZE&amp;nbsp;may have resolved my issue as I have not seen it.&amp;nbsp; I will re-open if I encounter again, thanks for the help.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Kscan callback triggers fault during interrupt handling</title><link>https://devzone.nordicsemi.com/thread/414972?ContentTypeID=1</link><pubDate>Mon, 13 Mar 2023 15:12:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6179c386-2385-4372-9255-22f1ac2ac1c6</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Application is communicating with a touch controller (FT5336) over I2C and registering a callback with &lt;em&gt;kscan_config()&lt;/em&gt; and &lt;em&gt;kscan_enable_callback()&lt;/em&gt;.&amp;nbsp; Every few minutes a &amp;quot;ZEPHYR FATAL ERROR 0: CPU exception on CPU 0&amp;quot; (Fault during interrupt handling) occurs, restarting the application.&amp;nbsp; Using debug I can see two &amp;quot;&amp;lt;signal handler called&amp;gt;&amp;quot; (photo&amp;#39;d) and I always see a call to &amp;quot;i2c_dump_msgs()&amp;quot; as the lowest call.[/quote]
&lt;p&gt;The functions you&amp;#39;re calling are effectively these, as you&amp;#39;re selecting the FT5336 device:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.2.99-ncs2/drivers/kscan/kscan_ft5336.c#L223-L225"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v3.2.99-ncs2/drivers/kscan/kscan_ft5336.c#L223-L225&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I would recommend that you first adjust your CONFIG_MAIN_STACK_SIZE to a higher value, for instance 4096.&lt;/p&gt;
&lt;p&gt;If you still see assertions, you should scope your SDA/SCL pins using a logic analyzer to see if the communication is working towards your sensor.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]Not sure if it&amp;#39;s related by occasionally see &amp;quot;&lt;em&gt;&amp;lt;err&amp;gt; i2c_nrfx_twim: Error on I2C line occurred for message 0&lt;/em&gt;&amp;quot; in my application at roughly the same frequency, although I do not see this at the same time as the CPU fault.[/quote]
&lt;p&gt;This normally means that it has problems communicating on that specific address:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.2.99-ncs2/drivers/i2c/i2c_nrfx_twi.c#L131"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v3.2.99-ncs2/drivers/i2c/i2c_nrfx_twi.c#L131&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]I&amp;#39;ve read similar posts that say this issue arises when an interrupt interrupts an interrupt - Am I understanding that correctly?&amp;nbsp; If so, shouldn&amp;#39;t interrupt priorities avoid this?&amp;nbsp; Where/how is this managed?&amp;nbsp; Also worth noting this application uses bluetooth soft device, timers (rtc2), uart, pwm, etc.[/quote]
&lt;p&gt;Are you experiencing the same problems if you isolate the functionality towards this specific sensor?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>