Hello
I have a very strange problem
A custom nRF52840 board has a charge detect pin, P1.6
A gpio callback is installed to wake it up on charger connect/disconnect
When the CPU is running this works like a charm
However if the CPU is powered off with sys_poweroff() API, the gpio callback does not wake up the CPU.
To make things more interesting, this does not happen every time and on all devices.
The most common failure scenario is as follows
1. Flash the firmware on device ( nrfjprog is used )
2. Load configuration data to scratch partition ( JLink is used) and reboot the device
3. On boot the device detects configuration data, configures itself and reboots. Everything works as expected including charger detection
4. Power off device with sys_poweroff() API
5. Connect the charger . Device does not wake up.
6. Connect device to a JLink app like RTT log viewer
7. Device wakes up and functions properly
8. Power off device with sys_poweroff() API
9. Attach the charger. - device wakes up. From this point on device can be powered off repeatedly and it wakes up every time