Any difference between entering shutdown on U585s?
Hello,
I've successfully used the code below to enter shutdown on a U585CIUx. It wakes up on button press and I can tell it is coming up from reset because of timestamps (based on time since startup) and terminal output that only happens during startup.
Using this same code on a U585QIIx, it seems to behave as if it has entered a low power mode, just not one as low power as shutdown. When it wakes up it picks up where it left off in terms of timestamps and it does not run through startup code as expected. I'm also measuring current draw during the so-called "shutdown" - it only goes 10mA lower, but there may be some interplay with battery backups that muddies up the reading.
While I don't normally test this kind of thing with the debugger, since it affects power, I did make sure that it's reaching the call to LL_PWR_SetPowerMode(LL_PWR_SHUTDOWN_MODE) and not going into some other mode.
Is there something I'm missing here? It only starts drawing 10mA more current (back where it started) when the button is pressed so it doesn't seem to act like it came right out of shutdown because of some interrupt.
Thanks
-------------------------------------------------
void goto_shutdown(void) {
HAL_SuspendTick();
LL_PWR_DisableWakeUpPin(DEEP_SLEEP_WAKEUP_PIN);
LL_PWR_ClearFlag_WU();
LL_PWR_SetWakeUpPinSignal1Selection(DEEP_SLEEP_WAKEUP_PIN);
LL_PWR_SetWakeUpPinPolarityLow(DEEP_SLEEP_WAKEUP_PIN);
while (!LL_PWR_GetWakeUpPinPolarity(DEEP_SLEEP_WAKEUP_PIN)) {}
LL_PWR_EnableWakeUpPin(DEEP_SLEEP_WAKEUP_PIN);
LL_PWR_ClearFlag_WU();
LL_PWR_SetPowerMode(LL_PWR_SHUTDOWN_MODE);
LL_LPM_EnableDeepSleep();
__WFI();
}
