Is there a way to maintain RTC ticking without any shifts while performing a power reset?
/*UPDATE*/
It turned out that im my case the problem was in the start up routine:
There was a "Start up" project (written not by me) that was downloaded at 0 flash address and it was jumping to another address where my project was located.
I did not know that in this "Start up" project there was an RTC initialization (which prevented my RTC from running continuously).
Everything below this sentence is what I wrote before I knew where the problem is.
Good day!
I'm using RTC in a STM32F407VG controller.
I configured RTC_ALARM_A to generate an interrupt every second (this indicates when a second changes in RTC). By this interrupt, an oscilloscope and a reference 1Hz clock from another device (that is not being reset) I watch whether my RTC is ticking consistently.
With this setting it can be seen if MCU's RTC is shifting during power reset. And that's exactly what I'm observing (don't know the absolute value of the time shift, but I see that the phase of MCU's 1Hz clock output is changing randomly after power reset is done).
Can anyone tell me if there is anything that can be done to make RTC run continгously, even when a power reset is performed?
Also this things need to be mentioned:
- I do use a battery for RTC and clocks are ticking while MCU is not powered.
- I am not reinitializing the RTC periphery each time.
- Backup registers preserve their values, so no "Backup domain reset" occures.
- RTC clock is consistent during "System reset", this behavior is only seen when "Power reset" is done
