forked from RT-Thread/rt-thread
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlnkm30627fhp.xcl
236 lines (192 loc) · 7.29 KB
/
lnkm30627fhp.xcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
//================================================================
//
// IAR XLINK command file for the IAR C/C++ Compiler for
// Renesas M16C/R8C
//
// This is an example XLINK command file for use with the
// M30627FHP derivative.
//
// Derivative group: m16c 62p
//
//
// Usage: xlink your_file(s) -f this_file clm16c*.r48
//
// Copyright 2001-2008 IAR Systems AB.
//
// $Revision: 2144 $
//
//================================================================
//================================================================
// The M16C IAR C/EC++ Compiler places code and data into named
// segments which are referred to by the IAR XLINK Linker. The
// table below shows the available segments.
//
// SEGMENT REFERENCE
// =================
//
// Segment Description
// ------- -----------
// BITVARS Bit variables.
// CODE The program code.
// CSTACK The stack used by C or Embedded C++ programs.
// CSTART The startup code.
// DATA16_HEAP Heap data used by malloc and free. Used by CLib and DLib
// FAR_HEAP Heap used by malloc and free in DLib
// DATA20_HEAP Heap used by malloc and free in DLib
//
// x_AC Non-initialized located const objects.
// x_AN Non-initialized located non-const objects.
// x_C Constant data, including string literals.
// x_I Initialized data.
// x_ID Data that is copied to x_I by cstartup.
// x_N Uninitialized data.
// x_Z zero initialized data.
//
// Where x can be one of:
// DATA13 (Range: 0-0x1FFF)
// DATA16 (Range: 0-0xFFFF, except DATA16_ID)
// DATA20 (Range: 0-0xFFFFF)
// FAR (Range: 0-0xFFFFF)
//
// DIFUNCT Pointers to code, typically EC++ constructors
// FLIST Jump table for __tiny_func functions.
// INTVEC Contains reset and interrupt vectors.
// INTVEC1 Contains the fixed reset and interrupt vectors.
// ISTACK The stack used by interrupts and exceptions.
//================================================================
// Define CPU
-cm16c
//================================================================
// USER DEFINITIONS
// Please customize according to your preferences.
//================================================================
// Size of the user stack
// Uncomment for command line use
//-D_CSTACK_SIZE=100
// Size of the interrupt stack
// Uncomment for command line use
//-D_ISTACK_SIZE=40
// Size of the heap
// Uncomment for command line use
//-D_DATA16_HEAP_SIZE=400
//-D_FAR_HEAP_SIZE=400
//-D_DATA20_HEAP_SIZE=400
// Reserved memory
// Reservation of RAM and ROM memory not to be used by the application.
// Preset for use with the E8 emulator.
// NOTE! Set these values to zero to utilize the whole RAM and ROM memory.
-D_RESERVED_RAM_SIZE=80
-D_RESERVED_ROM_SIZE=800
//================================================================
// Memory Definitions
//================================================================
// Memory areas available for the application
-D_USER_RAM_BEGIN=(00400+_RESERVED_RAM_SIZE)
-D_USER_RAM_END=07FFF
-D_DATA_FLASH_BEGIN=0F000
-D_DATA_FLASH_END=0FFFF
-D_USER_ROM_BEGIN=(A0000+_RESERVED_ROM_SIZE)
-D_USER_ROM_END=FFFFF
// Relocatable "bit" segment (must be in near area).
// As BITVARS contains bit addresses, the address has to be recalculated.
// Byte address 400 --> 400 * 8 = bit address 2000
-D_BITVAR_BEGIN=2000 // address 400
-D_BITVAR_END=FFFF // address 1FFF
// ID code and OFS value written to ROM memory
-D_ID_CODE_1=FF
-D_ID_CODE_2=FF
-D_ID_CODE_3=FF
-D_ID_CODE_4=FF
-D_ID_CODE_5=FF
-D_ID_CODE_6=FF
-D_ID_CODE_7=FF
-D_OFS_VALUE=FF
// _OFS2_VALUE has to be defined. It is only used in some R8C devices and will
// not result in any additional code or data for any other device.
-D_OFS2_VALUE=FF
// =======================
// DATA13 RAM
// =======================
-Z(NEAR)DATA13_AN=0-01FFF
-Z(NEAR)DATA13_I=_USER_RAM_BEGIN-01FFF
-Z(NEAR)DATA13_Z,DATA13_N=_USER_RAM_BEGIN-01FFF
// Relocatable "bit" segment. As BITVARS contains bit addresses,
// the desired (byte) address has to be multiplied by 8.
-Z(BIT)BITVARS=_BITVAR_BEGIN-_BITVAR_END
// =======================
// DATA16 RAM
// =======================
// Set up interrupt stack
-Z(NEAR)ISTACK+_ISTACK_SIZE#_USER_RAM_BEGIN-_USER_RAM_END
// Set up user stack
-Z(NEAR)CSTACK+_CSTACK_SIZE#_USER_RAM_BEGIN-_USER_RAM_END
// Set up near heap
-Z(NEAR)DATA16_HEAP+_DATA16_HEAP_SIZE=_USER_RAM_BEGIN-_USER_RAM_END
// Near variables
-Z(NEAR)DATA16_I,DATA16_Z,DATA16_N,DATA16_AN=_USER_RAM_BEGIN-_USER_RAM_END
// User defined near DATA segments
// =======================
// DATA16 ROM
// =======================
// Data flash
-Z(CONST)DATA_FLASH=_DATA_FLASH_BEGIN-_DATA_FLASH_END
// Constant segments (in ROM), reachable for near pointers
// (Use declaration -Z(CONST)DATA16_C if near ROM exists)
// User defined near CONST segments
// =======================
// FAR/DATA20 RAM
// =======================
// Far and huge data segments
-Z(FAR)FAR_I,FAR_Z,FAR_N,FAR_AN=_USER_RAM_BEGIN-_USER_RAM_END
-Z(FAR)FAR_HEAP+_FAR_HEAP_SIZE=_USER_RAM_BEGIN-_USER_RAM_END
-Z(HUGE)DATA20_I,DATA20_Z,DATA20_N,DATA20_AN=_USER_RAM_BEGIN-_USER_RAM_END
-Z(HUGE)DATA20_HEAP+_DATA20_HEAP_SIZE=_USER_RAM_BEGIN-_USER_RAM_END
// User defined far & huge DATA segments
// =======================
// FAR/DATA20 ROM
// =======================
// Fixed interrupt vector table
-Z(CONST)INTVEC1=FFFDC-FFFFF
// Special page table
-Z(CONST)FLIST=FFE00-FFFDB
// Variable vector table (growing downwards from _USER_ROM_END)
// The added -1 is too assure that all vectors start at even
// addresses.
-Z(CONST)INTVEC=D0000-(_USER_ROM_END-1)
// Constant and initializer segments (in ROM)
-Z(FARCONST)FAR_ID=_USER_ROM_BEGIN-_USER_ROM_END
-Z(FARCONST)FAR_C=_USER_ROM_BEGIN-_USER_ROM_END
-Z(HUGECONST)DATA20_C,DATA20_ID,CHECKSUM=_USER_ROM_BEGIN-_USER_ROM_END
-Z(FARCONST)DATA16_ID,DATA13_ID,DIFUNCT=_USER_ROM_BEGIN-_USER_ROM_END
// User defined far & huge CONST segments
// CODE segments
// TINYFUNC code must be located above 0xF0000
-P(CODE)TINYFUNC=F0000-_USER_ROM_END
// Startup code
-P(CODE)CSTART=D0000-_USER_ROM_END
// "Regular" code
-P(CODE)CODE=_USER_ROM_BEGIN-_USER_ROM_END
// User defined CODE segments
// ========================
// IAR C library formatting
// ========================
// Uncomment for command line use
//-e_small_write=_formatted_write
//-e_medium_read=_formatted_read
// ========================
// Output files
// ========================
// Use the -O option to create one or more output files
// at the same link session. Formats flags, file name and
// extension is optional. Please un-comment the wanted
// output formats below.
//
// CAUTION: Do not combine other output formats with -rt (special
// UBROF for Terminal I/O in C-SPY). Output files are valid but
// contain code that expects to be run under C-SPY.
// Motorola output
//-Omotorola=.mot
// IEEE-695 output with format flags for the Renesas debugger
//-Oieee695,lbm=.x30
// ELF/DWARF output with format flags for the Renesas debugger
//-Oelf,spc=.elf