maxgerhardt wrote on Tuesday, December 19, 2017:
Hi,
I think the documentation of vTaskDelete() (http://docs.aws.amazon.com/freertos-kernel/latest/ref/reference10.html) should be updated to clarify the following thing: Calling this function when using heap_1.c will result in a fatal RTOS error. Heap1 calls “assert( 0 )” when calling it’s (not-implemented) “vPortFree()” function.
The documentation says that “Only memory that is allocated to a task by the kernel itself is automatically freed when a task is deleted”, from which one may deduce that you have to use a heap which implements “free()”, but maybe you could put a more explicit note there. A sentence like "Take care that if you choose a FreeRTOS provided heap implementation, that you must a heap scheme which implements the free() operations. Using heap_1 will result in a crash when calling this function. " It cost me quite some time to figure out why firmware immediately crashes when call vTaskDelete().