I want to verify the system clock running frequency of STM32H7B3 MCU (It support up to 280MHz).
For example, If we configured SYSCLK is 256MHz in STM32CubeMx Software. How we can ensure the MCU is running at 256MHz clock speed.
uint32_t HAL_RCC_GetSysClockFreq(), by using this function call we can get SYSCLK frequency using register calculation. But, we can't to check the visual results like oscilloscope output.
I tried to measure the system clock by generating MCU clock signal from MCO1 GPIO pin. Normally, GPIO have some speed limitation. What is the maximum speed we can measure using this MCO1 pin?
Well the entire design is synchronous it shouldn't be hard to expose a measurable clock from any number of sources.
The MCOx pins typically the easiest and expose internal clock nodes, but obviously any of the TIM's would divide down an APB or peripheral clock, and the register can be decomposed/decoded.
There are ways of using a couple of TIM to measure LSE/LSI vs higher speed sources on most STM32. Review Reference Manuals
The RTC can also interrupt vs SysTick, Free-running TIM, or DWT CYCNT too.
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Sure, there are many. MCO is probably best though. Toggle a pin at an expected frequency, monitor it, and verify the observed frequency matches what is expected.
"If you feel a post has answered your question, please click ""Accept as Solution""."
Additionally it can be done with any timer with an output channel. Or a simple blinky based on SysTick and an oscilloscope, logic analyzer or anything to measure the period. Typically even a human eye is enough to determine the correct frequency with some +/-10% accuracy.