CubeMX 6.17.0 generates wrong code for HSE_RTC divider
Hi,
I'm using STM32H5F5LJHxQ. External HSE Oscillator is 48MHz. RTC clock mux is set to HSE_RTC, divider set to "/48" and the tool shows correctly that RTC clock is 1000kHz (48MHz / 48).
During my tests I discovered a wrong RTC time, error ~2%. (1.2 seconds deviation per minute)
In the generated function HAL_RTC_MspInit() is see: (49 instead of the expected 48)
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_HSE_DIV49; If I change the configuration in CubeMX to create a divider of 47, the correct RCC_RTCCLKSOURCE_HSE_DIV47 is generated
If I change the configuration in CubeMX to create a divider of 49, the correct RCC_RTCCLKSOURCE_HSE_DIV49 is. generated.
If I manually set the correct RCC_RTCCLKSOURCE_HSE_DIV48 in the sources, the RTC runs correctly.
Regards,
Gunnar Bohlen
HMS Networks
