I'm trying to get extended sleep working on my custom board with the DA14581 MOD board. The setup is as follows:
The system is initially configured with extended_sleep without OTP Copy. The wakeup is configured on a button interrupt, which does wake the system up on first press. Upon wakeup, the sleep is disabled (using arch_disable_sleep) so I can sample a sensor every 100ms using the timer0. The extended_sleep is then meant to be re-enabled after 7 seconds.
After a defined period of time(~3-4 seconds), the system seems to just decide it should go back into extended_sleep, eventhough it was never re-enabled, and according to arch_get_sleep_mode the sleep mode is off (0). Of course then the timer0 is no longer running, so the sensor is no longer being sampled.
If I configure the system to not use extended_sleep then everything works as expected. As well, this system with extended_sleep works fine when running off RAM (using KEIL debug), but not when using the flash.
Do you have any idea what is causing this?