Skip to content

Commit 80eb887

Browse files
author
Deepika
committed
Update linker files and resolve build issue
Linker files for LPC11U68 and LPC1549 updated as Mbed OS memory model 1. LPC1549 Has multiple memory banks, 4K bank used for stack exclusively and 16K for Heap Its is mbed 2 only target hence 4K for stack. 2. LPC11U68 Added Heap and Stack sections in linker files. Resolved build issues.
1 parent 3252530 commit 80eb887

File tree

3 files changed

+42
-5
lines changed

3 files changed

+42
-5
lines changed

targets/TARGET_NXP/TARGET_LPC11U6X/device/TOOLCHAIN_GCC_ARM/TARGET_LPC11U68/LPC11U68.ld

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
* By LPCXpresso v7.2.0 [Build 153] [2014-05-19] on Sat Jun 14 15:26:54 JST 2014
99
*/
1010

11+
12+
#if !defined(MBED_BOOT_STACK_SIZE)
13+
#define MBED_BOOT_STACK_SIZE 0x400
14+
#endif
15+
16+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
17+
1118
MEMORY
1219
{
1320
/* Define each memory region */
@@ -229,7 +236,32 @@ SECTIONS
229236
. = ALIGN(8) ;
230237
_end_noinit = .;
231238
} > Ram0_32
232-
239+
233240
PROVIDE(_pvHeapStart = .);
234-
PROVIDE(_vStackTop = __top_Ram0_32 - 0);
241+
.heap :
242+
{
243+
__end__ = .;
244+
end = __end__;
245+
*(.heap*)
246+
. = ORIGIN(Ram0_32) + LENGTH(Ram0_32) - STACK_SIZE;
247+
__HeapLimit = .;
248+
} > Ram0_32
249+
250+
251+
/* .stack_dummy section doesn't contains any symbols. It is only
252+
* used for linker to calculate size of stack sections, and assign
253+
* values to stack symbols later */
254+
.stack_dummy :
255+
{
256+
*(.stack)
257+
} > Ram0_32
258+
259+
/* Set stack top to end of RAM, and stack limit move down by
260+
* size of stack_dummy section */
261+
__StackTop = ORIGIN(Ram0_32) + LENGTH(Ram0_32);
262+
__StackLimit = __StackTop - STACK_SIZE;
263+
PROVIDE(__stack = __StackTop);
264+
265+
PROVIDE(__stack = __StackTop);
266+
PROVIDE(_vStackTop = __StackTop);
235267
}

targets/TARGET_NXP/TARGET_LPC15XX/device/TOOLCHAIN_GCC_ARM/LPC1549.ld

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,22 @@ SECTIONS
138138
__end__ = .;
139139
end = __end__;
140140
*(.heap*)
141+
. = ORIGIN(Ram1_16) + LENGTH(Ram1_16);
141142
__HeapLimit = .;
142-
} > Ram0_16
143+
} > Ram1_16
144+
143145

144146
/* .stack_dummy section doesn't contains any symbols. It is only
145147
* used for linker to calculate size of stack sections, and assign
146148
* values to stack symbols later */
147149
.stack_dummy :
148150
{
149151
*(.stack)
150-
} > Ram0_16
152+
} > Ram2_4
151153

152154
/* Set stack top to end of RAM, and stack limit move down by
153155
* size of stack_dummy section */
154-
__StackTop = ORIGIN(Ram0_16) + LENGTH(Ram0_16) + LENGTH(Ram1_16) + LENGTH(Ram2_4);
156+
__StackTop = ORIGIN(Ram2_4) + LENGTH(Ram2_4);
155157
__StackLimit = __StackTop - STACK_SIZE;
156158
PROVIDE(__stack = __StackTop);
157159

targets/targets.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,9 @@
511511
"SLEEP",
512512
"SPI"
513513
],
514+
"macros": [
515+
"MBED_FAULT_HANDLER_DISABLED"
516+
],
514517
"default_lib": "small",
515518
"release_versions": ["2"],
516519
"device_name": "LPC11U68JBD100"

0 commit comments

Comments
 (0)