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] [June 2010 Threads] Stack after vTaskDeletePosted by Bart on June 18, 2010 Hi,
I have a task that is called out by an ISR, when i press a button. This task creates another task. When i press the second button, ISR calls a third task that uses vTaskDelete to delete the second task.
Now before I create the second task, im checking available stack size by calling xPortGetFreeHeapSize(). I'm calling it again just after vTaskDelete deletes the second task. And the numbers don't match. Why is that? I thought all the memory should be freed after calling vTaskDelete. After few ISR's I'm getting a stack overflow. I'm using heap_2.c
RE: Stack after vTaskDeletePosted by Dave on June 18, 2010 “I have a task that is called out by an ISR, ” Do you mean unblocked by an ISR? I don't know what called out means. “ISR calls a third task that uses vTaskDelete to delete the second task. ” Again I don't really understand what you mean in this sentence. Tasks should not be called by an ISR so I suspect I just don't understand your terminology. “Now before I create the second task, im checking available stack size by calling xPortGetFreeHeapSize(). ” xPortGetFreeHeapSize() tells you the heap size, not the stack size. “I'm calling it again just after vTaskDelete deletes the second task. And the numbers don't match. Why is that? I thought all the memory should be freed after calling vTaskDelete. After few ISR's I'm getting a stack overflow. I'm using heap_2.c” When a task is deleted the heap memory that was allocated to the task is freed from inside the idle task (by default anyway). Therefore you would not expect the numbers to match until the idle task had executed at least one cycle.
RE: Stack after vTaskDeletePosted by Bart on June 21, 2010 Sorry, I meant 'unblocked by ISR'. The problem was the Idle Task - it was starved out of processing time. Everything works fine now, thanks.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|