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 ]    [ Sitemap ]    [ ]

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

Latest News

Meet us at Embedded World. Hall 3A-525.

Hear from Richard Barry at Embedded World. Feb 28, 16:00, Hall 4-428.

Video: Watch James Gosling & Richard Barry at re:Invent, Las Vegas 2017.

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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