Subscribe

Task Stack allocation problem

  1. 2012-04-16 01:58:27 PDT
    Hello, According to documentation individual task stacks are allocated from the Total Heap size we will be define and allocate in FreeRTOSConfig.h. Is there any possibility, of the addition of all individual task stacks exceeding the amount of total heap allocation? Thank you.
  2. 2012-04-16 02:12:53 PDT
    Is there any possibility, of the addition of all individual task stacks exceeding the amount of total heap allocation? Naturally, yes, there is a limited amount of RAM and a user can attempt to create an infinite amount of tasks. heap_1.c and heap_2.c both have a function xPortGetFreeHeapSize() that allows you to query the stack remaining. heap_3.c uses malloc() and free() so FreeRTOS itself cannot obtain the free space. There is also a malloc failed hook function that can be defined that will be called when an allocation fails. Regards.
  3. 2012-04-16 02:13:57 PDT
    Further, Can anybody explain how does the allocated Total Heap size is being used? Are there any documentation to follow up? Thank you.
  4. 2012-04-16 02:21:23 PDT
    Sorry - I'm not sure I fully understand your question. Have you seen this page: http://www.freertos.org/a00111.html Regards.
  5. 2012-04-16 05:13:36 PDT
    anuradha123, The total heap size parameter is used in heap_1 and heap_2 to define the size of the heap to be created. For heap_3 you need to use the method provided by your compiler/linker to set this, and the parameter in FreeRTOS is ignored.
  6. 2012-04-17 20:15:01 PDT
    All, Thanks for the replies. But I still did not get any answer to my original question, Further, Can anybody explain how does the allocated Total Heap size is being used? Are there any documentation to follow up? Information provided in FreeRTOS site and manual are inadequate. I am in interested of finding out, in detail how the task stack is being used. Thank you.
  7. 2012-04-17 23:35:35 PDT
    Forgive us, but your question was not clear. Each task has its own stack, that is used by the compiler to store things like function call return addresses and local variables. There is nothing different about the stack used by a task than any other stack - for example the stack allocated by the linker for use by the main() function. Regards.
  8. 2013-01-27 13:18:20 PST
    There is nothing different about the stack used by a task than any other stack - for example the stack allocated by the linker for use by the main() function. Does this means that each task behaves like main (in terms stack uses) that particular task stack also caters the requirement of nested function calls etc. Can we get a pictorial depiction of this, some book or online references ?
Jump To:
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.