Skip to main content
Explorer
November 29, 2024
Question

HAL_RCCEx_GetPeriphCLKFreq() getting incorrect PLL1 values (H5)

  • November 29, 2024
  • 2 replies
  • 538 views

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?

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    November 29, 2024

    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.

    Technical Moderator
    November 29, 2024

    Hello,

    Could you please share your project?

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