<?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>Configure multiple GPIO interrupts with different priorities</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109511/configure-multiple-gpio-interrupts-with-different-priorities</link><description>Hello, I&amp;#39;m working on an nRF5340-based system with Zephyr v3.6.99 that will have multiple external sensors, each with an associated interrupt pin tied to a GPIO. I am currently using the Zephyr GPIO API, but it is not clear to me how to set priorities</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Mar 2024 17:27:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109511/configure-multiple-gpio-interrupts-with-different-priorities" /><item><title>RE: Configure multiple GPIO interrupts with different priorities</title><link>https://devzone.nordicsemi.com/thread/475454?ContentTypeID=1</link><pubDate>Fri, 22 Mar 2024 17:27:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c883839-ca5c-4ad5-9ed4-f249f1986d71</guid><dc:creator>jaberk</dc:creator><description>&lt;p&gt;I have not run into issues as of yet, but development is ongoing, and I wanted to run this down before implementation. The info you&amp;#39;ve already provided will suffice for now, thank you again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure multiple GPIO interrupts with different priorities</title><link>https://devzone.nordicsemi.com/thread/475360?ContentTypeID=1</link><pubDate>Fri, 22 Mar 2024 10:52:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:644a5df8-3884-40ff-9e98-0041ca891c36</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Happy to help! Yes, you can increase the priority of the GPIOTE IRQ by setting the interrupt priority to a lower numerical value in the gpiote0 DT node. This will allow the GPIOTE interrupt to preempt other lower-priority interrupts. However, I&amp;#39;m not&amp;nbsp;sure if this would be advisable, as it may introduce race conditions. Are you experiencing problem with meeting timing requirements with your current implementation?&lt;/p&gt;
&lt;p&gt;EGU is supported through the nrfx drivers/hal:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/egu/index.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/egu/index.html&lt;/a&gt;.&amp;nbsp;But I believe I need a&amp;nbsp;better understanding of your application and requirements to&amp;nbsp;say whether&amp;nbsp;it would make sense to use it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure multiple GPIO interrupts with different priorities</title><link>https://devzone.nordicsemi.com/thread/475128?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2024 13:15:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50d24bca-5dbe-4c8c-8f14-0a4f38ebeca4</guid><dc:creator>jaberk</dc:creator><description>&lt;p&gt;Thank you for the help!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This sounds like, as it currently stands, there would be no way for the ISR of a sensor to preempt the ISR of another, lower priority sensor, and the best bet is to minimize processing within the ISR. Couple of follow-up questions:&lt;/p&gt;
&lt;p&gt;To increase the GPIO&amp;nbsp;ISR priority so it is serviced quicker than other peripherals,&amp;nbsp;would you override the interrupt property in the devicetree for the GPIO or&amp;nbsp;&lt;span&gt;the GPIOTE node? This would need to be lower than NRF_DEFAULT_IRQ_PRIORITY&amp;nbsp;and would alter the priority for all GPIOTE events? Something like the following:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;gpiote0 {
    interrupts = &amp;lt;13 MODIFIED_IRQ_PRIORITY&amp;gt;
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also, is there support for the EGU functionality in Zephyr, or&amp;nbsp;would this be of no benefit for this specific question?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Configure multiple GPIO interrupts with different priorities</title><link>https://devzone.nordicsemi.com/thread/474993?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2024 07:07:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3735d1d-09f3-4212-a35f-b32d55e944a8</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You are right that the driver uses&amp;nbsp;GPIOTE for pin interrupts. However, the peripheral only has one IRQ signal. This meanst that interrupt enabled GPIOTE events will all trigger the same interrupt. But you can defer the processing of sensor tasks from the GPIO callback to an application thread. This allows you to schedule the tasks with different priorities. This will also reduce the time spent in the ISR.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>