Should the task utilities be used as part as programming the software or are they only there for debugging and tracing?

sarahaka wrote on Saturday, October 19, 2019:

FreeRTOS provides some task utlitiles found here: https://www.freertos.org/a00021.html

Is it recommneded to use these as part of the project or are they only indeded for debugging. For instance, I use eTaskGetState to check the status of a task before suspending. I noticed when you suspend a task that does not exist some aspects of my program fail (for instance the FRAM lock is always busy).

Is this good practice ?

richard_damon wrote on Saturday, October 19, 2019:

You have to be doing something wrong to suspend a task that doesn’t exist. One requirement on all of those sorts of calls, is that you pass it a handle to the task to task you are manipulating, and that MUST be a valid handle (FreeRTOS, to remain efficient, does not scan the list of all tasks to verify that it is a valid handle). Passing an invalid handle can easily corrupt the system.

sarahaka wrote on Saturday, October 19, 2019:

I do indeed pass in a valid handle. The task was indeed created and suspended. However calling a second vTaskSuspend on the same handle causes bugs in the software.