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] [April 2007 Threads] Problems with vTaskDelete(NULL)Posted by the-moog on April 12, 2007 Hi,
I have two tasks that are mutually exclusive front ends for a piece of embedded software.
One of the tasks is initially created by another task.
When this new task receives a given command, it creates the other task and deletes itself.
When I do this the code seems to restart at the function being run at the time that the first task was deleted.
E.g.
Task 1 creats task 2, then idles Task 2 later receives a command which starts task 3, task 2 then kills itself with vTaskDelete(NULL). Task 3 later receives a command which starts task 2, task 3 then kills itself with vTaskDelete(NULL). But it seems that task 2 then immediately suspends or yields to the now dead task 3. The same function is called by task 1, 2 and 3 for creating and deleting tasks, 2 and 3 are created with the same priority. I can't trace what exactly happens as it happens inside the RTOS kernel which the debugger (insight/gdb) has problems with tracing. I thought perhaps task 2, when being re-created is resuming at the last function it was running when it was killed, which is the single task change function.
What other mechanisms can I use to trace the problem?
Using FreeRTOS v4.0.4 on an LPC/ARM7, is this a known problem? Will updating to a newer FreeRTOS solve it? (so far avoided this as it may cause a lot more work)
cheers, Jason.
RE: Problems with vTaskDelete(NULL)Posted by Richard on April 12, 2007 Sounds very odd, and not a known problem. I don't think anything in later versions will change anything in this area.
A couple of things to check:
1) Is the idle task being starved out (not getting any processing time)? The idle task performs some clean up of tasks that have been deleted.
2) Are you checking the return value of xTaskCreate()? It might be that the function is failing because of memory allocation problems.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|