Skip to content

Commit 9f8924c

Browse files
committed
Merge pull request #218 from dinau/stm32vld_initial
STM32VL-Discovery initial port
2 parents 8e21b1a + 1683e9f commit 9f8924c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

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

0 commit comments

Comments
 (0)