<?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>[nRF52840] MPU FAULT: ISR taking too long ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92930/nrf52840-mpu-fault-isr-taking-too-long</link><description>Hi, 
 
 I&amp;#39;ve got a GPIO interrupt callback that collects an ADC reading. All is fine until there. 
 
 But when interrupts become numerous (~3/5k triggers / sec), a MPU FAULT appears. 
 
 After some tests, I&amp;#39;m assuming it comes from the adc_read() (from</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Oct 2022 14:04:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92930/nrf52840-mpu-fault-isr-taking-too-long" /><item><title>RE: [nRF52840] MPU FAULT: ISR taking too long ?</title><link>https://devzone.nordicsemi.com/thread/391223?ContentTypeID=1</link><pubDate>Tue, 18 Oct 2022 14:04:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45584308-f442-44a1-9198-66acd5f7a0ef</guid><dc:creator>AnomalySmith</dc:creator><description>&lt;p&gt;Yes, finally I decided to change the logic even if it brings limitations in the final design.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52840] MPU FAULT: ISR taking too long ?</title><link>https://devzone.nordicsemi.com/thread/391222?ContentTypeID=1</link><pubDate>Tue, 18 Oct 2022 13:53:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca93ac07-e59b-4ebe-b282-77b75b4eca42</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure if the adc_read() function is blocking, but if it is then you should avoid calling it in an ISR.&lt;/p&gt;
&lt;p&gt;Instead you could try using adc_read_async(), or alternatively use a semaphore to signal from the ISR and call adc_read in your main thread.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>