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] [February 2008 Threads] Reuse of IAR cstack and rstackPosted 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 rstackPosted 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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|