<?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 nrfx gpiote zephyr thread unresponsive</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105429/nrf52840-nrfx-gpiote-zephyr-thread-unresponsive</link><description>Hi all, 
 I&amp;#39;m using the nrfx gpiote to setup an interrupt from an external device (IMU.) Whenever there is an interrupt, I would post an event and process it in another thread. The problem I&amp;#39;m facing is that this post event from the ISR doesn&amp;#39;t get processed</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Nov 2023 23:43:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105429/nrf52840-nrfx-gpiote-zephyr-thread-unresponsive" /><item><title>RE: nrf52840 nrfx gpiote zephyr thread unresponsive</title><link>https://devzone.nordicsemi.com/thread/454801?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 23:43:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec2105f2-7c6e-4739-b0f9-0a734a9a3c86</guid><dc:creator>lvh831</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;Thank you so much for sharing the info. I couldn&amp;#39;t use IRQ_CONNECT because I bypassed Zephyr stuff (initialization and devicetree etc.) The problem I noticed was with the scheduler. In directly using your suggestion:&amp;nbsp;&lt;span&gt;ISR_DIRECT_DECLARE,&amp;nbsp;ISR_DIRECT_FOOTER(1) got it to work. Thanks.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 nrfx gpiote zephyr thread unresponsive</title><link>https://devzone.nordicsemi.com/thread/454723?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 14:43:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:339cc516-9c94-4a78-b0cf-402c49610dd2</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;That is likely right, I can see from the documentation:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/kernel/services/interrupts.html#concepts"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/kernel/services/interrupts.html#concepts&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;Many kernel APIs can be used only by threads, and not by ISRs. In cases where a routine may be invoked by both threads and ISRs the kernel provides the k_is_in_isr() API to allow the routine to alter its behavior depending on whether it is executing as part of a thread or as part of an ISR.&amp;quot;&lt;/p&gt;
&lt;p&gt;I have not looked at your project to see if you are already doing this though.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 nrfx gpiote zephyr thread unresponsive</title><link>https://devzone.nordicsemi.com/thread/454556?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2023 22:57:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dc18b77-5ff5-4c4e-ae6c-816c894679af</guid><dc:creator>lvh831</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;The ncs version I&amp;#39;m using is 2.5 and the board is nrf52840dk_nrf52840. I tried to trace the code with ozone and noticed that as soon as I trigger the gpiote interrupt, it does switch to key1_thread which means the ISR is okay since it posts an event to this thread.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1699397577539v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;But I think it still stays there waiting for k_event_wait(..)&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1699397707890v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;I attached a zip version of this code that you try to build the project again with ncs 2.5&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 nrfx gpiote zephyr thread unresponsive</title><link>https://devzone.nordicsemi.com/thread/454477?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2023 13:46:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15dbe299-91dc-4499-bb0c-735d1ccd3344</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I was not able to compile your project, likely I am using the wrong board and/or ncs version.&lt;/p&gt;
&lt;p&gt;I think however your problem may be related to the use and description of IRQ_DIRECT_CONNECT:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/kernel/services/interrupts.html#c.IRQ_DIRECT_CONNECT"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/kernel/services/interrupts.html#c.IRQ_DIRECT_CONNECT&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I suggest you for instance try to use&amp;nbsp;ISR_DIRECT_DECLARE(nrfx_gpiote_irq_handler) if you want to use&amp;nbsp;IRQ_DIRECT_CONNECT.&lt;/p&gt;
&lt;p&gt;Alternatively don&amp;#39;t use&amp;nbsp;IRQ_DIRECT_CONNECT, but use&amp;nbsp;IRQ_CONNECT.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>