<?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>GPIO interrupt configuration failed on nRF9160 with npm1300</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123061/gpio-interrupt-configuration-failed-on-nrf9160-with-npm1300</link><description>Hi all, 
 I&amp;#39;m working on a custom board based on the nRF9160 and using nRF Connect SDK v3.0.2. We’ve developed the board in-house and integrated the npm1300 PMIC as part of our power management solution. 
 Everything is working well overall, but I’m facing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Jul 2025 06:31:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123061/gpio-interrupt-configuration-failed-on-nrf9160-with-npm1300" /><item><title>RE: GPIO interrupt configuration failed on nRF9160 with npm1300</title><link>https://devzone.nordicsemi.com/thread/543681?ContentTypeID=1</link><pubDate>Mon, 28 Jul 2025 06:31:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a4048e7-c26f-490e-a709-4397471e73f2</guid><dc:creator>Piziwate</dc:creator><description>&lt;p data-start="128" data-end="270"&gt;Thanks for the clarification &amp;mdash; it&amp;#39;s unfortunate that GPIO interrupts on the nPM1300 can&amp;#39;t be used in a standard way through Zephyr&amp;#39;s GPIO API.&lt;/p&gt;
&lt;p data-start="272" data-end="516"&gt;It would be much cleaner and more maintainable if these GPIOs could be exposed via a proper &lt;code data-start="364" data-end="381"&gt;gpio_driver_api&lt;/code&gt; implementation, allowing the use of standard Zephyr mechanisms like &lt;code data-start="450" data-end="475"&gt;gpio_pin_configure_dt()&lt;/code&gt; and &lt;code data-start="480" data-end="515"&gt;gpio_pin_interrupt_configure_dt()&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt configuration failed on nRF9160 with npm1300</title><link>https://devzone.nordicsemi.com/thread/543679?ContentTypeID=1</link><pubDate>Mon, 28 Jul 2025 06:04:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0db8ce9-a2a1-4a68-8f66-cccffef74547</guid><dc:creator>Piziwate</dc:creator><description>&lt;p&gt;We are using the QFN version.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt configuration failed on nRF9160 with npm1300</title><link>https://devzone.nordicsemi.com/thread/543497?ContentTypeID=1</link><pubDate>Thu, 24 Jul 2025 12:36:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25701956-3445-4a9e-bfe0-7dc52e5e8599</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;One more thing to ask, which package of nPM1300 (QFN or CSP) you are using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt configuration failed on nRF9160 with npm1300</title><link>https://devzone.nordicsemi.com/thread/543468?ContentTypeID=1</link><pubDate>Thu, 24 Jul 2025 11:02:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71e47f21-effe-42ae-9ef5-f2b2fc99bcc7</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The error mentions interrupt configuration which has code -88 (ENOSYS, not implemented), We suspect there is an interrupt directly on the PMIC pin, which is not supported.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To get interrupts from button presses connected to PMIC, you have to try differently&lt;/p&gt;
&lt;p&gt;1. Define PMIC interrupt callback&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void pmic_callback(const struct device *dev, struct gpio_callback *cb, uint32_t events)
{
    if (events &amp;amp; BIT(NPM1300_EVENT_GPIO0_EDGE)) {
        // button connected to nPM1300 GPIO0 is pressed or released
    }
    // handle other events in the same manner
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;2. Register it using npm1300 mfd API&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static struct gpio_callback event_cb;

gpio_init_callback(&amp;amp;event_cb, pmic_callback, BIT(NPM1300_EVENT_GPIO0_EDGE) /* | more_events */);
mfd_npm1300_add_callback(pmic, &amp;amp;event_cb);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You&amp;nbsp;can check out the &lt;a title="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/pmic/native/npm1300_one_button/readme.html" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/pmic/native/npm1300_one_button/README.html" rel="noopener noreferrer" target="_blank"&gt;one button sample&lt;/a&gt; source to see how we set up event handling on nPM1300 (that one uses different events, but the approach is the same)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt configuration failed on nRF9160 with npm1300</title><link>https://devzone.nordicsemi.com/thread/543012?ContentTypeID=1</link><pubDate>Mon, 21 Jul 2025 12:14:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d54bd86-4a2b-477c-b3c0-1ce9084122ee</guid><dc:creator>Piziwate</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Here is the current mapping :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;button0 -&amp;gt; GPIO 0.0 from the nRF9160&lt;/li&gt;
&lt;li&gt;button1 -&amp;gt; GPIO 0.1 from the nRF9160&lt;/li&gt;
&lt;li&gt;button2 -&amp;gt; GPIO 0.2 from the nRF9160&lt;/li&gt;
&lt;li&gt;button3 -&amp;gt; GPIO 0.3 from the nRF9160&lt;/li&gt;
&lt;li&gt;button4 -&amp;gt; GPIO 0.4 from the nRF9160&lt;/li&gt;
&lt;li&gt;button5 -&amp;gt; GPIO 0 from the nPM1300&lt;/li&gt;
&lt;li&gt;button6 -&amp;gt; GPIO 1 from the nPM1300&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If I look at the input_gpio_keys source file in Zephyr, the pin numbers corresponds to the button index. This has nothing to do with the GPIO pin.&lt;br /&gt;In my case I only use GPIO 0 and 1 on the nPM1300 (and the GPIO4 has interrupt).&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt configuration failed on nRF9160 with npm1300</title><link>https://devzone.nordicsemi.com/thread/543002?ContentTypeID=1</link><pubDate>Mon, 21 Jul 2025 11:51:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edc5e71a-84b4-4c35-abef-e8c2944407ea</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I can see from the device tree overlay for button; you have defined button 5.&amp;nbsp;&lt;span&gt;nPM1300 only supports GPIO[0..4]; According to pin configuration &amp;#39;&amp;#39;The GPIO peripheral implements up to 5 pins,&amp;nbsp;&lt;span&gt;GPIO[0...4]&lt;/span&gt;. Each of these pins can be individually configured in the&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ps_npm1300/page/chapters/core_components/gpio/doc/frontpage.html#register.GPIOMODE-0"&gt;GPIOMODE[n]&lt;/a&gt;&amp;nbsp;registers.&amp;#39;&amp;#39;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;source:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ps_npm1300/page/chapters/core_components/gpio/doc/frontpage.html#ariaid-title2"&gt;GPIO — General purpose input/output&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The error message about &amp;quot;Pin 5&amp;quot; suggests there may be an off-by-one error or a misconfiguration in the device tree.&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></channel></rss>