1 /*;******************** (C) COPYRIGHT 2005 STMicroelectronics ******************
\r
2 ;* File Name : lnkarm_flash.xcl
\r
3 ;* Author : MCD Application Team
\r
4 ;* Date First Issued : 03/10/2006
\r
5 ;* Description : XLINK command file for EWARM/ICCARM
\r
6 ;* : Usage: xlink -f lnkarm <your_object_file(s)>
\r
7 ;* : -s <program start label> <C/C++ runtime library>
\r
8 ;*******************************************************************************
\r
12 ;*******************************************************************************
\r
13 ; THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
\r
14 ; WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
\r
15 ; AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
\r
16 ; INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
\r
17 ; CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
\r
18 ; INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
\r
19 ;******************************************************************************/
\r
21 // Embedded Flash (256/128/64Kbytes)
\r
22 // The user has to change the flash memory length depending STR75xFxx devices
\r
24 // Code memory in flash
\r
25 -DROMSTART=0x20000000
\r
26 -DROMEND=0x2003FFFF //0x2001FFFF;0x200FFFF
\r
29 -DRAMSTART=0x40000000
\r
33 //*************************************************************************
\r
35 // Code segments - may be placed anywhere in memory.
\r
38 // INTVEC -- Exception vector table.
\r
39 // SWITAB -- Software interrupt vector table.
\r
40 // ICODE -- Startup (cstartup) and exception code.
\r
41 // DIFUNCT -- Dynamic initialization vectors used by C++.
\r
42 // CODE -- Compiler generated code.
\r
43 // CODE_I -- Compiler generated code declared __ramfunc (executes in RAM)
\r
44 // CODE_ID -- Initializer for CODE_I (ROM).
\r
47 // Data segments - may be placed anywhere in memory.
\r
50 // CSTACK -- The stack used by C/C++ programs (system and user mode).
\r
51 // IRQ_STACK -- The stack used by IRQ service routines.
\r
52 // SVC_STACK -- The stack used in supervisor mode
\r
53 // UND_STACK -- The stack used in Und mode
\r
54 // ABT_STACK -- The stack used in Abort mode
\r
55 // FIQ_STACK -- The stack used by FIQ service routines
\r
56 // HEAP -- The heap used by malloc and free in C and new and
\r
58 // INITTAB -- Table containing addresses and sizes of segments that
\r
59 // need to be initialized at startup (by cstartup).
\r
60 // CHECKSUM -- The linker places checksum byte(s) in this segment,
\r
61 // when the -J linker command line option is used.
\r
62 // DATA_y -- Data objects.
\r
64 // Where _y can be one of:
\r
66 // _AN -- Holds uninitialized located objects, i.e. objects with
\r
67 // an absolute location given by the @ operator or the
\r
68 // #pragma location directive. Since these segments
\r
69 // contain objects which already have a fixed address,
\r
70 // they should not be mentioned in this linker command
\r
72 // _C -- Constants (ROM).
\r
73 // _I -- Initialized data (RAM).
\r
74 // _ID -- The original content of _I (copied to _I by cstartup) (ROM).
\r
75 // _N -- Uninitialized data (RAM).
\r
76 // _Z -- Zero initialized data (RAM).
\r
78 // Note: Be sure to use end values for the defined address ranges.
\r
79 // Otherwise, the linker may allocate space outside the
\r
80 // intended memory range.
\r
81 //*************************************************************************
\r
84 //************************************************
\r
85 // Inform the linker about the CPU family used.
\r
86 //************************************************
\r
90 //*************************************************************************
\r
91 // Segment placement - General information
\r
93 // All numbers in the segment placement command lines below are interpreted
\r
94 // as hexadecimal unless they are immediately preceded by a '.', which
\r
95 // denotes decimal notation.
\r
97 // When specifying the segment placement using the -P instead of the -Z
\r
98 // option, the linker is free to split each segment into its segment parts
\r
99 // and randomly place these parts within the given ranges in order to
\r
100 // achieve a more efficient memory usage. One disadvantage, however, is
\r
101 // that it is not possible to find the start or end address (using
\r
102 // the assembler operators .sfb./.sfe.) of a segment which has been split
\r
105 // When generating an output file which is to be used for programming
\r
106 // external ROM/Flash devices, the -M linker option is very useful
\r
107 // (see xlink.pdf for details).
\r
108 //*************************************************************************
\r
111 //*************************************************************************
\r
112 // Read-only segments mapped to ROM.
\r
113 //*************************************************************************
\r
115 //************************************************
\r
116 // Address range for reset and exception
\r
117 // vectors (INTVEC).
\r
118 //************************************************
\r
120 -Z(CODE)INTVEC=ROMSTART-ROMEND
\r
122 //************************************************
\r
123 // Startup code and exception routines (ICODE).
\r
124 //************************************************
\r
126 -Z(CODE)ICODE,DIFUNCT=ROMSTART-ROMEND
\r
127 -Z(CODE)SWITAB=ROMSTART-ROMEND
\r
129 //************************************************
\r
130 // Code segments may be placed anywhere.
\r
131 //************************************************
\r
133 -Z(CODE)CODE=ROMSTART-ROMEND
\r
135 //************************************************
\r
136 // Original ROM location for __ramfunc code copied
\r
137 // to and executed from RAM.
\r
138 //************************************************
\r
140 -Z(CONST)CODE_ID=ROMSTART-ROMEND
\r
142 //************************************************
\r
143 // Various constants and initializers.
\r
144 //************************************************
\r
146 -Z(CONST)INITTAB,DATA_ID,DATA_C=ROMSTART-ROMEND
\r
147 -Z(CONST)CHECKSUM=ROMSTART-ROMEND
\r
150 //*************************************************************************
\r
151 // Read/write segments mapped to RAM.
\r
152 //*************************************************************************
\r
154 //************************************************
\r
156 //************************************************
\r
158 -Z(DATA)DATA_I,DATA_Z,DATA_N=RAMSTART-RAMEND
\r
160 //************************************************
\r
161 // __ramfunc code copied to and executed from RAM.
\r
162 //************************************************
\r
164 -Z(DATA)CODE_I=RAMSTART-RAMEND
\r
166 //************************************************
\r
167 // ICCARM produces code for __ramfunc functions in
\r
168 // CODE_I segments. The -Q XLINK command line
\r
169 // option redirects XLINK to emit the code in the
\r
170 // CODE_ID segment instead, but to keep symbol and
\r
171 // debug information associated with the CODE_I
\r
172 // segment, where the code will execute.
\r
173 //************************************************
\r
177 //*************************************************************************
\r
178 // Stack and heap segments.
\r
179 //*************************************************************************
\r
181 // Add size >0 for ABT_Stack, UND_Stack if you need them.
\r
182 // size must be 8 byte aligned.
\r
184 -D_CSTACK_SIZE=0x100
\r
185 -D_SVC_STACK_SIZE=0x400
\r
186 -D_IRQ_STACK_SIZE=0x400
\r
187 -D_FIQ_STACK_SIZE=0x40
\r
188 -D_ABT_STACK_SIZE=0x0
\r
189 -D_UND_STACK_SIZE=0x0
\r
192 -Z(DATA)CSTACK+_CSTACK_SIZE=RAMSTART-RAMEND
\r
193 -Z(DATA)SVC_STACK+_SVC_STACK_SIZE=RAMSTART-RAMEND
\r
194 -Z(DATA)ABT_STACK+_ABT_STACK_SIZE=RAMSTART-RAMEND
\r
195 -Z(DATA)UND_STACK+_UND_STACK_SIZE=RAMSTART-RAMEND
\r
196 -Z(DATA)FIQ_STACK+_FIQ_STACK_SIZE=RAMSTART-RAMEND
\r
197 -Z(DATA)IRQ_STACK+_IRQ_STACK_SIZE=RAMSTART-RAMEND
\r
198 -Z(DATA)HEAP+_HEAP_SIZE=RAMSTART-RAMEND
\r
200 //*************************************************************************
\r
201 // ELF/DWARF support.
\r
203 // Uncomment the line "-Felf" below to generate ELF/DWARF output.
\r
204 // Available format specifiers are:
\r
206 // "-yn": Suppress DWARF debug output
\r
207 // "-yp": Multiple ELF program sections
\r
208 // "-yas": Format suitable for debuggers from ARM Ltd (also sets -p flag)
\r
210 // "-Felf" and the format specifiers can also be supplied directly as
\r
211 // command line options, or selected from the Xlink Output tab in the
\r
212 // IAR Embedded Workbench.
\r
213 //*************************************************************************
\r