Howto parameterize memory size in linker scipts?

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 ----------
Reply to
Uwe Bonnes
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.