Skip to content

Commit e466685

Browse files
author
Roberto Spelta
committed
copy of L476RG ld file
1 parent 4d75cbe commit e466685

File tree

1 file changed

+162
-0
lines changed
  • targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L476xG/TARGET_SILICA_SENSOR_NODE/device/TOOLCHAIN_GCC_ARM

1 file changed

+162
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
#if !defined(MBED_APP_START)
2+
#define MBED_APP_START 0x08000000
3+
#endif
4+
5+
#if !defined(MBED_APP_SIZE)
6+
#define MBED_APP_SIZE 1024k
7+
#endif
8+
9+
/* Linker script to configure memory regions. */
10+
MEMORY
11+
{
12+
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
13+
SRAM2 (rwx) : ORIGIN = 0x10000188, LENGTH = 32k - 0x188
14+
SRAM1 (rwx) : ORIGIN = 0x20000000, LENGTH = 96k
15+
}
16+
17+
/* Linker script to place sections and symbol values. Should be used together
18+
* with other linker script that defines memory regions FLASH and RAM.
19+
* It references following symbols, which must be defined in code:
20+
* Reset_Handler : Entry of reset handler
21+
*
22+
* It defines following symbols, which code can use without definition:
23+
* __exidx_start
24+
* __exidx_end
25+
* __etext
26+
* __data_start__
27+
* __preinit_array_start
28+
* __preinit_array_end
29+
* __init_array_start
30+
* __init_array_end
31+
* __fini_array_start
32+
* __fini_array_end
33+
* __data_end__
34+
* __bss_start__
35+
* __bss_end__
36+
* __end__
37+
* end
38+
* __HeapLimit
39+
* __StackLimit
40+
* __StackTop
41+
* __stack
42+
* _estack
43+
*/
44+
ENTRY(Reset_Handler)
45+
46+
SECTIONS
47+
{
48+
.text :
49+
{
50+
KEEP(*(.isr_vector))
51+
*(.text*)
52+
KEEP(*(.init))
53+
KEEP(*(.fini))
54+
55+
/* .ctors */
56+
*crtbegin.o(.ctors)
57+
*crtbegin?.o(.ctors)
58+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
59+
*(SORT(.ctors.*))
60+
*(.ctors)
61+
62+
/* .dtors */
63+
*crtbegin.o(.dtors)
64+
*crtbegin?.o(.dtors)
65+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
66+
*(SORT(.dtors.*))
67+
*(.dtors)
68+
69+
*(.rodata*)
70+
71+
KEEP(*(.eh_frame*))
72+
} > FLASH
73+
74+
.ARM.extab :
75+
{
76+
*(.ARM.extab* .gnu.linkonce.armextab.*)
77+
} > FLASH
78+
79+
__exidx_start = .;
80+
.ARM.exidx :
81+
{
82+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
83+
} > FLASH
84+
__exidx_end = .;
85+
86+
__etext = .;
87+
_sidata = .;
88+
89+
.data : AT (__etext)
90+
{
91+
__data_start__ = .;
92+
_sdata = .;
93+
*(vtable)
94+
*(.data*)
95+
96+
. = ALIGN(4);
97+
/* preinit data */
98+
PROVIDE_HIDDEN (__preinit_array_start = .);
99+
KEEP(*(.preinit_array))
100+
PROVIDE_HIDDEN (__preinit_array_end = .);
101+
102+
. = ALIGN(4);
103+
/* init data */
104+
PROVIDE_HIDDEN (__init_array_start = .);
105+
KEEP(*(SORT(.init_array.*)))
106+
KEEP(*(.init_array))
107+
PROVIDE_HIDDEN (__init_array_end = .);
108+
109+
110+
. = ALIGN(4);
111+
/* finit data */
112+
PROVIDE_HIDDEN (__fini_array_start = .);
113+
KEEP(*(SORT(.fini_array.*)))
114+
KEEP(*(.fini_array))
115+
PROVIDE_HIDDEN (__fini_array_end = .);
116+
117+
KEEP(*(.jcr*))
118+
. = ALIGN(4);
119+
/* All data end */
120+
__data_end__ = .;
121+
_edata = .;
122+
123+
} > SRAM1
124+
125+
.bss :
126+
{
127+
. = ALIGN(4);
128+
__bss_start__ = .;
129+
_sbss = .;
130+
*(.bss*)
131+
*(COMMON)
132+
. = ALIGN(4);
133+
__bss_end__ = .;
134+
_ebss = .;
135+
} > SRAM1
136+
137+
.heap (COPY):
138+
{
139+
__end__ = .;
140+
end = __end__;
141+
*(.heap*)
142+
__HeapLimit = .;
143+
} > SRAM1
144+
145+
/* .stack_dummy section doesn't contains any symbols. It is only
146+
* used for linker to calculate size of stack sections, and assign
147+
* values to stack symbols later */
148+
.stack_dummy (COPY):
149+
{
150+
*(.stack*)
151+
} > SRAM1
152+
153+
/* Set stack top to end of RAM, and stack limit move down by
154+
* size of stack_dummy section */
155+
__StackTop = ORIGIN(SRAM1) + LENGTH(SRAM1);
156+
_estack = __StackTop;
157+
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
158+
PROVIDE(__stack = __StackTop);
159+
160+
/* Check if data + heap + stack exceeds RAM limit */
161+
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
162+
}

0 commit comments

Comments
 (0)