2023-12-05 06:24 AM
TickType_t tickCount1, tickCount2;
while (1) {
tickCount1 = xTaskGetTickCount();
vTaskDelay(25);
tickCount2 = xTaskGetTickCount();
printf("[%ld] %lu ms have passed!\r\n",
tickCount2, (tickCount2-tickCount1));
}
[64887] 25 ms have passed!
[64912] 25 ms have passed!
[64937] 25 ms have passed!
[64962] 25 ms have passed!
[66087] 1125 ms have passed!
[66112] 25 ms have passed!
[66137] 25 ms have passed!
[66162] 25 ms have passed!
[66187] 25 ms have passed!
TickType_t tickCount = 0;
while (1) {
vTaskDelay(25);
tickCount += 25;
printf("[%ld] %lu ms have passed!\r\n",
xTaskGetTickCount(), tickCount);
}
Solved! Go to Solution.
2023-12-06 05:16 AM
There is no problem with FreeRTOS. I let myself become fooled.
If I move my test-code to a separate task with a high enough priority, I am unable to reproduce the problem.
2023-12-05 06:41 AM
Here was a similar problem I think: https://forums.freertos.org/t/1-tick-delayed-task-start-after-portsuppress-ticks-and-sleep/6498/19
2023-12-06 05:16 AM
There is no problem with FreeRTOS. I let myself become fooled.
If I move my test-code to a separate task with a high enough priority, I am unable to reproduce the problem.