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 Constantin

    You need to call sd_ble_gap_adv_stop() before going to sleep with sd_power_system_off(). Please also add a small delay or a check to make sure that sd_ble_gap_adv_stop() is finished before calling sd_power_system_off() to avoid these crashes. You need to do this because advertising needs to be stopped/closed properly before going to sleep.

    Best regards,

    Simon

Reply
  • Hi Constantin

    You need to call sd_ble_gap_adv_stop() before going to sleep with sd_power_system_off(). Please also add a small delay or a check to make sure that sd_ble_gap_adv_stop() is finished before calling sd_power_system_off() to avoid these crashes. You need to do this because advertising needs to be stopped/closed properly before going to sleep.

    Best regards,

    Simon

Children
Related