2019-07-31 03:44 AM
The "MX_RTC_Init" function called by default from the main.c resets the RTC's date and time to zero values (by default) or to some other predefined constant values.
The standard practice is to set a bit in one of the backup registers after setting the date and time and to check the existence of the bit after enabling the backup domain and RTC - if the bit is set then don't touch the date and time.
There are no user code sections in MX_RTC_Init to try and change its logic, so what is the recommended way of implementing "don't change the date and time if it is already set" in a Cube generated LL project with RTC enabled?
Thank you.
Solved! Go to Solution.
2019-07-31 03:54 AM
Ah never mind, as it usually happens you find a solution just after posting the question :)
I'll just disable the "Activate Calendar" checkbox so Cube will stop generating date/time reset code, then I can write my own function and call it after MX_RTC_Init is called.
2019-07-31 03:54 AM
Ah never mind, as it usually happens you find a solution just after posting the question :)
I'll just disable the "Activate Calendar" checkbox so Cube will stop generating date/time reset code, then I can write my own function and call it after MX_RTC_Init is called.