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

4 REPLIES 4

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..
Ghofrane GSOURI
ST Employee

Hello @Nick Alexeev 

In order to change the _Min_Stack_Size and  _Min_Heap_Size  using GUI fields.

just go to  Project manager -->project 

GhofraneGSOURI_0-1734598597244.png

Unfortunately, for the meantime, there is a limitation in this option that has been tracked with internal ticket 197963

THX

Ghofrane

 

That doesn't answer the more general question about editing the .ld file.

How should that be managed - especially for things that are not provided in the MX GUI ?

An IDE bug is a serious matter.  Where are the details of the IDE bug published?  Post a link, please.