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

GPIO Wakeup from System OFF Not Working

This is the code I am using to wakeup my system from OFF. It is not working. Kindly Help.

#define Pin_0    0


static void gpio_init(void)
{
    ret_code_t err_code;

    // Configure output pin for LED
    err_code = nrf_drv_gpiote_init();
    APP_ERROR_CHECK(err_code);
    nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);
    err_code = nrf_drv_gpiote_out_init(BSP_LED_0, &out_config);
    APP_ERROR_CHECK(err_code);

    // Wake up button
    nrf_gpio_cfg_sense_input(Pin_0, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
}


int main(void)
{
    gpio_init();

    while (true)
    {
        // Toggle LED (will continuously toggle while button is pressed, so it will appear dimmed)
        nrf_drv_gpiote_out_toggle(BSP_LED_0);

        // Go to system off
        NRF_POWER->SYSTEMOFF = 1; 
    }
}
Related