nRF52 device stops waking up from deep sleep after 2-3 hours (NCS 2.7.0

I am working on an nRF52-based device using nRF Connect SDK (NCS) version 2.7.0. The device is configured to enter deep sleep every 60 seconds and wake up via a GPIO interrupt. However, after 2-3 hours of operation, the device stops waking up from deep sleep using the GPIO pin. But works fine before 2-3 hours. 

  • The device works as expected for the first 2-3 hours, waking up from deep sleep every 60 seconds using the GPIO interrupt.

  • After 2-3 hours, the device no longer wakes up from deep sleep, even though the GPIO signal is still active.

  • The device does not reset or crash; it simply remains in deep sleep.

void setup_pins_wakeup_source(void)
{
    gpio_pin_configure_dt(&button0, GPIO_INPUT);
    gpio_pin_configure_dt(&button1, GPIO_INPUT);
    gpio_pin_configure_dt(&button2, GPIO_INPUT);
    gpio_pin_configure_dt(&button3, GPIO_INPUT);
    gpio_pin_configure_dt(&button4, GPIO_INPUT);

   
    // Enable button interrupts
    gpio_pin_interrupt_configure(button0.port, button0.pin, GPIO_INT_LEVEL_INACTIVE);
    gpio_pin_interrupt_configure(button1.port, button1.pin, GPIO_INT_LEVEL_INACTIVE);
    gpio_pin_interrupt_configure(button2.port, button2.pin, GPIO_INT_LEVEL_INACTIVE);
    gpio_pin_interrupt_configure(button3.port, button3.pin, GPIO_INT_LEVEL_INACTIVE);
    gpio_pin_interrupt_configure(button4.port, button4.pin, GPIO_INT_LEVEL_INACTIVE);

}

void enter_deep_sleep_mode(void)
{

	LOG_INF("enter_deep_sleep_mode");
	setup_pins_wakeup_source();

	// enter deep sleep mode to save power
	sys_poweroff();
}

Parents
  • Hello,

    Try adding a pullup/pulldown to your GPIOs. I suspect that your gpio is already in the active state.

    So if your active state is low, add GPIO_PULL_UP to your init flags:

    gpio_pin_configure_dt(&button0, GPIO_INPUT | GPIO_PULL_UP);

    See if that helps. 

    To be sure, you can test this without any changes. If the pin is active low, try shorting the pin to VDD, and then press it again. 

    Best regards,

    Edvin

Reply
  • Hello,

    Try adding a pullup/pulldown to your GPIOs. I suspect that your gpio is already in the active state.

    So if your active state is low, add GPIO_PULL_UP to your init flags:

    gpio_pin_configure_dt(&button0, GPIO_INPUT | GPIO_PULL_UP);

    See if that helps. 

    To be sure, you can test this without any changes. If the pin is active low, try shorting the pin to VDD, and then press it again. 

    Best regards,

    Edvin

Children
No Data
Related