Unwise default for FreeRTOS Timer Task Priority. ST Employees might want to read this.
Hi All,
With CMSIS V1 the default priority for the FreeRTOS Timer Task is set to 2. In CMSIS V1 that is the highest priority for a thread (low numbers = high priority). In CMSIS V2 the priority scheme was reversed (high numbers = high priority). However the default priority for the Timer Task remained at 2. That means the Timer Task is now the lowest priority thread in the system (excluding idle).
The job of the Timer Task is to unblock higher priority threads. So unless I'm wrong, using the current default priority of 2 effectively disables much of its preemption capabilities.
I discovered this when my highest priority thread could not preempt low priority threads. It sometimes took several seconds to wake up when there was high demand from the lower threads.
So I think for CMSIS V2 the FreeRTOS Timer Task priority setting should be (MAX_PRIORITIES - 1) not 2.
Note, the change can make the threads much more responsive, but also have an unforeseen impact if the design relies on a delayed response.
Cheers
David
