I tried to set the periodic wake up to 23 hours since this post explained that the maximum is about 23.3 hours https://support.dialog-semiconductor.com/cfgmaxsleepdurationexternalwake.... What is the exact maximum and how do I calculate it?
However when I set the wake-up to 23 hours by setting CFG_MAX_SLEEP_DURATION_EXTERNAL_WAKEUP_MS to (1000*60*60*23), it started waking up every 4 minutes. I tried setting it to (1000*60*10) and it woke up every 10 minutes as expected. Lower values also worked as expected. When I set it to (1000*60*30) it started waking up every 8 minutes.
I read in this post https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl... and here https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-da... that there is a bug in the MS_TO_SLOTS_CONVERT function. I tried the suggested fix with converting to 'long long' but it still doesn't work. Perhaps there is some other integer overflow error somewhere?