cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H757XIHx's M4 core SysClockFreq doesn't match CubeMX's settings.

ABrim.1
Associate

I have the M4 sysclk set to 200MHz, in the Clock Configration. HAL_RCC_GetSysClockFreq() on the M4 core returns 64MHz. This is being run on the STM32H757I-EVAL board. Any ideas on what I may have set wrong? The M7's sysclk is set to 400MHz and HAL_RCC_GetSysClockFreq() returns 400MHz, as expected.

2 REPLIES 2
TDK
Guru

If CPU1 is at 400MHz, it's impossible for CPU2 to be at 64 MHz. They are linked by a prescaler. How exactly are you verifying these?

64 MHz is the frequency used after reset. Likely the clock configuration failed during the run where you monitored it. In a typical run, the cores boot, the M4 goes to sleep and waits for the M7 to configure the clock, then the M4 wakes up again after it's done. Likely this sequence didn't happen correctly.

If you feel a post has answered your question, please click "Accept as Solution".
ABrim.1
Associate

Thanks for the response. When I debug the M7 (using IAR EWARM), HAL_RCC_GetSysClockFreq() returns 400MHz, as expected, although I did not verify the MCO. If I then debug the M4, the same call returns 64MHz. So there is something failing in the clock config, when I debug on the M4. This is code generated by CubeMX. Is there something I need to do to get the M4's clock configured correctly, while debugging? The M7 is flashed. I have not explored multi-core debugging in IAR. I also noticed that the M4 hangs, if I don't single step through the code that waits for the M7 to configure the clock. I'm sure this is where my problem is. I'm not sure how to proceed.