Skip to content

Commit 0718c76

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 2e54966 + 42e27e7 commit 0718c76

File tree

28 files changed

+785
-257
lines changed

28 files changed

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

libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11XX/TOOLCHAIN_GCC_ARM/LPC1114.ld

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
MEMORY
55
{
66
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 32K
7-
RAM (rwx) : ORIGIN = 0x10000000, LENGTH = 2K
7+
RAM (rwx) : ORIGIN = 0x100000C0, LENGTH = 0x0F40
88
}
99

1010
/* Linker script to place sections and symbol values. Should be used together
@@ -40,6 +40,9 @@ SECTIONS
4040
.text :
4141
{
4242
KEEP(*(.isr_vector))
43+
*(.text.Reset_Handler)
44+
*(.text.SystemInit)
45+
. = 0x200;
4346
*(.text*)
4447

4548
KEEP(*(.init))

libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC23XX/TOOLCHAIN_GCC_ARM/LPC2368.ld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ SECTIONS
142142
/* Heap starts here and grows up in memory */
143143
. = ALIGN( 8 ) ;
144144
__heap_start__ = . ;
145+
end = . ;
145146

146147
.stab 0 (NOLOAD) : { *(.stab) }
147148
.stabstr 0 (NOLOAD) : { *(.stabstr) }

0 commit comments

Comments
 (0)