Welcome! Log In Create A New Profile

Advanced

Stack Overflow!

Posted by Mlogue9 
Stack Overflow!
November 14, 2021 04:23PM
OK I have been making little changes to the cfg files but none of the code! Too depressed to code. All of a sudden, really I just made a change regarding hardware retraction, and I get these prospective stack overflow errors and it won't compile. I tried reinstalling VSC and that has no effect, the VSC on my older machine has now grown a dislike for any #macro directive so that's out too. Of course I rolled back my changes, i tag each change with a version id.

c:/users/matt/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: region RAM overflowed with stack
collect2.exe: error: ld returned 1 exit status

Any clues how to resolve this? A stack overflow is rarley the effect of a config change, usually poor variable scope and mem mgmt.
Re: Stack Overflow!
November 14, 2021 04:49PM
The stack size is fixed and defined with the number of variables you create by turning on options.
There is no almost no memory management in a a microcomputer. (its not an operating system)

It is very much effected by changing the config.

Especially things like buffer sizes
Re: Stack Overflow!
November 14, 2021 05:47PM
I turned on one thing, and it occurs, in response I've shut down like 20 things and it still occurs. That's what I don't get.
Re: Stack Overflow!
November 14, 2021 06:01PM
Forgot to attach the cfgs
Attachments:
open | download - Configuration.h (113.2 KB)
open | download - Configuration_adv.h (170.7 KB)
Re: Stack Overflow!
November 14, 2021 07:39PM
You have

#define GCODE_MACROS
#if ENABLED(GCODE_MACROS)
#define GCODE_MACROS_SLOTS 10 // Up to 10 may be used
#define GCODE_MACROS_SLOT_SIZE 2048 // Maximum length of a single macro
#endif


so that 10 * 2k, ie 20k on a machine that only has 32k in total for everything.

Edited 1 time(s). Last edit at 11/14/2021 07:40PM by Dust.
Re: Stack Overflow!
November 14, 2021 07:57PM
Its not a stack overflow as such
It is the other memory variables using to much space that it over writes the area of memory the stack needs
Re: Stack Overflow!
November 15, 2021 07:51PM
Dust,

You hit it on the head. It is a something overflow and I cleared out the shit and dropped the macro size to 128B. I had long functions defined there. Now going to store those in the plugin gcode macros. I run it through the marlin gcode macros so I can turn them off or redefine them mid-print. Actually i could do that with the plugin too I suppose...

Thanks,
Matt
Sorry, only registered users may post in this forum.

Click here to login