2025-03-06 2:15 AM
So I'm having this issue with a Nucleo STM32H563ZI board regarding the USART3 that connects to the VCP ST-Link port.
If I enable the USART3 at 115200 baud rate, and keep all the default parameters and, in the clock configuration, if I do not change any clock parameters, except to configure the HCLK to 250Mhz, then the USART3 Clock Mux will use PCLK1 and also will output a clock frequency of 250Mhz.
So basically all defaults without too much changes except the HCLK.
In this situation, the USART3 works just fine, meaning that I can see correctly the data that is output by the USART with a terminal program. So far so good.
Nevertheless if I change the main clock source to the 24Mhz crystal, hence use the HSE and still keeping the HCLK at 250Mhz, the USART Clock Mux will still also be at 250MHz (still using PCLK1), BUT this time the USART output is just garbage meaning that the baudrate calculation is just wrong.
If I drop the USART clock mux to 4Mhz, for example everything just starts to work fine, meaning that the terminal program can see again the corrected output data.
So my question is, despite in both cases the USART Clock Mux use the same 250Mhz frequency, why it fails to work correctly when using the HSE?
I've searched the documentation and forums, some referring the BRR register, but this doesn't make sense since when using the HSI and the clock mux at also the 250MHz there is no need of further configuration...
Any ideas?