Skip to content

Commit d97c4d5

Browse files
committed
[TT] Support boot stack size configuration option
1 parent 4ee9378 commit d97c4d5

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

targets/TARGET_TT/TARGET_TT_M3HQ/device/TOOLCHAIN_ARM_STD/tmpm3hqfdfg.sct

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#! armcc -E
12
;; TMPM3HQFDFG scatter file
23

34
;; Vector table starts at 0
@@ -13,6 +14,12 @@
1314

1415
;; Compatible with ISSM model
1516

17+
#if !defined(MBED_BOOT_STACK_SIZE)
18+
#define MBED_BOOT_STACK_SIZE 0x400
19+
#endif
20+
21+
#define Stack_Size MBED_BOOT_STACK_SIZE
22+
1623
LR_IROM1 0x00000000 0x80000
1724
{
1825
ER_IROM1 0x00000000 0x80000
@@ -26,4 +33,7 @@ LR_IROM1 0x00000000 0x80000
2633
{
2734
.ANY (+RW, +ZI)
2835
}
36+
37+
ARM_LIB_STACK 0x200002D8+0x10000 EMPTY -Stack_Size { ; Stack region growing down
38+
}
2939
}

targets/TARGET_TT/TARGET_TT_M3HQ/device/TOOLCHAIN_GCC_ARM/tmpm3hqfdfg.ld

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ MEMORY
77
RAM (rwx) : ORIGIN = (0x20000000 + 0x2D8), LENGTH = (64K - 0x2D8)
88
}
99

10+
#if !defined(MBED_BOOT_STACK_SIZE)
11+
#define MBED_BOOT_STACK_SIZE 0x400
12+
#endif
13+
1014
/* Linker script to place sections and symbol values. Should be used together
1115
* with other linker script that defines memory regions FLASH and RAM.
1216
* It references following symbols, which must be defined in code:
@@ -153,7 +157,7 @@ SECTIONS
153157
/* Set stack top to end of RAM, and stack limit move down by
154158
* size of stack_dummy section */
155159
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
156-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
160+
__StackLimit = __StackTop - MBED_BOOT_STACK_SIZE;
157161
PROVIDE(__stack = __StackTop);
158162

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

targets/TARGET_TT/TARGET_TT_M3HQ/device/TOOLCHAIN_IAR/tmpm3hqfdfg.icf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ define symbol __ICFEDIT_region_ROM_end__ = 0x0007FFFF;
99
define symbol __ICFEDIT_region_RAM_start__ = 0x200002D8;
1010
define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF;
1111
/*-Sizes-*/
12-
/*Heap 1/4 of ram and stack 1/8*/
13-
define symbol __ICFEDIT_size_cstack__ = 0x400;
12+
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
13+
define symbol MBED_BOOT_STACK_SIZE = 0x400;
14+
}
15+
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
1416
define symbol __ICFEDIT_size_heap__ = 0x2000;
1517
/**** End of ICF editor section. ###ICF###*/
1618

0 commit comments

Comments
 (0)