cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_RCCEx_GetPeriphCLKFreq() getting incorrect PLL1 values (H5)

vaa2ovr
Associate

Hello ST Community,

After running some tests on a board with an STM32H562 microcontroller and using an oscilloscope, I detected what might be a bug in the HAL. I was using the HAL function HAL_RCCEx_GetPeriphCLKFreq() to retrieve the clock frequency of a specific peripheral, in this case, SPI2 (whose clock source was PLL1Q). However, I was getting a value significantly different from the expected one.

After validating the clock tree through the IDE, I decided to measure the signal with an oscilloscope to better understand the issue. There, I observed the expected 125 MHz instead of the 140 MHz reported by the HAL function.

Do you have any idea what might be causing this?

2 REPLIES 2
Imen.D
ST Employee

Hello @vaa2ovr ,

Which CubeH5 version are you using ?

Please make sure to use the latest release STM32CubeH5 v1.4.0 as contains limitation fixes related to HAL_RCCEx_GetPLLxClockFreq.

From my side, I will check this with latest release and keep you updated.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
SofLit
ST Employee

Hello,

Could you please share your project?

Also how did you measure the frequency? on MCO pin?

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.