2025-07-31 1:45 AM
Dear friends,
I am playing around with NUCLEO-H745ZI-Q.
I generated example motor control project from en.X-CUBE-MCSDK-FUL_6.4.0 for CubeIDE v.1.18.1.
This example project utilizes CM4 core.
Clock frequency for CM7 core can be twice higher than the clock frequency for CM4.
Therefore, I believed that CM7 core can run code twice faster than the CM4.
I use GPIO Output to measure code execution time on the oscilloscope.
To estimate completion time, I use a code in a while() like this:
HAL_GPIO_TogglePin(GPIOK, GPIO_PIN_0);
Ialphabeta = MCM_Clarke(Iab);
HAL_GPIO_TogglePin(GPIOK, GPIO_PIN_0);
HAL_Delay(100);
I/O pin is in “Very High Speed Mode”.
So, running it on CM4 @240 MHz, I get:
- 630 ns without optimization;
- 230 ns with FAST optimization;
Surprisingly, after migrating code on CM7@480 MHz, I get worse results:
- 850 ns without optimization;
- 470 ns with FAST optimization;
Could you please help me understand how is it possible? Why could the code run so much slower on a core with the clock frequency twice higher?
Best regards, wwknoww.
Solved! Go to Solution.
2025-07-31 6:24 AM
I found a reason for such behavior in disabled ICash and DCash for CM7.
With cash enabled the code works nearly twice faster on CM7 than on CM4.
2025-07-31 6:24 AM
I found a reason for such behavior in disabled ICash and DCash for CM7.
With cash enabled the code works nearly twice faster on CM7 than on CM4.