Skip to main content
Graduate II
May 27, 2025
Question

STM32G0B1RCT6 HSE Bypass Mode - Intermittent Startup Issues

  • May 27, 2025
  • 19 replies
  • 3778 views

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!

    This topic has been closed for replies.

    19 replies

    flawlessAuthor
    Graduate II
    June 2, 2025

    I'll answer because my colleague @Satty has issues login in, it says he's banned for some reason.
    @TDK @waclawek.jan We tried different BOR levels but it doesn't help. 
    We think this isn't solely a power supply issue. Connecting it directly to MCU's 3.3V rail didn't resolve the HSE startup problem. But in case of using wires to close the circuit instead of power supply channel output enable button, HSE starts reliably. This approach doesn't help if used on main power rail (12V) which implies that it actually is some kind of power timing issue.

    Super User
    June 2, 2025

    Make sure *all* VSS and VDD  (including VSSA/VDDA) pins are connected properly. Measure continuity directly at the pins (think of bad solder joints).

    How is VDDA connected? And what about VBAT?

    JW

    flawlessAuthor
    Graduate II
    June 2, 2025
     

    image.png
    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

    Super User
    June 2, 2025

    @flawless wrote:

    connecting VBAT to VDD make it works stable


    AN5096Getting started with STM32G0 Series hardware development does recommend that you should do that:

    AndrewNeil_0-1748882198838.png

     

     

    Super User
    June 2, 2025

    > 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

    flawlessAuthor
    Graduate II
    June 2, 2025

    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.

    Super User
    June 2, 2025

    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

    flawlessAuthor
    Graduate II
    June 2, 2025

    Yes, sure, here it isimage.pngimage2.png

    It actually stays the same when HSE is ok, changing VBAT leads to the same content of BDCR

    Super User
    June 2, 2025

    OK I see, thanks.

    JW

     

    Super User
    June 2, 2025

    At this point, no more ideas, sorry.

    JW

    flawlessAuthor
    Graduate II
    June 2, 2025

    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.

    Technical Moderator
    June 2, 2025

    Hi @flawless ,

    Please note that it is explicitly mentioned in the reference manual RM0444 that is is required to connect VBAT to VDD when no external battery is used:

    AmelNASRI_1-1748882936745.png

    Important to pay attention to this warning when this condition isn't respected and that may explain the behavior you see:

    AmelNASRI_2-1748883057524.png

    You have the same in the he AN5096Getting started with STM32G0 Series hardware development.

    -Amel

     

    June 2, 2025

    Yes thank you, but I read a few discussions where people say, you can leave VBAT floating in case you don't use anything from VBAT power domain. I just assumed, HSE isn't part of it, so it shouldn't affect it in any way. I hope, VBAT is the real reason behind HSE problems because it is somehow fixable. Though as I said, the fact that in case of battery discharge, HSE could just stop working is a bit worrying.

    Super User
    June 2, 2025

    @Sattys wrote:

    I read a few discussions where people say, you can leave VBAT floating in case you don't use anything from VBAT power domain. 


    Do you have (a) link(s) to any such thread(s) ?

     


    @Sattys wrote:

    the fact that in case of battery discharge, HSE could just stop working is a bit worrying.


    You should be able to fall-back to an internal oscillator in that case?

    Presumably, you'd want to detect low battery & act on that before it got to this stage?

    June 2, 2025

    To finally confirm described behavior we bought NUCLEO-G0B1RE board.
    We swapped board's MCU with one of our board's one to check all the possibilities. Also, we unsoldered NUCLEO board's SB26 bridge (it connects VBAT to VDD). Both MCUs were then programmed with same basic software that enables HSE & MCO to output HSE.

    Our board behaved exactly the same as was previously described.

    NUCLEO board was powered by Vin using 12V from my lab PSU. It also behaved exactly the same as our board: HSE didn't start without power cycling in a "special" manner.

    flawlessAuthor
    Graduate II
    June 3, 2025

    Hi everyone, just want to share a little update on what else we checked:

    LSE seems not affected by this and starts normally with floating VBAT
    We were unable to reproduce the original issue on F413ZH on Nucleo F413ZH desoldering the junction between VDD and VBAT and checking CR content with st-link - HSE always starting normally with floating VBAT