1
- /*
2
- ******************************************************************************
3
- **
4
- ** File : LinkerScript.ld
5
- **
6
- ** Author : Auto-generated by STM32CubeIDE
7
- **
8
- ** Abstract : Linker script for NUCLEO-G474RE Board embedding STM32G474RETx Device from STM32G4 series
9
- ** 512Kbytes FLASH
10
- ** 128Kbytes 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
- ** <h2><center>© COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
26
- **
27
- ** Redistribution and use in source and binary forms, with or without modification,
28
- ** are permitted provided that the following conditions are met :
29
- ** 1. Redistributions of source code must retain the above copyright notice,
30
- ** this list of conditions and the following disclaimer.
31
- ** 2. Redistributions in binary form must reproduce the above copyright notice,
32
- ** this list of conditions and the following disclaimer in the documentation
33
- ** and/or other materials provided with the distribution.
34
- ** 3. Neither the name of STMicroelectronics nor the names of its contributors
35
- ** may be used to endorse or promote products derived from this software
36
- ** without specific prior written permission.
37
- **
38
- ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
39
- ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40
- ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41
- ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
42
- ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
43
- ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
44
- ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
45
- ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46
- ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
47
- ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48
- **
49
- *****************************************************************************
50
- */
1
+ /**
2
+ ******************************************************************************
3
+ * @file LinkerScript.ld
4
+ * @author Auto-generated by STM32CubeIDE
5
+ * @brief Linker script for STM32G431KBTx Device from STM32G4 series
6
+ * 128Kbytes FLASH
7
+ * 32Kbytes RAM
8
+ *
9
+ * Set heap size, stack size and stack location according
10
+ * to application requirements.
11
+ *
12
+ * Set memory bank area and size if external memory is used
13
+ ******************************************************************************
14
+ * @attention
15
+ *
16
+ * <h2><center>© Copyright (c) 2020 STMicroelectronics.
17
+ * All rights reserved.</center></h2>
18
+ *
19
+ * This software component is licensed by ST under BSD 3-Clause license,
20
+ * the "License"; You may not use this file except in compliance with the
21
+ * License. You may obtain a copy of the License at :
22
+ * opensource.org /licenses/BSD-3-Clause
23
+ *
24
+ ******************************************************************************
25
+ */
51
26
52
27
/* Entry Point */
53
28
ENTRY (Reset_Handler )
54
29
55
30
/* Highest address of the user mode stack */
56
- _estack = 0x20020000 ; /* end of "RAM" Ram type memory */
31
+ _estack = ORIGIN (RAM) + LENGTH (RAM) ; /* end of "RAM" Ram type memory */
57
32
58
33
_Min_Heap_Size = 0x200; /* required amount of heap */
59
34
_Min_Stack_Size = 0x400; /* required amount of stack */
60
35
61
36
/* Memories definition */
62
37
MEMORY
63
38
{
64
- RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
65
- FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
39
+ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
40
+ FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
66
41
}
67
42
68
43
/* Sections */
@@ -102,12 +77,12 @@ SECTIONS
102
77
. = ALIGN (4);
103
78
} >FLASH
104
79
105
- .ARM.extab : {
106
- . = ALIGN (4);
107
- *(.ARM.extab* .gnu.linkonce.armextab.*)
108
- . = ALIGN (4);
80
+ .ARM.extab : {
81
+ . = ALIGN (4);
82
+ *(.ARM.extab* .gnu.linkonce.armextab.*)
83
+ . = ALIGN (4);
109
84
} >FLASH
110
-
85
+
111
86
.ARM : {
112
87
. = ALIGN (4);
113
88
__exidx_start = .;
@@ -124,7 +99,7 @@ SECTIONS
124
99
PROVIDE_HIDDEN (__preinit_array_end = .);
125
100
. = ALIGN (4);
126
101
} >FLASH
127
-
102
+
128
103
.init_array :
129
104
{
130
105
. = ALIGN (4);
@@ -134,7 +109,7 @@ SECTIONS
134
109
PROVIDE_HIDDEN (__init_array_end = .);
135
110
. = ALIGN (4);
136
111
} >FLASH
137
-
112
+
138
113
.fini_array :
139
114
{
140
115
. = ALIGN (4);
@@ -149,23 +124,25 @@ SECTIONS
149
124
_sidata = LOADADDR (.data);
150
125
151
126
/* Initialized data sections into "RAM" Ram type memory */
152
- .data :
127
+ .data :
153
128
{
154
129
. = ALIGN (4);
155
130
_sdata = .; /* create a global symbol at data start */
156
131
*(.data) /* .data sections */
157
132
*(.data*) /* .data* sections */
133
+ *(.RamFunc) /* .RamFunc sections */
134
+ *(.RamFunc*) /* .RamFunc* sections */
158
135
159
136
. = ALIGN (4);
160
137
_edata = .; /* define a global symbol at data end */
161
-
138
+
162
139
} >RAM AT> FLASH
163
-
140
+
164
141
/* Uninitialized data section into "RAM" Ram type memory */
165
142
. = ALIGN (4);
166
143
.bss :
167
144
{
168
- /* This is used by the startup in order to initialize the .bss secion */
145
+ /* This is used by the startup in order to initialize the .bss section */
169
146
_sbss = .; /* define a global symbol at bss start */
170
147
__bss_start__ = _sbss;
171
148
*(.bss)
0 commit comments