Hi,
In my aplication, I bring my nRF52840 into power system off mode with sd_power_system_off on several different events, most notably the BLE_GAP_EVT_DISCONNECTED event. The problem is that in my application it is not guaranteed that the nRF will always have its voltage on (it will be powered off occasionally). And when it is powered on (hence having a reset), it should go into power system off mode again.
So my first thought for that was to put my sleep_mode_enter function right after my initialization code, so that it it will do exactly that: entering power off mode right after a power cycle. The problem obviously is in this case that it will also happen when the nRF is woken up by an NFC event, since it will reset the nRF and the nRF will go immediately into power system off again, basically oscillating between system off mode and reset state.
Is there a smart strategy for achieving what I want? Are there any bits that indicate whether it was a reset from a power cycle or whether the nRF was in power system off mode that I could check? Or maybe even a ready-to-use function that indicates that the nRF was woken due to a FIELDDETECT event?
Thank you for your help.
Kind regards,
Alex