I’m new on FreeRTOS and started with a own simple project to test mukltitasking.
Now i’ve got the first problem. In the code below i call vTaskDelay to wait 500ms before toggeling the output. But when I measure the frequency with scope, I can see, that the delay is arround 50us. It doesn’t matter which time is entered, I always get the same delay. Any suggestions?
The timertick works correct at 1ms. I’ve already changed the settings of portTICK_RATE_MS and it’s parameters to the right value.
That is not a user configurable value, please set it back to its default as it should be calculated automatically from the value of configTICK_RATE_HZ. Only the values in FreeRTOSConfig.h are user configurable. Note that portTICK_RATE_MS is only useful when configTICK_RATE_HZ is equal to or less than 1000.
The difference is always zero/one. So there is no delay by calling the vTaskDelay().
I also tried to call the function with different xDelay’s and watched the pin with scope. But there is no difference neither with 5 nor with 500. Togglefrequency of the pin is somewhere above 10kHz.
If an interrupt vector is used to yield a task (a yield is done inside vTaskDelay()), have you installed the interrupt handler correctly in the vector table? Maybe the handler is just using a default handler that does nothing but return right away. Have you tried stepping through the vTaskDelay() function to see what happens? It is not a long function.
Yes i already debugged the vTaskDelay but didn’t see anything unuasual (except it doesn’t wait ).
I use the internal PIT0 (programable interrupt timer) to generate the 1ms tick. This one i checked with the function vApplicationTickHook which works well.
So i’m confused that i have to configure a second int-vector?
Is it right that during PIT-int an new interrupt is set to change task after PIT-Int? Which function should be called with the second interrupt?