<?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>nRF9160 wake up from button interrupt not working.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49607/nrf9160-wake-up-from-button-interrupt-not-working</link><description>I am trying to use a button to put the nRF9160 to sleep and to wake it back up. 
 
 I configure my button as follows: 
 
 gpio_pin_configure(dev, PIN, GPIO_DIR_IN | GPIO_INT | GPIO_INT_LEVEL); 
 gpio_init_callback(&amp;amp;button_cb, button_pressed, BIT(PIN)</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Jul 2019 14:21:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49607/nrf9160-wake-up-from-button-interrupt-not-working" /><item><title>RE: nRF9160 wake up from button interrupt not working.</title><link>https://devzone.nordicsemi.com/thread/197905?ContentTypeID=1</link><pubDate>Thu, 11 Jul 2019 14:21:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b3eb859-b090-4234-8408-102d14aba8d4</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Did you try the sample I posted?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 wake up from button interrupt not working.</title><link>https://devzone.nordicsemi.com/thread/197885?ContentTypeID=1</link><pubDate>Thu, 11 Jul 2019 13:57:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c5985e8-36bc-4aa7-96bb-aefbe203fe14</guid><dc:creator>rkreinin</dc:creator><description>&lt;p&gt;I tried this but there was no difference. In my main function I have a simple while loop that increments a counter and prints the counter, and then does k_busy_wait(100000); If i switch out k_busy_wait for k_sleep(500), it won&amp;#39;t go to sleep at all. &amp;quot;Sleeping&amp;quot; and &amp;quot;Waking&amp;quot; get printed but the counter just keeps incrementing and printing regardless of which state its in.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 wake up from button interrupt not working.</title><link>https://devzone.nordicsemi.com/thread/197815?ContentTypeID=1</link><pubDate>Thu, 11 Jul 2019 11:39:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:298a9e34-5da5-48ea-97c9-22accab26fa4</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;
&lt;p&gt;Try to use&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;k_cpu_idle();&lt;/pre&gt; instead of&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;__WFI();&lt;/pre&gt;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tested this with the following code:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-1e19b6e93139450f8a35c0f0d824c333/main.c"&gt;devzone.nordicsemi.com/.../main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And do note the flags I put into the gpio configure:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;gpio_pin_configure(gpio_dev, PIN, GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE | GPIO_INT_ACTIVE_LOW | GPIO_PUD_PULL_UP);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Unless you have external pull resistor, you need to apply either pull up or pull down (depending on your active level).&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>