1
- /** Copyright © 2021 The Things Industries B.V.
2
- *
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http ://www.apache.org /licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
1
+ /*
2
+ ******************************************************************************
3
+ **
4
+ ** File : ldscript.ld
5
+ **
6
+ ** Author : STM32CubeIDE
7
+ **
8
+ ** Abstract : Linker script for STM32WL55xC Device
9
+ ** 256Kbytes FLASH
10
+ ** 64Kbytes 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) 2021 STMicroelectronics.
26
+ ** All rights reserved.</center></h2>
27
+ **
28
+ ** This software component is licensed by ST under BSD 3-Clause license,
29
+ ** the "License"; You may not use this file except in compliance with the
30
+ ** License. You may obtain a copy of the License at :
31
+ ** opensource.org /licenses/BSD-3-Clause
32
+ **
33
+ *****************************************************************************
14
34
*/
15
35
16
36
/* Entry Point */
17
37
ENTRY (Reset_Handler )
18
38
19
39
/* Highest address of the user mode stack */
20
- _estack = ORIGIN (RAM1 ) + LENGTH (RAM1 ); /* end of "SRAM1 " Ram type memory */
40
+ _estack = ORIGIN (RAM ) + LENGTH (RAM ); /* end of "RAM " Ram type memory */
21
41
22
- _Min_Heap_Size = 0x400 ; /* required amount of heap */
23
- _Min_Stack_Size = 0x800 ; /* required amount of stack */
42
+ _Min_Heap_Size = 0x200 ; /* required amount of heap */
43
+ _Min_Stack_Size = 0x400 ; /* required amount of stack */
24
44
25
45
/* Memories definition */
26
46
MEMORY
27
47
{
28
- ROM (rx) : ORIGIN = 0x08000000, LENGTH = 256K /* Flash memory dedicated to CM4 */
29
- RAM1 (xrw) : ORIGIN = 0x20000000, LENGTH = 32K /* Non-backup SRAM1 dedicated to CM4 */
30
- RAM2 (xrw) : ORIGIN = 0x20008000, LENGTH = 32K /* Backup SRAM2 dedicated to CM4 */
48
+ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
49
+ FLASH (rx) : ORIGIN = 0x08000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
31
50
}
32
51
33
52
/* Sections */
34
53
SECTIONS
35
54
{
36
- /* The startup code into "ROM " Rom type memory */
55
+ /* The startup code into "FLASH " Rom type memory */
37
56
.isr_vector :
38
57
{
39
- . = ALIGN (8 );
58
+ . = ALIGN (4 );
40
59
KEEP(*(.isr_vector)) /* Startup code */
41
- . = ALIGN (8 );
42
- } >ROM
60
+ . = ALIGN (4 );
61
+ } >FLASH
43
62
44
- /* The program code and other data into "ROM " Rom type memory */
63
+ /* The program code and other data into "FLASH " Rom type memory */
45
64
.text :
46
65
{
47
- . = ALIGN (8 );
66
+ . = ALIGN (4 );
48
67
*(.text) /* .text sections (code) */
49
68
*(.text*) /* .text* sections (code) */
50
69
*(.glue_7) /* glue arm to thumb code */
@@ -54,80 +73,82 @@ SECTIONS
54
73
KEEP (*(.init))
55
74
KEEP (*(.fini))
56
75
57
- . = ALIGN (8 );
76
+ . = ALIGN (4 );
58
77
_etext = .; /* define a global symbols at end of code */
59
- } >ROM
78
+ } >FLASH
60
79
61
- /* Constant data into "ROM " Rom type memory */
80
+ /* Constant data into "FLASH " Rom type memory */
62
81
.rodata :
63
82
{
64
- . = ALIGN (8 );
83
+ . = ALIGN (4 );
65
84
*(.rodata) /* .rodata sections (constants, strings, etc.) */
66
85
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
67
- . = ALIGN (8 );
68
- } >ROM
86
+ . = ALIGN (4 );
87
+ } >FLASH
69
88
70
89
.ARM.extab : {
71
- . = ALIGN (8 );
90
+ . = ALIGN (4 );
72
91
*(.ARM.extab* .gnu.linkonce.armextab.*)
73
- . = ALIGN (8 );
74
- } >ROM
92
+ . = ALIGN (4 );
93
+ } >FLASH
75
94
76
95
.ARM : {
77
- . = ALIGN (8 );
96
+ . = ALIGN (4 );
78
97
__exidx_start = .;
79
98
*(.ARM.exidx*)
80
99
__exidx_end = .;
81
- . = ALIGN (8 );
82
- } >ROM
100
+ . = ALIGN (4 );
101
+ } >FLASH
83
102
84
103
.preinit_array :
85
104
{
86
- . = ALIGN (8 );
105
+ . = ALIGN (4 );
87
106
PROVIDE_HIDDEN (__preinit_array_start = .);
88
107
KEEP (*(.preinit_array*))
89
108
PROVIDE_HIDDEN (__preinit_array_end = .);
90
- . = ALIGN (8 );
91
- } >ROM
109
+ . = ALIGN (4 );
110
+ } >FLASH
92
111
93
112
.init_array :
94
113
{
95
- . = ALIGN (8 );
114
+ . = ALIGN (4 );
96
115
PROVIDE_HIDDEN (__init_array_start = .);
97
116
KEEP (*(SORT(.init_array.*)))
98
117
KEEP (*(.init_array*))
99
118
PROVIDE_HIDDEN (__init_array_end = .);
100
- . = ALIGN (8 );
101
- } >ROM
119
+ . = ALIGN (4 );
120
+ } >FLASH
102
121
103
122
.fini_array :
104
123
{
105
- . = ALIGN (8 );
124
+ . = ALIGN (4 );
106
125
PROVIDE_HIDDEN (__fini_array_start = .);
107
126
KEEP (*(SORT(.fini_array.*)))
108
127
KEEP (*(.fini_array*))
109
128
PROVIDE_HIDDEN (__fini_array_end = .);
110
- . = ALIGN (8 );
111
- } >ROM
129
+ . = ALIGN (4 );
130
+ } >FLASH
112
131
113
132
/* Used by the startup to initialize data */
114
133
_sidata = LOADADDR (.data);
115
134
116
- /* Initialized data sections into "SRAM1 " Ram type memory */
135
+ /* Initialized data sections into "RAM " Ram type memory */
117
136
.data :
118
137
{
119
- . = ALIGN (8 );
138
+ . = ALIGN (4 );
120
139
_sdata = .; /* create a global symbol at data start */
121
140
*(.data) /* .data sections */
122
141
*(.data*) /* .data* sections */
142
+ *(.RamFunc) /* .RamFunc sections */
143
+ *(.RamFunc*) /* .RamFunc* sections */
123
144
124
- . = ALIGN (8 );
145
+ . = ALIGN (4 );
125
146
_edata = .; /* define a global symbol at data end */
126
147
127
- } >RAM1 AT> ROM
148
+ } >RAM AT> FLASH
128
149
129
- /* Uninitialized data section into "SRAM1 " Ram type memory */
130
- . = ALIGN (8 );
150
+ /* Uninitialized data section into "RAM " Ram type memory */
151
+ . = ALIGN (4 );
131
152
.bss :
132
153
{
133
154
/* This is used by the startup in order to initialize the .bss section */
@@ -137,34 +158,12 @@ SECTIONS
137
158
*(.bss*)
138
159
*(COMMON)
139
160
140
- . = ALIGN (8 );
161
+ . = ALIGN (4 );
141
162
_ebss = .; /* define a global symbol at bss end */
142
163
__bss_end__ = _ebss;
143
- } >RAM1
144
-
145
- /* Data section into "SRAM1" Ram type memory : Non-backup SRAM1 dedicated to CM4 */
146
- . = ALIGN (8);
147
- RAM1_region :
148
- {
149
- _sRAM1_region = .; /* define a global symbol at section start */
150
- *(.RAM1_region)
151
-
152
- . = ALIGN (8);
153
- _eRAM1_region = .; /* define a global symbol at section end */
154
- } >RAM1
155
-
156
- /* Data section into "SRAM2" Ram type memory : Backup SRAM2 dedicated to CM4 */
157
- . = ALIGN (8);
158
- RAM2_region :
159
- {
160
- _sRAM2_region = .; /* define a global symbol at section start */
161
- *(.RAM2_region)
162
-
163
- . = ALIGN (8);
164
- _eRAM2_region = .; /* define a global symbol at section end */
165
- } >RAM2
164
+ } >RAM
166
165
167
- /* User_heap_stack section, used to check that there is enough "SRAM1 " Ram type memory left */
166
+ /* User_heap_stack section, used to check that there is enough "RAM " Ram type memory left */
168
167
._user_heap_stack :
169
168
{
170
169
. = ALIGN (8);
@@ -173,8 +172,7 @@ SECTIONS
173
172
. = . + _Min_Heap_Size;
174
173
. = . + _Min_Stack_Size;
175
174
. = ALIGN (8);
176
- __RAM_segment_used_end__ = .;
177
- } >RAM1
175
+ } >RAM
178
176
179
177
/* Remove information from the compiler libraries */
180
178
/DISCARD/ :
0 commit comments