STack frame too large

I think my robit idea with vex just died…

I was trying to make an array 80 slots big, and as soon as I set it to 80(it was at 40), I get “Stack frame too large” on where I int it.

…is this the end of my robit?!

Reload DefaultCode to check Vex Controller

Move Array into EEPROM or make smaller.

I have very little experience with the Vex libraries and linker/loaders, but a stack frame is usually added/removed on each procedure call, so you might try declaring the array as global, which would probably allocate this memory from an area outside the stack. If you later need to pass a reference to the array, then only do so via a pointer.

Alternatively, this error could be a reference to running the stack, itself, out of space (poor message, if so) or it could refer to an artificial limitation in the size of a particular frame–either of which you might be able to change via compiler/linker/loader directives.

Sorry that I don’t have more specific advice.

Good call Bill!!!

“MPLAB C18 C Compiler User’s Guide” (DS51288j) on page 108 (page 116 of the PDF) it says:

1300: stack frame too large
The size of the stack frame has exceeded the maximum addressable size.
Commonly caused by too many local variables allocated as ‘auto’ storage
class in a single function.

Thanks guys, I owe you big time. Appreciate it. I’ll try the stuff tonight and I’ll let you know how it turns out.


I reviewed link quickly. Stack frame sizes and stack size are pretty small by default and have a limited ability to grow. That said, the memory management control is highly specific and builds upon that which is offered in ANSI C. If you read doc, you will find that you have several options available to you. Good luck.


Thanks for the link. I am new to Vex and have a young team that is struggling with their first-ever programming using EasyC. I think all the graphical additions are helpful, but I do wonder.

Seeing as we are not likely to stretch any boundaries, I have not bothered to explore exactly which pic is in microcontroller, nor have I sorted out the options available to program it, but I have noticed some VEX-specific function calls that do not appear to be documented. Are you aware of any documentation for this library or any other more-detailed documentation for EasyC? Thanks for your help.


what’s a robit?