I am working with a (ARTERY) Cortex M4 MCU with a clock set at 288 MHz.
The problem I am having is the FreeRTOS clock is kind of running too fast.
Example: vTaskDelay( 1000 / portTICK_RATE_MS ) delay last milliseconds and not 1 second as it’s supposed to be.
I guess there is something should be set that I am missing; but I’m a newbie and cannot figure it out.
Any help would be greatly appreciated.
Are you using SysTick or some other timer to drive FreeRTOS tick? Have you defined
configTICK_RATE_HZ correctly in your FreeRTOSConfig.h?
When I google “artery cortex m4”, I find an MCU that runs at 96 MHz. Aren’t you overclocking the part?
No way, it is the AT32F435ZMT7
I had this setting in the FreeRTOSConfig.h header:
#if defined(ICCARM) || defined(__CC_ARM) || defined(GNUC)
extern uint32_t SystemCoreClock;
#define configCPU_CLOCK_HZ ( SystemCoreClock )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
Now I have, for testing purposes, replaced (SystemCoreClock) with the value of the clock: 288000000 and it started working as expected.
I guess SystemCoreClock was not providing the real clock value.
This variable is usually updated by the startup code. You can search for the function where it is updated and try to see why it is not called.
I’ll do, thank you very much