STM32F469: HAL_RTC_GetTime jumps from 12:59 to 1:00 instead 13:00 or 1:00 pm
I get the time in one thread with following code:
RTC_TimeTypeDef ti = {0};
RTC_DateTypeDef da = {0};
HAL_RTC_GetTime(& hrtc, ti, RTC_FORMAT_BIN);
HAL_RTC_GetDate(& hrtc, da, RTC_FORMAT_BIN);It jumps from 12:59 to 1:00 instead 13:00,
With another project which uses an older firmware and different pcb but same MCU this does not happen.
Can this be a probem in the Cube Ide HAL 1.28.1?
Or a problem with the RTC itself? I have only one prototype yet, but I will check next week with other prototypes.
HAL_RTC_GetTime contains the following code:
sTime->Hours jumps from 13 to 1 but sTime->TimeFormat remains 0.
I use 24 hours, but even if the settings would be 12 hours, the sTime->TimeFormat should be set after going from a.m. to p.m.
sTime->Hours = (uint8_t)((tmpreg & (RTC_TR_HT | RTC_TR_HU)) >> RTC_TR_HU_Pos);
sTime->Minutes = (uint8_t)((tmpreg & (RTC_TR_MNT | RTC_TR_MNU)) >> RTC_TR_MNU_Pos);
sTime->Seconds = (uint8_t)( tmpreg & (RTC_TR_ST | RTC_TR_SU));
sTime->TimeFormat = (uint8_t)((tmpreg & (RTC_TR_PM)) >> RTC_TR_PM_Pos);
The jump happens also if I set the time to 12:59 and afterwards put the MCU some minutes into power saving mode. I am not sure if the jump happens in the RTC (but worked previously) or after initialising and restoring the RTC backup.
