1
+ /*
2
+ ******************************************************************************
3
+ **
4
+ ** @file : LinkerScript.ld
5
+ **
6
+ ** @author : Auto-generated by STM32CubeIDE
7
+ **
8
+ ** @brief : Linker script for STM32H503RBTx Device from STM32H5 series
9
+ ** 128Kbytes FLASH
10
+ ** 32Kbytes RAM
11
+ **
12
+ ** Set heap size, stack size and stack location according
13
+ ** to application requirements.
14
+ **
15
+ ** Set memory bank area and size if external memory is used
16
+ **
17
+ ** Target : STMicroelectronics STM32
18
+ **
19
+ ** Distribution : The file is distributed as is, without any warranty
20
+ ** of any kind.
21
+ **
22
+ ******************************************************************************
23
+ ** @attention
24
+ **
25
+ ** Copyright (c) 2021 STMicroelectronics.
26
+ ** All rights reserved.
27
+ **
28
+ ** This software is licensed under terms that can be found in the LICENSE file
29
+ ** in the root directory of this software component.
30
+ ** If no LICENSE file comes with this software, it is provided AS-IS.
31
+ **
32
+ ******************************************************************************
33
+ */
34
+
35
+ /* Entry Point */
36
+ ENTRY (Reset_Handler )
37
+
38
+ /* Highest address of the user mode stack */
39
+ _estack = ORIGIN (RAM) + LENGTH (RAM); /* end of "RAM" Ram type memory */
40
+
41
+ _Min_Heap_Size = 0x200; /* required amount of heap */
42
+ _Min_Stack_Size = 0x400; /* required amount of stack */
43
+
44
+ /* Memories definition */
45
+ MEMORY {
46
+ RAM (rwx) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
47
+ FLASH ( rx) : ORIGIN = 0x08000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
48
+ }
49
+
50
+ /* Sections */
51
+ SECTIONS {
52
+ /* The startup code into "FLASH" Rom type memory */
53
+ .isr_vector : {
54
+ . = ALIGN (4);
55
+ KEEP(*(.isr_vector)) /* Startup code */
56
+ . = ALIGN (4);
57
+ } > FLASH
58
+
59
+ /* The program code and other data into "FLASH" Rom type memory */
60
+ .text : {
61
+ . = ALIGN (4);
62
+ *(.text) /* .text sections (code) */
63
+ *(.text*) /* .text* sections (code) */
64
+ *(.glue_7) /* glue arm to thumb code */
65
+ *(.glue_7t) /* glue thumb to arm code */
66
+ *(.eh_frame)
67
+
68
+ KEEP(*(.init))
69
+ KEEP(*(.fini))
70
+
71
+ . = ALIGN (4);
72
+ _etext = .; /* define a global symbols at end of code */
73
+ } > FLASH
74
+
75
+ /* Constant data into "FLASH" Rom type memory */
76
+ .rodata : {
77
+ . = ALIGN (4);
78
+ *(.rodata) /* .rodata sections (constants, strings, etc.) */
79
+ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
80
+ . = ALIGN (4);
81
+ } > FLASH
82
+
83
+ .ARM.extab : {
84
+ . = ALIGN (4);
85
+ *(.ARM.extab* .gnu.linkonce.armextab.*)
86
+ . = ALIGN (4);
87
+ } > FLASH
88
+
89
+ .ARM : {
90
+ . = ALIGN (4);
91
+ __exidx_start = .;
92
+ *(.ARM.exidx*)
93
+ __exidx_end = .;
94
+ . = ALIGN (4);
95
+ } > FLASH
96
+
97
+ .preinit_array : {
98
+ . = ALIGN (4);
99
+ PROVIDE_HIDDEN (__preinit_array_start = .);
100
+ KEEP(*(.preinit_array*))
101
+ PROVIDE_HIDDEN (__preinit_array_end = .);
102
+ . = ALIGN (4);
103
+ } > FLASH
104
+
105
+ .init_array : {
106
+ . = ALIGN (4);
107
+ PROVIDE_HIDDEN (__init_array_start = .);
108
+ KEEP(*(SORT(.init_array.*)))
109
+ KEEP(*(.init_array*))
110
+ PROVIDE_HIDDEN (__init_array_end = .);
111
+ . = ALIGN (4);
112
+ } > FLASH
113
+
114
+ .fini_array : {
115
+ . = ALIGN (4);
116
+ PROVIDE_HIDDEN (__fini_array_start = .);
117
+ KEEP(*(SORT(.fini_array.*)))
118
+ KEEP(*(.fini_array*))
119
+ PROVIDE_HIDDEN (__fini_array_end = .);
120
+ . = ALIGN (4);
121
+ } > FLASH
122
+
123
+ /* Used by the startup to initialize data */
124
+ _sidata = LOADADDR (.data);
125
+
126
+ /* Initialized data sections into "RAM" Ram type memory */
127
+ .data : {
128
+ . = ALIGN (4);
129
+ _sdata = .; /* create a global symbol at data start */
130
+ *(.data) /* .data sections */
131
+ *(.data*) /* .data* sections */
132
+ *(.RamFunc) /* .RamFunc sections */
133
+ *(.RamFunc*) /* .RamFunc* sections */
134
+
135
+ . = ALIGN (4);
136
+ _edata = .; /* define a global symbol at data end */
137
+
138
+ } > RAM AT > FLASH
139
+
140
+ /* Uninitialized data section into "RAM" Ram type memory */
141
+ . = ALIGN (4);
142
+ .bss : {
143
+ /* This is used by the startup in order to initialize the .bss section */
144
+ _sbss = .; /* define a global symbol at bss start */
145
+ __bss_start__ = _sbss;
146
+ *(.bss)
147
+ *(.bss*)
148
+ *(COMMON)
149
+
150
+ . = ALIGN (4);
151
+ _ebss = .; /* define a global symbol at bss end */
152
+ __bss_end__ = _ebss;
153
+ } > RAM
154
+
155
+ /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
156
+ ._user_heap_stack : {
157
+ . = ALIGN (8);
158
+ PROVIDE (end = .);
159
+ PROVIDE (_end = .);
160
+ . = . + _Min_Heap_Size;
161
+ . = . + _Min_Stack_Size;
162
+ . = ALIGN (8);
163
+ } > RAM
164
+
165
+ /* Remove information from the compiler libraries */
166
+ /DISCARD/ : {
167
+ libc.a (*)
168
+ libm.a (*)
169
+ libgcc.a (*)
170
+ }
171
+
172
+ .ARM.attributes 0 : {
173
+ *(.ARM.attributes)
174
+ }
175
+ }
0 commit comments