2021-05-27 03:43 AM
Hello,
I am using STM32L011 MCU and STM32CubeIDE environment. After generating project with CubeMX and even deleting initializations in main function, 'Build analyzer' section shows that 76 % of RAM memory (of total 2KB) is used. What might consume so much memory?
Thanks.
2021-05-27 06:39 AM
You can look in the map file to find out what's in use. CubeMX isn't really built for chips with a super-low RAM amount.
You can build in Release mode to mitigate.
2021-05-27 06:42 AM
Actually, I was interested. Turns out 512 bytes is the default stack and 1024 bytes is the default heap.
You can adjust these in the linker script.
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
HAL only uses 48 bytes of RAM, way less than I expected.