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
  • Hello,

     

    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.

     Based on this, you should set pullup and NRF_GPIO_PIN_SENSE_LOW.

    Do you configure this pin to be anything else in your application as well? Perhaps you set it to be NRF_GPIO_SENSE_HIGH somewhere else in your application, which then wakes up the chip when the button is released? Or perhaps another pin is set to sense something, and this pin receives a pulse that wakes the chip up?

     

    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

     That is because the button is pulled low (so it is low when the button is not pressed), and you press the button, which will set it even harder low (the same really). There is no physical change on the pin.

    Check your other pins, if they receive any pulses that may wake it up. E.g. if you use UART or any other peripheral using any input pins, if these pins are not disconnected before you go to system off, they may wake the chip as well.

    Best regards,

    Edvin

Reply
  • Hello,

     

    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.

     Based on this, you should set pullup and NRF_GPIO_PIN_SENSE_LOW.

    Do you configure this pin to be anything else in your application as well? Perhaps you set it to be NRF_GPIO_SENSE_HIGH somewhere else in your application, which then wakes up the chip when the button is released? Or perhaps another pin is set to sense something, and this pin receives a pulse that wakes the chip up?

     

    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

     That is because the button is pulled low (so it is low when the button is not pressed), and you press the button, which will set it even harder low (the same really). There is no physical change on the pin.

    Check your other pins, if they receive any pulses that may wake it up. E.g. if you use UART or any other peripheral using any input pins, if these pins are not disconnected before you go to system off, they may wake the chip as well.

    Best regards,

    Edvin

Children
No Data
Related