<?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>Integrating DPPI in Zephyr-based Firmware</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111409/integrating-dppi-in-zephyr-based-firmware</link><description>Hello, I started looking into the DPPI from NRF5340 series and planning to integrate some functionality into an existing zephyr-based project. Specifically, I need timer-based GPIO toggles for an application with precise timing requirements. But I planned</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 May 2024 12:58:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111409/integrating-dppi-in-zephyr-based-firmware" /><item><title>RE: Integrating DPPI in Zephyr-based Firmware</title><link>https://devzone.nordicsemi.com/thread/485428?ContentTypeID=1</link><pubDate>Wed, 22 May 2024 12:58:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f36b5528-4d33-4fd8-8cd5-dcc3fabbd8a7</guid><dc:creator>Yaxit</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Ok this is actually interesting. I managed to get the basic example running similarly (using a barrier for the initialization with&amp;nbsp;&lt;code&gt;&lt;span&gt;nrfx_gpiote_init_check&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;gpiote) &lt;/span&gt;&lt;/code&gt;&lt;span&gt;and also toggling some LEDs with timers. I wonder how flexible this approach will be with more complex peripherals, but I do not need that for now.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Integrating DPPI in Zephyr-based Firmware</title><link>https://devzone.nordicsemi.com/thread/485370?ContentTypeID=1</link><pubDate>Wed, 22 May 2024 11:04:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1336c6a6-34b9-416e-9062-27d4a9280cb8</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;
[quote user=""]For example, to use NRFX GPIOTE I need to disable the GPIO driver in zephyr (CONFIG_GPIO=n), which would break basically everything already existing.[/quote]
&lt;p&gt;This was true in older versions of NCS, but now that gpio_nrfx (zephyr &amp;quot;gpio&amp;quot; port) uses nrfx_gpiote, this should not break other instances of GPIO usage:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.4.99-ncs1-2/drivers/gpio/gpio_nrfx.c#L380"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v3.4.99-ncs1-2/drivers/gpio/gpio_nrfx.c#L380&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you are using ncs v2.6 or newer, there&amp;#39;s a instance that is passed to nrfx_gpiote_* API calls.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To make the specific sample run, you need to guard the IRQ_CONNECT and nrfx_gpiote_init call with #if !defined(CONFIG_GPIO) to make it run as you&amp;#39;d expect.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a suggested fix:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;diff --git a/samples/boards/nrf/nrfx/prj.conf b/samples/boards/nrf/nrfx/prj.conf
index d4f0c29699f..77bc86c294a 100644
--- a/samples/boards/nrf/nrfx/prj.conf
+++ b/samples/boards/nrf/nrfx/prj.conf
@@ -1,3 +1,3 @@
-CONFIG_GPIO=n
+CONFIG_GPIO=y
 CONFIG_LOG=y
 CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100
diff --git a/samples/boards/nrf/nrfx/src/main.c b/samples/boards/nrf/nrfx/src/main.c
index 0643b1c0911..b6835b8b186 100644
--- a/samples/boards/nrf/nrfx/src/main.c
+++ b/samples/boards/nrf/nrfx/src/main.c
@@ -45,7 +45,7 @@ int main(void)
        uint8_t in_channel, out_channel;
        uint8_t ppi_channel;
        const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(GPIOTE_INST);
-
+#if !defined(CONFIG_GPIO)
        /* Connect GPIOTE instance IRQ to irq handler */
        IRQ_CONNECT(DT_IRQN(GPIOTE_NODE), DT_IRQ(GPIOTE_NODE, priority), nrfx_isr,
                    NRFX_CONCAT(nrfx_gpiote_, GPIOTE_INST, _irq_handler), 0);
@@ -58,7 +58,7 @@ int main(void)
                LOG_ERR(&amp;quot;nrfx_gpiote_init error: 0x%08X&amp;quot;, err);
                return 0;
        }
-
+#endif
        err = nrfx_gpiote_channel_alloc(&amp;amp;gpiote, &amp;amp;in_channel);
        if (err != NRFX_SUCCESS) {
                LOG_ERR(&amp;quot;Failed to allocate in_channel, error: 0x%08X&amp;quot;, err);

&lt;/pre&gt;&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>