Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

WakeUp from sleep mode

Hi,

we try to get the NRF52840 to sleep and then wake up from an GPIO interrupt.

We try it in debug mode which should give a emulated sleep mode. So we stop all processing and at a while(1) loop after calling sd_power_system_off.

The wakeup pin is configured as followed:

	nrf_gpio_cfg_input(IMU_INT2, NRF_GPIO_PIN_NOPULL);
	nrf_gpio_cfg_sense_set(IMU_INT2, NRF_GPIO_PIN_SENSE_HIGH);

Prior to setting the nrf to sleep the interrupt is firing and working as expected. And I can see the interrupt going high and low again when the nrf should be in sleep

but it does not produce a reset. Some other information the device is running with USB powered and usb_handling enabled and debugger disconnected.

I've already tried to uncomment the USB stuff and run it without USB but still no progress.
Help is appreciated ;-).

Kind regards,

C.W.

PS: SDK is 17.0.0

Parents
  • Hi

    First off, I strongly recommend that you move your project to SDK v17.0.2, as the SDK v17.0.2 release is a bug fix release replacing version 17.0.0, which had quite a few issues. If that doesn't solve anything for you, please show me how you put the device to sleep, and how you prepare the device to sleep before that.

    Best regards,

    Simon

  • Sorry we already tried it but no success, here is the code snippet how we launche the sleep mode:

        // Prepare wakeup buttons.
    	nrf_gpio_cfg_input(IMU_INT2, NRF_GPIO_PIN_NOPULL);
    	nrf_gpio_cfg_sense_set(IMU_INT2, NRF_GPIO_PIN_SENSE_HIGH);
    
    	nrf_gpio_pin_set(LED_ERROR);
    	nrf_delay_ms(500);
    	nrf_gpio_pin_clear(LED_ERROR);
    
        // Go to system-off mode (this function will not return; wakeup will cause a reset).
    	#ifdef DEBUG
    	 (void) sd_power_system_off();
    	 while(1);
    	#else
    	  APP_ERROR_CHECK(sd_power_system_off());
    	#endif  // DEBUG_NRF

    Again the device is powered via USB and the usb+ nad usb- lines are connected to a PC. But we already tested with battery powered only. The Debugger was always disconnected.

    Kind regards,

    C.W.

Reply
  • Sorry we already tried it but no success, here is the code snippet how we launche the sleep mode:

        // Prepare wakeup buttons.
    	nrf_gpio_cfg_input(IMU_INT2, NRF_GPIO_PIN_NOPULL);
    	nrf_gpio_cfg_sense_set(IMU_INT2, NRF_GPIO_PIN_SENSE_HIGH);
    
    	nrf_gpio_pin_set(LED_ERROR);
    	nrf_delay_ms(500);
    	nrf_gpio_pin_clear(LED_ERROR);
    
        // Go to system-off mode (this function will not return; wakeup will cause a reset).
    	#ifdef DEBUG
    	 (void) sd_power_system_off();
    	 while(1);
    	#else
    	  APP_ERROR_CHECK(sd_power_system_off());
    	#endif  // DEBUG_NRF

    Again the device is powered via USB and the usb+ nad usb- lines are connected to a PC. But we already tested with battery powered only. The Debugger was always disconnected.

    Kind regards,

    C.W.

Children
No Data
Related