Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

Task Stack allocation problem

Posted by Anuradha on April 16, 2012
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.


RE: Task Stack allocation problem

Posted by Richard on April 16, 2012
“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.

RE: Task Stack allocation problem

Posted by Anuradha on April 16, 2012
Further, Can anybody explain how does the allocated Total Heap size is being used?

Are there any documentation to follow up?

Thank you.

RE: Task Stack allocation problem

Posted by Richard on April 16, 2012
Sorry - I'm not sure I fully understand your question. Have you seen this page:
http://www.freertos.org/a00111.html

Regards.

RE: Task Stack allocation problem

Posted by Richard Damon on April 16, 2012
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.

RE: Task Stack allocation problem

Posted by Anuradha on April 18, 2012
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.

RE: Task Stack allocation problem

Posted by Richard on April 18, 2012
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.

RE: Task Stack allocation problem

Posted by dev on January 27, 2013
“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 ?

RE: Task Stack allocation problem

Posted by MEdwards on January 27, 2013
http://sourceforge.net/projects/freertos/forums/forum/382005/topic/6687087


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists