Report
1 year, 8 months ago.

Setting heap and stack size for ST MCU

Does anyone know how to change the heap and stack size for the ST MCUs within MBED? When using the standard peripheral Libraries or the HAL Libraries, you could change it in the stm startup file, but there's no sign of the file within the MBED stuff.

I've just come across this section in my linker script. Maybe I need to use of the HeapLimit somehow?

  • It defines following symbols, which code can use without definition:
  • exidx_start
  • exidx_end
  • etext
  • data_start
  • preinit_array_start
  • preinit_array_end
  • init_array_start
  • init_array_end
  • fini_array_start
  • fini_array_end
  • data_end
  • bss_start
  • bss_end
  • end
  • end
  • HeapLimit
  • StackLimit
  • StackTop
  • stack
  • _estack
  • /
posted by Joshua Cowpland 30 Nov 2017
Comment on this question

1 Answer

1 year, 8 months ago.

The heap size is dynamic with ARM/GCC compilers. It is hard coded in startup files for IAR.

As for stack size, please see this document - https://os.mbed.com/docs/v5.6/reference/configuration.html

What's the best way to make use of the configuration stuff when writing code in an external IDE (in my case CoIDE?)

posted by Joshua Cowpland 05 Dec 2017

You would make the configuration file then run "mbed export." Here is the documentation for exporting - https://os.mbed.com/docs/v5.6/tools/exporting.html. Just be aware that if you change the configuration file, you'll need to run export again to get the new symbols.

posted by mbed official 05 Dec 2017