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] [May 2010 Threads] freertos (and atmega32) memory allocationPosted by zvonko on May 15, 2010 hi can anyone tell me where all the data is actually allocated/stored in ram, i.e. what goes where , for example , where are the variables created and initialised in task located in ram , do they end up in task stack area or what, is there a some sort of tutorial on this sort of thing ? what about variables created in main() ? what about system stack area etc.. please dont tell me to read compiler/linker manuals or read convoluted source code, :) im a beginner just trying to get a big picture before diving into detailed stuff. so links to explanations of these sort of questions related to freertos would be much appreciated.
thank you all
RE: freertos (and atmega32) memory allocationPosted by Richard Damon on May 15, 2010 It somewhat depends on the machine/compiler, but in general "static" and "global" variables, are allocated in one part of memory together, and "automatic" variables (those declared inside a function, including main or tasks), are allocated on the "stack:, For automatic variables in a task, or functions called by a task, these are stored in the task's stack, which depending on which version of "heap" you are using, will either be from an array in the static memory allocated in heap1.c or heap2.c, or if you are using heap3.c, will be within the program heap. Automatic variable from main, will be in the main stack (which will be what the compiler/linker will think is "stack".
I'm afraid that if you need more details, you are going to need to read the manuals. That is where the details will be described. Normally you don't really need to know about this sort of details though.
RE: freertos (and atmega32) memory allocationPosted by zvonko on May 15, 2010 hi richard thanks for your response
what about this main() stack, in relation to freertos, where is this stack actually located in ram, how do you recover this main() stack area if it is not used up completely (this is mentioned on freertos site somewhere). ?
i was just looking at ram memory with freertos running on atmega32 & two tasks with simulator software and noticed that an automatic variable , char *, i.e. pointer to string, initialised before task for loop is not within task stack area, but somwhere near the beginning of ram, i.e. i guess in the are reserved for global stuff ? maybe the pointer to string itself is within the task stack ?
how would you go about finding answers to these sort of detailed questions ? what compiler output files would tell me this information , im using avr-gcc ?
thanks
RE: freertos (and atmega32) memory allocationPosted by sotd on May 15, 2010 “how would you go about finding answers to these sort of detailed questions ?” Look at the linker script. You tell it where to put things, not the other way round.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|