2021-03-15 09:15 AM
The MX_RTC_Init function resets the SSR register of the RTC, so with every power cycle there is a average error of 0.5s! That can accumulate to quite a huge error pretty quickly, if the device is switched on and off several times a day.
Is this intended behaviour? Is there a way around this problem without manually digging into the RTC init function?
2021-03-15 11:37 AM
This is a recurring theme here, try searching, I believe workarounds have been already posted.
Btw., AFAIK, is a CubeMX problem rather than Cube FW. I don't use either so can't judge.
JW
2021-03-18 02:38 AM
You are right, there already are some topics discussing this problem.
Unfortunatly there is not really a solution, except for manually gating the init function call.
As it currently is, we are using the MX init, because it makes it really easy to change settings of the peripherals without digging into all registers ourselfs. But because every "Code regeneration" with CubeMX deletes changes in the "non user code blocks", it is not really great to add code to gate the call of the MX_RTC_Init.
This is not a huuuge deal, we just have to be careful and maybe limit our use of the MX stuff, but I think it would be great if ST approached this in a future MX or FW update. MX generally is really a big help and reducing our workload, but with stuff like that it is extremely limiting the usefulness...