cancel
Showing results for 
Search instead for 
Did you mean: 

In the HSE bypass mode of STM32G0B1, the HSERDY bit cannot be set

ShimiaoWang
Associate II

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.

ShimiaoWang_0-1763695402505.png

Use an oscilloscope to check if the crystal oscillator has started oscillating.

ShimiaoWang_1-1763705052901.jpeg

 

7 REPLIES 7
KnarfB
Super User

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

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?

ShimiaoWang_0-1763706792335.png

 

AScha.3
Super User

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 ?

AScha3_0-1763709888772.png

 

 

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

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.

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

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.

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.

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.

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

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:

https://www.sitime.com/company/newsroom/articles/do-you-know-when-use-crystal-or-oscillator-wrong-answer-can-cost-you

 

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.