Yes, calling vTaskDelete() stops the task from being scheduled to run again but doesn't free all the associated resources. The task's resources aren't fully released until after the FreeRTOS idle task has a chance to run and "clean up" the task. This is part of the FreeRTOS design.RobMeades wrote: ↑Mon Dec 02, 2019 5:40 pmA possible answer (still testing): allow the idle task to run. If I put a vTaskDelay() of 100 ms after deleting my "LED" task then, so far at least, the problem does not occur. Is it possible that FreeRTOS is getting confused when the task is created once more after it has been deleted if FreeRTOS is not allowed to do some form of clean-up first?
As you're using static resources, if the vTaskStaticCreate() is run before the idle task has cleaned up, there's a high chance of a problem.