Does LowPower Shutdown() reset the internal RTC?
Does LowPower Shutdown() reset the internal RTC?
Hi, i am looking to save power using the shutdown LowPower function but i'm not sure what is preserved after the shutdown. If i configure the RTC, then trigger a LowPower shutdown, will the RTC reset?
Re: Does LowPower Shutdown() reset the internal RTC?
Also, what's the point in having a LowPower shutdown() and also having an IWatchdog, don't they do exactly the same thing?
Re: Does LowPower Shutdown() reset the internal RTC?
So there isn't much difference between rebooting using the LowPower.shutdown() and the IWatchdog methods other than with the LowPower module, you can specify an amount of time to stay shutdown for (i think, i'm just testing this).
Re: Does LowPower Shutdown() reset the internal RTC?
For RTC you can handle the reset if you want:
https://github.com/stm32duino/STM32RTC# ... rsion--150
IWatchdog and shutdown have not the same behavior:
https://github.com/stm32duino/Arduino_C ... /README.md
https://github.com/stm32duino/STM32RTC# ... rsion--150
IWatchdog and shutdown have not the same behavior:
https://github.com/stm32duino/Arduino_C ... /README.md
Re: Does LowPower Shutdown() reset the internal RTC?
Oh nice! thanks 

Re: Does LowPower Shutdown() reset the internal RTC?
On my test bench, the LowPower.shutdown() reboot causes the rtc.isTimeSet() to return false even if it was preivously set? Am i doing something logically wrong here?
Output:
Edit:
The LowPower.shutdown() function does wipe the RTC, however, when i use LowPower.deepSleep() the RTCis preserved.
Is LowPower.shutdown() ment to wipe the RTC?
Code: Select all
void AlarmFunc(void* data)
{
Serial3.println("Woke");
Serial3.flush();
}
void ready()
{
STM32RTC& rtc = STM32RTC::getInstance();
rtc.begin();
if (rtc.isTimeSet())
{
Serial3.println("RTC is set!");
Serial3.flush();
}
else
{
Serial3.println("RTC is not set... setting");
Serial3.flush();
rtc.setEpoch(1587119789U);
}
delay(1000);
// reboot.
LowPower.begin();
LowPower.enableWakeupFrom(&rtc, AlarmFunc, nullptr);
LowPower.shutdown(2000);
}
void loop()
{
}
Output:
12:03:41.205 -> RTC is not set... setting
12:03:54.345 -> RTC is not set... setting
Edit:
The LowPower.shutdown() function does wipe the RTC, however, when i use LowPower.deepSleep() the RTCis preserved.
Is LowPower.shutdown() ment to wipe the RTC?
Re: Does LowPower Shutdown() reset the internal RTC?
Your code is not complete..
where is setup() ? where ready() is called ? and mainly which board you used ?
where is setup() ? where ready() is called ? and mainly which board you used ?
Re: Does LowPower Shutdown() reset the internal RTC?
I guess you work on L4, in shutdown mode use the LSE:
before the rtc.begin.
Code: Select all
rtc.setClockSource(STM32RTC::LSE_CLOCK);
Re: Does LowPower Shutdown() reset the internal RTC?
Nice! thanks, yes this is custom code, i made a system that does POST checking and calls this Ready() when its done. Thanks for debugging i will test it 
