FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [November 2012 Threads] Task CleanupPosted by Jason on November 2, 2012 I am trying to understand what happens to a task when it returns (ends). The majority of my tasks are perpetual but I have a few that are 'one shot' tasks meaning they may do something, delay, do some more things then return. I noticed the following in one of the demo projects... #define INCLUDE_vTaskCleanUpResources0 ... but I can't find this documented anywhere. Will the idle task clean up the resources used by the task that returns? Does it depend on the option above?
RE: Task CleanupPosted by Dave on November 2, 2012 According to http://www.freertos.org/History.txt vTaskCleanUpResources was obsolete and finally removed in V7.0.2.
A task must never return, but can be deleted, so if you want a task to "return" then add vTaskDelay(NULL) to the end of the function that implements it.
When you delete a task the TCB and stack will be freed by the idle task. The stack and TCB were allocated by FreeRTOS so it is right that they are also freed by FreeRTOS. FreeRTOS will not free any memory that the application allocated itself though, that must be cleaned manually.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|