Skip to content

Commit 22399bb

Browse files
committed
TARGET_Silicon_Labs: ISR stack size unification
Unify ISR stack size for targets which support MBED 5 (or MBED 2 and MBED 5).
1 parent da3d347 commit 22399bb

File tree

32 files changed

+198
-107
lines changed

32 files changed

+198
-107
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#! armcc -E
2+
#include "mbed_config.h"
23
; *************************************************************
34
; *** Scatter-Loading Description File generated by uVision ***
45
; *************************************************************
@@ -11,14 +12,26 @@
1112
#define MBED_APP_SIZE 0x00100000
1213
#endif
1314

15+
#if (defined(__stack_size__))
16+
#define Stack_Size __stack_size__
17+
#else
18+
#if (defined(MBED_CONF_RTOS_PRESENT))
19+
#define Stack_Size 0x0400
20+
#else
21+
#define Stack_Size 0x1000
22+
#endif
23+
#endif
24+
1425
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
1526
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
1627
*.o (RESET, +First)
1728
*(InRoot$$Sections)
1829
.ANY (+RO)
1930
}
20-
RW_IRAM1 0x200000DC 0x0001FF24 { ; RW data
31+
RW_IRAM1 0x200000DC 0x0001FF24-Stack_Size { ; RW data
2132
.ANY (+RW +ZI)
2233
}
34+
ARM_LIB_STACK 0x200000DC+0x0001FF24 EMPTY -Stack_Size { ; Stack region growing down
35+
}
2336
}
2437

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

Lines changed: 2 additions & 8 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
@@ -220,13 +214,13 @@ SECTIONS
220214
__end__ = .;
221215
end = __end__;
222216
_end = __end__;
223-
. += HEAP_SIZE;
217+
. = ORIGIN(RAM) + LENGTH(RAM) - Stack_Size;
224218
__HeapLimit = .;
225219
} > RAM
226220

227221
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
228222
__stack = __StackTop;
229-
__StackLimit = __StackTop - STACK_SIZE;
223+
__StackLimit = __StackTop - Stack_Size;
230224

231225
ASSERT(__StackLimit >= __HeapLimit, "Region RAM overflowed with stack and heap")
232226

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/TARGET_1024K/TOOLCHAIN_GCC_ARM/startup_efm32gg.S

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,18 @@
3737
.section .stack
3838
.align 3
3939
#ifdef __STACK_SIZE
40-
.equ Stack_Size, __STACK_SIZE
40+
.equ Stack_Size, __STACK_SIZE
4141
#else
42-
.equ Stack_Size, 0x00000400
42+
#if defined(MBED_CONF_RTOS_PRESENT)
43+
.equ Stack_Size, 0x400
44+
#else
45+
.equ Stack_Size, 0x1000
46+
#endif
4347
#endif
4448
.globl __StackTop
4549
.globl __StackLimit
4650
__StackLimit:
47-
.space Stack_Size
51+
.globl Stack_Size
4852
.size __StackLimit, . - __StackLimit
4953
__StackTop:
5054
.size __StackTop, . - __StackTop

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ define symbol __NVIC_end__ = 0x200000DB;
1515
define symbol __ICFEDIT_region_RAM_start__ = 0x200000DC;
1616
define symbol __ICFEDIT_region_RAM_end__ = 0x2001FFFF;
1717
/*-Sizes-*/
18-
/*Heap 1/4 of ram and stack 1/8*/
19-
define symbol __ICFEDIT_size_cstack__ = 0x4000;
18+
define symbol __ICFEDIT_size_cstack__ = 0x400;
2019
define symbol __ICFEDIT_size_heap__ = 0x8000;
2120
/**** End of ICF editor section. ###ICF###*/
2221

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#! armcc -E
2+
#include "mbed_config.h"
23
; *************************************************************
34
; *** Scatter-Loading Description File generated by uVision ***
45
; *************************************************************
@@ -11,14 +12,26 @@
1112
#define MBED_APP_SIZE 0x00200000
1213
#endif
1314

15+
#if (defined(__stack_size__))
16+
#define Stack_Size __stack_size__
17+
#else
18+
#if (defined(MBED_CONF_RTOS_PRESENT))
19+
#define Stack_Size 0x0400
20+
#else
21+
#define Stack_Size 0x1000
22+
#endif
23+
#endif
24+
1425
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
1526
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
1627
*.o (RESET, +First)
1728
*(InRoot$$Sections)
1829
.ANY (+RO)
1930
}
20-
RW_IRAM1 0x20000158 0x0007FEA8 { ; RW data
31+
RW_IRAM1 0x20000158 0x0007FEA8-Stack_Size { ; RW data
2132
.ANY (+RW +ZI)
2233
}
34+
ARM_LIB_STACK 0x20000158+0x0007FEA8 EMPTY -Stack_Size { ; Stack region growing down
35+
}
2336
}
2437

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ SECTIONS
198198
end = __end__;
199199
_end = __end__;
200200
KEEP(*(.heap*))
201+
. = ORIGIN(RAM) + LENGTH(RAM) - Stack_Size;
201202
__HeapLimit = .;
202203
} > RAM
203204

@@ -207,12 +208,13 @@ SECTIONS
207208
.stack_dummy (COPY):
208209
{
209210
KEEP(*(.stack*))
211+
. += Stack_Size;
210212
} > RAM
211213

212214
/* Set stack top to end of RAM, and stack limit move down by
213215
* size of stack_dummy section */
214216
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
215-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
217+
__StackLimit = __StackTop - Stack_Size;
216218
PROVIDE(__stack = __StackTop);
217219

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

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG11/device/TOOLCHAIN_GCC_ARM/startup_efm32gg11.S

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,18 @@
3737
.section .stack
3838
.align 3
3939
#ifdef __STACK_SIZE
40-
.equ Stack_Size, __STACK_SIZE
40+
.equ Stack_Size, __STACK_SIZE
4141
#else
42-
.equ Stack_Size, 0x00004000
42+
#if defined(MBED_CONF_RTOS_PRESENT)
43+
.equ Stack_Size, 0x400
44+
#else
45+
.equ Stack_Size, 0x1000
46+
#endif
4347
#endif
4448
.globl __StackTop
4549
.globl __StackLimit
4650
__StackLimit:
47-
.space Stack_Size
51+
.globl Stack_Size
4852
.size __StackLimit, . - __StackLimit
4953
__StackTop:
5054
.size __StackTop, . - __StackTop

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ define symbol __NVIC_end__ = 0x20000157;
1515
define symbol __ICFEDIT_region_RAM_start__ = 0x20000158;
1616
define symbol __ICFEDIT_region_RAM_end__ = 0x2007FFFF;
1717
/*-Sizes-*/
18-
/*Heap 1/4 of ram and stack 1/8*/
19-
define symbol __ICFEDIT_size_cstack__ = 0x4000;
18+
define symbol __ICFEDIT_size_cstack__ = 0x400;
2019
define symbol __ICFEDIT_size_heap__ = 0x10000;
2120
/**** End of ICF editor section. ###ICF###*/
2221

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#! armcc -E
2+
#include "mbed_config.h"
23
; *************************************************************
34
; *** Scatter-Loading Description File generated by uVision ***
45
; *************************************************************
@@ -11,14 +12,26 @@
1112
#define MBED_APP_SIZE 0x00040000
1213
#endif
1314

15+
#if (defined(__stack_size__))
16+
#define Stack_Size __stack_size__
17+
#else
18+
#if (defined(MBED_CONF_RTOS_PRESENT))
19+
#define Stack_Size 0x0400
20+
#else
21+
#define Stack_Size 0x1000
22+
#endif
23+
#endif
24+
1425
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
1526
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
1627
*.o (RESET, +First)
1728
*(InRoot$$Sections)
1829
.ANY (+RO)
1930
}
20-
RW_IRAM1 0x200000E0 0x00007F20 { ; RW data
31+
RW_IRAM1 0x200000E0 0x00007F20-Stack_Size { ; RW data
2132
.ANY (+RW +ZI)
2233
}
34+
ARM_LIB_STACK 0x200000E0+0x00007F20 EMPTY -Stack_Size { ; Stack region growing down
35+
}
2336
}
2437

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ SECTIONS
198198
end = __end__;
199199
_end = __end__;
200200
KEEP(*(.heap*))
201+
. = ORIGIN(RAM) + LENGTH(RAM) - Stack_Size;
201202
__HeapLimit = .;
202203
} > RAM
203204

@@ -207,12 +208,13 @@ SECTIONS
207208
.stack_dummy (COPY):
208209
{
209210
KEEP(*(.stack*))
211+
. += Stack_Size;
210212
} > RAM
211213

212214
/* Set stack top to end of RAM, and stack limit move down by
213215
* size of stack_dummy section */
214216
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
215-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
217+
__StackLimit = __StackTop - Stack_Size;
216218
PROVIDE(__stack = __StackTop);
217219

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

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG/device/TARGET_256K/TOOLCHAIN_GCC_ARM/startup_efm32lg.S

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,18 @@
3737
.section .stack
3838
.align 3
3939
#ifdef __STACK_SIZE
40-
.equ Stack_Size, __STACK_SIZE
40+
.equ Stack_Size, __STACK_SIZE
4141
#else
42-
.equ Stack_Size, 0x00000400
42+
#if defined(MBED_CONF_RTOS_PRESENT)
43+
.equ Stack_Size, 0x400
44+
#else
45+
.equ Stack_Size, 0x1000
46+
#endif
4347
#endif
4448
.globl __StackTop
4549
.globl __StackLimit
4650
__StackLimit:
47-
.space Stack_Size
51+
.globl Stack_Size
4852
.size __StackLimit, . - __StackLimit
4953
__StackTop:
5054
.size __StackTop, . - __StackTop

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ define symbol __ICFEDIT_region_RAM_start__ = 0x200000E0;
1616
define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF;
1717
/*-Sizes-*/
1818
/*Heap 1/4 of ram and stack 1/8*/
19-
define symbol __ICFEDIT_size_cstack__ = 0x1000;
19+
define symbol __ICFEDIT_size_cstack__ = 0x400;
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: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#! armcc -E
2+
#include "mbed_config.h"
23
; *************************************************************
34
; *** Scatter-Loading Description File generated by uVision ***
45
; *************************************************************
@@ -11,14 +12,26 @@
1112
#define MBED_APP_SIZE 0x00040000
1213
#endif
1314

15+
#if (defined(__stack_size__))
16+
#define Stack_Size __stack_size__
17+
#else
18+
#if (defined(MBED_CONF_RTOS_PRESENT))
19+
#define Stack_Size 0x0400
20+
#else
21+
#define Stack_Size 0x1000
22+
#endif
23+
#endif
24+
1425
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
1526
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
1627
*.o (RESET, +First)
1728
*(InRoot$$Sections)
1829
.ANY (+RO)
1930
}
20-
RW_IRAM1 0x200000C8 0x00007F38 { ; RW data
31+
RW_IRAM1 0x200000C8 0x00007F38-Stack_Size { ; RW data
2132
.ANY (+RW +ZI)
2233
}
34+
ARM_LIB_STACK 0x200000C8+0x00007F38 EMPTY -Stack_Size { ; Stack region growing down
35+
}
2336
}
2437

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ SECTIONS
198198
end = __end__;
199199
_end = __end__;
200200
KEEP(*(.heap*))
201+
. = ORIGIN(RAM) + LENGTH(RAM) - Stack_Size;
201202
__HeapLimit = .;
202203
} > RAM
203204

@@ -207,12 +208,13 @@ SECTIONS
207208
.stack_dummy (COPY):
208209
{
209210
KEEP(*(.stack*))
211+
. += Stack_Size;
210212
} > RAM
211213

212214
/* Set stack top to end of RAM, and stack limit move down by
213215
* size of stack_dummy section */
214216
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
215-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
217+
__StackLimit = __StackTop - Stack_Size;
216218
PROVIDE(__stack = __StackTop);
217219

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

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG/device/TARGET_256K/TOOLCHAIN_GCC_ARM/startup_efm32pg1b.S

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,18 @@
3737
.section .stack
3838
.align 3
3939
#ifdef __STACK_SIZE
40-
.equ Stack_Size, __STACK_SIZE
40+
.equ Stack_Size, __STACK_SIZE
4141
#else
42-
.equ Stack_Size, 0x00000400
42+
#if defined(MBED_CONF_RTOS_PRESENT)
43+
.equ Stack_Size, 0x400
44+
#else
45+
.equ Stack_Size, 0x1000
46+
#endif
4347
#endif
4448
.globl __StackTop
4549
.globl __StackLimit
4650
__StackLimit:
47-
.space Stack_Size
51+
.globl Stack_Size
4852
.size __StackLimit, . - __StackLimit
4953
__StackTop:
5054
.size __StackTop, . - __StackTop

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ define symbol __ICFEDIT_region_RAM_start__ = 0x200000C8;
1616
define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF;
1717
/*-Sizes-*/
1818
/*Heap 1/4 of ram and stack 1/8*/
19-
define symbol __ICFEDIT_size_cstack__ = 0x1000;
19+
define symbol __ICFEDIT_size_cstack__ = 0x400;
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: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#! armcc -E
2+
#include "mbed_config.h"
23
; *************************************************************
34
; *** Scatter-Loading Description File generated by uVision ***
45
; *************************************************************
@@ -11,14 +12,26 @@
1112
#define MBED_APP_SIZE 0x00100000
1213
#endif
1314

15+
#if (defined(__stack_size__))
16+
#define Stack_Size __stack_size__
17+
#else
18+
#if (defined(MBED_CONF_RTOS_PRESENT))
19+
#define Stack_Size 0x0400
20+
#else
21+
#define Stack_Size 0x1000
22+
#endif
23+
#endif
24+
1425
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
1526
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
1627
*.o (RESET, +First)
1728
*(InRoot$$Sections)
1829
.ANY (+RO)
1930
}
20-
RW_IRAM1 0x2000010C 0x0003FEF4 { ; RW data
31+
RW_IRAM1 0x2000010C 0x0003FEF4-Stack_Size { ; RW data
2132
.ANY (+RW +ZI)
2233
}
34+
ARM_LIB_STACK 0x2000010C+0x0003FEF4 EMPTY -Stack_Size { ; Stack region growing down
35+
}
2336
}
2437

0 commit comments

Comments
 (0)