Skip to main content
LCE
Principal II
July 3, 2024
Solved

H733: MCO output active without GPIO init

  • July 3, 2024
  • 9 replies
  • 2771 views

Heyho,

so I was just checking the MCO1 output of my STM32H733ZGT6 and found some super jittery 64 MHz with full swing between 0V and 3.3V.

Then checked my code and found that I had not set the RCC->CFGR and not even initialized the GPIO.

When I actually set it up it does what it should, but why is there such an output signal without the GPIO having been configured?
This could be some serious EMI source or cause some other trouble if the GPIO is not yet configured, but connected elsewhere (I only have a serial R and a testpoint on my PCB).

Best answer by LCE

I was just about to check the GPIO, when I found one of the most embarrassing mistakes I made (here): 

The bootloader (which is active for only a few ms) had the MCO configured. Ouch.

Sorry that I have wasted your time! :frowning_face:

9 replies

LCE
LCEAuthor
Principal II
July 3, 2024

Now I put the GPIO init before any RCC / clock setup, setting the MCO pin to input with pull-up without any alternate function.

After power-up I still see this crappy 64 MHz (HSI) on that pin shortly - which makes sense, but is still terrible.

What's wrong here?

LCE
LCEAuthor
Principal II
July 4, 2024

That a known issue, or what am I doing wrong?

ST please comment! 

@Peter BENSCH maybe?

LCE
LCEAuthor
Principal II
July 8, 2024

Nothing from ST? :frowning_face:

AScha.3
Super User
July 8, 2024

Hi,

is this mco1 signal there, if holding reset ? (no program started at all)

I have a H733ZI here, so this i could try...if you want.

"If you feel a post has answered your question, please click ""Accept as Solution""."
LCE
LCEAuthor
Principal II
July 8, 2024

Hello @AScha.3 ,

thanks for your help.

It's actually occurring here if reset is released, the GPIO is not configured, and has no load.

So if you can find the time you could just grab a scope and check if you see anything on that pin.

It's a STM32H733ZGT6 in LQFP-144, pin 100 = PA8.

I just checked on my H723 Nucleono signal / clock on the H723-Nucleo MCO pin. As it should be.

AScha.3
Super User
July 8, 2024

Now -- found :  STM32H733ZGT6 , rev. Z ; boot0 : low : nothing on PA8 on power up .

DSO on single shot, just finds a small "pump" , about 1V, at power connection - nothing else.

btw. PA8 is configured as output in program.

Whats your H733 doing, if set it as output, low ?

ed

update : PA8 not configured, unused. power-up : nothing to see.

"If you feel a post has answered your question, please click ""Accept as Solution""."
waclawek.jan
Super User
July 8, 2024

Then checked my code and found that I had not set the RCC->CFGR and not even initialized the GPIO.

And what's the content of those registers, when the oscillations are ongoing? 

JW

LCE
LCEAuthor
Principal II
July 9, 2024

It doesn't actually matter how the registers are configured, at least I haven't found some "MCO off" bit, there's only the source selection (default HSI  = 64MHz) and divider settings (1 = default).

At least I would have expected the same behavior on the H723 Nucleo in the same package (and 99% same source code).

@AScha.3 thanks for testing!

unconfigured GPIO: full 64 MHz (HSI)

configured GPIO (no matter in or out): nothing

So it's only a little bit of noise at start-up until the GPIO is configured - which is still something I don't like!

AScha.3
Super User
July 9, 2024

So there remains only : (because "my" H733ZG shows nothing strange) chip version ..? rev. Z here.

"If you feel a post has answered your question, please click ""Accept as Solution""."
waclawek.jan
Super User
July 9, 2024

> It doesn't actually matter how the registers are configured, at least I haven't found some "MCO off" bit, there's only the source selection (default HSI = 64MHz) and divider settings (1 = default).

 

Just read them out (both RCC_CFGR and GPIO registers) and post.

JW

LCE
LCEAuthor
Principal II
July 9, 2024

Hmm, I can only read RCC_CFGR = 0, GPIO clock is not even enabled...

waclawek.jan
Super User
July 9, 2024

> GPIO clock is not even enabled...

And if you enable it, what are the GPIO registers' values?

---

Yes, I do have a suspicion, that this is consequence of a bootloader, either default or your own. Either one might have set various registers and then incompletely restored them.

JW

 

LCE
LCEAuthorBest answer
Principal II
July 9, 2024

I was just about to check the GPIO, when I found one of the most embarrassing mistakes I made (here): 

The bootloader (which is active for only a few ms) had the MCO configured. Ouch.

Sorry that I have wasted your time! :frowning_face: