cancel
Showing results for 
Search instead for 
Did you mean: 

How to persuade linker not to copy const data arrays from flash into RAM at startup

herbert
Associate III

Hello Community,

I have several really large const arrays (with graphics data for LCD displays) which need not to be copied into RAM at startup, as this overflows my available RAM (on STM32F411 Discovery board). As there is no way to configure such behavior in STM32 Cube IDE I have tried to modify the linker scripts but GCC linker keeps ignoring my modifications.:face_with_rolling_eyes:

Does anybody have experienced the same problems or have some ideas how to convince the linker not to copy that sort of data into RAM? Data access speed is no issue as the speed bottleneck is in any case the display (connected via SPI).

Thank you for any ideas or suggestions
Herbert

10 REPLIES 10
herbert
Associate III

Your suspicion is correct, thank you. I was chasing the wrong culprit. Some other arrays seem to be too large. I have reduced their size and the overflowed RAM collapsed from 68K to 2K. So it is there I have to go and look for a solution.