2025-05-27 5:45 AM - edited 2025-05-27 5:52 AM
Hi everyone,
I'm having an issue with HSE bypass mode on the STM32G0B1RCT6 and hoping someone here has seen something similar.
The HSE randomly won't start in bypass mode. I've tried two different oscillators - the S2D8.000000B20F30T and an OT32258MJBA4SL that I pulled from a working STM32F405RGT6 board where it runs without any problems.
The behavior is inconsistent. Sometimes it starts up normally and then runs solid. Other times it just won't set the HSERDY flag. We've tried both toggling the NRST pin and resetting from code, but neither changes the state - if it's working, it stays working, and if it's not working, it stays not working. Only power cycling the entire board can change the state in either direction, sometimes making a non-working board work or making a working board stop working.
On the scope, the signal from the oscillator is always visually fine.
Any ideas or suggestions for debugging this would be helpful!
2025-06-02 12:56 AM - edited 2025-06-02 1:00 AM
This MCU has single VDD and VSS pins, VSS is just connected to the common ground directly. VBAT is currently floating.
We didn't tried measuring it directly at the pins, but the fact that it reproduces on multiple boards, including resoldered one with MCU from dev board, so we will check it, but we think this is not the issue.
Update: connecting VBAT to VDD make it works stable
2025-06-02 3:31 AM
> connecting VBAT to VDD make it works stable
Oh.
Maybe another effect of the VBAT brownout erratum? Although I don't see, how would HSE be related to the backup domain.
JW
2025-06-02 4:46 AM - edited 2025-06-02 4:48 AM
This actually makes us a bit confused because we didn't find any traces of this issue from other developers. HSE doesn't look like super rare thing to use, maybe many solutions just have VBAT connected to VDD by default, but anyway it's strange.
Btw, we tried to connect VBAT to VSS and it also won't help to make HSE start, to prevent it from floating. Other strange thing is how VDD rise time affects that (with floating VBAT), as we tested it's always start if we just connect it to already running power supply.
Also it doesn't look like this issue is closely related to erratum at least because we found how to stable reproduce both behaviours, when it starts or not, for instance it always depends just on VDD rise time, but erratum describes more constrained scenario that would be hard to reproduce by hand consistently.
2025-06-02 6:53 AM
Thanks for the detailed info.
I would like to ask you to do one more experiment: in the "failed" state, i.e. when HSE does not work, can you please read out content of RCC_BDCR register and post it.
Thanks,
JW
2025-06-02 7:25 AM - edited 2025-06-02 7:30 AM
Yes, sure, here it is
It actually stays the same when HSE is ok, changing VBAT leads to the same content of BDCR
2025-06-02 7:37 AM
OK I see, thanks.
JW
2025-06-02 7:37 AM
If you have any other ideas, I can check them. I have oscilloscope and waveform generator in addition to the previously mentioned 3-channel power supply.
2025-06-02 8:07 AM
At this point, no more ideas, sorry.
JW
2025-06-02 8:15 AM
Anyway, thank you for your suggestions, we already found many interesting cues with your help. We will play a bit more with what we have so far.
2025-06-02 9:37 AM
@flawless wrote:connecting VBAT to VDD make it works stable
AN5096: Getting started with STM32G0 Series hardware development does recommend that you should do that: