2024-04-10 11:33 PM
How does STM32 dynamically allocate memory ?
Solved! Go to Solution.
2024-04-11 01:50 AM - edited 2024-04-11 02:09 AM
https://stackoverflow.com/questions/77829982/how-does-arm-none-eabi-gcc-9-2-implement-malloc-free
EDIT
You didn't state what compiler you're asking about.
The above relates to the GCC/ARM compiler, as used in the STM32CubeIDE, using the newlib library.
Other compilers & libraries are available; eg,
2024-04-11 01:50 AM - edited 2024-04-11 02:09 AM
https://stackoverflow.com/questions/77829982/how-does-arm-none-eabi-gcc-9-2-implement-malloc-free
EDIT
You didn't state what compiler you're asking about.
The above relates to the GCC/ARM compiler, as used in the STM32CubeIDE, using the newlib library.
Other compilers & libraries are available; eg,
2024-04-11 02:03 AM
It allocates memory from the heap. In the GNU/GCC sense this is from the top of the statics to the bottom of the stack via sbrk().
On Keil/IAR it would be a section of heap memory of defined size that the linker places after the statics.
2024-04-11 02:12 AM
From the title I understand: in which situation the dynamic allocation is used if no rtos is used, but in the text I understand something else. Need to be concise.
2024-04-12 08:49 PM
thanks