Skip to content

Commit f429708

Browse files
committed
fix(bsp): 重新添加开发板IAR、GCC链接脚本
链接脚本中包含了所有寄存器,除flash与主sarm外其余寄存器已注释
1 parent 25426dc commit f429708

File tree

2 files changed

+202
-0
lines changed

2 files changed

+202
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*###ICF### Section handled by ICF editor, don't touch! ****/
2+
/*-Editor annotation file-*/
3+
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
4+
/*-Specials-*/
5+
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
6+
/*-Memory Regions-*/
7+
define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
8+
define symbol __ICFEDIT_region_ROM_end__ = 0x080FFFFF; /* 1MB FLASH */
9+
define symbol __ICFEDIT_region_RAM_start__ = 0x24000000;
10+
define symbol __ICFEDIT_region_RAM_end__ = 0x2404FFFF; /* 320KB AXI SRAM */
11+
/*-Sizes-*/
12+
define symbol __ICFEDIT_size_cstack__ = 0x0400;
13+
define symbol __ICFEDIT_size_heap__ = 0x000;
14+
/**** End of ICF editor section. ###ICF###*/
15+
16+
/* Commented memory regions for reference */
17+
/* define symbol __ICFEDIT_region_ITCM_start__ = 0x00000000; */
18+
/* define symbol __ICFEDIT_region_ITCM_end__ = 0x0000FFFF; /\* 64KB ITCM *\/ */
19+
/* define symbol __ICFEDIT_region_DTCM_start__ = 0x20000000; */
20+
/* define symbol __ICFEDIT_region_DTCM_end__ = 0x2001FFFF; /\* 128KB DTCM *\/ */
21+
/* define symbol __ICFEDIT_region_SRAM2_start__ = 0x30000000; */
22+
/* define symbol __ICFEDIT_region_SRAM2_end__ = 0x30007FFF; /\* 32KB AHB SRAM D2 *\/ */
23+
/* define symbol __ICFEDIT_region_SRAM3_start__ = 0x38000000; */
24+
/* define symbol __ICFEDIT_region_SRAM3_end__ = 0x38003FFF; /\* 16KB AHB SRAM D3 *\/ */
25+
/* define symbol __ICFEDIT_region_BSRAM_start__ = 0x38800000; */
26+
/* define symbol __ICFEDIT_region_BSRAM_end__ = 0x38800FFF; /\* 4KB BACKUP SRAM D3 *\/ */
27+
28+
define memory mem with size = 4G;
29+
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
30+
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
31+
32+
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
33+
34+
initialize by copy { readwrite };
35+
do not initialize { section .noinit };
36+
37+
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
38+
39+
place in ROM_region { readonly };
40+
place in RAM_region { readwrite, last block CSTACK};
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
/*
2+
* linker script for STM32F4xx with GNU ld
3+
* bernard.xiong 2009-10-14
4+
*/
5+
6+
/* Program Entry, set to mark it as "used" and avoid gc */
7+
MEMORY
8+
{
9+
ROM (rx) : ORIGIN = 0x08000000, LENGTH = 1024k /* 1024KB flash */
10+
RAM (rw) : ORIGIN = 0x24000000, LENGTH = 320k /* 320K AXI SRAM */
11+
/* ITCM (rx) : ORIGIN = 0x00000000, LENGTH = 64k /\* 64KB ITCM SRAM *\/ */
12+
/* DTCM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /\* 128KB DTCM SRAM *\/ */
13+
/* SRAM2 (rw): ORIGIN = 0x30000000, LENGTH = 32k /\* 32KB AHB SRAM D2 *\/ */
14+
/* SRAM3 (rw): ORIGIN = 0x38000000, LENGTH = 16k /\* 16KB AHB SRAM D3 *\/ */
15+
/* BSRAM (rw): ORIGIN = 0x38800000, LENGTH = 4k /\* 4KB BACKUP SRAM D3 *\/ */
16+
}
17+
ENTRY(Reset_Handler)
18+
_system_stack_size = 0x400;
19+
20+
SECTIONS
21+
{
22+
.text :
23+
{
24+
. = ALIGN(4);
25+
_stext = .;
26+
KEEP(*(.isr_vector)) /* Startup code */
27+
28+
. = ALIGN(4);
29+
*(.text) /* remaining code */
30+
*(.text.*) /* remaining code */
31+
*(.rodata) /* read-only data (constants) */
32+
*(.rodata*)
33+
*(.glue_7)
34+
*(.glue_7t)
35+
*(.gnu.linkonce.t*)
36+
37+
/* section information for finsh shell */
38+
. = ALIGN(4);
39+
__fsymtab_start = .;
40+
KEEP(*(FSymTab))
41+
__fsymtab_end = .;
42+
43+
. = ALIGN(4);
44+
__vsymtab_start = .;
45+
KEEP(*(VSymTab))
46+
__vsymtab_end = .;
47+
48+
/* section information for initial. */
49+
. = ALIGN(4);
50+
__rt_init_start = .;
51+
KEEP(*(SORT(.rti_fn*)))
52+
__rt_init_end = .;
53+
54+
. = ALIGN(4);
55+
56+
PROVIDE(__ctors_start__ = .);
57+
KEEP (*(SORT(.init_array.*)))
58+
KEEP (*(.init_array))
59+
PROVIDE(__ctors_end__ = .);
60+
61+
. = ALIGN(4);
62+
63+
_etext = .;
64+
} > ROM = 0
65+
66+
/* .ARM.exidx is sorted, so has to go in its own output section. */
67+
__exidx_start = .;
68+
.ARM.exidx :
69+
{
70+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
71+
72+
/* This is used by the startup in order to initialize the .data secion */
73+
_sidata = .;
74+
} > ROM
75+
__exidx_end = .;
76+
77+
/* .data section which is used for initialized data */
78+
79+
.data : AT (_sidata)
80+
{
81+
. = ALIGN(4);
82+
/* This is used by the startup in order to initialize the .data secion */
83+
_sdata = . ;
84+
85+
*(.data)
86+
*(.data.*)
87+
*(.gnu.linkonce.d*)
88+
89+
PROVIDE(__dtors_start__ = .);
90+
KEEP(*(SORT(.dtors.*)))
91+
KEEP(*(.dtors))
92+
PROVIDE(__dtors_end__ = .);
93+
94+
. = ALIGN(4);
95+
/* This is used by the startup in order to initialize the .data secion */
96+
_edata = . ;
97+
} >RAM
98+
99+
.stack :
100+
{
101+
. = ALIGN(4);
102+
_sstack = .;
103+
. = . + _system_stack_size;
104+
. = ALIGN(4);
105+
_estack = .;
106+
} >RAM
107+
108+
__bss_start = .;
109+
.bss :
110+
{
111+
. = ALIGN(4);
112+
/* This is used by the startup in order to initialize the .bss secion */
113+
_sbss = .;
114+
115+
*(.bss)
116+
*(.bss.*)
117+
*(COMMON)
118+
119+
. = ALIGN(4);
120+
/* This is used by the startup in order to initialize the .bss secion */
121+
_ebss = . ;
122+
123+
*(.bss.init)
124+
} > RAM
125+
__bss_end = .;
126+
127+
_end = .;
128+
129+
/* Stabs debugging sections. */
130+
.stab 0 : { *(.stab) }
131+
.stabstr 0 : { *(.stabstr) }
132+
.stab.excl 0 : { *(.stab.excl) }
133+
.stab.exclstr 0 : { *(.stab.exclstr) }
134+
.stab.index 0 : { *(.stab.index) }
135+
.stab.indexstr 0 : { *(.stab.indexstr) }
136+
.comment 0 : { *(.comment) }
137+
/* DWARF debug sections.
138+
* Symbols in the DWARF debugging sections are relative to the beginning
139+
* of the section so we begin them at 0. */
140+
/* DWARF 1 */
141+
.debug 0 : { *(.debug) }
142+
.line 0 : { *(.line) }
143+
/* GNU DWARF 1 extensions */
144+
.debug_srcinfo 0 : { *(.debug_srcinfo) }
145+
.debug_sfnames 0 : { *(.debug_sfnames) }
146+
/* DWARF 1.1 and DWARF 2 */
147+
.debug_aranges 0 : { *(.debug_aranges) }
148+
.debug_pubnames 0 : { *(.debug_pubnames) }
149+
/* DWARF 2 */
150+
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
151+
.debug_abbrev 0 : { *(.debug_abbrev) }
152+
.debug_line 0 : { *(.debug_line) }
153+
.debug_frame 0 : { *(.debug_frame) }
154+
.debug_str 0 : { *(.debug_str) }
155+
.debug_loc 0 : { *(.debug_loc) }
156+
.debug_macinfo 0 : { *(.debug_macinfo) }
157+
/* SGI/MIPS DWARF 2 extensions */
158+
.debug_weaknames 0 : { *(.debug_weaknames) }
159+
.debug_funcnames 0 : { *(.debug_funcnames) }
160+
.debug_typenames 0 : { *(.debug_typenames) }
161+
.debug_varnames 0 : { *(.debug_varnames) }
162+
}

0 commit comments

Comments
 (0)