Hello All,
I am facing an issue with the xTaskDelayUntil API. My goal is to create tasks with execution frequencies of 5ms and 10ms using this API.
The problem I’m encountering is that when I run the code, the 5ms and 10ms counters increment properly. However, if I stop the code and rerun it, the counters no longer increment at all.
Even when I set a breakpoint inside the vTask1_handler, the counters remain stagnant. It’s important to note that the program is in the run state and not halting anywhere.
Upon breaking the execution of the program, I’ve observed that it halts at the following API: prvCheckTasksWaitingTermination().
For reference, the value of pxDelayedTaskList is 1, and pxDelayedTaskList = 2.
Below is the relevant code snippet:
xTaskCreate(vTask1_handler, "Task_1", configMINIMAL_STACK_SIZE, NULL, 2, &xTaskHandle1);
void vTask1_handler(void *params)
{
TickType_t xLastWakeTime;
const TickType_t xFrequency = pdMS_TO_TICKS(5);
xLastWakeTime = xTaskGetTickCount();
while (1)
{
// Wait for the next cycle.
xWasDelayed = xTaskDelayUntil(&xLastWakeTime, xFrequency);
FreeRtos_5ms_Counter++;
taskYIELD();
}
}
I appreciate any assistance in resolving this issue. Thank you!