Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


FreeRTOS10 vTaskDelete clarify documentation

Posted by maxgerhardt on December 19, 2017


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().

FreeRTOS10 vTaskDelete clarify documentation

Posted by rtel on December 19, 2017

That is not just the case for deleting tasks though. Nothing can be deleted, so the same is true for queues, semaphores, stream buffers, event groups, etc. The page describing the memory schemes does say heap1 can only be used if your application doesn't delete anything: https://www.freertos.org/a00111.html#heap1 and having the assert there will hopefully alert people to the cause right away (stopping the debugger you should find yourself in the line that says there is no free() and objects cannot be deleted).

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner