2013-12-09 09:34 PM
I have a STM32429I-EVAL board, initialized it and made it work, but I am not sure if the processor speed is up to max. The function RCC_GetClocksFreq returns 180 MHz, but cannot trust its return.
I did a loop to toggle LED1 and the max speed of toggle is 4 MHz. while(1) { STM_EVAL_LEDToggle(LED1); } This 4 MHz seems too low to me, I don't think the processor spends 45 cycles to toggle the led. Is there a more precise way to measure the speed?2013-12-09 09:56 PM
Use a TIMx_CHx pin of known ratio, or one of the MCOx pins?
2013-12-10 12:48 AM
RCC_GetClocksFreq header note:
* @note The system frequency computed by this function is not the real * frequency in the chip. It is calculated based on the predefined * constant and the selected clock source: You must define the correct HSE_VALUE (if external clock is used) Add the compiler symblo define HSE_VALUE=*clockvalue* Example for 8MHz clock HSE_VALUE= (8000000) Check also PLL_M and PLL_N constants in system_stm32f4xx.c file Default value for PLL_M and PLL_Nobtain max HCLK frrequency but with HSE_VALUE = 25MHz You must change PLL_M and PLL_N values to obtain correct PLL frequency (must be between 190...400MHz) HCLK is PLL freq/PLL_P value PLL_P minimum value 2 --> HCLK max value is half of PLL frequency