ST 32f429I-Discovery wrong delay timing

fabio-it wrote on Friday, January 16, 2015:

Hi guys, I’m trying to use freeRTOS 8.1.2 with the aforementioned board but till now I only have bad timings. I’ve attached my current configuration for freeRTOS

any idea?

edwards3 wrote on Friday, January 16, 2015:

#define configCPU_CLOCK_HZ ( SystemCoreClock )

Are you setting SystemCoreClock anywhere? To do that you normally call SystemCoreClockUpdate.

fabio-it wrote on Friday, January 16, 2015:

Yes, I’ve checked and it correctly returns 180000000 (180MHz). I’m using the Standard Peripheral Driver from ST website, no problem at all with STM32F407 cpu

edwards3 wrote on Friday, January 16, 2015:

Is SystemCoreClockUpdate() setting up the clock, or just setting SystemCoreClock to 180000000. If it is not setting up the clock does anything set up the clock. Maybe it is done before main() is called.

My guess is the clock is not actually running at 180000000.

fabio-it wrote on Friday, January 16, 2015:

SystemCoreClock is 168000000 at default, after initialization becames 180000000. I’m really stuck in this, seems like if the clock is about 4 times slower. I was wondering, on which clock the tick frequency is calculated? Could it be a PCLK1 or PCLK2?

fabio-it wrote on Friday, January 16, 2015:

Solved, the default main clock, as you said, was different. FIXED

Thanks a lot