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+ */
5126
5227/* Entry Point */
5328ENTRY (Reset_Handler)
5429
5530/* 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 */
5732
5833_Min_Heap_Size = 0x200 ; /* required amount of heap */
5934_Min_Stack_Size = 0x400 ; /* required amount of stack */
6035
6136/* Memories definition */
6237MEMORY
6338{
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
6641}
6742
6843/* Sections */
@@ -102,12 +77,12 @@ SECTIONS
10277 . = ALIGN (4 );
10378 } >FLASH
10479
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 );
10984 } >FLASH
110-
85+
11186 .ARM : {
11287 . = ALIGN (4 );
11388 __exidx_start = .;
@@ -124,7 +99,7 @@ SECTIONS
12499 PROVIDE_HIDDEN (__preinit_array_end = .);
125100 . = ALIGN (4 );
126101 } >FLASH
127-
102+
128103 .init_array :
129104 {
130105 . = ALIGN (4 );
@@ -134,7 +109,7 @@ SECTIONS
134109 PROVIDE_HIDDEN (__init_array_end = .);
135110 . = ALIGN (4 );
136111 } >FLASH
137-
112+
138113 .fini_array :
139114 {
140115 . = ALIGN (4 );
@@ -149,23 +124,25 @@ SECTIONS
149124 _sidata = LOADADDR (.data );
150125
151126 /* Initialized data sections into "RAM" Ram type memory */
152- .data :
127+ .data :
153128 {
154129 . = ALIGN (4 );
155130 _sdata = .; /* create a global symbol at data start */
156131 *(.data ) /* .data sections */
157132 *(.data *) /* .data* sections */
133+ *(.RamFunc ) /* .RamFunc sections */
134+ *(.RamFunc *) /* .RamFunc* sections */
158135
159136 . = ALIGN (4 );
160137 _edata = .; /* define a global symbol at data end */
161-
138+
162139 } >RAM AT> FLASH
163-
140+
164141 /* Uninitialized data section into "RAM" Ram type memory */
165142 . = ALIGN (4 );
166143 .bss :
167144 {
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 */
169146 _sbss = .; /* define a global symbol at bss start */
170147 __bss_start__ = _sbss;
171148 *(.bss )
0 commit comments