This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sd_power_system_off() interfere with GPIOTE port interrupts

I am using NRF52 SDK14.0 and SoftDevice S132 v5.0.0. I am using GPIOTE low level port interrupt to wake the system from SysOff mode. If SoftDevice is enabled and I put the system to SysOff by calling NRF_POWER->SYSTEMOFF = POWER_SYSTEMOFF_SYSTEMOFF_Enter; port interrupt (button press) wakes the system as expected. But if I am trying to use sd_power_system_off() function instead, the system goes to SysOff and is never woken again by the port interrupt. Could something inside sd_power_system_off() interfere with GPIOTE interrupt settings?

Parents
  • Hi,

    When in System OFF mode, the device can be woken up through one of the following signals:

    1. The DETECT signal, optionally generated by the GPIO peripheral
    2. The ANADETECT signal, optionally generated by the LPCOMP module
    3. The SENSE signal, optionally generated by the NFC module to “wake-on-field”
    4. A reset

    GPIOTE will not wake the processor up from SYSTEM OFF, the sense mechanism in the GPIO peripheral will. If you enable the sense mechanism, a DETECT signal will be generated if the correct sense is detected on one of the pins.

    Try to configure the pin you want to use to wake the chip up like this:

    nrf_gpio_cfg_sense_input(PIN NUMBER, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
    

    Also note that when the SoftDevice is enabled, the POWER register is restricted, and should not be accessed directly. When the SoftDevice is enabled, you should therefore only use the sd_power_system_off() function to go to sleep.

  • I just tested the code you provided, and it worked fine to exit sleep mode with it. The sd_power_system_off() does not interfere with any GPIOTE interrupt settings.

    What pin is GPIO_BUTTON_MAIN ? Could you debug/print the GPIO configuration register value of the pin you use, and see if it's correctly configured before you enter system off?

    The NRF_P0->PIN_CNF[GPIO_BUTTON_MAIN] should be 0x0003000C if configured correctly.

Reply
  • I just tested the code you provided, and it worked fine to exit sleep mode with it. The sd_power_system_off() does not interfere with any GPIOTE interrupt settings.

    What pin is GPIO_BUTTON_MAIN ? Could you debug/print the GPIO configuration register value of the pin you use, and see if it's correctly configured before you enter system off?

    The NRF_P0->PIN_CNF[GPIO_BUTTON_MAIN] should be 0x0003000C if configured correctly.

Children
No Data
Related