STM32U5 RTC subseconds count up sometimes
Hello,
I've noticed an issue when using the RTC to try to calculate subseconds. I am using the NUCLEO-U575ZI-Q board, with a new project with these settings:

with this clock configuration:

I've added this code to the while loop:
/* Infinite loop */
/* USER CODE BEGIN WHILE */
RTC_TimeTypeDef last_time = {0};
int first = 1;
while (1)
{
RTC_TimeTypeDef sTime = {0};
RTC_DateTypeDef sDate = {0};
do {
HAL_RTC_GetTime(&hrtc, &sTime, RTC_FORMAT_BIN);
HAL_RTC_GetDate(&hrtc, &sDate, RTC_FORMAT_BIN);
} while (sTime.SubSeconds != hrtc.Instance->SSR);
if (!first) {
if (sTime.Seconds < last_time.Seconds) {
HAL_Delay(1000); // Breakpoint 1
} else if (sTime.Seconds == last_time.Seconds && sTime.SubSeconds > last_time.SubSeconds) {
HAL_Delay(1000); // Breakpoint 2
}
}
first = 0;
last_time = sTime;
HAL_Delay(100);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */The issue I am seeing is that when I set breakpoints at line 17 and 19 above, I regularly hit them. Here's an example of hitting line 19:

Here's the RTC register contents:

The problem is that it seems that there's an issue where the SSR register ticks up sometimes? The Seconds hasn't updated, but the SSR register has somehow gotten a larger value in it. I checked the Errata for this part and I don't see anything relevant there?
Thank you,
Jonathan
