]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_GCC_Atollic/xmc4500_flash.ld
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / CORTEX_M4F_Infineon_XMC4500_GCC_Atollic / xmc4500_flash.ld
1 /*
2 *****************************************************************************
3 **
4 **  File        : xmc4500_flash.ld
5 **
6 **  Abstract    : Linker script for XMC4500-E144x1024 Device with
7 **                1024KByte FLASH, 64KByte RAM
8 **
9 **                Set heap size, stack size and stack location according
10 **                to application requirements.
11 **
12 **                Set memory bank area and size if external memory is used.
13 **
14 **  Target      : Infineon XMC4500
15 **
16 **  Environment : Atollic TrueSTUDIO(R)
17 **
18 **  Distribution: The file is distributed \93as is,\94 without any warranty
19 **                of any kind.
20 **
21 **  (c)Copyright Atollic AB.
22 **  This file may be distributed and used with the FreeRTOS example project
23 **  for Atollic TrueSTUDIO only.
24 **
25 *****************************************************************************
26 */
27
28 /* Entry Point */
29 ENTRY(Reset_Handler)
30
31 /* Highest address of the user mode stack */
32 _estack = 0x10010000;    /* end of 64K RAM */
33
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 = 0x200; /* required amount of stack */
37
38 /* Specify the memory areas */
39 MEMORY
40 {
41   FLASH1_cached (rx)   : ORIGIN = 0x08000000, LENGTH = 1024K
42   FLASH1_uncached (rx) : ORIGIN = 0x0C000000, LENGTH = 1024K
43   PSRAM1 (xrw)         : ORIGIN = 0x10000000, LENGTH = 64K
44   DSRAM1_system (xrw)  : ORIGIN = 0x20000000, LENGTH = 64K
45   DSRAM2_comm (xrw)    : ORIGIN = 0x30000000, LENGTH = 32K
46   MEMORY_B1 (rx)       : ORIGIN = 0x60000000, LENGTH = 0K
47 }
48
49 /* Define output sections */
50 SECTIONS
51 {
52   /* The startup code goes first into FLASH */
53   .isr_vector :
54   {
55     . = ALIGN(4);
56     _isr_vector = .;     /* define isr_vector start address */
57     KEEP(*(.isr_vector)) /* Startup code */
58     . = ALIGN(4);
59   } >FLASH1_uncached
60
61   /* The program code and other data goes into FLASH */
62   .text :
63   {
64     . = ALIGN(4);
65     *(.text)           /* .text sections (code) */
66     *(.text*)          /* .text* sections (code) */
67     *(.rodata)         /* .rodata sections (constants, strings, etc.) */
68     *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
69     *(.glue_7)         /* glue arm to thumb code */
70     *(.glue_7t)        /* glue thumb to arm code */
71     *(.eh_frame)
72
73     KEEP (*(.init))
74     KEEP (*(.fini))
75
76     . = ALIGN(4);
77     _etext = .;        /* define a global symbols at end of code */
78   } >FLASH1_uncached
79
80
81    .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH1_uncached
82     .ARM : {
83     __exidx_start = .;
84       *(.ARM.exidx*)
85       __exidx_end = .;
86     } >FLASH1_uncached
87
88   .preinit_array     :
89   {
90     PROVIDE_HIDDEN (__preinit_array_start = .);
91     KEEP (*(.preinit_array*))
92     PROVIDE_HIDDEN (__preinit_array_end = .);
93   } >FLASH1_uncached
94   .init_array :
95   {
96     PROVIDE_HIDDEN (__init_array_start = .);
97     KEEP (*(SORT(.init_array.*)))
98     KEEP (*(.init_array*))
99     PROVIDE_HIDDEN (__init_array_end = .);
100   } >FLASH1_uncached
101   .fini_array :
102   {
103     PROVIDE_HIDDEN (__fini_array_start = .);
104     KEEP (*(SORT(.fini_array.*)))
105     KEEP (*(.fini_array*))
106     PROVIDE_HIDDEN (__fini_array_end = .);
107   } >FLASH1_uncached
108
109   /* used by the startup to initialize data */
110   _sidata = LOADADDR(.data);
111
112   /* Initialized data sections goes into RAM, load LMA copy after code */
113   .data : 
114   {
115     . = ALIGN(4);
116     _sdata = .;        /* create a global symbol at data start */
117     *(.data)           /* .data sections */
118     *(.data*)          /* .data* sections */
119
120     . = ALIGN(4);
121     _edata = .;        /* define a global symbol at data end */
122   } >DSRAM1_system AT> FLASH1_uncached
123
124   /* Uninitialized data section */
125   . = ALIGN(4);
126   .bss :
127   {
128     /* This is used by the startup in order to initialize the .bss secion */
129     _sbss = .;         /* define a global symbol at bss start */
130     __bss_start__ = _sbss;
131     *(.bss)
132     *(.bss*)
133     *(COMMON)
134
135     . = ALIGN(4);
136     _ebss = .;         /* define a global symbol at bss end */
137     __bss_end__ = _ebss;
138   } >DSRAM1_system
139
140   /* User_heap_stack section, used to check that there is enough RAM left */
141   ._user_heap_stack :
142   {
143     . = ALIGN(4);
144     PROVIDE ( end = . );
145     PROVIDE ( _end = . );
146     . = . + _Min_Heap_Size;
147     . = . + _Min_Stack_Size;
148     . = ALIGN(4);
149   } >DSRAM1_system
150
151   /* MEMORY_bank1 section, code must be located here explicitly            */
152   /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
153   .memory_b1_text :
154   {
155     *(.mb1text)        /* .mb1text sections (code) */
156     *(.mb1text*)       /* .mb1text* sections (code)  */
157     *(.mb1rodata)      /* read-only data (constants) */
158     *(.mb1rodata*)
159   } >MEMORY_B1
160
161   /* Remove information from the standard libraries */
162   /DISCARD/ :
163   {
164     libc.a ( * )
165     libm.a ( * )
166     libgcc.a ( * )
167   }
168
169   .ARM.attributes 0 : { *(.ARM.attributes) }
170 }