I have an application running on a dsPIC33F that has 3 tasks :
Task A priority tskIDLE_PRIORITY + 1
Task B priority tskIDLE_PRIORITY + 2
Task C priority tskIDLE_PRIORITY + 3
Task C performs a short piece of code, then deletes itself.
Only tasks A and B remain then.
Task A is a loop timed with a vTaskDelayUntil, which execute once every second.
Task B is a loop controlled by a
vTaskSuspend( NULL ) ;
it is awaken by an interrupt service routine, with a priority equal to that of the kernel, which calls xTaskResumeFromISR when data is available.
If I configure the project to be in cooperative mode, it works correctly.
If I use the preemptive mode, tasks C and A execute once each, and task B executes twice, then all is frozen.
The kernel runs forever without returning to any task.
I had a look at the code, and found that the execution went throug xTaskIncrementTick forever, without switching any task. If I understand correctly, this function only handles the time slicing of tasks of tskIDLE_PRIORITY. Since my tasks have both higher priorities, they are not considered in this function and their execution is frozen.
I suppose that sometime before, a call to portYield has been missed?
Please advise me.