2024-02-01 12:58 AM
I now have two copies of basically identical code running in both MCUs. It was found that the two MCUs took different times to execute memset() of the same length.
Observe the running time by adding an IO flip before and after memset(). buffer is a global variable.
HAL_GPIO_WritePin(TEST_GPIO_Port, TEST_Pin, GPIO_PIN_RESET);
memset(buffer, 0, 256);
HAL_GPIO_WritePin(TEST_GPIO_Port, TEST_Pin, GPIO_PIN_SET);
lower is 6us, higher is 36us.(The loop runs with this value every time)
I can confirm that the frequency or settings of the two MCUs are consistent. And there are no operations like interrupts during running memset(). Micro used is STM32F746VGK. The library is libc_nano.a.
Any ideal? Is it related to memory alignment? thanks.
2024-02-01 04:05 AM
+1 Would also be agnostic to clock settings, say if HSE or PLL didn't start.
Would print out bus clock values as perceived by system, and DWT CYC counts over test function.