Skip to content

Commit 36ff053

Browse files
committed
[RDA] Support boot stack size configuration option
1 parent c5a67c9 commit 36ff053

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

targets/TARGET_RDA/TARGET_UNO_91H/device/TOOLCHAIN_ARM_STD/TARGET_UNO_91H/RDA5981C.sct

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
#define RDA_AHB1_BASE (0x40100000)
2828
#define RDA_MEMC_BASE (RDA_AHB1_BASE + 0x00000)
2929

30+
#if !defined(MBED_BOOT_STACK_SIZE)
31+
#define MBED_BOOT_STACK_SIZE 0x400
32+
#endif
33+
34+
#define Stack_Size MBED_BOOT_STACK_SIZE
35+
3036
; max code size: RDA_CODE_SIZE
3137
LR_IROM1 RDA_CODE_BASE RDA_CODE_SIZE { ; load region size_region
3238
ER_IROM0 RDA_CODE_BASE RDA_CODE_SIZE { ; load address = execution address
@@ -37,11 +43,11 @@ LR_IROM1 RDA_CODE_BASE RDA_CODE_SIZE { ; load region size_region
3743
; 8_byte_aligned(31 vect * 4 bytes) = 8_byte_aligned(0x7C) = 0x80
3844
ER_IRAMVEC RDA_IRAM_BASE EMPTY 0x80 { ; Reserved for vectors
3945
}
40-
; IRAM Size: Total(128KB) - Vector(128B) - Stack(2KB)
41-
RW_IRAM1 AlignExpr(+0, 8) (0x20000 - 0x80 - 0x800) {
46+
; IRAM Size: Total(128KB) - Vector(128B) - Stack(1KB)
47+
RW_IRAM1 AlignExpr(+0, 8) (0x20000 - 0x80 - Stack_Size) {
4248
.ANY (+RW +ZI)
4349
}
44-
ARM_LIB_STACK AlignExpr(+0, 8) EMPTY (RDA_IRAM_BASE + RDA_IRAM_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 8)) {
50+
ARM_LIB_STACK AlignExpr(+0, 8) EMPTY Stack_Size {
4551
}
4652
ARM_LIB_HEAP RDA_DRAM_BASE EMPTY RDA_DRAM_SIZE {
4753
}

targets/TARGET_RDA/TARGET_UNO_91H/device/TOOLCHAIN_GCC_ARM/TARGET_UNO_91H/RDA5981C.ld

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
/* Linker script for mbed RDA5981C */
22

3+
#if !defined(MBED_BOOT_STACK_SIZE)
4+
#define MBED_BOOT_STACK_SIZE 0x400
5+
#endif
6+
7+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
8+
39
/* Linker script to configure memory regions. */
410
MEMORY
511
{
@@ -148,7 +154,7 @@ SECTIONS
148154
/* Set stack top to end of IRAM, and stack limit move down by
149155
* size of stack_dummy section */
150156
__StackTop = ORIGIN(IRAM) + LENGTH(IRAM);
151-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
157+
__StackLimit = __StackTop - STACK_SIZE;
152158
PROVIDE(__stack = __StackTop);
153159

154160
/* Check if data + stack exceeds RAM limit */

targets/TARGET_RDA/TARGET_UNO_91H/device/TOOLCHAIN_IAR/TARGET_UNO_91H/RDA5981C.icf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ define symbol WLAN_BASE = RDA_MEMC_BASE + 0x19800;
3636
define symbol WLAN_END = RDA_MEMC_END;
3737

3838
/* Stack Size & Heap Size*/
39-
define symbol CSTACK_SIZE = 0x00400;
39+
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
40+
define symbol MBED_BOOT_STACK_SIZE = 0x400;
41+
}
42+
43+
define symbol CSTACK_SIZE = MBED_BOOT_STACK_SIZE;
4044
define symbol HEAP_SIZE = RDA_DRAM_END - RDA_DRAM_BASE + 1;
4145

4246
/*Memory regions*/

0 commit comments

Comments
 (0)