enginayd wrote on Friday, July 03, 2009:
Actually this is quite the problem I’m having. FreeRTOS works as described, lower priority does not get any slice of the time unless all higher level tasks block.
I thought it would get a proportional slice of time according to its priority level, but it does not.
So I have a task (which is the main purpose of whole application btw) that needs to run as fast as possible. So I think I have two choices;
1) Delay the task;
Delaying task is in the resolution of SYSTICK interval, which is 1ms at the moment, and even that is said to be faster than necessary. 1ms delay for that task is inacceptable. So this option is not viable.
This looks like the perfect solution. It would request a context switch process others. But this doesn’t work as expected. Because I believe that in the context switch, FreeRTOS again choses highest priority task to run.
So what is the best way to build a task that consumes ALL available CPU time while don’t let other tasks to starve. Maybe suspend the high priority task, and then resume it from other tasks ?
Besides, I moved my watchdog petting in IDLE task, so that I’m sure that the system runs stable. If a starvation occur (idle never runs) that I reset the device, with the highest priority task turned off. So use can fix the problem. Is this a good idea ?