2 *****************************************************************************
4 ** File : xmc1000_flash.ld
6 ** Abstract : Linker script for XMC1200-T038F0200 Device with
7 ** 200KByte FLASH, 16KByte RAM
9 ** Set heap size, stack size and stack location according
10 ** to application requirements.
12 ** Target : Infineon XMC1000 Microcontrollers
14 ** Environment : Atollic TrueSTUDIO(R)
16 ** Distribution: The file is distributed
\93as is,
\94 without any warranty
19 ** (c)Copyright Atollic AB.
20 ** You may use this file as-is or modify it according to the needs of your
21 ** project. This file may only be built (assembled or compiled and linked)
22 ** using the Atollic TrueSTUDIO(R) product. The use of this file together
23 ** with other tools than Atollic TrueSTUDIO(R) is not permitted.
25 *****************************************************************************
31 /* Highest address of the user mode stack */
32 _estack = 0x20004000; /* end of 16K RAM */
34 /* Generate a link error if heap and stack don't fit into RAM */
35 _Min_Heap_Size = 0; /* required amount of heap */
36 _Min_Stack_Size = 0x80; /* required amount of stack */
38 /* Specify the memory areas */
41 FLASH (rx) : ORIGIN = 0x10001000, LENGTH = 200K
42 RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K
43 MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
46 /* Define output sections */
49 /* The startup code goes first into FLASH */
53 KEEP(*(.isr_vector)) /* Startup code */
57 /* The program code and other data goes into FLASH */
61 *(.text) /* .text sections (code) */
62 *(.text*) /* .text* sections (code) */
64 *(.glue_7) /* glue arm to thumb code */
65 *(.glue_7t) /* glue thumb to arm code */
72 _etext = .; /* define a global symbols at end of code */
75 /* Constant data goes into FLASH */
79 *(.rodata) /* .rodata sections (constants, strings, etc.) */
80 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
84 .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
93 PROVIDE_HIDDEN (__preinit_array_start = .);
94 KEEP (*(.preinit_array*))
95 PROVIDE_HIDDEN (__preinit_array_end = .);
99 PROVIDE_HIDDEN (__init_array_start = .);
100 KEEP (*(SORT(.init_array.*)))
101 KEEP (*(.init_array*))
102 PROVIDE_HIDDEN (__init_array_end = .);
106 PROVIDE_HIDDEN (__fini_array_start = .);
107 KEEP (*(SORT(.fini_array.*)))
108 KEEP (*(.fini_array*))
109 PROVIDE_HIDDEN (__fini_array_end = .);
115 /* Initialize XMC Veneer interrupt code */
116 VeneerLoadAddr = ABSOLUTE(eROData);
117 .VENEER_Code ABSOLUTE(0x2000000C) :
120 KEEP(*(.XmcVeneerCode)) /* Keep the VeneerCode */
127 VeneerSize = ABSOLUTE(VeneerEnd) - ABSOLUTE(VeneerStart);
129 /* used by the startup to initialize data */
130 _sidata = LOADADDR(.data);
132 /* Initialized data sections goes into RAM, load LMA copy after code */
136 _sdata = .; /* create a global symbol at data start */
137 *(.data) /* .data sections */
138 *(.data*) /* .data* sections */
141 _edata = .; /* define a global symbol at data end */
144 /* Uninitialized data section */
148 /* This is used by the startup in order to initialize the .bss secion */
149 _sbss = .; /* define a global symbol at bss start */
150 __bss_start__ = _sbss;
156 _ebss = .; /* define a global symbol at bss end */
160 /* User_heap_stack section, used to check that there is enough RAM left */
165 PROVIDE ( _end = . );
166 . = . + _Min_Heap_Size;
167 . = . + _Min_Stack_Size;
171 /* MEMORY_bank1 section, code must be located here explicitly */
172 /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
175 *(.mb1text) /* .mb1text sections (code) */
176 *(.mb1text*) /* .mb1text* sections (code) */
177 *(.mb1rodata) /* read-only data (constants) */
181 /* Remove information from the standard libraries */
189 .ARM.attributes 0 : { *(.ARM.attributes) }