Debian Codegraph @

ports/renesas-ra/boards/VK_RA6M5/vk_ra6m5.ld

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