2022-04-20 04:31 AM
Hi
I am working on an STM32wl project where I need to use a real time clock, I use the Utilities that I have found in one of the examples that ST provides, it is the Sequencer, Timer server and System time.
I can not see if there is a smart way to save and read the current time.
I can see that the Timer server uses the RTC in free running mode and therefore can not set the current time.
If I set System time, and reset the stm after some time, it starts with the time I have set earlier, and not the updated time.
anyone who can point me in the right direction ??
2022-05-04 04:15 PM
Hello @spa23 ,
Here is a way to do it with attached patch to apply on top of the LoRaWAN_AT_Slave example.
This set the time :
AT+LTIME=00h27m09s on 05/05/2022
This retrieve the time :
AT+LTIME=?
Then after reset or power loss (but with VBAT is kept), you should keep your time as you have set it.
If RTC is enabled then we don't re-initialize it !You may increase robustness with more checks if you want....
Hope it helps you.
BR,
Bruno
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.