2025-02-10 10:56 AM
Cube MX: After RTC configuration with "activate clock source" and running the Cube generated Code the RTC wont start.
TheCube MX generated code is missing to set the RTCAPBEN Bit in the RCC->APB3ENR Register.
I found out that the "stm32h5xx_hal_rtc.c" hal driver doesnt work correct.:
The driver states: "Call the function HAL_RCCEx_PeriphCLKConfig with RCC_PERIPHCLK_RTC for
PeriphClockSelection and select RTCClockSelection (LSE, LSI or HSEdiv32)
(+) Enable RTC Clock using the __HAL_RCC_RTC_ENABLE() function."
This is called by the Cube output but this doesnt set the RCC Clock bit for the RTC to "1" . It stays "0"
Workaround: Set the RTCAPBEN Bit in RCC->APB3ENR manualy.
Regards Henry