Quality RTOS & Embedded Software

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




Loading

Reuse of IAR cstack and rstack

Posted by BarberCol on February 13, 2008
Using IAR and a Atmega 645. The IAR needs space for a cstack and rstack for initialization. The return stack should be completely reusable and most of the cstack is free. I do not want to manually force data to these areas because this could lead to maintenance problems later. Is there a way for the compiler linker to automatically reuse this space?
Thanks

RE: Reuse of IAR cstack and rstack

Posted by sotd on February 13, 2008
No, but there are some hacks you can do.

You can make the idle task stack use the same memory to gain some there.

You can use the linker to allocate the main stack to an area that will get written over once the scheduler starts. If the main stack uses memory that is also used by a task stack then you must ensure that the start of the memory block where the first task context is written is kept clean but only that big.

You can allocate a very small stack, pvPortMalloc() some memory from the heap, point the stack to that so you get a stack big enough to create your tasks, then vPortFree() the memory again when the first task start running. This is probably the easiest.

Im talking GCC here not IAR but should be the same.


[ 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