Skip to main content
Associate II
Nov 11, 2026 8:28 PM UTC
Question

STM32H561 I2C2 data OK but USART3 baud rate at 1/3 of set baud rate

NUCLEO-H563ZI with STM32CubeMX 6.18.1 and STM32CubeIDE 2.2.0 reading in magnetometer data at 100 kHz then printing the data out the USART3 VCP.  Baud set at 115200 but to read the data requires receiving it at 38400, one third the set baud rate.  PLL is set at 250MHz, but that has no influence on the baud rate.  How do I get the baud rate to 115200 like USART3 is set at?  What could be slowing everything down by 1/3?  Data came out at >1 sec intervals on one project. On this project it comes out closer to 6 seconds. That, and the baud rate is receiving at 38400 has me looking at the board funny.

Any suggestions as to why it is generating data at 1/3 the rate set?

7 replies

TDK
Nov 11, 2026 9:10 PM UTC

Any suggestions as to why it is generating data at 1/3 the rate set?

Your clock settings are off. Default is 8 MHz HSE bypass from the ST-Link. Maybe you have something else set. Probably 25 MHz. There’s your 1/3 factor.

If you set it to use HSI instead, it’ll likely work, Or if you correct the error, it will work. User manual has a section for clock settings.

 

I2C works because the clock does not need to be precise there.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate II
Nov 12, 2026 12:40 AM UTC

The original setting for USART example about NUCLEO-H563ZI could be as asynchronous mode (115200 bauds, 8 data bit, 1 start bit, 1 stop bit, no parity). 38400 should be the measurement value instead of setting value. It could be helpful if you check the USART setting code like below:

Have you check ASK AI option for debug information? It could be helpful as well

====================================================================================

- BaudRate = 9600 baud

- Word Length = 8 Bits

- One Stop Bit

- No parity

- Hardware flow control disabled (RTS and CTS signals)

- Receive and transmit enabled

*/

USART_InitStructure.USART_BaudRate = 9600;

USART_InitStructure.USART_WordLength = USART_WordLength_8b;

USART_InitStructure.USART_StopBits = USART_StopBits_1;

USART_InitStructure.USART_Parity = USART_Parity_No;

USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;

USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;

whascalAuthor
Associate II
Nov 12, 2026 4:29 PM UTC

I have turned on High Speed Clock (HSE) to Crystal/Ceramic Resonator and I did the same for Low Speed Clock (LSE). On the Clock Configuration tab the LSE has little squares connecting them to the 32.768 Input Frequency, which is fine.  Why does the Input Frequency for 25MHz NOT have little squares connecting it to the HSE, which is the selected clock?  How do I get it to recognize that the 25 MHz is there.  The other clock speeds are 4 MHz and 64 MHz.  Where does DEFAULT of 8 MHz come into play?  I have set High Speed Clock (HSE) to Crystal/Ceramic Resonator on and off and back on but the silly thing NEVER wants to connect the 25 MHz to the HSE.  WHY NOT?  How can I force the issue?  Is my CubeMX defective?

TDK
Nov 12, 2026 10:27 PM UTC

Where does DEFAULT of 8 MHz come into play?  I have set High Speed Clock (HSE) to Crystal/Ceramic Resonator on and off and back on but the silly thing NEVER wants to connect the 25 MHz to the HSE.  WHY NOT?  How can I force the issue?  Is my CubeMX defective?

Yes, let’s play the blame game instead of opening up the user manual and reading a few paragraphs.

No software settings can change the hardware layout.

"If you feel a post has answered your question, please click ""Accept as Solution""."
whascalAuthor
Associate II
Nov 12, 2026 4:56 PM UTC

All the clock calculations are showing 250 MHz clock speeds and the calculations work for 25 MHz crystal. When I select other options for HSE one or both legs between 25 and HSE disappeared. But it is not connected to HSE like LSE is.  What test point can I look at with an o’scope to verify that it is as 25 MHz and not 8 MHz? Or where can I look to find what clock speeds are running internally? 

AScha.3
Super User
Nov 12, 2026 7:18 PM UTC

Look at the circuit of the nucleo-H563 :

https://www.st.com/resource/en/schematic_pack/mb1404-h563zi-c01-schematic.pdf

the HSE clk for the H563 is coming from st-link mco , usually 8 MHz . The crystal is not fitted .

(check whats really on your nucleo , not what you assume ! )

Set the 8M HSE bypass - as it is :

 

 

And to check , what clocks running on chip, use the mco output. Its there to do exactly this.

on H563 are two mco, to check different clock sources inside the chip, so choose what you want to check;

and set (with the mco divider) a useful (not too high ) speed , as its useless to try to put out 250MHz.

  •  

  • set port/pin speed high for this mco pin.

 

If you feel a post has answered your question, please click on " Best Answer ".
mƎALLEm
ST Technical Moderator
Nov 12, 2026 7:24 PM UTC

the HSE clk for the H563 is coming from st-link mco , usually 8 MHz . The crystal is not fitted . (check your nucleo ! )

Need to check if STLINK MCO outputs 8Mhz. As NUCLEO-H563ZI has STLINK-V3 and the frequency output is configurable.

Need to refer to the knowledge base article: 

 

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.