I am doing an image processing application. I need to load the data into the stack memory. so the default size is fixed as 0x400. I increased the size of the stack memory yet the error comes as Internal error: space required for local variables exceeds maximum in _main. Help me out.
Which tool is generating this error, is it one of the code generation tools or CCS? Are you trying to load data from a file using probe points? Could you provide more information on how you are loading this data into memory - that might give us a better idea of why this message is appearing.
If a post answers your question please mark it with the "Verify Answer" button
Search the wikis for common questions: CGT, BIOS, CCSv3, CCSv4Track a known bug with SDOWP. Enter the bug id in the "Find Record ID" box
The actual error message is "INTERNAL ERROR: Space required for local variables exceeds maximum in _main". (Capitalization matters here; when reporting an error, please be sure to cut and paste the exact error message instead of re-typing it.)
This comes from the compiler when a function's frame (the space for local variables in one function) is too big. Only C2000, C5500, and MSP430 have this error message, and since the
name of the function starts with an underscore, it is not coming from MSP430. The
limit for C2000 is 0xffff 16-bit words, and the limit for C5500 is
0x7ffff 16-bit words.
The only solution is to reduce the number or size of variables on the stack, probably by moving them to static scope (global variables) or by using dynamic allocation (malloc).
I am using TMS320F28335 ans simulating on CCS3.3. In code i used around three 2-D arrays of size 160*120. while compiling the code itself it popped the error. so i dint yet loaded any data into memory. It gives a stack space error as it has no memory to provide space to local variables. The local variables has to be stored on stack as it specified, but stack has a memory of 0x400 only. so, now how can i use external memory as stack.
You will not be able to solve the problem just by increasing the total size of the stack, because the 0xffff limit is for one stack frame.
Each function instance gets its own stack frame every time it is called. Stack frames are allocated (in LIFO fashion) in the memory area called the stack. See http://en.wikipedia.org/wiki/Call_stack
When you adjust the total size of the stack, you are adjusting the size of the memory area. That option does not affect how large an individual function stack frame can be.
One of those arrays is 160 * 120 = 19200 words (0x4b00 in hex). Therefore, you will never be able to have more than two of those arrays as local variables. Change one of them to be "static".
I'm not very familiar with C2000, but I suspect you may need to consider using a large memory model. Still, the maximum size of a stack frame is the same in large model.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.