lpcware

AN11069: Why reboot after leaving DEEP SLEEP?

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by OldManVimes on Mon Aug 10 20:43:18 MST 2015
Hi support,

Question. AN11069 provides sample code for dealing with DEEP SLEEP (and other low power modes). The DEEP SLEEP implementation (with RTC based wakeup) simply reboots after waking up. I am using this feature, but cannot reboot after waking up (I would loose state information). However I find that waking up is not very robust. I get frequent hangups (but not always). Can the system wakeup reliably?

Detailed questions:
- Why does the application note do this? Is it simply an oversight or is there a problem with the re-initializing of clocks?
- Is there a code example that provides an insight into how to setup the clocks (with implicit timing information) after waking up when going to DEEP SLEEP with a timed RTC wakeup + GPIO wakeup based on the WDT clock (as detailed in the errata sheet)?

My application:
- Runs on the IRC + PLL to get to 24 MHz CPU clock
- Switches to the IRC input, followed by the lowest possible WDT clock for DEEP SLEEP
- Always wakes up nicely from DEEP SLEEP (so the WDT clock is running after waking up)
- Switches on a GPIO LED
- Hangs in the re-initialization of clocks (sync on locking the PLL + switching to the PLL clock source)

Thanks,
Vimes

Outcomes