Additonally, open CubeMX (Double-click the blue .ioc file), try reducing the heap and stack sizes under "Project Manager".
Today my messages are getting flooded with [ size] tags automatically, what's wrong with the forum?
Try to find what's using the ram, temporary edit the linker script (STM23xxxx_FLASH.ld) and modify the RAM size.
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 2KPut 16K for example. Will compile now, and you'll be able to see everything in the Build Analyzer section.
Go to Memory Details, RAM and find out what's using so much.
(Of course, programming that will simply not work)
Once you fix it and get under the 2K limit, put the original size back.
To have an idea of the stack size, open The Static Stack Analyzer window.
Under Call graph, you'll find the worst case scenario (Where a function allocates stack, calls another function, allocates more stack and so on).
Ensure the reserved stack setting in CubeMX meets this, so if you have 400bytes there, you'll be fine with 0x1C0 bytes in CubeMX (448bytes).
Of course, that will change as your code grows, so give it some margin, ex. 0x200 (512bytes).
As you get close to the final code, you might tighten it down.
The heap size is a different thing, that's for the dynamic allocation (malloc and such), often used by some CubeMX functions like the USB library to allocate the buffers.
You can find out the allocated memory with this code
#include <malloc.h>
uint32_t getHeapUsage(void){
return mallinfo().uordblks;
}
Calling getHeapUsage() would return the Heap usage in bytes.
You can call this after HAL initialization.
Can't help further without seeing some code, you might be declaring large arrays, or using the wrong word size for them, can't really tell![/code]