STM32CubeMX(6.15.0) bug for NUCLEO-H563
- November 4, 2025
- 2 replies
- 147 views
Hello.
In CubeMX, there is a Bug with a wrong Clock of USART2 and a wrong BRR-Value
I've used CubeMX to configure the Clock, based on the Nucleon-H563.
For the USART2, i want to use the stable crystal oszillator (25MHz) from the Board (not the HSI-Clock)
So i configure a 125MHz-Clock on PLL2Q and set this as clock for USART2.
The Baudrate should be: 9600.
After generating code, the baudrate of USART2 ist 3078,81 Baud (measured).
To calculate the uart baudrate divider (USART2_BRR), MX use the: STM32Cube_FW_H5_V1.5.0\Drivers\STM32H5xx_HAL_Driver\Src\stm32h5xx_hal_uart.c
In Function: UART_SetConfig(UART_HandleTypeDef *huart) Line 3329, the usartdiv is calculated with: 407
( (125000000 / 32) + ((9600)/2)) / 9600 = 407
But with this, a wrong baudrate is generated (3078,81Baud)
If i use 130 as divider, the Baudrate is near correct, because the USART-Clock seems to be 39,9013776MHz instead of 125MHz .
What is the reason for the wrong clock of PLL2Q or the BRR?


