1 | /* Entry Point */
|
2 | ENTRY(Reset_Handler)
|
3 |
|
4 | /* Highest address of the user mode stack */
|
5 | _estack = 0x20080000; /* end of RAM */
|
6 | /* Generate a link error if heap and stack don't fit into RAM */
|
7 | _Min_Heap_Size = 0x400; /* required amount of heap */
|
8 | _Min_Stack_Size = 0x800; /* required amount of stack */
|
9 |
|
10 | /* Specify the memory areas */
|
11 | MEMORY
|
12 | {
|
13 | FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
|
14 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K
|
15 | Memory_B1(xrw) : ORIGIN = 0x2007C000, LENGTH = 0x80
|
16 | Memory_B2(xrw) : ORIGIN = 0x2007C080, LENGTH = 0x80
|
17 | Memory_B3(xrw) : ORIGIN = 0x2007C100, LENGTH = 0x17d0
|
18 | Memory_B4(xrw) : ORIGIN = 0x2007D8D0, LENGTH = 0x17d0
|
19 | ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 16K
|
20 | }
|
21 |
|
22 | /* Define output sections */
|
23 | SECTIONS
|
24 | {
|
25 | /* The startup code goes first into FLASH */
|
26 | .isr_vector :
|
27 | {
|
28 | . = ALIGN(4);
|
29 | KEEP(*(.isr_vector)) /* Startup code */
|
30 | . = ALIGN(4);
|
31 | } >FLASH
|
32 |
|
33 | /* The program code and other data goes into FLASH */
|
34 | .text :
|
35 | {
|
36 | . = ALIGN(4);
|
37 | *(.text) /* .text sections (code) */
|
38 | *(.text*) /* .text* sections (code) */
|
39 | *(.glue_7) /* glue arm to thumb code */
|
40 | *(.glue_7t) /* glue thumb to arm code */
|
41 | *(.eh_frame)
|
42 |
|
43 | KEEP (*(.init))
|
44 | KEEP (*(.fini))
|
45 |
|
46 | . = ALIGN(4);
|
47 | _etext = .; /* define a global symbols at end of code */
|
48 | } >FLASH
|
49 |
|
50 | /* Constant data goes into FLASH */
|
51 | .rodata :
|
52 | {
|
53 | . = ALIGN(4);
|
54 | *(.rodata) /* .rodata sections (constants, strings, etc.) */
|
55 | *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
56 | . = ALIGN(4);
|
57 | } >FLASH
|
58 |
|
59 | .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
|
60 | .ARM : {
|
61 | __exidx_start = .;
|
62 | *(.ARM.exidx*)
|
63 | __exidx_end = .;
|
64 | } >FLASH
|
65 |
|
66 | .preinit_array :
|
67 | {
|
68 | PROVIDE_HIDDEN (__preinit_array_start = .);
|
69 | KEEP (*(.preinit_array*))
|
70 | PROVIDE_HIDDEN (__preinit_array_end = .);
|
71 | } >FLASH
|
72 | .init_array :
|
73 | {
|
74 | PROVIDE_HIDDEN (__init_array_start = .);
|
75 | KEEP (*(SORT(.init_array.*)))
|
76 | KEEP (*(.init_array*))
|
77 | PROVIDE_HIDDEN (__init_array_end = .);
|
78 | } >FLASH
|
79 | .fini_array :
|
80 | {
|
81 | PROVIDE_HIDDEN (__fini_array_start = .);
|
82 | KEEP (*(SORT(.fini_array.*)))
|
83 | KEEP (*(.fini_array*))
|
84 | PROVIDE_HIDDEN (__fini_array_end = .);
|
85 | } >FLASH
|
86 |
|
87 | /* used by the startup to initialize data */
|
88 | _sidata = LOADADDR(.data);
|
89 |
|
90 | /* Initialized data sections goes into RAM, load LMA copy after code */
|
91 | .data :
|
92 | {
|
93 | . = ALIGN(4);
|
94 | _sdata = .; /* create a global symbol at data start */
|
95 | *(.data) /* .data sections */
|
96 | *(.data*) /* .data* sections */
|
97 |
|
98 | . = ALIGN(4);
|
99 | _edata = .; /* define a global symbol at data end */
|
100 | } >RAM AT> FLASH
|
101 |
|
102 |
|
103 | /* Uninitialized data section */
|
104 | . = ALIGN(4);
|
105 | .bss :
|
106 | {
|
107 | /* This is used by the startup in order to initialize the .bss secion */
|
108 | _sbss = .; /* define a global symbol at bss start */
|
109 | __bss_start__ = _sbss;
|
110 | *(.bss)
|
111 | *(.bss*)
|
112 | *(COMMON)
|
113 |
|
114 | . = ALIGN(4);
|
115 | _ebss = .; /* define a global symbol at bss end */
|
116 | __bss_end__ = _ebss;
|
117 | } >RAM
|
118 |
|
119 | /* User_heap_stack section, used to check that there is enough RAM left */
|
120 | ._user_heap_stack :
|
121 | {
|
122 | . = ALIGN(8);
|
123 | PROVIDE ( end = . );
|
124 | PROVIDE ( _end = . );
|
125 | . = . + _Min_Heap_Size;
|
126 | . = . + _Min_Stack_Size;
|
127 | . = ALIGN(8);
|
128 | } >RAM
|
129 |
|
130 |
|
131 |
|
132 | /* Remove information from the standard libraries */
|
133 | /DISCARD/ :
|
134 | {
|
135 | libc.a ( * )
|
136 | libm.a ( * )
|
137 | libgcc.a ( * )
|
138 | }
|
139 |
|
140 | .ARM.attributes 0 : { *(.ARM.attributes) }
|
141 | .RxDescripSection : { *(.RxDescripSection) } >Memory_B1
|
142 | .TxDescripSection : { *(.TxDescripSection) } >Memory_B2
|
143 | .RxBUF : { *(.RxBUF) } >Memory_B3
|
144 | .TxBUF : { *(.TxBUF) } >Memory_B4
|
145 | }
|