Question
Why RTC always count twice 00:00:00?
Hi guys:
I initialed the RTC of STM32F103C8T6 by cubeMx and enabled the RTC global interrupt.
void HAL_RTCEx_RTCEventCallback(RTC_HandleTypeDef *hrtc) /* second callback */
{
RTC_DateTypeDef rtcDate;
RTC_TimeTypeDef rtcTime;
HAL_RTC_GetTime(hrtc, &rtcTime, RTC_FORMAT_BIN);
HAL_RTC_GetDate(hrtc, &rtcDate, RTC_FORMAT_BIN);
LOG_DBG("[20%02d-%02d-%02d(%d) ", rtcDate.Year, rtcDate.Month, rtcDate.Date, rtcDate.WeekDay);
LOG_DBG("%02d:%02d:%02d] tick[%5d]\n", rtcTime.Hours, rtcTime.Minutes, rtcTime.Seconds, HAL_GetTick());
}
I got the following output:
[2023-17-24(6) 23:59:58] tick[ 4140]
[2023-17-24(6) 23:59:59] tick[ 5175]
[2023-17-24(6) 00:00:00] tick[ 6210]
[2023-17-24(6) 00:00:00] tick[ 7245]
[2023-17-24(6) 00:00:01] tick[ 8280]
[2023-17-24(6) 00:00:02] tick[ 9315]
It is clear that the time 00:00:00 is output twice, and we can see the ticks are different, and the data still keep 24, NOT change to 25.
So my questions are:
1. Why the time "00:00:00" output twice?
2. Why the date NOT be updated after 23:59:59?
Thanks.
