This board drives me crazy:
I see in schematics, MCU gets external clock as 27 MHz. I think I saw also in code that HSE_VALUE is/was set to 27000000.
So, if you use Arduino code which assumes XTAL frequency is 27 MHz - you might get a result as 480 MHz (nominal) MCU core clock. But it is NOT correct: your MCU might run slower, e.g. just with 450 MHz.
I can confirm: My board has external MCU clock as 25 MHz (not 27 MHz).
And changing code to:
/* Make sure that HSE_VALUE is set properly - it looks like Portenta H7 uses a 25 MHz XTAL, not 27 MHz as shown in schematics! */
#if HSE_VALUE == 25000000
RCC_OscInitStruct.PLL.PLLM = 5;
if (lowspeed) {
RCC_OscInitStruct.PLL.PLLN = 40;
}
else {
RCC_OscInitStruct.PLL.PLLN = 192; //192 = 480 MHz - with a 25 MHz XTAL!
}
#endif
sets the clock correctly.
I could confirm via SPI2 PLL clock config: it makes only sense when 25 MHz is there. Now my SPI clock speed is correct with the expected speed (but not with assuming 27 MHz).
Here is a modified file "system_clock_override.c":
system_clock_override.c (11.1 KB)