The vTaskList() and vTaskGetRunTimeStats() can be enhanced to not use pcStatsString at all, which will reduce RAM footprint by 100 bytes. The execution speed will also benefit.
Instead of sprintf() and strcat(), we can use this:
sprintf(vBuff + strlen(vBuff), “%s …”, taskName);
This way, sprintf will append to vBuff rather than using sprintf and strcat().
I’ve also enhanced the vTaskGetRunTimeStats() by adding vTaskResetRunTimeStats(). Without resetting the run time counters, it is difficult to see CPU utilization of recent activity. This change is really trivial, which is to reset Task counters, ulRunTimeCounter, and have a Portable function to reset the hardware timer.
Let me know if you’d like me to post code. I’ve got a working/tested version that also follows your coding standards.