cancel
Showing results for 
Search instead for 
Did you mean: 

Questions about SystemClock_Config() generated by cubeMX

Kefei Yao
Associate III
Posted on April 12, 2018 at 08:23

The SystemClock_Config() function is generated by cubeMX in main.c. It configure the different clocks used by the system. The question is that it handles the systick timer count in this way:

HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);

It just divides the Hclk frequency by 1000 (assume the system timer clock is provided by HCLK). This result in 1ms tick regardless the actual value of systick set in the freeRTOS configuration in freeRTOSConfig.h. I assume something like 

HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/configTICK_RATE_HZ);

should be used.

0 REPLIES 0