FreeRTOS – Wrong parameters passed to function vTaskDelayUntil

Target: PIC18F452 (same one used for demos) FreeRTOS version: V10.0.1 When calling the function: ~~~ void vTaskDelayUntil( TickTypet * const pxPreviousWakeTime, const TickTypet xTimeIncrement) ~~~ For ex: ~~~ vTaskDelayUntil( &xLastWakeTime, 1000); ~~~ Parameter xTimeIncrement is always being ZERO, thus the delay is not happening and the task runs as fast as possible. Any ideas? Thank you

FreeRTOS – Wrong parameters passed to function vTaskDelayUntil

I’m not sure I fully understand your post. Are you saying that xTimeIncrement is being passed into vTaskDelayUntil() correctly (in that you can set a break point inside the function as see it is passed in as a non-zero value) but the function is behaving as if the value was 0? Or are you saying when you look at the value inside vTaskDelayUntil() it genuinely is zero? If the first case then it might be that more than xTimeIncrement ticks have passed since pxPreviousWakeTime was updated, so you are effectively asking to block until a time that is already in the past, so the function doesn’t block at all. If the second then it could be simple a stack overflow or other such corruption.

FreeRTOS – Wrong parameters passed to function vTaskDelayUntil

FreeRTOS – Wrong parameters passed to function vTaskDelayUntil

In fact I have added a breakpoint inside the function. This is how I found out that xTimeIncrement param is always being ZERO no matter what’s the actual passed value – even at the very first call. There’s no overflow.

FreeRTOS – Wrong parameters passed to function vTaskDelayUntil

So the parameters is genuinely 0. As this is a function call, which is generated by your C compiler, there are very few ways that FreeRTOS can effect this. One way is for the stack pointer to be misaligned within a task – but I think on that hardware there are no specific stack alignment requirements.