<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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>nRF52 wake up with GPIO from system off issue</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/87514/nrf52-wake-up-with-gpio-from-system-off-issue</link><description>Hi Sir/Miss, 
 I use nRF52832, softdevice 132 and SDK 17.1.0 to develop. 
 And, I want to use GPIO to wake up from system off. 
 We use external pull up resistor in wake up pin. 
 
 I try to set up the wake up pin as below: 
 
 When I remove wake up pin</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Thu, 02 Jun 2022 06:02:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/87514/nrf52-wake-up-with-gpio-from-system-off-issue" /><item><title>RE: nRF52 wake up with GPIO from system off issue</title><link>https://test-devzone.nordicsemi.com/thread/370563?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 06:02:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed62f4e4-b5ec-4d44-9a65-d4e869d4ed3a</guid><dc:creator>user20009</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;Sorry for reply late. I found out pressing button twice issue. That&amp;#39;s my process problem. When I press button to wake up chip. It works and initialize peripheral components. Therefore, it&amp;nbsp;must be pressed to enter running procedure again.&lt;/p&gt;
&lt;p&gt;Really appreciate your assistance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wake up with GPIO from system off issue</title><link>https://test-devzone.nordicsemi.com/thread/366186?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 11:17:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5b1567c-d145-4d08-9fbf-7c351393245c</guid><dc:creator>user2111</dc:creator><description>[quote user="Countach"]It works to me.&amp;nbsp;Do you mean that it requires time to setup status?[/quote]
&lt;p&gt;It might be a very small delay from configuring input until it is settled, so yes, reading back the actual input level should solve this.&lt;/p&gt;
[quote user="Countach"]I encounter another problem in wake up.[/quote]
&lt;p&gt;I don&amp;#39;t have any suggestion here unfortunately here, I suggest to continue debugging, you can also on startup in main() check the reset reason, e.g. NRF_POWER-&amp;gt;RESETREAS to find the startup reason if that might be helpful, remember to clear the register by writing &amp;#39;1&amp;#39; to bits to clear it.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wake up with GPIO from system off issue</title><link>https://test-devzone.nordicsemi.com/thread/366083?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 01:53:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8c1eca3-5b73-498f-a3bb-ca820bf410a0</guid><dc:creator>user20009</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;I change it as below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    uint32_t err_code;
      
    nrf_gpio_cfg_input(BTN_START_SLEEP_PIN, NRF_GPIO_PIN_NOPULL);
    
    while(1)
    {
        if(nrf_gpio_pin_read(BTN_START_SLEEP_PIN) == 1)
        {
            nrf_gpio_pin_sense_t sense =  NRF_GPIO_PIN_SENSE_LOW;
            nrf_gpio_cfg_sense_set(BTN_START_SLEEP_PIN, sense);
            
            break;
        }
    }
    
    err_code = sd_power_system_off();
    APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It works to me.&amp;nbsp;Do you mean that it requires time to setup status?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I encounter another problem in wake up.&lt;/p&gt;
&lt;p&gt;After system enters sleep mode, I want to wake it up.&lt;/p&gt;
&lt;p&gt;In my condition, to press button to&amp;nbsp;wake up system which will turn on LED.&lt;/p&gt;
&lt;p&gt;At the&amp;nbsp;first press button, LED turns on. But, it turns off quickly.&lt;/p&gt;
&lt;p&gt;I should press it second times, that will work normal.&lt;/p&gt;
&lt;p&gt;My process is pressing button, then to enter timer function is to do my application. Then, application will turn on LED.&lt;/p&gt;
&lt;p&gt;Furthermore, I try to&amp;nbsp;replace my timer process function to turn on LED. That result is same.&lt;/p&gt;
&lt;p&gt;Here is my GPIO setting and trigger function in GPIO.&lt;pre class="ui-code" data-mode="text"&gt;nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
in_config.pull = NRF_GPIO_PIN_NOPULL;

err_code = nrf_drv_gpiote_in_init(BTN_START_SLEEP_PIN, &amp;amp;in_config, input_pin_handle);
APP_ERROR_CHECK(err_code);

nrf_drv_gpiote_in_event_enable(BTN_START_SLEEP_PIN, true);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void input_pin_handle(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
    switch(pin)
    {
        case BTN_START_SLEEP_PIN:
            if(!dev_status.dev_enable)
            {
                if(!dev_status.under_uninit)
                {
                    if(dev_status.dev_mode == NORMAL || SLEEP)
                    {
                        dev_status.dev_enable = true;
                        
                        dev_gpio_low(LED1);
                    }
                }
                
            }
            else
            {
                dev_status.dev_enable = false;
                dev_status.dev_uninit = false;
                
                dev_gpio_high(LED1);
                
                app_user_status = APP_USER_UNINIT;
                
                shutdown_configuration();
            }
            break;
    }    
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wake up with GPIO from system off issue</title><link>https://test-devzone.nordicsemi.com/thread/365950?ContentTypeID=1</link><pubDate>Tue, 03 May 2022 11:01:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80004ee1-eec0-407f-a788-752554c05994</guid><dc:creator>user2111</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you try to change the code a bit, after configuring input by&amp;nbsp;nrf_gpio_cfg_input(), then read the input pin until the input is high, before you enable sense&amp;nbsp;nrf_gpio_cfg_sense_set().&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>