<?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 after wake up</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51942/gpio-interrupt-after-wake-up</link><description>Hello 
 My custom board has only 1 button and I&amp;#39;m trying to detect 3 button clicks. The first click is waking up the device and the other 2 are configured as BSP_EVENT_KEY_0. I noticed people pushes the button between 0.2s to 0.4s after each click and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Apr 2020 18:15:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51942/gpio-interrupt-after-wake-up" /><item><title>RE: GPIO interrupt after wake up</title><link>https://devzone.nordicsemi.com/thread/243458?ContentTypeID=1</link><pubDate>Fri, 03 Apr 2020 18:15:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d6cdfd5-3354-4d97-9efb-39c746af6cbd</guid><dc:creator>gercer</dc:creator><description>&lt;p&gt;Keeping the device awake consumes too much battery so I decided to go back and try to fix the issue with nrf_sdh_enable. &lt;br /&gt;Defining&amp;nbsp;NRF_SDH_CLOCK_LF_SRC as&amp;nbsp;NRF_CLOCK_LF_SRC_RC &lt;br /&gt;or NRF_CLOCK_LF_SRC_XTAL takes a lot of time for nrf_sdh_enable to resolve. Using&amp;nbsp;NRF_CLOCK_LF_SRC_SYNTH executes it faster. I don&amp;acute;t know why. For now I will just keep it like this. Thank you for the help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt after wake up</title><link>https://devzone.nordicsemi.com/thread/234604?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2020 10:29:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ede82372-d272-4011-a1bd-16173356fdc1</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Use&amp;nbsp;&lt;span&gt;nrf_pwr_mgmt_run&lt;/span&gt;&lt;span&gt;(); instead. It will put the system into SystemON, Idle. And it will not reset the MCU when it wakes up.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt after wake up</title><link>https://devzone.nordicsemi.com/thread/234495?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2020 18:51:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c27dc921-a6f2-4d43-acb0-c6b8c6edad62</guid><dc:creator>gercer</dc:creator><description>&lt;p&gt;Sorry that it took me a couple of months to reply.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void sleep_mode_enter(void)
{

    uint32_t err_code = bsp_indication_set(BSP_INDICATE_IDLE);
    APP_ERROR_CHECK(err_code);
    bsp_led_state = BSP_INDICATE_IDLE;

    // Prepare wakeup buttons.
    err_code = bsp_btn_ble_sleep_mode_prepare();
    APP_ERROR_CHECK(err_code);

    //Disable SoftDevice. It is required to be able to write to GPREGRET2 register (SoftDevice API blocks it).
    //GPREGRET2 register holds the information about skipping CRC check on next boot.
    err_code = nrf_sdh_disable_request();
    APP_ERROR_CHECK(err_code);

    // Go to system-off mode (this function will not return; wakeup will cause a reset).
    err_code = sd_power_system_off();
    APP_ERROR_CHECK(err_code);
    
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the reference manual says the default is system ON. I&amp;#39;m not sure where to change that.&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 after wake up</title><link>https://devzone.nordicsemi.com/thread/218217?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2019 12:57:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27aa27e7-a5b8-4dc1-b4a9-97e455629d7b</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;&amp;quot;&lt;span&gt;Oh, looks like we are using 12pF capacitors for both crystals, 32MHz and 32kHz.&amp;quot;&lt;br /&gt;&lt;/span&gt;The LFXO will operate with 12pF capacitors, but the accuracy might be way off and think you&amp;#39;ll get a slight increase in current consumption.&lt;br /&gt;&lt;br /&gt;I suggest you toggle a pin from the RTC peripheral once a second and measure the accuracy with a logic analyzer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;quot;&lt;span&gt;But the problem can also be replicated in the nrf52 that´s why i dont´think the capacitors are the issue here...&amp;quot;&lt;br /&gt;&lt;/span&gt;You&amp;#39;re probably right.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;What I think is happening is that the&amp;nbsp;SoftDevice&amp;nbsp;has to wait for the LFXO clock to stabilize, which takes ~250ms, and that somehow bodges stuff up for the app_timer library.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Do you use SystemOFF or SystemON for sleep?&amp;nbsp;&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 after wake up</title><link>https://devzone.nordicsemi.com/thread/217857?ContentTypeID=1</link><pubDate>Thu, 31 Oct 2019 22:34:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f98d7066-c3b6-478b-a3df-31a86bcf9d76</guid><dc:creator>gercer</dc:creator><description>&lt;p&gt;Oh, looks like we are using 12pF capacitors for both crystals, 32MHz and 32kHz. But the problem can also be replicated in the nrf52 that&amp;acute;s why i dont&amp;acute;think the capacitors are the issue here...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt after wake up</title><link>https://devzone.nordicsemi.com/thread/217502?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2019 11:56:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e97cb0b-285c-4dc4-8dc8-3db9bcd058da</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;And what&amp;#39;s the capacitance of the loading caps?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;With a 9pF crystal, you&amp;#39;ll need 15pF loading capacitors.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt after wake up</title><link>https://devzone.nordicsemi.com/thread/217206?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 20:25:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18b7eae4-439d-47f2-b543-5394a0d599fd</guid><dc:creator>gercer</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;Yes here is the link of the datasheet and the capacitance is 9pF&lt;a href="https://www.sii.co.jp/en/quartz/files/2013/03/SC-20S_Leaflet_e20151217.pdf"&gt;&lt;br /&gt;&lt;br /&gt;https://www.sii.co.jp/en/quartz/files/2013/03/SC-20S_Leaflet_e20151217.pdf&lt;/a&gt;&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 after wake up</title><link>https://devzone.nordicsemi.com/thread/217043?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 10:39:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca6d913d-2d70-4233-bbd6-a7f280353db3</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Oh, there might be an issue with your external 32kHz crystal.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Can you share the part number for the 32kHz crystal and the capacitance of the loading caps you&amp;#39;re using?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt after wake up</title><link>https://devzone.nordicsemi.com/thread/216445?ContentTypeID=1</link><pubDate>Wed, 23 Oct 2019 16:34:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23f62c68-37c0-4ba2-aebc-0ab40eb08a23</guid><dc:creator>gercer</dc:creator><description>&lt;p&gt;This is resolving the issue&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;#define NRF_SDH_CLOCK_LF_SRC 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//&amp;nbsp; I was using 32MHz XTAL&lt;br /&gt;#define NRF_SDH_CLOCK_LF_RC_CTIV 16&lt;br /&gt;#define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2&lt;br /&gt;#define NRF_SDH_CLOCK_LF_ACCURACY 1&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;How will this affect the nRF52 behaviour?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt after wake up</title><link>https://devzone.nordicsemi.com/thread/215764?ContentTypeID=1</link><pubDate>Fri, 18 Oct 2019 20:46:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8cd50d2e-4f87-423c-bb2d-f6343f1b4270</guid><dc:creator>gercer</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;I posted the code as private. Evn tho i don&amp;acute;t think it is necessary for you to check it. I think i found the problem. After doing some changes I left the main with the following fucntions:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;log_init();&lt;br /&gt;timers_init();&lt;br /&gt; buttons_leds_init(&amp;amp;wakeup);&lt;br /&gt;ble_stack_init();&lt;/p&gt;
&lt;p&gt;After doing some research i found out the &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/47014/nrf_sdh_enable_request-takes-quite-a-long-time-to-end-s132-6-1-1"&gt;issue&lt;/a&gt;&amp;nbsp;is the nrf_sdh_enable_request takes too long executing.&amp;nbsp;Sadly the guy didnt post how he solved it. Do you have any idea what is going on?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt after wake up</title><link>https://devzone.nordicsemi.com/thread/214568?ContentTypeID=1</link><pubDate>Fri, 11 Oct 2019 11:16:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f90ee0a-caba-41c8-ad1e-dba8e3f5237a</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Hmm, my best guess is that something is blocking the CPU from executing. Maybe the starting of the LFXO as it can take a few hundred ms.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Do you mind sharing a project that we can use to recreate your issue?&amp;nbsp;&lt;br /&gt;I suggest you strip out seemingly unrelated part of your code until the issue disappears as that will help us narrow down where the issue originates.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt after wake up</title><link>https://devzone.nordicsemi.com/thread/214470?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 19:55:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcf22523-dede-478d-bdf7-09d3a33d44b0</guid><dc:creator>gercer</dc:creator><description>&lt;p&gt;Sorry for the late reply,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;It doesnt seem to be the problem because once the device is awake I can press the button as fast as i can and it detects every single click. The issue is just the first half second after waking up.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO interrupt after wake up</title><link>https://devzone.nordicsemi.com/thread/208846?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2019 09:26:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b559c647-84a3-4fc7-912e-fe2892d935ef</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;The BSP uses the app_button library who has implemented SW debouncing by setting an&amp;nbsp;app_timer&amp;nbsp;to trigger a callback after 50ms where the app_button library will check to see if the button is still pressed.&amp;nbsp;&lt;br /&gt;If the pin event is triggered before the 50ms has expired the app_button library will reset the&amp;nbsp;&lt;span&gt;app_timer. This might cause you trouble if the button signal is extremely bouncy.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I would scope the button signal to check for noise issues and log the button press patterns of good vs bad operations. This will give us valuable insight into how the application responds to the button presses.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>