<?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_INT_EDGE_BOTH Resulting in ~500uA extra power draw</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99814/gpio_int_edge_both-resulting-in-500ua-extra-power-draw</link><description>Hi, 
 I am in the process of migrating my production product to the latest NCS release. I am upgrading from 1.7.1 to 2.3.0 and noticed extra power draw after doing so. 
 I have narrowed it down to my gpio0 interrupt configuration. The following line of</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 May 2023 14:17:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99814/gpio_int_edge_both-resulting-in-500ua-extra-power-draw" /><item><title>RE: GPIO_INT_EDGE_BOTH Resulting in ~500uA extra power draw</title><link>https://devzone.nordicsemi.com/thread/425931?ContentTypeID=1</link><pubDate>Tue, 16 May 2023 14:17:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d9f4de9-40a7-41a3-bab5-0b0fc8f42b82</guid><dc:creator>zciwor</dc:creator><description>&lt;p&gt;I am also very surprised at the large impact that had. Thank you for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO_INT_EDGE_BOTH Resulting in ~500uA extra power draw</title><link>https://devzone.nordicsemi.com/thread/425930?ContentTypeID=1</link><pubDate>Tue, 16 May 2023 09:28:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:522392c0-edc9-44e8-862c-46e8ac8e163c</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for reporting back. Sorry for not catching that, I was pretty sure that not configuring the sense-edge-mask (which makes the pin use the GPIOTE PORT event instead of the IN event) would only add about 10-15 uA, but I guess I was wrong. Anyways, I&amp;#39;m glad you were able to figure it out. I&amp;#39;ll make the question public again (and I think you will have to approve somehow)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO_INT_EDGE_BOTH Resulting in ~500uA extra power draw</title><link>https://devzone.nordicsemi.com/thread/425928?ContentTypeID=1</link><pubDate>Mon, 15 May 2023 17:08:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:799d9fe1-7580-4523-a02d-adb33defbeaa</guid><dc:creator>zciwor</dc:creator><description>&lt;p&gt;I also removed my pin definitions from a previous comment to hopefully keep some of our information private. You can feel free to make this question public again for future reference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO_INT_EDGE_BOTH Resulting in ~500uA extra power draw</title><link>https://devzone.nordicsemi.com/thread/425926?ContentTypeID=1</link><pubDate>Mon, 15 May 2023 17:06:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7950080-b34a-477e-88ca-4b4fad68cf33</guid><dc:creator>zciwor</dc:creator><description>&lt;p&gt;Hi Stian,&lt;/p&gt;
&lt;p&gt;I was able to fix this! It is indeed a problem with the&amp;nbsp;&lt;span&gt;GPIO_INT_EDGE_* flag as described here:&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/28499"&gt;https://github.com/zephyrproject-rtos/zephyr/issues/28499&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Migrating from 1.7.1 to 2.3.1 depreciated the&amp;nbsp;CONFIG_GPIO_NRF_INT_EDGE_USING_SENSE=y flag that I had set.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Therefore, I needed to change my &amp;amp;gpio0 node to the following:&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;gpio0&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; status &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;okay&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; sense-edge-mask &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;0xffffffff&lt;/span&gt;&lt;span&gt;&amp;gt;; // new for 2.3.0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This seemed to bring my power draw back down to normal levels.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO_INT_EDGE_BOTH Resulting in ~500uA extra power draw</title><link>https://devzone.nordicsemi.com/thread/425924?ContentTypeID=1</link><pubDate>Mon, 15 May 2023 12:32:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5af9aa6-e8ca-484d-ad56-e8b4602b4c77</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Hi, sorry for the late reply. I did take a look but could not find anything wrong. I tried to compare it with a project I have running here with the same pin interrupt configuration and the only difference I can see is that gpio0 seems to be missing the phandle property. Not sure if this is relevant or not but you can try to add this property in a .overlay file. &lt;code&gt;&amp;amp;uart0 { phandle = &amp;lt; 0x12 &amp;gt;; };&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Looking at the plots it seems like the floor current increases (as opposed to the active (internal) current, which by the internal regulator design is drawn in bursts) which indicates that the current is drawn through a resistive load on the VDD domain directly, not by the internal peripherals, but it is a bit difficult to see due the resolution of the plots. If you are able to provide zoomed in plots (50ms/div) with a 100,000 samples/sec resolution, it would be helpful. Also you can try to change the voltage and see if the current changes proportional to the voltage (which would indicate a resistive load).&lt;/p&gt;
&lt;p&gt;If we assume the current is drawn directly from VDD; (500uA - 30 uA from the plots) = 470 uA difference could be the result of current flowing through two pullup/down resistors&amp;nbsp; (3V / 13k Ohm) * 2 = 460 uA. One on each pin. &lt;br /&gt;You can read the PIN_CNF[n] registers to check this hypothesis. Please post the output here:&lt;/p&gt;
&lt;pre&gt;nrfjprog --memrd 0x50000700 --n 0x80&lt;/pre&gt;
&lt;p&gt;Also if you can upload the hardware schematics it would be helpful.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also wondering if it is the pin interrupt configuration that is causing the current consumption, or if it is the result of the pin interrupt handler starting up something else? Is it doing anything in the interrupt handler, or have you been able to reproduce this with simple code that just implements the pin interrupt functionality?&lt;/p&gt;
&lt;p&gt;I think maybe the next step would be for me to reproduce the issue here. As long as I can see the same thing here, I would be able to find a solution for you. Would it be possible to run your code on a nRF52 DK, and still be able to reproduce the issue? If not, are you still able to provide the whole project code, then I can see if I&amp;#39;m able to get it to run somehow? Thanks&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Stian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO_INT_EDGE_BOTH Resulting in ~500uA extra power draw</title><link>https://devzone.nordicsemi.com/thread/425922?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 14:37:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98289542-5e6a-4807-8520-dd7623b5bd9a</guid><dc:creator>zciwor</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Stian,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Were you able to take a look at this issue? I am facing a release deadline quickly approaching.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Eric&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO_INT_EDGE_BOTH Resulting in ~500uA extra power draw</title><link>https://devzone.nordicsemi.com/thread/425920?ContentTypeID=1</link><pubDate>Tue, 09 May 2023 20:06:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c113e8a-9355-4b33-bee2-f4e89bae88e4</guid><dc:creator>zciwor</dc:creator><description>&lt;p&gt;Thank you! Pin definitions for reference:&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO_INT_EDGE_BOTH Resulting in ~500uA extra power draw</title><link>https://devzone.nordicsemi.com/thread/425918?ContentTypeID=1</link><pubDate>Tue, 09 May 2023 15:46:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e9f0dee-2209-4fda-aaa8-7dbe76ad619b</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Hi, sorry for the late reply. I tried your code snippet here, and I do not see any higher current consumption with NCS 2.3.0. Is it possible that the INT_PIN_1 is configured by some other peripherals in the device tree? Can you please upload the device tree build output file (build/zephyr/zephyr.dts) and also the file build/zephyr/.config, then I can help to check if everything looks ok. Thanks&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Stian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>