Quality RTOS & Embedded Software

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




Loading

Stack or Heap or something else

Posted by Torben on April 25, 2007
Hi!

I want to use a char[2000] in a task. Now I am wondering if I have to set the stack size or the heap size +2000, so there are no memory problems.

Another question: Is there a possibility to see the heap address?

Thx!

RE: Stack or Heap or something else

Posted by Richard on April 25, 2007
If you really need the array to be on the stack then the stack size will have to be increased to accommodate it. If only one task is going to access the array, or there is some sort of mutual exclusion mechanism to ensure consistent access, then the array can be declared static - which will prevent it being allocated on the stack.

Regards.

RE: Stack or Heap or something else

Posted by Torben on April 25, 2007
Thx for your answer. I am now using the array as a global array in a task which means it does not occupy stack or heap space, so everything should be fine.


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




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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

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

OpenRTOS and SafeRTOS