This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

System "always" wakes up from SYSTEM OFF Mode due to GPIO no matter what setting it is?

Dear Nordic,

I am using nRF52832-XXAB, SDK 15

I am aware that in order to enter SYSTEM OFF Mode and woke up by an GPIO event,

I have to set "nrf_gpio_cfg_sense_input(PIN_NUMBER, PULL_STATUS, SENSE_STATUS)" before calling NRF_POWER->SYSTEMOFF = 1

In my case, I want my system enters SYSTEM OFF due to a button being pressed for 10 seconds.

That button is at low level when being pressed and at high level in other times.

I expect users will keep pressing the button even the system already enters SYSTEM OFF Mode, so I am trying to deal with this situation.

However I discovered no matter what settings I set, the system always instantly wake up and starting to boot from my boot-loader(except one),

which really confused me.

Here are the combination I tried:

1. nrf_gpio_cfg_sense_input(BTN_PIN, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_LOW)-->Instantly boot

2. nrf_gpio_cfg_sense_input(BTN_PIN, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_HIGH)-->Instantly boot

3. nrf_gpio_cfg_sense_input(BTN_PIN, NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_LOW)-->Instantly boot

4. nrf_gpio_cfg_sense_input(BTN_PIN, NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH)-->Cannot boot, no matter how hard I press the button

5. nrf_gpio_cfg_sense_input(BTN_PIN, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW)-->Instantly boot

6. nrf_gpio_cfg_sense_input(BTN_PIN, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_HIGH)-->Instantly boot

If I wish to implement a mechanism that allows the system to wake up by that button GPIO only if users release that button AFTER entering SYSTEM OFF Mode,

How would you suggest I achieve it?

Thanks.

Parents
  • Dear Edvin,

    I am sure that this button pin only being configured as a GPIOTE when system boot up, and is uninitialized with 

    nrf_drv_gpiote_in_uninit(BTN_PIN)
     before executing the pre-system off function.

    I followed your instructions using 

    nrf_gpio_cfg_sense_input(BTN_PIN, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW)

    Other than that, I set default all the pins from 2 to 31 using 

    nrf_gpio_cfg_default(PIN)
     before entering SYSTEM OFF Mode, except P0.00 and P0.01 are for 32.768kHz crystal and I keep four LED pins as output and turn them off using 
    nrf_gpio_pin_clear(PIN)

    I do have a pair of UART TX/RX set when system boot up, but it wasn't physically connect to any device.

    Besides, I tried set them with 

    nrf_gpio_cfg_input(TX, NRF_GPIO_PIN_PULLUP)
    nrf_gpio_cfg_input(RX, NRF_GPIO_PIN_PULLUP)
     and 
    nrf_gpio_cfg_default(TX)
    nrf_gpio_cfg_default(RX)
    respectively before entering SYSTEM OFF Mode, but doesn't seem to have any impact to the question.

    Another phenomenon that kind of tells only the BTN_PIN is causing the system to instantly boot up is that if I remove 

    nrf_gpio_cfg_sense_input(BTN_PIN, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW)
    , then the system won't wake up anymore after entering SYSTEM OFF Mode.

  • Is it possible for me to reproduce this on a DK? If so, can you zip a project folder containing a project that I can compile in an unmodified SDK and reproduce the issue?

    BR,
    Edvin

Reply Children
No Data
Related