2025-11-26 1:58 AM - last edited on 2025-11-26 2:00 AM by Andrew Neil
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
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
Iternal clock ioc and log
2025-11-26 2:07 AM
@sameer_2k3 wrote:The code runs,but the UART prints garbage characters, for example:
<0x1c><0xe0><0xfc><0x1c><0xe
So your baud rate is wrong.
Use an oscilloscope or logic analyser to see what rate you are actually getting.
@sameer_2k3 wrote:
25 MHz external clock is selected in CubeMX (HSE ON, Crystal/Ceramic Resonator).
You mean an external Crystal - not an external clock?
Have you checked that it is actually oscillating, and actually at 25MHz?
@sameer_2k3 wrote:
- PLL settings are unchanged except switching HSI → HSE.
But the HSI is 64MHz - changing to a 25MHz source means that you do need to change your clock settings...
2025-11-26 2:09 AM
Check input clock is 25 MHz with scope, usually derived from ST-LINK, check options/settings there.
Check HSE_VALUE define in stm32h7xx_hal_config.h matches reality.
2025-11-26 2:16 AM
@Tesla DeLorean wrote:usually derived from ST-LINK, check options/settings there.
@sameer_2k3 if it is coming from the ST-Link, then you would need 'Bypass' mode - not 'Crystal/Ceramic Resonator'
2025-11-26 2:16 AM - edited 2025-11-26 2:20 AM
Hi @sameer_2k3,
Are you using an external HSE? The NUCLEO-STM32H753 board does not have an HSE clock fitted.
I think this may be the cause of your problem.
You can refer to this article How to use STLINK-V3 MCO output on Nucleo boards as a precise clock source for STM32 to see how to select the frequency and configure the HSE input according to your selection.
Thanks.
ELABI.1
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.
2025-11-26 4:25 AM
after selecting bypass mode still printing garbage
2025-11-26 4:26 AM
i have connected externally 25 M
2025-11-26 4:27 AM
You mean an external Crystal - not an external clock?
yes external Crystal .
Have you checked that it is actually oscillating, and actually at 25MHz?
yes checked and verify
2025-11-26 4:40 AM
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
2025-11-26 6:07 AM
Unless you have physically modified the board, you should select HSE bypass mode and change the value to 8 MHz. That is the clock signal coming in to OSC_IN on the target chip. The ST-link chip has a 25 MHz crystal but that is not relevant here.