Hi,
I’m new with FreeRTOS and I do me first steps. I use the Xilinx ZCU102 eval board with a Zynq UltraScale+ 9EG FPGA.
I modified the Hello World Sample application and added a task which prints the task list and than I call the vTaskDelay. The task should be every second print out the task status list. So I set the delay to
The likely issue is that the tick rate is set wrong, likely because you have given the wrong processor clock rate.
You will need to look at the port code to see how it is setup, and what parameters need to be set for it, and compare that to what your FPGA configuration are using.
I found in portZynqUltraScale.c the following code:
/*
* The Xilinx implementation of generating run time task stats uses the same timer used for generating
* FreeRTOS ticks. In case user decides to generate run time stats the timer time out interval is changed
* as "configured tick rate * 10". The multiplying factor of 10 is hard coded for Xilinx FreeRTOS ports.
*/
#if (configGENERATE_RUN_TIME_STATS == 1)
XTtcPs_CalcIntervalFromFreq( &xTimerInstance, configTICK_RATE_HZ*10, &usInterval, &ucPrescale );
#else
XTtcPs_CalcIntervalFromFreq( &xTimerInstance, configTICK_RATE_HZ, &( usInterval ), &( ucPrescale ) );
#endif
and in port.c
/*
* The Xilinx implementation of generating run time task stats uses the same timer used for generating
* FreeRTOS ticks. In case user decides to generate run time stats the tick handler is called more
* frequently (10 times faster). The timer/tick handler uses logic to handle the same. It handles
* the FreeRTOS tick once per 10 interrupts.
* For handling generation of run time stats, it increments a pre-defined counter every time the
* interrupt handler executes.
*/
#if (configGENERATE_RUN_TIME_STATS == 1)
ulHighFrequencyTimerTicks++;
if (!(ulHighFrequencyTimerTicks % 10))
#endif
{
But it looks like that the delay timer and tick timer are running to fast.
1.- Have you seen your FreeRTOSConfig.h file? There you’ll see this constant:
#define configTICK_RATE_HZ ( 1000 )
that you should adapt to your needs.
2.- The constant portTICK_PERIOD_MS doesn’t work for frequencies greater than 1KHz (or tick periods faster than 1ms: 500us, 100us, etc); I learned it the hardway. Even if you use tick periods equal or greater than 1ms you should use the macro pdMS_TO_TICKS() instead:
I believe this comment answers it. When generating runtime stats the tick is called 10 times more. Are you generating runtime stats? If so, is it possible that this tick speed up is the cause of the behavior?
If you turn off runtime stats, does the delay behave as expected?