Debian Codegraph @

ports/renesas-ra/boards/ARDUINO_PORTENTA_C33/ra6m5.ld

raw
1 /*
2 Linker File for RA6M5 MCU
3 */
4
5 /* Linker script to configure memory regions. */
6 MEMORY
7 {
8 FLASH_BOOT (r) : ORIGIN = 0x00000000, LENGTH = 0x00010000 /* 64K */
9 FLASH (rx) : ORIGIN = 0x00010000, LENGTH = 0x000f0000 /* 960KB */
10 FLASH_FS (r) : ORIGIN = 0x00100000, LENGTH = 0x00100000 /* 1MB */
11 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00080000 /* 512KB */
12 OSPI_RAM (rwx) : ORIGIN = 0x68000000, LENGTH = 0x00800000 /* 8MB/8MB */
13 DATA_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x00002000 /* 8KB */
14 QSPI_FLASH (rx) : ORIGIN = 0x60000000, LENGTH = 0x01000000 /* 16MB/64MB */
15 OSPI_FLASH (rx) : ORIGIN = 0x70000000, LENGTH = 0x01000000 /* 16MB/256MB */
16 ID_CODE (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000000 /* N/A */
17 }
18
19 /* Library configurations */
20 /*GROUP(libgcc.a libc.a libm.a libnosys.a) */
21
22 /* Linker script to place sections and symbol values. Should be used together
23 * with other linker script that defines memory regions FLASH and RAM.
24 * It references following symbols, which must be defined in code:
25 * Reset_Handler : Entry of reset handler
26 *
27 * It defines following symbols, which code can use without definition:
28 * __exidx_start
29 * __exidx_end
30 * __copy_table_start__
31 * __copy_table_end__
32 * __zero_table_start__
33 * __zero_table_end__
34 * __etext
35 * __data_start__
36 * __preinit_array_start
37 * __preinit_array_end
38 * __init_array_start
39 * __init_array_end
40 * __fini_array_start
41 * __fini_array_end
42 * __data_end__
43 * __bss_start__
44 * __bss_end__
45 * __end__
46 * end
47 * __HeapLimit
48 * __StackLimit
49 * __StackTop
50 * __stack
51 * __Vectors_End
52 * __Vectors_Size
53 */
54 ENTRY(Reset_Handler)
55
56 SECTIONS
57 {
58 .text :
59 {
60 _stext = .;
61 __ROM_Start = .;
62
63 /* Even though the vector table is not 256 entries (1KB) long, we still allocate that much
64 * space because ROM registers are at address 0x400 and there is very little space
65 * in between. */
66 KEEP(*(.fixed_vectors*))
67 KEEP(*(.application_vectors*))
68 __Vectors_End = .;
69 __end__ = .;
70
71 /* ROM Registers start at address 0x00000400 */
72 . = __ROM_Start + 0x400;
73 KEEP(*(.rom_registers*))
74
75 /* Reserving 0x100 bytes of space for ROM registers. */
76 . = __ROM_Start + 0x500;
77
78 *(.text*)
79
80 KEEP(*(.version))
81 KEEP(*(.init))
82 KEEP(*(.fini))
83
84 /* .ctors */
85 *crtbegin.o(.ctors)
86 *crtbegin?.o(.ctors)
87 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
88 *(SORT(.ctors.*))
89 *(.ctors)
90
91 /* .dtors */
92 *crtbegin.o(.dtors)
93 *crtbegin?.o(.dtors)
94 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
95 *(SORT(.dtors.*))
96 *(.dtors)
97
98 *(.rodata*)
99 __usb_dev_descriptor_start_fs = .;
100 KEEP(*(.usb_device_desc_fs*))
101 __usb_cfg_descriptor_start_fs = .;
102 KEEP(*(.usb_config_desc_fs*))
103 __usb_interface_descriptor_start_fs = .;
104 KEEP(*(.usb_interface_desc_fs*))
105 __usb_descriptor_end_fs = .;
106 __usb_dev_descriptor_start_hs = .;
107 KEEP(*(.usb_device_desc_hs*))
108 __usb_cfg_descriptor_start_hs = .;
109 KEEP(*(.usb_config_desc_hs*))
110 __usb_interface_descriptor_start_hs = .;
111 KEEP(*(.usb_interface_desc_hs*))
112 __usb_descriptor_end_hs = .;
113
114 KEEP(*(.eh_frame*))
115
116 __ROM_End = .;
117 _etext = .;
118 } > FLASH = 0xFF
119
120 __Vectors_Size = __Vectors_End - __Vectors;
121
122 .ARM.extab :
123 {
124 *(.ARM.extab* .gnu.linkonce.armextab.*)
125 } > FLASH
126
127 __exidx_start = .;
128 .ARM.exidx :
129 {
130 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
131 } > FLASH
132 __exidx_end = .;
133
134 /* To copy multiple ROM to RAM sections,
135 * uncomment .copy.table section and,
136 * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
137 /*
138 .copy.table :
139 {
140 . = ALIGN(4);
141 __copy_table_start__ = .;
142 LONG (__etext)
143 LONG (__data_start__)
144 LONG (__data_end__ - __data_start__)
145 LONG (__etext2)
146 LONG (__data2_start__)
147 LONG (__data2_end__ - __data2_start__)
148 __copy_table_end__ = .;
149 } > FLASH
150 */
151
152 /* To clear multiple BSS sections,
153 * uncomment .zero.table section and,
154 * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
155 /*
156 .zero.table :
157 {
158 . = ALIGN(4);
159 __zero_table_start__ = .;
160 LONG (__bss_start__)
161 LONG (__bss_end__ - __bss_start__)
162 LONG (__bss2_start__)
163 LONG (__bss2_end__ - __bss2_start__)
164 __zero_table_end__ = .;
165 } > FLASH
166 */
167
168 __etext = .;
169
170 /* If DTC is used, put the DTC vector table at the start of SRAM.
171 This avoids memory holes due to 1K alignment required by it. */
172 .fsp_dtc_vector_table (NOLOAD) :
173 {
174 . = ORIGIN(RAM);
175 *(.fsp_dtc_vector_table)
176 } > RAM
177
178 /* Initialized data section. */
179 .data :
180 {
181 _sidata = .;
182 _sdata = .;
183 __data_start__ = .;
184 *(vtable)
185 *(.data.*)
186
187 . = ALIGN(4);
188 /* preinit data */
189 PROVIDE_HIDDEN (__preinit_array_start = .);
190 KEEP(*(.preinit_array))
191 PROVIDE_HIDDEN (__preinit_array_end = .);
192
193 . = ALIGN(4);
194 /* init data */
195 PROVIDE_HIDDEN (__init_array_start = .);
196 KEEP(*(SORT(.init_array.*)))
197 KEEP(*(.init_array))
198 PROVIDE_HIDDEN (__init_array_end = .);
199
200
201 . = ALIGN(4);
202 /* finit data */
203 PROVIDE_HIDDEN (__fini_array_start = .);
204 KEEP(*(SORT(.fini_array.*)))
205 KEEP(*(.fini_array))
206 PROVIDE_HIDDEN (__fini_array_end = .);
207
208 KEEP(*(.jcr*))
209 . = ALIGN(4);
210
211 __Code_In_RAM_Start = .;
212
213 KEEP(*(.code_in_ram*))
214 __Code_In_RAM_End = .;
215
216 /* All data end */
217 __data_end__ = .;
218 _edata = .;
219
220 } > RAM AT > FLASH
221
222
223
224 .noinit (NOLOAD):
225 {
226 . = ALIGN(4);
227 __noinit_start = .;
228 KEEP(*(.noinit*))
229 __noinit_end = .;
230 } > RAM
231
232 .bss :
233 {
234 . = ALIGN(4);
235 _sbss = .;
236 __bss_start__ = .;
237 *(.bss*)
238 *(COMMON)
239 . = ALIGN(4);
240 __bss_end__ = .;
241 _ebss = .;
242 } > RAM
243
244 .heap (NOLOAD):
245 {
246 . = ALIGN(8);
247 __HeapBase = .;
248 __end__ = .;
249 end = __end__;
250 KEEP(*(.heap*))
251 __HeapLimit = .;
252 } > RAM
253
254 /* Stacks are stored in this section. */
255 .stack_dummy (NOLOAD):
256 {
257 . = ALIGN(8);
258 _sstack = .;
259 __StackLimit = .;
260 /* Main stack */
261 KEEP(*(.stack))
262 __StackTop = .;
263 /* Thread stacks */
264 KEEP(*(.stack*))
265 __StackTopAll = .;
266 _estack = .;
267 } > RAM
268
269 PROVIDE(__stack = __StackTopAll);
270
271 /* This symbol represents the end of user allocated RAM. The RAM after this symbol can be used
272 at run time for things such as ThreadX memory pool allocations. */
273 __RAM_segment_used_end__ = ALIGN(__StackTopAll , 4);
274
275 /* Data flash. */
276 .data_flash :
277 {
278 __Data_Flash_Start = .;
279 KEEP(*(.data_flash*))
280 __Data_Flash_End = .;
281 } > DATA_FLASH
282
283 .id_code :
284 {
285 __ID_Code_Start = .;
286 KEEP(*(.id_code*))
287 __ID_Code_End = .;
288 } > ID_CODE
289 }
290 /* produce a link error if there is not this amount of RAM for these sections */
291 /* _minimum_stack_size = 2K; */
292 /* _minimum_heap_size = 16K; */
293
294 /* Define tho top end of the stack. The stack is full descending so begins just
295 above last byte of RAM. Note that EABI requires the stack to be 8-byte
296 aligned for a call. */
297 _estack = ORIGIN(RAM) + LENGTH(RAM);
298
299 /* RAM extents for the garbage collector */
300 _ram_start = ORIGIN(RAM);
301 _ram_end = ORIGIN(RAM) + LENGTH(RAM);
302 _heap_start = __HeapBase; /* heap starts just after statically allocated memory */
303 _heap_end = __HeapLimit; /* tunable */
304
305 _micropy_hw_internal_flash_storage_start = ORIGIN(FLASH_FS);
306 _micropy_hw_internal_flash_storage_end = ORIGIN(FLASH_FS) + LENGTH(FLASH_FS);