I’ve been trying to find a way to disable interrupts (for all tasks given any priority) when a certain task is running.
Here’s what’s happening -
-
The desired task runs within the critical section context (using
vPortEnterCritical
) but is preempted by the systick handler in the middle of execution. -
This causes some unwanted deadlocks further due to other threads waiting for this resource.
I’m running a small experiment on the posix blinky (modified to my requirements) and have added instrumentation to all the kernel functions (which also includes the idleTask
). The systick preemption happens when my instrumented code is called from inside the idleTask
. What can be a simple workaround for this?