Skip to content

Commit 1b931dc

Browse files
committed
[ublox] Support boot stack size configuration option
1 parent 40b0fab commit 1b931dc

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#! armcc -E
2+
3+
#if !defined(MBED_BOOT_STACK_SIZE)
4+
#define MBED_BOOT_STACK_SIZE 0x400
5+
#endif
6+
7+
#define Stack_Size MBED_BOOT_STACK_SIZE
8+
19
LR_IROM1 0x00000000 0x20000 {
210
ER_IROM1 0x00000000 0x20000 {
311
*.o (RESET, +First)
@@ -6,10 +14,12 @@ LR_IROM1 0x00000000 0x20000 {
614
}
715
RW_IRAM_VTABLE 0x01000000 EMPTY 128 {
816
}
9-
RW_IRAM1 +0 (0x5000 - 256) {
17+
RW_IRAM1 +0 (0x5000 - 256 - Stack_Size) {
1018
.ANY (+RW +ZI)
1119
}
1220
RW_IPCRAM +0 256 {
1321
ipc.o (+RW)
1422
}
23+
ARM_LIB_STACK (0x01000000+0x5000) EMPTY -Stack_Size { ; stack
24+
}
1525
}

targets/TARGET_ublox/TARGET_HI2110/device/TOOLCHAIN_GCC_ARM/hi2110.ld

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
OUTPUT_FORMAT("elf32-littlearm")
55
OUTPUT_ARCH(arm)
66
ENTRY(Reset_Handler)
7+
8+
#if !defined(MBED_BOOT_STACK_SIZE)
9+
#define MBED_BOOT_STACK_SIZE 0x400
10+
#endif
11+
12+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
13+
714
MEMORY
815
{
916
FLASH_VECTORS : ORIGIN = 0, LENGTH = 192
@@ -151,7 +158,7 @@ SECTIONS
151158
/* Set stack top to end of RAM, and stack limit move down by
152159
* size of stack_dummy section */
153160
__StackTop = ORIGIN(RAM) + LENGTH(RAM); /* Remember that LENGTH(RAM) is already reduced by the IPC block */
154-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
161+
__StackLimit = __StackTop - STACK_SIZE;
155162
PROVIDE(__stack = __StackTop);
156163

157164
/* Check if data + heap + stack exceeds RAM limit */

targets/TARGET_ublox/TARGET_HI2110/device/TOOLCHAIN_IAR/hi2110.icf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ define symbol __size_flash_vtable__ = 192;
88
define symbol __size_ram_vtable__ = 128; /* Reserve space for dynamic vectors mapped to RAM (see cmsis_nvic.c) */
99
define symbol __size_ipc__ = 256;
1010

11+
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
12+
define symbol MBED_BOOT_STACK_SIZE = 0x400;
13+
}
14+
1115
if (isdefinedsymbol(__stack_size__)) {
1216
define symbol __size_cstack__ = __stack_size__;
1317
} else {
14-
define symbol __size_cstack__ = 1024;
18+
define symbol __size_cstack__ = MBED_BOOT_STACK_SIZE;
1519
}
1620

1721
if (isdefinedsymbol(__heap_size__)) {

0 commit comments

Comments
 (0)