Skip to content

Commit 93ed18e

Browse files
committed
[Silicon_Labs] Support boot stack size configuration option
1 parent 8b32aa3 commit 93ed18e

File tree

28 files changed

+168
-43
lines changed

28 files changed

+168
-43
lines changed

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/TARGET_1024K/TOOLCHAIN_ARM_STD/efm32gg.sct

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,23 @@
1111
#define MBED_APP_SIZE 0x00100000
1212
#endif
1313

14+
#if !defined(MBED_BOOT_STACK_SIZE)
15+
#define MBED_BOOT_STACK_SIZE 0x400
16+
#endif
17+
18+
#define Stack_Size MBED_BOOT_STACK_SIZE
19+
1420
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
1521
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
1622
*.o (RESET, +First)
1723
*(InRoot$$Sections)
1824
.ANY (+RO)
1925
}
20-
RW_IRAM1 0x200000E0 0x0001FF20 { ; RW data
26+
RW_IRAM1 0x200000E0 0x0001FF20-Stack_Size { ; RW data
2127
.ANY (+RW +ZI)
2228
}
29+
30+
ARM_LIB_STACK (0x200000E0+0x0001FF20) EMPTY -Stack_Size { ; stack
31+
}
2332
}
2433

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/TARGET_1024K/TOOLCHAIN_GCC_ARM/efm32gg.ld

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
/* Version 4.2.0 */
1010
/* */
1111

12-
/* With the RTOS in use, this does not affect the main stack size. The size of
13-
* the stack where main runs is determined via the RTOS. */
14-
STACK_SIZE = 0x400;
15-
16-
HEAP_SIZE = 0x6000;
17-
1812
#if !defined(MBED_APP_START)
1913
#define MBED_APP_START 0x00000000
2014
#endif
@@ -23,6 +17,16 @@ HEAP_SIZE = 0x6000;
2317
#define MBED_APP_SIZE 1048576
2418
#endif
2519

20+
#if !defined(MBED_BOOT_STACK_SIZE)
21+
#define MBED_BOOT_STACK_SIZE 0x400
22+
#endif
23+
24+
/* With the RTOS in use, this does not affect the main stack size. The size of
25+
* the stack where main runs is determined via the RTOS. */
26+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
27+
28+
HEAP_SIZE = 0x6000;
29+
2630
MEMORY
2731
{
2832
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
@@ -220,7 +224,7 @@ SECTIONS
220224
__end__ = .;
221225
end = __end__;
222226
_end = __end__;
223-
. += HEAP_SIZE;
227+
. = ORIGIN(RAM) + LENGTH(RAM) - STACK_SIZE;
224228
__HeapLimit = .;
225229
} > RAM
226230

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/TARGET_1024K/TOOLCHAIN_IAR/efm32gg990f1024.icf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
66
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00100000; }
7+
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) { define symbol MBED_BOOT_STACK_SIZE = 0x400; }
78

89
/*-Specials-*/
910
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
@@ -15,8 +16,7 @@ define symbol __NVIC_end__ = 0x200000DF;
1516
define symbol __ICFEDIT_region_RAM_start__ = 0x200000E0;
1617
define symbol __ICFEDIT_region_RAM_end__ = 0x2001FFFF;
1718
/*-Sizes-*/
18-
/*Heap 1/4 of ram and stack 1/8*/
19-
define symbol __ICFEDIT_size_cstack__ = 0x4000;
19+
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
2020
define symbol __ICFEDIT_size_heap__ = 0x8000;
2121
/**** End of ICF editor section. ###ICF###*/
2222

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG11/device/TOOLCHAIN_ARM_STD/efm32gg11.sct

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,23 @@
1111
#define MBED_APP_SIZE 0x00200000
1212
#endif
1313

14+
#if !defined(MBED_BOOT_STACK_SIZE)
15+
#define MBED_BOOT_STACK_SIZE 0x400
16+
#endif
17+
18+
#define Stack_Size MBED_BOOT_STACK_SIZE
19+
1420
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
1521
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
1622
*.o (RESET, +First)
1723
*(InRoot$$Sections)
1824
.ANY (+RO)
1925
}
20-
RW_IRAM1 0x20000158 0x0007FEA8 { ; RW data
26+
RW_IRAM1 0x20000158 0x0007FEA8-Stack_Size { ; RW data
2127
.ANY (+RW +ZI)
2228
}
29+
30+
ARM_LIB_STACK (0x20000158+0x0007FEA8) EMPTY -Stack_Size { ; stack
31+
}
2332
}
2433

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG11/device/TOOLCHAIN_GCC_ARM/efm32gg11.ld

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
#define MBED_APP_SIZE 0x200000
1818
#endif
1919

20+
#if !defined(MBED_BOOT_STACK_SIZE)
21+
#define MBED_BOOT_STACK_SIZE 0x400
22+
#endif
23+
24+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
25+
2026
MEMORY
2127
{
2228
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
@@ -212,7 +218,7 @@ SECTIONS
212218
/* Set stack top to end of RAM, and stack limit move down by
213219
* size of stack_dummy section */
214220
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
215-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
221+
__StackLimit = __StackTop - STACK_SIZE;
216222
PROVIDE(__stack = __StackTop);
217223

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

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG11/device/TOOLCHAIN_IAR/efm32gg11b820f2048gl192.icf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
66
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00200000; }
7+
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) { define symbol MBED_BOOT_STACK_SIZE = 0x400; }
78

89
/*-Specials-*/
910
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
@@ -15,8 +16,7 @@ define symbol __NVIC_end__ = 0x20000157;
1516
define symbol __ICFEDIT_region_RAM_start__ = 0x20000158;
1617
define symbol __ICFEDIT_region_RAM_end__ = 0x2007FFFF;
1718
/*-Sizes-*/
18-
/*Heap 1/4 of ram and stack 1/8*/
19-
define symbol __ICFEDIT_size_cstack__ = 0x4000;
19+
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
2020
define symbol __ICFEDIT_size_heap__ = 0x10000;
2121
/**** End of ICF editor section. ###ICF###*/
2222

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG/device/TARGET_64K/TOOLCHAIN_GCC_ARM/efm32hg.ld

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
#define MBED_APP_SIZE 65536
1818
#endif
1919

20+
#if !defined(MBED_BOOT_STACK_SIZE)
21+
#define MBED_BOOT_STACK_SIZE 0x400
22+
#endif
23+
24+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
25+
2026
MEMORY
2127
{
2228
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
@@ -213,7 +219,7 @@ SECTIONS
213219
/* Set stack top to end of RAM, and stack limit move down by
214220
* size of stack_dummy section */
215221
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
216-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
222+
__StackLimit = __StackTop - STACK_SIZE;
217223
PROVIDE(__stack = __StackTop);
218224

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

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG/device/TARGET_64K/TOOLCHAIN_IAR/efm32hg322f64.icf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
66
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00010000; }
7+
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) { define symbol MBED_BOOT_STACK_SIZE = 0x400; }
78

89
/*-Specials-*/
910
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
@@ -15,8 +16,7 @@ define symbol __NVIC_end__ = 0x20000097;
1516
define symbol __ICFEDIT_region_RAM_start__ = 0x20000098;
1617
define symbol __ICFEDIT_region_RAM_end__ = 0x20001FFF;
1718
/*-Sizes-*/
18-
/*Heap 1/4 of ram and stack 1/8*/
19-
define symbol __ICFEDIT_size_cstack__ = 0x400;
19+
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
2020
define symbol __ICFEDIT_size_heap__ = 0x800;
2121
/**** End of ICF editor section. ###ICF###*/
2222

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG/device/TARGET_256K/TOOLCHAIN_ARM_STD/efm32lg.sct

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,22 @@
1111
#define MBED_APP_SIZE 0x00040000
1212
#endif
1313

14+
#if !defined(MBED_BOOT_STACK_SIZE)
15+
#define MBED_BOOT_STACK_SIZE 0x400
16+
#endif
17+
18+
#define Stack_Size MBED_BOOT_STACK_SIZE
19+
1420
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
1521
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
1622
*.o (RESET, +First)
1723
*(InRoot$$Sections)
1824
.ANY (+RO)
1925
}
20-
RW_IRAM1 0x200000E0 0x00007F20 { ; RW data
26+
RW_IRAM1 0x200000E0 0x00007F20-Stack_Size { ; RW data
2127
.ANY (+RW +ZI)
2228
}
29+
ARM_LIB_STACK (0x200000E0+0x00007F20) EMPTY -Stack_Size { ; stack
30+
}
2331
}
2432

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG/device/TARGET_256K/TOOLCHAIN_GCC_ARM/efm32lg.ld

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
#define MBED_APP_SIZE 262144
1818
#endif
1919

20+
#if !defined(MBED_BOOT_STACK_SIZE)
21+
#define MBED_BOOT_STACK_SIZE 0x400
22+
#endif
23+
24+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
25+
2026
MEMORY
2127
{
2228
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
@@ -212,7 +218,7 @@ SECTIONS
212218
/* Set stack top to end of RAM, and stack limit move down by
213219
* size of stack_dummy section */
214220
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
215-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
221+
__StackLimit = __StackTop - STACK_SIZE;
216222
PROVIDE(__stack = __StackTop);
217223

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

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG/device/TARGET_256K/TOOLCHAIN_IAR/efm32lg990f256.icf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
66
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00040000; }
7+
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) { define symbol MBED_BOOT_STACK_SIZE = 0x400; }
78

89
/*-Specials-*/
910
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
@@ -15,8 +16,7 @@ define symbol __NVIC_end__ = 0x200000DF;
1516
define symbol __ICFEDIT_region_RAM_start__ = 0x200000E0;
1617
define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF;
1718
/*-Sizes-*/
18-
/*Heap 1/4 of ram and stack 1/8*/
19-
define symbol __ICFEDIT_size_cstack__ = 0x1000;
19+
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
2020
define symbol __ICFEDIT_size_heap__ = 0x2000;
2121
/**** End of ICF editor section. ###ICF###*/
2222

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG/device/TARGET_256K/TOOLCHAIN_ARM_STD/efm32pg1b.sct

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,22 @@
1111
#define MBED_APP_SIZE 0x00040000
1212
#endif
1313

14+
#if !defined(MBED_BOOT_STACK_SIZE)
15+
#define MBED_BOOT_STACK_SIZE 0x400
16+
#endif
17+
18+
#define Stack_Size MBED_BOOT_STACK_SIZE
19+
1420
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
1521
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
1622
*.o (RESET, +First)
1723
*(InRoot$$Sections)
1824
.ANY (+RO)
1925
}
20-
RW_IRAM1 0x200000C8 0x00007F38 { ; RW data
26+
RW_IRAM1 0x200000C8 0x00007F38-Stack_Size { ; RW data
2127
.ANY (+RW +ZI)
2228
}
29+
ARM_LIB_STACK (0x200000C8+0x00007F38) EMPTY -Stack_Size { ; stack
30+
}
2331
}
2432

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG/device/TARGET_256K/TOOLCHAIN_GCC_ARM/efm32pg1b.ld

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
#define MBED_APP_SIZE 262144
1818
#endif
1919

20+
#if !defined(MBED_BOOT_STACK_SIZE)
21+
#define MBED_BOOT_STACK_SIZE 0x400
22+
#endif
23+
24+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
25+
2026
MEMORY
2127
{
2228
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
@@ -212,7 +218,7 @@ SECTIONS
212218
/* Set stack top to end of RAM, and stack limit move down by
213219
* size of stack_dummy section */
214220
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
215-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
221+
__StackLimit = __StackTop - STACK_SIZE;
216222
PROVIDE(__stack = __StackTop);
217223

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

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG/device/TARGET_256K/TOOLCHAIN_IAR/efm32pg1b200f256.icf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
66
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00040000; }
7+
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) { define symbol MBED_BOOT_STACK_SIZE = 0x400; }
78

89
/*-Specials-*/
910
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
@@ -15,8 +16,7 @@ define symbol __NVIC_end__ = 0x200000C7;
1516
define symbol __ICFEDIT_region_RAM_start__ = 0x200000C8;
1617
define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF;
1718
/*-Sizes-*/
18-
/*Heap 1/4 of ram and stack 1/8*/
19-
define symbol __ICFEDIT_size_cstack__ = 0x1000;
19+
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
2020
define symbol __ICFEDIT_size_heap__ = 0x2000;
2121
/**** End of ICF editor section. ###ICF###*/
2222

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG12/device/TOOLCHAIN_ARM_STD/efr32pg12b.sct

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,22 @@
1111
#define MBED_APP_SIZE 0x00100000
1212
#endif
1313

14+
#if !defined(MBED_BOOT_STACK_SIZE)
15+
#define MBED_BOOT_STACK_SIZE 0x400
16+
#endif
17+
18+
#define Stack_Size MBED_BOOT_STACK_SIZE
19+
1420
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
1521
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
1622
*.o (RESET, +First)
1723
*(InRoot$$Sections)
1824
.ANY (+RO)
1925
}
20-
RW_IRAM1 0x20000110 0x0003FEF0 { ; RW data
26+
RW_IRAM1 0x20000110 0x0003FEF0-Stack_Size { ; RW data
2127
.ANY (+RW +ZI)
2228
}
29+
ARM_LIB_STACK (0x20000110+0x0003FEF0) EMPTY -Stack_Size { ; stack
30+
}
2331
}
2432

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG12/device/TOOLCHAIN_GCC_ARM/efm32pg12b.ld

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
#define MBED_APP_SIZE 1048576
1818
#endif
1919

20+
#if !defined(MBED_BOOT_STACK_SIZE)
21+
#define MBED_BOOT_STACK_SIZE 0x400
22+
#endif
23+
24+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
25+
2026
MEMORY
2127
{
2228
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
@@ -212,7 +218,7 @@ SECTIONS
212218
/* Set stack top to end of RAM, and stack limit move down by
213219
* size of stack_dummy section */
214220
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
215-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
221+
__StackLimit = __StackTop - STACK_SIZE;
216222
PROVIDE(__stack = __StackTop);
217223

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

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG12/device/TOOLCHAIN_IAR/EFM32PG12B500F1024GL125.icf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
77
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00100000; }
8+
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) { define symbol MBED_BOOT_STACK_SIZE = 0x400; }
89

910
/*-Specials-*/
1011
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
@@ -18,7 +19,7 @@ define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x00040000-1);
1819

1920
/*-Sizes-*/
2021
if ( !isdefinedsymbol( __ICFEDIT_size_cstack__ ) )
21-
{ define symbol __ICFEDIT_size_cstack__ = 0x1000; }
22+
{ define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE; }
2223

2324
if ( !isdefinedsymbol( __ICFEDIT_size_heap__ ) )
2425
{ define symbol __ICFEDIT_size_heap__ = 0x4000; }

0 commit comments

Comments
 (0)