Howto parameterize memory size in linker scipts?

Nov 03, 2014 0 Replies

Hello,



is there a way to parameterize the memory length in a linker file? I started with:



"bootloader_offset" = 0x00; _flashsize = 256K; MEMORY { FLASH0 (rx) : ORIGIN = 0x08000000, LENGTH = _flashsize SRAM0 (rwx) : ORIGIN = 0x20000000, LENGTH = 40K CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 8K }



INCLUDE stm32f10x_flash.ld



but even that results in



stm32f303xC_flash.ld:14: nonconstant expression for length collect2:
> error: ld returned 1 exit status

with line 14 the line referencing _flashsize.


Parameterize the memory definition would allow a single linker script for a whole family of chips.


Thanks


Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required