1
- /*
2
- ******************************************************************************
3
- **
4
- ** File : LinkerScript.ld
5
- **
6
- ** Abstract : Linker script for STM32MP1 series
7
- **
8
- ** Set heap size, stack size and stack location according
9
- ** to application requirements.
10
- **
11
- ** Set memory bank area and size if external memory is used.
12
- **
13
- ** Target : STMicroelectronics STM32
14
- **
15
- ** Distribution : The file is distributed “as is,” without any warranty
16
- ** of any kind.
17
- **
18
- *****************************************************************************
19
- ** @attention
20
- **
21
- ** <h2><center>© Copyright (c) 2019 STMicroelectronics.
22
- ** All rights reserved.</center></h2>
23
- **
24
- ** This software component is licensed by ST under BSD 3-Clause license,
25
- ** the License; You may not use this file except in compliance with the
26
- ** License. You may obtain a copy of the License at :
27
- ** opensource.org /licenses/BSD-3-Clause
28
- **
29
- *****************************************************************************
30
- */
1
+ /**
2
+ ******************************************************************************
3
+ * @file LinkerScript.ld
4
+ * @author Auto-generated by STM32CubeIDE
5
+ * @brief Linker script for STM32MP157xAC series
6
+ * 128Kbytes FLASH
7
+ * 128Kbytes RAM1
8
+ * 128Kbytes RAM2
9
+ *
10
+ * Set heap size, stack size and stack location according
11
+ * to application requirements.
12
+ *
13
+ * Set memory bank area and size if external memory is used
14
+ ******************************************************************************
15
+ * @attention
16
+ *
17
+ * <h2><center>© Copyright (c) 2021 STMicroelectronics.
18
+ * All rights reserved.</center></h2>
19
+ *
20
+ * This software component is licensed by ST under BSD 3-Clause license,
21
+ * the "License"; You may not use this file except in compliance with the
22
+ * License. You may obtain a copy of the License at :
23
+ * opensource.org /licenses/BSD-3-Clause
24
+ *
25
+ ******************************************************************************
26
+ */
31
27
32
28
/* Entry Point */
33
29
ENTRY (Reset_Handler )
34
30
35
31
/* Highest address of the user mode stack */
36
- _estack = 0x10040000; /* end of RAM */
32
+ _estack = ORIGIN (RAM1_data) + LENGTH (RAM1_data); /* end of "RAM1_data" Ram type memory */
37
33
38
- _Min_Heap_Size = 0x200; /* required amount of heap */
39
- _Min_Stack_Size = 0x400; /* required amount of stack */
34
+ _Min_Heap_Size = 0x200; /* required amount of heap */
35
+ _Min_Stack_Size = 0x400; /* required amount of stack */
40
36
41
37
/* Memories definition */
42
38
MEMORY
43
39
{
44
- m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000298
45
- m_text (RX) : ORIGIN = 0x10000000, LENGTH = 0x00020000
46
- m_data (RW) : ORIGIN = 0x10020000, LENGTH = 0x00020000
47
- m_ipc_shm (RW) : ORIGIN = 0x10040000, LENGTH = 0x00008000
40
+ RETRAM_interrupts (xrw) : ORIGIN = 0x00000000, LENGTH = 0x00000298
41
+ FLASH_text (rx) : ORIGIN = 0x10000000, LENGTH = 128K
42
+ RAM1_data (xrw) : ORIGIN = 0x10020000, LENGTH = 128K
43
+ RAM2_ipc_shm (xrw) : ORIGIN = 0x10040000, LENGTH = 0x00008000
48
44
}
49
45
50
46
/* Symbols needed for OpenAMP to enable rpmsg */
51
- __OPENAMP_region_start__ = ORIGIN (m_ipc_shm );
52
- __OPENAMP_region_end__ = ORIGIN (m_ipc_shm )+LENGTH (m_ipc_shm );
47
+ __OPENAMP_region_start__ = ORIGIN (RAM2_ipc_shm );
48
+ __OPENAMP_region_end__ = ORIGIN (RAM2_ipc_shm )+LENGTH (RAM2_ipc_shm );
53
49
54
50
/* Sections */
55
51
SECTIONS
56
52
{
57
- /* The startup code into ROM memory */
53
+ /* The startup code into "RETRAM_interrupts" Ram type memory */
58
54
.isr_vector :
59
55
{
60
56
. = ALIGN (4);
61
57
KEEP(*(.isr_vector)) /* Startup code */
62
58
. = ALIGN (4);
63
- } > m_interrupts
64
-
59
+ } >RETRAM_interrupts
65
60
66
- /* The program code and other data into ROM memory */
61
+ /* The program code and other data into "FLASH_text" Rom type memory */
67
62
.text :
68
63
{
69
64
. = ALIGN (4);
@@ -78,30 +73,30 @@ SECTIONS
78
73
79
74
. = ALIGN (4);
80
75
_etext = .; /* define a global symbols at end of code */
81
- } > m_text
76
+ } >FLASH_text
82
77
83
- /* Constant data into ROM memory*/
78
+ /* Constant data into "FLASH_text" Rom type memory */
84
79
.rodata :
85
80
{
86
81
. = ALIGN (4);
87
82
*(.rodata) /* .rodata sections (constants, strings, etc.) */
88
83
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
89
84
. = ALIGN (4);
90
- } > m_text
85
+ } >FLASH_text
91
86
92
- .ARM.extab : {
87
+ .ARM.extab : {
93
88
. = ALIGN (4);
94
89
*(.ARM.extab* .gnu.linkonce.armextab.*)
95
90
. = ALIGN (4);
96
- } > m_text
97
-
91
+ } >FLASH_text
92
+
98
93
.ARM : {
99
94
. = ALIGN (4);
100
95
__exidx_start = .;
101
96
*(.ARM.exidx*)
102
97
__exidx_end = .;
103
98
. = ALIGN (4);
104
- } > m_text
99
+ } >FLASH_text
105
100
106
101
.preinit_array :
107
102
{
@@ -110,8 +105,8 @@ SECTIONS
110
105
KEEP (*(.preinit_array*))
111
106
PROVIDE_HIDDEN (__preinit_array_end = .);
112
107
. = ALIGN (4);
113
- } > m_text
114
-
108
+ } >FLASH_text
109
+
115
110
.init_array :
116
111
{
117
112
. = ALIGN (4);
@@ -120,8 +115,8 @@ SECTIONS
120
115
KEEP (*(.init_array*))
121
116
PROVIDE_HIDDEN (__init_array_end = .);
122
117
. = ALIGN (4);
123
- } > m_text
124
-
118
+ } >FLASH_text
119
+
125
120
.fini_array :
126
121
{
127
122
. = ALIGN (4);
@@ -130,13 +125,13 @@ SECTIONS
130
125
KEEP (*(.fini_array*))
131
126
PROVIDE_HIDDEN (__fini_array_end = .);
132
127
. = ALIGN (4);
133
- } > m_text
128
+ } >FLASH_text
134
129
135
130
/* Used by the startup to initialize data */
136
131
__DATA_ROM = .;
137
132
_sidata = LOADADDR (.data);
138
133
139
- /* Initialized data sections */
134
+ /* Initialized data sections into "RAM1_data" Ram type memory */
140
135
.data : AT(__DATA_ROM)
141
136
{
142
137
. = ALIGN (4);
@@ -146,21 +141,21 @@ SECTIONS
146
141
147
142
. = ALIGN (4);
148
143
_edata = .; /* define a global symbol at data end */
149
- } > m_data
144
+ } >RAM1_data
145
+
146
+ __DATA_END = __DATA_ROM + (_edata - _sdata);
147
+ text_end = ORIGIN (FLASH_text) + LENGTH (FLASH_text);
148
+ ASSERT (__DATA_END <= text_end, "region FLASH_text overflowed with text and data")
150
149
151
- __DATA_END = __DATA_ROM + (_edata - _sdata);
152
- text_end = ORIGIN (m_text) + LENGTH (m_text);
153
- ASSERT (__DATA_END <= text_end, "region m_text overflowed with text and data")
154
150
155
151
.resource_table :
156
152
{
157
153
. = ALIGN (4);
158
154
KEEP (*(.resource_table*))
159
155
. = ALIGN (4);
160
- } > m_data
161
-
156
+ } >RAM1_data
162
157
163
- /* Uninitialized data section into RAM memory */
158
+ /* Uninitialized data section into "RAM1_data" Ram type memory */
164
159
. = ALIGN (4);
165
160
.bss :
166
161
{
@@ -174,9 +169,9 @@ SECTIONS
174
169
. = ALIGN (4);
175
170
_ebss = .; /* define a global symbol at bss end */
176
171
__bss_end__ = _ebss;
177
- } > m_data
172
+ } >RAM1_data
178
173
179
- /* User_heap_stack section, used to check that there is enough RAM left */
174
+ /* User_heap_stack section, used to check that there is enough "RAM1_data" Ram type memory left */
180
175
._user_heap_stack :
181
176
{
182
177
. = ALIGN (8);
@@ -185,9 +180,7 @@ SECTIONS
185
180
. = . + _Min_Heap_Size;
186
181
. = . + _Min_Stack_Size;
187
182
. = ALIGN (8);
188
- } > m_data
189
-
190
-
183
+ } >RAM1_data
191
184
192
185
/* Remove information from the compiler libraries */
193
186
/DISCARD/ :
@@ -198,5 +191,4 @@ SECTIONS
198
191
}
199
192
200
193
.ARM.attributes 0 : { *(.ARM.attributes) }
201
-
202
194
}
0 commit comments