<?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>wake up from system off</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69278/wake-up-from-system-off</link><description>Hello 
 I have found 2 strange behavoir when I want to wake up nrf from system off state: 
 1/ when I use pin 15, this does not work at all, but with pin 6 it does. Why? 
 
 2/ if i use gpiote to program the gpio pin for wake up this doesn&amp;#39;t work. I have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Dec 2020 08:11:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69278/wake-up-from-system-off" /><item><title>RE: wake up from system off</title><link>https://devzone.nordicsemi.com/thread/284444?ContentTypeID=1</link><pubDate>Fri, 11 Dec 2020 08:11:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9262a6c6-eb19-4418-ae46-ee1b76b2b6ff</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you using a custom board or a Development kit? If you&amp;#39;re using the development kit and pin 15 then you have to observe that pin 15 is connected to Button 3. The pin is therefore connected to a button switch, that connects the pin to gnd when you press the button. You therefore have to do it like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;

#define PIN_GPIO_WAKEUP 3


/**
 * @brief Function for application main entry.
 */
int main(void)
{
    /* Configure board. */
    bsp_board_init(BSP_INIT_LEDS);


    for (int i = 0; i &amp;lt; LEDS_NUMBER; i++)
    {
        bsp_board_led_invert(i);
        nrf_delay_ms(500);
    }
    
    //Note the difference in the PULLUP and the Sense requirment being changed to NRF_GPIO_PIN_SENSE_LOW 
    nrf_gpio_cfg_sense_input(BUTTON_3, NRF_GPIO_PIN_PULLUP,NRF_GPIO_PIN_SENSE_LOW);
    bsp_board_leds_off();

    NRF_POWER-&amp;gt;SYSTEMOFF = 0x1;
    (void) NRF_POWER-&amp;gt;SYSTEMOFF;
    while (true);   
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: wake up from system off</title><link>https://devzone.nordicsemi.com/thread/284376?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 15:22:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d18908e-2941-42df-b1b9-f3fa82e7361a</guid><dc:creator>Mikael</dc:creator><description>&lt;p&gt;Ok thank you for the answer.&lt;/p&gt;
&lt;p&gt;have you got an idea of question 1?&lt;/p&gt;
&lt;p&gt;1/ when I use pin 15, this does not work at all, but with pin 6 it does. Why?&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: wake up from system off</title><link>https://devzone.nordicsemi.com/thread/284369?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 15:12:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0126a538-2db4-4897-9c2f-5a164f536c90</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;&amp;nbsp;Hi,&lt;/p&gt;
&lt;p&gt;You&amp;#39;re assumption is correct.&lt;/p&gt;
&lt;p&gt;You don&amp;#39;t need to configure the pin as input before you call the nrf_gpio_cfg_input as it will do everything itself.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here is a quick sample that shows you how to configure it on the DK:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;

#define PIN_GPIO_WAKEUP 3


/**
 * @brief Function for application main entry.
 */
int main(void)
{
    /* Configure board. */
    bsp_board_init(BSP_INIT_LEDS);


    for (int i = 0; i &amp;lt; LEDS_NUMBER; i++)
    {
        bsp_board_led_invert(i);
        nrf_delay_ms(500);
    }

    nrf_gpio_cfg_sense_input(PIN_GPIO_WAKEUP, NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH);
    bsp_board_leds_off();

    NRF_POWER-&amp;gt;SYSTEMOFF = 0x1;
    (void) NRF_POWER-&amp;gt;SYSTEMOFF;
    while (true);   
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: wake up from system off</title><link>https://devzone.nordicsemi.com/thread/284132?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2020 15:08:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1218e8d7-1541-44ed-9b6a-1e789da29fd5</guid><dc:creator>Mikael</dc:creator><description>&lt;p&gt;Hi Jared,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I use a custom board. we use as well soft device.&lt;/p&gt;
&lt;p&gt;I read on other post that &amp;quot;The only peripherals that are partially kept active in SYSTEM OFF are &lt;em&gt;GPIO&lt;/em&gt;, &lt;em&gt;LPCOMP&lt;/em&gt; and &lt;em&gt;NFC&lt;/em&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;So I deduced that GPIOTE is completely off.&lt;/p&gt;
&lt;p&gt;Let me know if misunderstand something.&lt;/p&gt;
&lt;p&gt;before I went to sleep I did&lt;/p&gt;
&lt;p&gt;err_code = nrfx_gpiote_init();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; nrfx_gpiote_in_config_t in_config = NRFX_GPIOTE_CONFIG_IN_SENSE_TOGGLE(true);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; in_config.pull = NRF_GPIO_PIN_PULLDOWN;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; // configure wakeup pin&lt;/p&gt;
&lt;p&gt;&amp;nbsp; err_code = nrfx_gpiote_in_init( GPIO_WAKEUP_PIN, &amp;amp;in_config, wakeup_event_handler);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; nrfx_gpiote_in_event_enable( GPIO_WAKEUP_PIN, true);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; // switch OFF both RAM banks when in System OFF mode&lt;/p&gt;
&lt;p&gt;&amp;nbsp; NRF_POWER-&amp;gt;RAMON |= (POWER_RAMON_OFFRAM0_RAM0Off &amp;lt;&amp;lt; POWER_RAMON_OFFRAM0_Pos) |&lt;/p&gt;
&lt;p&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (POWER_RAMON_OFFRAM1_RAM1Off &amp;lt;&amp;lt; POWER_RAMON_OFFRAM1_Pos);&lt;/p&gt;
&lt;p&gt;but does not work&lt;/p&gt;
&lt;p&gt;Now I use&lt;/p&gt;
&lt;p&gt;&amp;nbsp; // configure wakeup pin&lt;br /&gt;&amp;nbsp; nrf_gpio_cfg_input( GPIO_WAKEUP_PIN, NRF_GPIO_PIN_PULLDOWN );&lt;br /&gt;&amp;nbsp; nrf_gpio_cfg_sense_input( GPIO_WAKEUP_PIN, NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH );&lt;br /&gt;&lt;br /&gt;&amp;nbsp; NRF_GPIOTE-&amp;gt;INTENSET = GPIOTE_INTENSET_PORT_Msk;&lt;br /&gt;&amp;nbsp; NVIC_EnableIRQ(GPIOTE_IRQn);&lt;/p&gt;
&lt;p&gt;and its fine.&lt;/p&gt;
&lt;p&gt;but something strange even. If the gpio goes from 0 to 1 and stay to 1 this does not work. the signal shall do 0-1-0 to work.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Mikael&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: wake up from system off</title><link>https://devzone.nordicsemi.com/thread/284119?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2020 14:38:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c642670f-f120-42a4-9951-6b99662e803b</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you using the DK or a custom board? And how did you configure it to wake-up before you went to sleep? Could share your code?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>