Hi there
I am currently trying to wakeup from system On mode using the DETECT signal and Port Event.
According to the product specification:
Trying to put the system to System OFF while DETECT is high will cause a wakeup from System OFF reset.
This is the opposite behaviour when entering system ON.
Putting the system into System ON IDLE while DETECT is high will not cause DETECT to wake the system
up again. Make sure to clear all DETECT sources before entering sleep.
My question is, how can I ensure that I don't end locking up the nRF52832. In my case the nRF52832 is supposed to wakeup from a GPIO sensing on a low level.
When the low level occurs right before entering sd_app_evt_wait() the nRF will not wake up since DETECT is already triggered.
How is it meant to use DETECT in such a scenario? I cannot clear the DETECT signal sourced by the GPIO since it is driven from another device.
To minimize the timespan where this lockup could happen, I read the GPIO and then enter sd_app_evt_wait() only if the GPIO level is still high. Yet there is still the possibility for the GPIO level to go low between reading the GPIO and finally entering sd_app_evt_wait().
// Skip sleep when GPIO is already low if (nrf_gpio_pin_read(GPIO)) { sd_stat = sd_app_evt_wait(); } else { // Stay awake }
Thank you in advance!
Regards,
Pascal