cancel
Showing results for 
Search instead for 
Did you mean: 

Making sense of memory space and ''no space in execution'' - STM32F401RC

shubham
Associate
Posted on August 12, 2016 at 09:36

I'm working with an STM32F401RC which should have 256kB flash, and 64kB RAM. However I seem to be running into memory issues well below that limit.

In my code I'm declaring 9 total float arrays of size 2x700 which should take up 9*2*700*4B = 50kB.

float32_t cosSinHammF0[2][700]; //Index 0 for cos, 1 for sin
float32_t cosSinHammF1[2][700]; //Index 0 for cos, 1 for sin
float32_t cosSinHammF2[2][700]; //Index 0 for cos, 1 for sin
float32_t cosSinHammF3[2][700]; //Index 0 for cos, 1 for sin
float32_t cosSinHammF4[2][700]; //Index 0 for cos, 1 for sin
float32_t cosSinHammF5[2][700]; //Index 0 for cos, 1 for sin
float32_t cosSinHammF6[2][700]; //Index 0 for cos, 1 for sin
float32_t cosSinHammF7[2][700]; //Index 0 for cos, 1 for sin
float32_t cosSinHammF8[2][700]; //Index 0 for cos, 1 for sin

Compiling gives following errors:

.\Targets\STM32F401_Discovery\project.axf: Error: L6406E: No space in execution regions with .ANY selector matching usart.o(.data).
.\Targets\STM32F401_Discovery\project.axf: Error: L6407E: Sections of aggregate size 0x18c64 bytes could not fit into .ANY selector(s).
Not enough information to list image symbols.
Not enough information to list the image map.
Finished: 2 information, 0 warning and 17 error messages.
''.\Targets\STM32F401_Discovery\project.axf'' - 17 Error(s), 1 Warning(s).

Looks it can't find space for 0x18c64 bytes (~100kB). In my target settings, I have set ROM start [size] to0x8000000 [0x40000], or ~256kB RAM set to0x2000000 [0x10000], or 64KB Anyone know what is going on? When I change my float arrays to 2x100, it compiles successfully with the following numbers:

Program Size: Code=26204 RO-data=1284 RW-data=172 ZI-data=58108

Which also doesn't make sense because those numbers don;t add up to 256k? Please help! #stm32f4 #flash-memory #ram #rom
1 REPLY 1
Posted on August 12, 2016 at 14:21

So it would seem you have a lot of other memory being used elsewhere. Suggest you look at the .MAP file to understand where.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..