I am using FreeRTOS v10.0.1 and I am experiencing some issues with FreeRTOS timers expiring earlier than expected when configUSE_TICKLESS_IDLE == 1.
The problems started occurring when I applied fix in vTaskStepTick() proposed in topic: “Assert in tasks.c: 2611 on xTickCount wrap around” in this forum.
as I was experiencing the same issue with assert on xTickCount wrap around.
Also, applying the second solution proposed in that topic (fix in generic FreeRTOS code) cause the same problem.
I assume that the best solution for me would be fixing the original problem described in this post: “Assert in tasks.c: 2611 on xTickCount wrap around” in a way that does not cause FreeRTOS timers to fire earlier than expected.
The test I performed was setting a single shot timer starting itself for 20ms.
The results was:
- 19,5ms to 20,5ms for configUSE_TICKLESS_IDLE == 0
- mostly 19,5ms to 20,5ms, but sometimes 16,5ms, 17,5ms, 18,5ms, 21,5ms, 22,5ms for configUSE_TICKLESS_IDLE == 1
- mostly 19,5ms to 20,5ms, but sometimes 21,5ms or 22,5ms for configUSE_TICKLESS_IDLE == 1 and reverted fix in vTaskStepTick()
The conclusion is that tickless idle enabled have bigger jitter than disabled, however only in pair with the proposed fix, it causes timers to fire earlier than expected.
So is there any solution that fixes the original problem with assert on xTickCount wrap around that will not cause timers to expire too early?