CMSIS2000  0.0.7
 Указатель Структуры данных Файлы Функции Переменные Определения типов Перечисления Элементы перечислений Макросы Группы Страницы
lpc2xxx_generic_one_sect.ld
См. документацию.
1 /*
2  * CMSIS2000
3  * CMSIS-like sources for LPC2xxx series MCUs
4  *
5  * (C) Copyright 2011-2012, Dmitriy Cherepanov, All Rights Reserved
6  *
7  * Version: 0.0.7
8  * Date of the Last Update: 2013-03-04
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining a copy
11  * of this software and associated documentation files (the "Software"), to
12  * deal in the Software without restriction, including without limitation the
13  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
14  * sell copies of the Software, and to permit persons to whom the Software is
15  * furnished to do so, subject to the following conditions:
16  *
17  * The above copyright notice and this permission notice shall be included in
18  * all copies or substantial portions of the Software.
19  *
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
26  * IN THE SOFTWARE.
27  *
28  * Do not be lasy! For the latest version see http://irtos.sourceforge.net .
29  *
30  *
31 #*/
32 
33 /* ************************************************************************************** */
34 /** \page nxp_port_gerenric_linker_one NXP GENERIC 2xxx LINKER SCRIPT FOR ONE FLAT IMAGE
35 \verbatim
36  * Script ALSO SUITABLE TO SYSTEMS WITH BIG MEMORY (SDRAM EXT SRAM) FOR DEBUG PURPOSES (breakpoints in RAM) *
37  * *
38  * * *
39  * THIS SCRIPT HAS NO MEMORY SECTIONS DEFENITON !!!!! USE THIS SCRIPT AS A PART OF OTHER *
40  * *
41  * FOR EXAMPLE: *
42  * INCLUDE ../CMSIS/Device/NXP/LPC2xxx/Source/GCC/lpc24x8_sect.ld *
43  * INCLUDE ../CMSIS/Device/NXP/LPC2xxx/Source/GCC/lpc2xxx_generic_one_sect.ld *
44  * *
45  * The Linker Script defines how the code and data emitted by the GNU C compiler and *
46  * assembler are to be loaded into memory (code goes into FLASH, variables go into RAM). *
47  * *
48  * Any symbols defined in the Linker Script are automatically global and available *
49  * to the rest of the program. *
50  * *
51  * LFLAGS = -Map main.map -nostartfiles -T YOU_SCRIPT.cmd *
52  * *
53  * *
54  * The Philips boot loader supports the ISP (In System Programming) via the serial port and the IAP *
55  * (In Application Programming) for flash programming from within your application. *
56  * *
57  * The boot loader uses RAM memory and we MUST NOT load variables or code in these areas.*
58  * *
59  * RAM used by boot loader: 0x40000120 - 0x400001FF (223 bytes) for ISP variables *
60  * 0x4000FFE0 - 0x4000FFFF (32 bytes) for ISP and IAP variables*
61  * 0x4000FEE0 - 0x4000FFDF (256 bytes) stack for ISP and IAP *
62  * *
63  * *
64  * MEMORY MAP *
65  *-----------------------------------------------------------------------------------------*
66  * | |0x40xx0000 *
67  * END OF RAM.-------->|---------------------------------| *
68  * | SVC Stack 8 bytes |0x40xxxFFC <------- _stack_end *
69  * .-------->|---------------------------------| *
70  * | FIQ Stack X bytes |0x40xxxxxx *
71  * .-------->|---------------------------------| *
72  * | ABT Stack Y bytes |0x40xxxxxx *
73  * .-------->|---------------------------------| *
74  * | UDF Stack Z bytes |0x40xxxxxx *
75  * .-------->|---------------------------------| *
76  * | IRQ Stack I bytes |0x40xxxxxx *
77  * .-------->|---------------------------------| *
78  * . | |0x40xxxxxx *
79  * . | stack area for user program | *
80  * . | | *
81  * . | | *
82  * . | free ram | *
83  * ram | | *
84  * . | MAY BE YOUR IMAGE | *
85  * . | IS HERE !!!!!???? | *
86  * . | | *
87  * . | | *
88  * . | | *
89  * . | | *
90  * . | | *
91  * . |---------------------------------|0x40000040 *
92  * . | |0x4000003F *
93  * . | Interrupt Vectors (re-mapped) | *
94  * . | 56-64 bytes |0x40000000 *
95  * .-------->|---------------------------------| *
96  * | | *
97  * *
98  * *
99  * *
100  * | | *
101  * |---------------------------------| *
102  * . | |0xxxxxxxxx *
103  * . | | *
104  * . | | *
105  * . | unused AREA | *
106  * . | | *
107  * . |.................................| *
108  * . | | *
109  * . | BSS NO LOAD AREA | *
110  * . | | *
111  * .--------> |.................................| END OF BINARY IMAGE *
112  * image | | *
113  * . | | *
114  * . | | *
115  * . | copy of .data area | *
116  * somewhere | (.data) | *
117  * . | (.text.ram_code) | *
118  * . | | *
119  * . |---------------------------------| *
120  * . | | *
121  * . | READ ONLY DATA | *
122  * . | *(.rodata*) | *
123  * . | | *
124  * . |---------------------------------| *
125  * . | | *
126  * . | C code | *
127  * . | *(.text) | *
128  * . | (.text.ram_code) | *
129  * . |---------------------------------| *
130  * . | |0xxxxxxxxx *
131  * . | Startup Code | *
132  * . | (assembler) | *
133  * . | *(.text.vectors) | *
134  * . |---------------------------------|0xxxxxxxxx Reset_Handler <-_etext*
135  * . | SELF COPY CODE HERE (assembler) | *
136  * . +-->| *(.text.vectors) |0xxxxxxxxx sc_here *
137  * . | |---------------------------------| *
138  * . | | Interrupt Vector Table | *
139  * . | | 56-64 bytes | *
140  * . | | | *
141  * . +---|B sc_here (PC+CONST) | *
142  * onesect.--------->|---------------------------------|0xxxxxxxxx _vectors, *
143  * !!!SOMEWHERE IN SRAM OR EXT SRAM OR SDRAM !!!! | _vectors_start,_startup *
144  * OR MAY BE EVEN IN FLASH | *
145  * . | unused AREA | *
146  * . | | *
147  * . | | *
148  * *
149  * *
150  * Author: James P. Lynch *
151  * Author: Dmitriy A. Cherepanov *
152 \endverbatim
153 */
154 /* *****************************************************************************************/
155 default_align = 4; /* 32 bit arch and 8 bit in byte -- 4 byte align*/
156 /* identify the Entry Point */
157 ENTRY(_vectors) /* image file will be started from this symbol*/
158 vectors_size_in_RAM = _vectors_end - _vectors_start;
159 /*etext_value = (Reset_Handler - _vectors);*/
160 
161 /* Library configurations */
162 GROUP(libgcc.a libc.a libm.a libnosys.a)
163 
164 /* now define the output sections */
165 SECTIONS
166 {
167  . = 0; /* set location counter to address zero */
168 
169  .vectors_in_ram :
170  {
171  *(.text.vectors*)
172  . = ALIGN(default_align);
173  /* create a global symbol marking the start of the copy to ram section */
175  } >onesect
176 
177  _etext = Reset_Handler - ORIGIN(onesect);/* start simbol in */
178 
179  .text : /* collect all sections that should go into FLASH after startup */
180  {
181  *(.text.ram_code*)/*__attribute__ ((section (".text.ram_code")))*/
182  . = ALIGN(default_align);
183  KEEP(*(.text.keep.vector*))/* interrupt handlers */
184  . = ALIGN(default_align);
185  *(.text*) /* all .text sections (code) */
186  . = ALIGN(default_align);
187  *(.rodata*) /* all .rodata* sections (constants, strings, etc.) */
188  . = ALIGN(default_align);
189  *(.glue_7*) /* all .glue_7 sections (arm/thump interwork code) */
190  *(.glue_7t*) /* all .glue_7t sections (arm/thump interwork code) */
191  *(.eh_frame*) /* all .glue_7t sections (no idea what these are) */
192  *(.vfp11_veneer*)/* all .glue_7t sections (no idea what these are) */
193  *(.v4_bx*) /* all .glue_7t sections (no idea what these are) */
194  } >onesect /* put all the above into FLASH */
195 
196  .ARM.extab :
197  {
198  *(.ARM.extab* .gnu.linkonce.armextab.*)
199  } > onesect
200 
201  __exidx_start = .;
202  .ARM.exidx :
203  {
204  *(.ARM.exidx* .gnu.linkonce.armexidx.*)
205  } > onesect
206  __exidx_end = .;
207 
208  .data : /* collect all initialized .data sections that go into RAM */
209  {
210  *(.data*) /* all .data sections */
211  /* define a global symbol marking the end of the copy to ram section */
212  __data_end = .;
213  } >onesect
214 
215  .bss (NOLOAD): /* collect all uninitialized .bss sections that go into RAM */
216  {
217  PROVIDE (__bss_start = .);
218  /* define a global symbol marking the start of the .bss section */
219  _bss_start = .;/* all .bss sections */
220  *(EXCLUDE_FILE (*heap_data*.o) .bss*) /* all .bss sections */
221  *heap_data*.o (.bss*) /* let put heap at the end*/
222  } >onesect /* put all the above in RAM (it will be cleared in the startup code */
223  . = ALIGN(default_align);/* advance location counter to the next 32-bit boundary */
224 
225  /* define a global symbol marking the end of the .bss section */
226  __bss_end = . ;
227  _end = .;/* define a global symbol marking the end of application RAM */
228  PROVIDE (end = .);
229 
230  .rtcram_sect (NOLOAD):
231  {
232  *(.ram_battery*)
233  }>rtcram
234 
235  .usbram_sect (NOLOAD):
236  {
237  *(.usbram*)
238  *(.usb_ram*)
239  *(.USB_RAM*)
240  }>usbram
241  .ethram_sect (NOLOAD):
242  {
243  *(.ethram*)
244  *(.eth_ram*)
245  *(.eth_RAM*)
246  }>usbram
247 }
248