2020-07-06 04:32 AM
I am running RTC for stm32h753. If I read the time of RTC, I do not get updated value as shown in below example. I am using LSE 32.768Khz. As it can be seen that 00:08:10 is being read repeatedly and then 00:08:15. if I compare overall time, it is correct but I want to get it once per sec correctly in my task. Is there any restriction that I need to set update rate to read the register once per sec? or any other suggestion!
hh:mm:sec
> 00:08:10
> 00:08:10
> 00:08:10
> 00:08:10
> 00:08:10
> 00:08:15
> 00:08:15
.............
............
> 00:08:19
> 00:08:19
............
............
> 00:08:24
......
> 00:08:27
Best Regards,
2020-07-06 06:21 AM
I found that HAL_RTC_GetTime () needs to be called 1st and then HAL_RTC_GetDate (). so far could not find any documentation for this explanation.
Thanks,
2020-07-06 01:30 PM
No, there is no documentation... only this:
And RM0433 section 46.3.9:
To ensure consistency between the 3 values, reading either RTC_SSR or RTC_TR locks the values in the higher-order calendar shadow registers until RTC_DR is read.
And of course idiot made HAL is such a "high-level" library that you have to deal with low-level specifics to use it...