cancel
Showing results for 
Search instead for 
Did you mean: 

UART stops printing when using 25 MHz external clock on NUCLEO-H753ZI-$AT3

sameer_2k3
Associate II

Hello,

I am using a NUCLEO-STM32H753ZI-$AT3 development board.
When I configure the MCU to use the internal clock (HSI), everything works correctly and my UART debug logs are printed normally.

However, when I switch to using the external 25 MHz clock (HSE), no UART logs are printed. The code runs,but the UART prints garbage characters, for example:

<0x1c><0xe0><0xfc><0x1c><0xe

What I have already checked:

  • 25 MHz external clock is selected in CubeMX (HSE ON, Crystal/Ceramic Resonator).

  • PLL settings are unchanged except switching HSI → HSE.

  • UART baud rate is the same (115200).

  • If I go back to internal HSI, UART prints again.

External clock ioc and log

sameer_2k3_0-1764150481356.png

sameer_2k3_4-1764150853375.png

Iternal clock ioc and log

sameer_2k3_5-1764150881049.png

sameer_2k3_6-1764150964266.png

 

 

17 REPLIES 17

@sameer_2k3 wrote:

on NUCLEO-H753ZI board (MB1364), the STLINK has a crystal oscillator having a value of 25 MHz.

 How to use STLINK-V3 MCO output on Nucleo boards as a precise clock source for STM32 they already mention 


It is used by the MCU that manages the STLINK (STM32F723). Not the target MCU, in your case STM32H753ZI:

mALLEm_1-1764166876029.png

STLINK is clocked by a 25MHz crystal oscillator and it generates another clock to the target MCU that should be configured in Bypass mode unless you added a 25MHz on OSC_IN/OSC_OUT.

PS: the STLINK clock output is configurable based on the article link provided above. So need to check what clock frequency is generating.

 

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

yess i have change PLL setting

after selecting 'Bypass' mode still the log is garbage

Did you change the HSE frequency in the clock tree to 8 MHz?

TDK_0-1764217622443.png

 

If you feel a post has answered your question, please click "Accept as Solution".
sameer_2k3
Associate II

sameer_2k3_0-1764220801876.png

I configured the PLL to 400 MHz, and when I select HSI as the clock source for UART, the UART logs print correctly. However, when I switch the UART clock source to the PLL in CubeMX, the UART output becomes corrupted and prints garbage characters.
Why does this happen, and how can I fix it?
What changes do I need to make to use the PLL clock for UART logging without getting garbage output?

You still have the input frequency set at 25MHz :

AndrewNeil_0-1764233154363.png

 

You can use the MCO output to check actual clock frequency (the output pin will need to be configured for High speed)

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

@sameer_2k3 I see many unnecessary ping pongs in this post and that's not efficient.

So please:

1- Confirm: did you solder an external 25MHz crystal on OSC_IN/OSC_OUT?

2- Please share your ioc file.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
TDK
Super User

@sameer_2k3 Are you actually reading the replies you're getting? Or just ignoring them after reading?

Multiple people have told you the problem in multiple different ways.

If you feel a post has answered your question, please click "Accept as Solution".