<?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>reducing current consumption of nrf5340 GPIO interrupts configured for edge triggering</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90532/reducing-current-consumption-of-nrf5340-gpio-interrupts-configured-for-edge-triggering</link><description>I have a few GPIOs configured as interrupt pins.. most are edge triggered GPIO_INT_EDGE_FALLING or GPIO_INT_EDGE_RISING (won&amp;#39;t work otherwise so, i cant go for level triggered at this time)..Only button is GPIO_INT_LEVEL_INACTIVE.. Looks like in 1.9.1</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 Mar 2024 01:07:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90532/reducing-current-consumption-of-nrf5340-gpio-interrupts-configured-for-edge-triggering" /><item><title>RE: reducing current consumption of nrf5340 GPIO interrupts configured for edge triggering</title><link>https://devzone.nordicsemi.com/thread/475792?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 01:07:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b21ed62d-e15e-470e-afdb-1d564b020030</guid><dc:creator>Rait</dc:creator><description>&lt;p&gt;The problem with assert still exists in the latest 2.6.0 release of the SDK. Can Nordic provide guidance on how to get this configuration working without hacks (like overriding assert macro locally)?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: reducing current consumption of nrf5340 GPIO interrupts configured for edge triggering</title><link>https://devzone.nordicsemi.com/thread/467123?ContentTypeID=1</link><pubDate>Thu, 01 Feb 2024 10:36:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a74ee04b-ddb6-48d6-8ef6-2764802e048b</guid><dc:creator>Rait</dc:creator><description>&lt;p&gt;I&amp;#39;m getting the same assertion failure when assert is enabled. Is there a solution for this?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;CONFIG_ASSERT=y&lt;/p&gt;
&lt;p&gt;gpio_pin_interrupt_configure_dt(&amp;amp;m_config.gpioDtSpec, GPIO_INT_ENABLE | GPIO_INT_TRIG_BOTH)&lt;/p&gt;
&lt;p&gt;ASSERTION FAIL [((flags &amp;amp; (1U &amp;lt;&amp;lt; 22)) == 0) || ((flags &amp;amp; (1U &amp;lt;&amp;lt; 24)) != 0) || ((flags &amp;amp; ((1U &amp;lt;&amp;lt; 25) | (1U &amp;lt;&amp;lt; 26))) != ((1U &amp;lt;&amp;lt; 25) | (1U &amp;lt;&amp;lt; 26)))] @ WEST_TOPDIR/zephyr/include/zephyr/drivers/gpio.h:881&lt;br /&gt; Only one of GPIO_INT_LOW_0, GPIO_INT_HIGH_1 can be enabled for a level interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: reducing current consumption of nrf5340 GPIO interrupts configured for edge triggering</title><link>https://devzone.nordicsemi.com/thread/422260?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2023 11:04:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:927fe12f-9cf3-447e-b49d-8b4e35e5d7d4</guid><dc:creator>u9357</dc:creator><description>&lt;p&gt;If you use &lt;span style="color:#800080;"&gt;GPIO_INT_TRIG_BOTH&lt;/span&gt;&lt;span style="color:#c0c0c0;"&gt; &lt;/span&gt;|&lt;span style="color:#c0c0c0;"&gt; &lt;/span&gt;&lt;span style="color:#000080;"&gt;GPIO_INT_ENABLE. &lt;/span&gt;It will fail an assertion &lt;code&gt;Only one of GPIO_INT_LOW_0, GPIO_INT_HIGH_1 can be enabled for a level interrupt&lt;/code&gt;&lt;span style="color:#000080;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: reducing current consumption of nrf5340 GPIO interrupts configured for edge triggering</title><link>https://devzone.nordicsemi.com/thread/381244?ContentTypeID=1</link><pubDate>Thu, 11 Aug 2022 20:47:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9e2f6be-b9b0-4163-b208-dde9d2a0dfe1</guid><dc:creator>sshenoy105</dc:creator><description>&lt;p&gt;i have seen that datasheet.. it is honestly not clear as to what should be expected when I have bunch of GPIOs configured for interrupt..&amp;nbsp;&lt;br /&gt;&lt;br /&gt;In any case, at least two of my peripheral interrupts create havoc if I have both edges configured.. and hence i wont be able to go with your solution .. will just have to live with the power consumption.&lt;br /&gt;&lt;br /&gt;I had &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/89113/nrf5340-sdk-1-9-1-idle-mode-consumption-and-power-management" rel="noopener noreferrer" target="_blank"&gt;another ticket&lt;/a&gt; about all things power but i was told to file separate tickets for each issue going forward..&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thank you for your help.. you can close this ticket since there doesn&amp;#39;t seem to be a real way to do what I wanted to do&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: reducing current consumption of nrf5340 GPIO interrupts configured for edge triggering</title><link>https://devzone.nordicsemi.com/thread/380328?ContentTypeID=1</link><pubDate>Fri, 05 Aug 2022 10:06:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a602540-de10-4bbe-8d68-917162bf3c2f</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;How much current consumption are you actually seeing, and what is the exact difference in current consumption between using sense and not? I cannot say whether the difference is to be expected or not without knowing what it actually is.&lt;/p&gt;
&lt;p&gt;Are you using other things with high current consumption? Please try disabling logging/serial.&lt;/p&gt;
&lt;p&gt;You can also see typical numbers for current consumption here:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/chapters/current_consumption/doc/current_consumption.html?cp=3_0_0_3_3_0#topic"&gt;nRF5340 current consumption&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: reducing current consumption of nrf5340 GPIO interrupts configured for edge triggering</title><link>https://devzone.nordicsemi.com/thread/379989?ContentTypeID=1</link><pubDate>Wed, 03 Aug 2022 22:35:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de663388-5959-48b2-8357-6cbbf1c7231a</guid><dc:creator>sshenoy105</dc:creator><description>&lt;p&gt;I tried this.. I was expecting double digit uA reduction per GPIO interrupt and given I have 5 such interrupts configured, was hoping to see significant change.. i saw probably 10s of uA change with this edit.. is that ot be expected ? I couldn&amp;#39;t find exact power numbers in the data sheet&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: reducing current consumption of nrf5340 GPIO interrupts configured for edge triggering</title><link>https://devzone.nordicsemi.com/thread/379929?ContentTypeID=1</link><pubDate>Wed, 03 Aug 2022 13:15:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc3dd578-06eb-4490-9e77-20b4d12f1a47</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="sshenoy105"]this should be fine right ? os will the masking all create any issues ?[/quote]
&lt;p&gt;Yes, my mistake. When enabling the sense mechanism for all pins setting&amp;nbsp;sense-edge-mask to&amp;nbsp;0xffffffff is correct and should be fine.&lt;/p&gt;
[quote user="sshenoy105"]I will try the&amp;nbsp;&lt;span&gt;GPIO_INT_TRIG_BOTH&amp;nbsp;..&amp;nbsp;is that because of what you mentioned about emulated interrupt ?&lt;/span&gt;[/quote]
&lt;p&gt;That is correct. GPIO sense is a level interrupt mechanism emulating edge triggering, which is why you should use&amp;nbsp;GPIO_INT_TRIG_BOTH instead.&lt;/p&gt;
&lt;p&gt;Please let me know if you see any changes in current consumption or not using this.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: reducing current consumption of nrf5340 GPIO interrupts configured for edge triggering</title><link>https://devzone.nordicsemi.com/thread/379777?ContentTypeID=1</link><pubDate>Tue, 02 Aug 2022 21:16:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cebe16bd-6007-43c9-bbc1-df56876b94a6</guid><dc:creator>sshenoy105</dc:creator><description>&lt;p&gt;thank you for the reply.. my original post already shows my sense-edge-mask config value.. i am pasting it below.. this should be fine right ? os will the masking all create any issues ?&lt;/p&gt;
&lt;p&gt;&amp;amp;gpio0 {&lt;br /&gt;status = &amp;quot;okay&amp;quot;;&lt;br /&gt;&lt;strong&gt;sense-edge-mask = &amp;lt; 0xffffffff &amp;gt;;&lt;/strong&gt;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&amp;amp;gpio1 {&lt;br /&gt;status = &amp;quot;okay&amp;quot;;&lt;br /&gt;&lt;strong&gt;sense-edge-mask = &amp;lt; 0xffffffff &amp;gt;;&lt;/strong&gt;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I will try the&amp;nbsp;&lt;span&gt;GPIO_INT_TRIG_BOTH&amp;nbsp;..&amp;nbsp;is that because of what you mentioned about emulated interrupt ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: reducing current consumption of nrf5340 GPIO interrupts configured for edge triggering</title><link>https://devzone.nordicsemi.com/thread/379733?ContentTypeID=1</link><pubDate>Tue, 02 Aug 2022 13:33:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07194030-e539-4f19-a106-dd27b9a273f4</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;CONFIG_GPIO_NRF_INT_EDGE_USING_SENSE does not exist anymore because it was replaced by the sense-edge-mask property. Using sense edge detection should reduce the current consumption compared to using GPIO edge triggering, as this emulates edge triggering with GPIOTE SENSE instead of GPIOTE IN.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Make sure that you are configuring the sense-edge-mask property correctly, as Stian writes in his comment here:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/85119/nrf9160-lis2dw12-high-current-consumption/356705"&gt;RE: nRF9160: LIS2DW12 high current consumption&lt;/a&gt;&amp;nbsp;.&lt;/p&gt;
&lt;p&gt;You should also change GPIO_INT_EDGE_FALLING in&amp;nbsp;gpio_pin_interrupt_configure() to&amp;nbsp;GPIO_INT_TRIG_BOTH instead.&lt;/p&gt;
&lt;p&gt;Please note that this is emulated, meaning that the CPU runs logic to make this happen. If the GPIO edges are very close to each other in time, the cpu might not be able to register the change in certain use-cases (ie. its blocked by a higher interrupt or similar).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: reducing current consumption of nrf5340 GPIO interrupts configured for edge triggering</title><link>https://devzone.nordicsemi.com/thread/379559?ContentTypeID=1</link><pubDate>Mon, 01 Aug 2022 13:44:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d22ba96a-1e8d-42be-a58a-054cf9bf596f</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Several of our experts on this are out of office, but I will check internally and get back to you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: reducing current consumption of nrf5340 GPIO interrupts configured for edge triggering</title><link>https://devzone.nordicsemi.com/thread/379385?ContentTypeID=1</link><pubDate>Fri, 29 Jul 2022 23:04:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad4a6ccc-e764-4d8b-9eae-e6ae71022050</guid><dc:creator>sshenoy105</dc:creator><description>&lt;p&gt;here&amp;#39;s one example of how I set up the interrupt.. and please note that this works exactly as expected and there are no issues.. level triggering does not work and hence i can;t use it.. question is only about finding a way to use edge triggered interrupts that don;t take too much power&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;bool xx_nrf5340_gpio_interrupt_for_xx_setup(void) {&lt;br /&gt; int ret;&lt;br /&gt;xx_nrf5340_gpio_1_init();&lt;br /&gt; gpio_pin_configure(gpio_1_dev, NRF53440_GPIO_PIN_FOR_xx_INTR, GPIO_INPUT);&lt;/p&gt;
&lt;p&gt;ret = gpio_pin_interrupt_configure(gpio_1_dev, NRF53440_GPIO_PIN_FOR_xx_INTR, GPIO_INT_EDGE_FALLING);&lt;br /&gt; if (ret != 0) {&lt;br /&gt; printk(&amp;quot;Error %d: failed to configure xx interrupt pin %d\n&amp;quot;, ret, &lt;span&gt;NRF53440_GPIO_PIN_FOR_xx_INTR&lt;/span&gt;);&lt;br /&gt; return false;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; gpio_init_callback(&amp;amp;xx_cb,&lt;br /&gt;xx_intr_process,&lt;br /&gt; BIT(NRF53440_GPIO_PIN_FOR_xx_INTR));&lt;/p&gt;
&lt;p&gt;gpio_add_callback(gpio_1_dev, &amp;amp;xx_cb);&lt;br /&gt; return true;&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>