]> git.sur5r.net Git - freertos/blob - Demo/CORTEX_STM32F103_IAR/lnkarm_flash.xcl
Update to V4.4.0.
[freertos] / Demo / CORTEX_STM32F103_IAR / lnkarm_flash.xcl
1 /*;******************** (C) COPYRIGHT 2007 STMicroelectronics ******************\r
2 ;* File Name          : lnkarm_flash.xcl\r
3 ;* Author             : MCD Application Team\r
4 ;* Date First Issued  :  02/19/2007\r
5 ;* Description        :  XLINK command file template 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
9 ; History:\r
10 ; 04/02/2007: V0.2\r
11 ; 02/19/2007: V0.1\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
20 \r
21 // Code memory in FLASH\r
22 -DROMSTART=0x8000000\r
23 -DROMEND=0x801FFFF\r
24 \r
25 // Data in RAM\r
26 -DRAMSTART=0x20000000\r
27 -DRAMEND=0x20004FFF\r
28 \r
29 //*************************************************************************\r
30 // -------------\r
31 // Code segments - may be placed anywhere in memory.\r
32 // -------------\r
33 //\r
34 //   INTVEC     -- Exception vector table.\r
35 //   SWITAB     -- Software interrupt vector table.\r
36 //   ICODE      -- Startup (cstartup) and exception code.\r
37 //   DIFUNCT    -- Dynamic initialization vectors used by C++.\r
38 //   CODE       -- Compiler generated code.\r
39 //   CODE_I     -- Compiler generated code declared __ramfunc (executes in RAM)\r
40 //   CODE_ID    -- Initializer for CODE_I (ROM).\r
41 //\r
42 // -------------\r
43 // Data segments - may be placed anywhere in memory.\r
44 // -------------\r
45 //\r
46 //   CSTACK      -- The stack used by C/C++ programs (system and user mode).\r
47 //   HEAP       -- The heap used by malloc and free in C and new and\r
48 //                 delete in C++.\r
49 //   INITTAB    -- Table containing addresses and sizes of segments that\r
50 //                 need to be initialized at startup (by cstartup).\r
51 //   CHECKSUM   -- The linker places checksum byte(s) in this segment,\r
52 //                 when the -J linker command line option is used.\r
53 //   DATA_y     -- Data objects.\r
54 //\r
55 // Where _y can be one of:\r
56 //\r
57 //   _AN        -- Holds uninitialized located objects, i.e. objects with\r
58 //                 an absolute location given by the @ operator or the\r
59 //                 #pragma location directive. Since these segments\r
60 //                 contain objects which already have a fixed address,\r
61 //                 they should not be mentioned in this linker command\r
62 //                 file.\r
63 //   _C         -- Constants (ROM).\r
64 //   _I         -- Initialized data (RAM).\r
65 //   _ID        -- The original content of _I (copied to _I by cstartup) (ROM).\r
66 //   _N         -- Uninitialized data (RAM).\r
67 //   _Z         -- Zero initialized data (RAM).\r
68 //\r
69 // Note:  Be sure to use end values for the defined address ranges.\r
70 //        Otherwise, the linker may allocate space outside the\r
71 //        intended memory range.\r
72 //*************************************************************************\r
73 \r
74 \r
75 //************************************************\r
76 // Inform the linker about the CPU family used.\r
77 //************************************************\r
78 \r
79 -carm\r
80 \r
81 //*************************************************************************\r
82 // Segment placement - General information\r
83 //\r
84 // All numbers in the segment placement command lines below are interpreted\r
85 // as hexadecimal unless they are immediately preceded by a '.', which\r
86 // denotes decimal notation.\r
87 //\r
88 // When specifying the segment placement using the -P instead of the -Z\r
89 // option, the linker is free to split each segment into its segment parts\r
90 // and randomly place these parts within the given ranges in order to\r
91 // achieve a more efficient memory usage. One disadvantage, however, is\r
92 // that it is not possible to find the start or end address (using\r
93 // the assembler operators .sfb./.sfe.) of a segment which has been split\r
94 // and reformed.\r
95 //\r
96 // When generating an output file which is to be used for programming\r
97 // external ROM/Flash devices, the -M linker option is very useful\r
98 // (see xlink.pdf for details).\r
99 //*************************************************************************\r
100 \r
101 \r
102 //*************************************************************************\r
103 // Read-only segments mapped to ROM.\r
104 //*************************************************************************\r
105 \r
106 //************************************************\r
107 // Address range for reset and exception\r
108 // vectors (INTVEC).\r
109 //************************************************\r
110 \r
111 -Z(CODE)INTVEC=ROMSTART-ROMEND\r
112 \r
113 //************************************************\r
114 // Startup code and exception routines (ICODE).\r
115 //************************************************\r
116 \r
117 -Z(CODE)ICODE,DIFUNCT=ROMSTART-ROMEND\r
118 -Z(CODE)SWITAB=ROMSTART-ROMEND\r
119 \r
120 //************************************************\r
121 // Code segments may be placed anywhere.\r
122 //************************************************\r
123 \r
124 -Z(CODE)CODE=ROMSTART-ROMEND\r
125 \r
126 //************************************************\r
127 // Original ROM location for __ramfunc code copied\r
128 // to and executed from RAM.\r
129 //************************************************\r
130 \r
131 -Z(CONST)CODE_ID=ROMSTART-ROMEND\r
132 \r
133 //************************************************\r
134 // Various constants and initializers.\r
135 //************************************************\r
136 \r
137 -Z(CONST)INITTAB,DATA_ID,DATA_C=ROMSTART-ROMEND\r
138 -Z(CONST)CHECKSUM=ROMSTART-ROMEND\r
139 \r
140 \r
141 //*************************************************************************\r
142 // Read/write segments mapped to RAM.\r
143 //*************************************************************************\r
144 \r
145 //************************************************\r
146 // Data segments.\r
147 //************************************************\r
148 \r
149 -Z(DATA)DATA_I,DATA_Z,DATA_N=RAMSTART-RAMEND\r
150 \r
151 //************************************************\r
152 // __ramfunc code copied to and executed from RAM.\r
153 //************************************************\r
154 \r
155 -Z(DATA)CODE_I=RAMSTART-RAMEND\r
156 \r
157 //************************************************\r
158 // ICCARM produces code for __ramfunc functions in\r
159 // CODE_I segments. The -Q XLINK command line\r
160 // option redirects XLINK to emit the code in the\r
161 // CODE_ID segment instead, but to keep symbol and\r
162 // debug information associated with the CODE_I\r
163 // segment, where the code will execute.\r
164 //************************************************\r
165 \r
166 -QCODE_I=CODE_ID\r
167 \r
168 //*************************************************************************\r
169 // Stack and heap segments.\r
170 //*************************************************************************\r
171 \r
172 -D_CSTACK_SIZE=400\r
173 -D_HEAP_SIZE=4\r
174 \r
175 -Z(DATA)CSTACK+_CSTACK_SIZE=RAMSTART-RAMEND\r
176 -Z(DATA)HEAP+_HEAP_SIZE=RAMSTART-RAMEND\r
177 \r
178 //*************************************************************************\r
179 // ELF/DWARF support.\r
180 //\r
181 // Uncomment the line "-Felf" below to generate ELF/DWARF output.\r
182 // Available format specifiers are:\r
183 //\r
184 //   "-yn": Suppress DWARF debug output\r
185 //   "-yp": Multiple ELF program sections\r
186 //   "-yas": Format suitable for debuggers from ARM Ltd (also sets -p flag)\r
187 //\r
188 // "-Felf" and the format specifiers can also be supplied directly as\r
189 // command line options, or selected from the Xlink Output tab in the\r
190 // IAR Embedded Workbench.\r
191 //*************************************************************************\r
192 \r
193 // -Felf\r
194 \r