Skip to content

Commit 29fc31e

Browse files
author
Bogdan Marinescu
committed
Merge branch 'ohagendorf-DISCO_F429'
2 parents 43bee35 + a156b0f commit 29fc31e

File tree

152 files changed

+113967
-1
lines changed

Some content is hidden

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

152 files changed

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

0 commit comments

Comments
 (0)