When using the MPU port of FreeRTOS and a task gets deleted (and INCLUDE_vTaskDelete == 1), prvCheckTasksWaitingTermination() invokes prvDeleteTCB() on the task TCB, which in turn unconditionally calls vPortFreeAligned( pxTCB->pxStack ), i.e. FreeRTOS always assumes the stack has been dynamically allocated. When using the MPU though, this is not true, as stacks MUST be statically allocated and properly aligned buffers. This causes the allocator (heap_4 in my case), for example, to lookup the heap block header immediately before pxTCB->pxStack and proceed as if pxTCB->pxStack had been allocated from the heap.