amiro-os / ports / STM32F405xG.ld @ 61544eee
History | View | Annotate | Download (3.205 KB)
1 |
/* |
---|---|
2 |
* ST32F405xG memory setup. |
3 |
*/ |
4 |
__main_stack_size__ = 0x0400; |
5 |
__process_stack_size__ = 0x0400; |
6 |
|
7 |
MEMORY |
8 |
{ |
9 |
flash : org = 0x08008000, len = 1M-32k |
10 |
ram : org = 0x20000000, len = 112k |
11 |
ethram : org = 0x2001C000, len = 16k |
12 |
ccmram : org = 0x10000000, len = 64k |
13 |
} |
14 |
|
15 |
__ram_start__ = ORIGIN(ram); |
16 |
__ram_size__ = LENGTH(ram); |
17 |
__ram_end__ = __ram_start__ + __ram_size__; |
18 |
|
19 |
__crc_start__ = ORIGIN(flash) + 0x1AC; |
20 |
|
21 |
ENTRY(ResetHandler) |
22 |
|
23 |
SECTIONS |
24 |
{ |
25 |
. = 0; |
26 |
_text = .; |
27 |
|
28 |
startup : ALIGN(16) SUBALIGN(16) |
29 |
{ |
30 |
KEEP(*(vectors)) |
31 |
} > flash |
32 |
|
33 |
crc __crc_start__ : |
34 |
{ |
35 |
LONG(0x55AA11EE); |
36 |
} > flash |
37 |
|
38 |
constructors : ALIGN(4) SUBALIGN(4) |
39 |
{ |
40 |
PROVIDE(__init_array_start = .); |
41 |
KEEP(*(SORT(.init_array.*))) |
42 |
KEEP(*(.init_array)) |
43 |
PROVIDE(__init_array_end = .); |
44 |
} > flash |
45 |
|
46 |
destructors : ALIGN(4) SUBALIGN(4) |
47 |
{ |
48 |
PROVIDE(__fini_array_start = .); |
49 |
KEEP(*(.fini_array)) |
50 |
KEEP(*(SORT(.fini_array.*))) |
51 |
PROVIDE(__fini_array_end = .); |
52 |
} > flash |
53 |
|
54 |
.text : ALIGN(16) SUBALIGN(16) |
55 |
{ |
56 |
*(.text.startup.*) |
57 |
*(.text) |
58 |
*(.text.*) |
59 |
*(.rodata) |
60 |
*(.rodata.*) |
61 |
*(.glue_7t) |
62 |
*(.glue_7) |
63 |
*(.gcc*) |
64 |
} > flash |
65 |
|
66 |
.ARM.extab : |
67 |
{ |
68 |
*(.ARM.extab* .gnu.linkonce.armextab.*) |
69 |
} > flash |
70 |
|
71 |
.ARM.exidx : { |
72 |
PROVIDE(__exidx_start = .); |
73 |
*(.ARM.exidx* .gnu.linkonce.armexidx.*) |
74 |
PROVIDE(__exidx_end = .); |
75 |
} > flash |
76 |
|
77 |
.eh_frame_hdr : |
78 |
{ |
79 |
*(.eh_frame_hdr) |
80 |
} > flash |
81 |
|
82 |
.eh_frame : ONLY_IF_RO |
83 |
{ |
84 |
*(.eh_frame) |
85 |
} > flash |
86 |
|
87 |
.textalign : ONLY_IF_RO |
88 |
{ |
89 |
. = ALIGN(8); |
90 |
} > flash |
91 |
|
92 |
. = ALIGN(4); |
93 |
_etext = .; |
94 |
_textdata = _etext; |
95 |
|
96 |
.ccm (NOLOAD): |
97 |
{ |
98 |
PROVIDE(_ccm_start = .); |
99 |
. = ALIGN(4); |
100 |
*(.ccm) |
101 |
. = ALIGN(4); |
102 |
*(.ccm.*) |
103 |
. = ALIGN(4); |
104 |
PROVIDE(_ccm_end = .); |
105 |
} > ccmram |
106 |
|
107 |
.stacks : |
108 |
{ |
109 |
. = ALIGN(8); |
110 |
__main_stack_base__ = .; |
111 |
. += __main_stack_size__; |
112 |
. = ALIGN(8); |
113 |
__main_stack_end__ = .; |
114 |
__process_stack_base__ = .; |
115 |
__main_thread_stack_base__ = .; |
116 |
. += __process_stack_size__; |
117 |
. = ALIGN(8); |
118 |
__process_stack_end__ = .; |
119 |
__main_thread_stack_end__ = .; |
120 |
} > ram |
121 |
|
122 |
.data ALIGN(4) : ALIGN(4) |
123 |
{ |
124 |
. = ALIGN(4); |
125 |
PROVIDE(_data = .); |
126 |
*(.data) |
127 |
*(.data.*) |
128 |
*(.ramtext) |
129 |
. = ALIGN(4); |
130 |
PROVIDE(_edata = .); |
131 |
} > ram AT > flash |
132 |
|
133 |
.bss ALIGN(4) : ALIGN(4) |
134 |
{ |
135 |
. = ALIGN(4); |
136 |
PROVIDE(_bss_start = .); |
137 |
*(.bss) |
138 |
*(.bss.*) |
139 |
*(COMMON) |
140 |
. = ALIGN(4); |
141 |
PROVIDE(_bss_end = .); |
142 |
} > ram |
143 |
|
144 |
.eth (NOLOAD): |
145 |
{ |
146 |
PROVIDE(_dma_start = .); |
147 |
. = ALIGN(4); |
148 |
*(.eth) |
149 |
. = ALIGN(4); |
150 |
*(.eth.*) |
151 |
. = ALIGN(4); |
152 |
PROVIDE(_dma_end = .); |
153 |
} > ethram |
154 |
} |
155 |
|
156 |
PROVIDE(end = .); |
157 |
_end = .; |
158 |
|
159 |
__heap_base__ = _end; |
160 |
__heap_end__ = __ram_end__; |