2025-11-20 10:05 PM
I am currently using STM32G0B1. I found that when using an active crystal oscillator, the STM32 fails to recognize my crystal oscillator, resulting in the HSERDY bit not being set.
This is the configuration of my cubemx.
Use an oscilloscope to check if the crystal oscillator has started oscillating.
2025-11-20 10:24 PM
Isn't that expected behaviour?
Reference manual RM0444:
The HSERDY flag in the Clock control register (RCC_CR) indicates if the HSE oscillator is stable or not.
...
Note: Once the HSEON bit is cleared, HSERDY goes low after 6 HSE clock cycles.
hth
KnarfB
2025-11-20 10:34 PM
The crystal oscillator has started oscillating normally, but the clock initialization will enter a waiting state for the timeout of HSERDY. Could this be a reasonable phenomenon?
2025-11-20 11:26 PM
Did you set the scope probe "10:1" ? Because your signal seems to be about 600mV , on the scope pic.
Need to have hi speed + low capacitance probe . If not having this, do not touch it with the probe !
But it has to be 3Vss , to work at 3v3 cpu input.
+
You set range 1 ?
2025-11-21 6:08 AM - edited 2025-11-21 6:22 AM
Bypass is not the correct mode if you have a crystal oscillator. You should choose "Crystal/Ceramic Resonator" and connect it to the OSC_IN and OSC_OUT pins with appropriate load caps.
The signal shown is not a valid bypass clock and HSERDY being low is the expected behavior.
2025-11-21 6:12 AM - edited 2025-11-21 6:14 AM
No, the Bypass mode is the correct config for the crystal oscillator (XO).
@TDK wrote:
Bypass is not the correct mode if you have a crystal oscillator. You should choose "Crystal/Ceramic Resonator" and connect it to the OSC_IN and OSC_OUT pins with appropriate load caps.
This is the case of the XTAL.
2025-11-21 6:37 AM - edited 2025-11-21 6:44 AM
You're certainly technically correct here, but the output shown here looks a lot more like a crystal and not an oscillator. Could be an oscillator with less than 0-3.3V output, which would not be compatible with STM32. Probe capacitance shouldn't affect oscillator output much. PN or schematic would be helpful.
2025-11-21 6:43 AM - edited 2025-11-21 6:51 AM
Need a confirmation from @ShimiaoWang:
Are you using a Crystal (XTAL: passive device) or a Crystal Oscillator (XO: active device). There are some differences. Refer to this link for your reference: