cancel
Showing results for 
Search instead for 
Did you mean: 

Should stack and heap size in LinkerScript.ld be edited directly, or through the STM32cubeIDE GUI ?

Nick Alexeev
Associate III

Folks,

I’m grappling with what looks like a low level bug** , and the root cause could be running out of stack space.  At the same time, I’ve got plenty of unused RAM, so I’d like to increase the stack size as a diagnostic measure, and see if the bug goes away*** . In the CubeIDE user guide (UM2906) there’s a mention that heap and stack size are set in the LinkerScript.ld (comments in the code on p. 69).

If I want to change the _Min_Stack_Size , should I edit the LinkerScript.ld file directly?

Or is the LinkerScript.ld file (re)generated by the IDE, and I should make the change through the IDE GUI?
If so then where are these settings? 
I couldn't figure it out from the UM2906.  I saw hints that CubeMX had GUI fields settings for stack and heap.

 

** Can post the details of the bug if anyone’s interested.

*** Don’t know if that’s the right long-term solution. I could also try to declare fewer string buffers on the stack.

 

Best regards,

- Nick

1 REPLY 1

I understand the dilemma, the .LD impacts what the Linker actually builds, but ST for years has nailed the GNU/GCC stack to Top-of-Ram directly via _estack

And then used SP to provide a heap ceiling for _sbrk, ie from end-of-statics to base-of-stack

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..