Skip to content

Commit e207719

Browse files
authored
Merge pull request ARMmbed#13452 from Patater/conf-boot-stack-size
Use boot stack size from config system
2 parents 8a22d35 + 612b148 commit e207719

File tree

438 files changed

+2072
-1444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

438 files changed

+2072
-1444
lines changed

docs/design-documents/platform/memory-model/ram_memory_model.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,16 @@ Phase 2:
9090
Note: Heap split support across multiple RAM banks, can also be achieved post this change.
9191

9292
# Detailed Design
93-
1. Update tools to set define `MBED_BOOT_STACK_SIZE` from target config option `target.boot-stack-size`
94-
1. Linker Scripts - Update linker scripts for ARM, IAR and GCC toolchain to use MBED_BOOT_STACK_SIZE define for standardizing size of ISR stack.
93+
1. Update tools to set define `MBED_CONF_TARGET_BOOT_STACK_SIZE` from target config option `target.boot-stack-size`
94+
1. Linker Scripts - Update linker scripts for ARM, IAR and GCC toolchain to use MBED_CONF_TARGET_BOOT_STACK_SIZE define for standardizing size of ISR stack.
9595
1. Update __user_setup_stackheap() implementation to adopt 2-region RAM memory model.
9696
__user_setup_stackheap() works with systems where the application starts with a value of sp (r13) that is already correct. To make use of sp(stack base), implement __user_setup_stackheap() to set up r0 (heap base), r2 (heap limit), and r3 (stack limit) (for a two-region model) and return.
9797
Reference http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.kui0099a/armlib_cjagaaha.htm http://www.keil.com/support/man/docs/armlib/armlib_chr1359122863069.htm
9898
1. Modify _sbrk() implementation for GCC to use 2-region memory model
9999

100100
# Tools and configuration changes
101101

102-
1. Target config option "target.boot-stack-size" which is passed to the linker as the define "MBED_BOOT_STACK_SIZE" so the linker can adjust the stack accordingly.
102+
1. Target config option "target.boot-stack-size" which is passed to the linker as the define "MBED_CONF_TARGET_BOOT_STACK_SIZE" so the linker can adjust the stack accordingly.
103103
Boot stack size - the size of ISR and main stack will be 4K as default in targets.json for bare metal (non-RTOS) builds.
104104
Boot stack size - the size of ISR stack will be over-written as 1K in `rtos/mbed_lib.json` for RTOS builds.
105105

hal/tests/TESTS/mbed_hal/stack_size_unification/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extern uint32_t mbed_stack_isr_size;
3737

3838
#define EXPECTED_USER_THREAD_DEFAULT_STACK_SIZE (MBED_CONF_RTOS_THREAD_STACK_SIZE)
3939

40-
#if ((MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE) <= (EXPECTED_MAIN_THREAD_STACK_SIZE + EXPECTED_ISR_STACK_SIZE))
40+
#if ((MBED_RAM_SIZE - MBED_CONF_TARGET_BOOT_STACK_SIZE) <= (EXPECTED_MAIN_THREAD_STACK_SIZE + EXPECTED_ISR_STACK_SIZE))
4141
#error [NOT_SUPPORTED] Insufficient stack for staci_size_unification tests
4242
#endif
4343

storage/blockdevice/tests/TESTS/blockdevice/heap_block_device/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ using namespace utest::v1;
2828
#define TEST_BLOCK_COUNT 10
2929
#define TEST_ERROR_MASK 16
3030

31-
#if ((MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE) <= TEST_BLOCK_DEVICE_SIZE)
31+
#if ((MBED_RAM_SIZE - MBED_CONF_TARGET_BOOT_STACK_SIZE) <= TEST_BLOCK_DEVICE_SIZE)
3232
#error [NOT_SUPPORTED] Insufficient heap for heap block device tests
3333
#endif
3434

storage/blockdevice/tests/TESTS/blockdevice/mbr_block_device/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using namespace utest::v1;
2727
#define BLOCK_COUNT 16
2828
#define BLOCK_SIZE 512
2929

30-
#if ((MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE) <= (BLOCK_COUNT * BLOCK_SIZE))
30+
#if ((MBED_RAM_SIZE - MBED_CONF_TARGET_BOOT_STACK_SIZE) <= (BLOCK_COUNT * BLOCK_SIZE))
3131
#error [NOT_SUPPORTED] Insufficient heap for mbr block device tests
3232
#endif
3333

storage/blockdevice/tests/TESTS/blockdevice/util_block_device/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ using namespace utest::v1;
2929
#define BLOCK_COUNT 16
3030
#define BLOCK_SIZE 512
3131

32-
#if ((MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE) <= (BLOCK_COUNT * BLOCK_SIZE))
32+
#if ((MBED_RAM_SIZE - MBED_CONF_TARGET_BOOT_STACK_SIZE) <= (BLOCK_COUNT * BLOCK_SIZE))
3333
#error [NOT_SUPPORTED] Insufficient heap for util block device tests
3434
#endif
3535

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,18 @@
3838
#include "../memory_zones.h"
3939
#include "../cmsis_nvic.h"
4040

41-
#if !defined(MBED_BOOT_STACK_SIZE)
42-
#define MBED_BOOT_STACK_SIZE 0x400
41+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
42+
# if defined(MBED_BOOT_STACK_SIZE)
43+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
44+
# else
45+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
46+
# endif
4347
#endif
4448

4549
#if (defined(__stack_size__))
4650
#define STACK_SIZE __stack_size__
4751
#else
48-
#define STACK_SIZE MBED_BOOT_STACK_SIZE
52+
#define STACK_SIZE MBED_CONF_TARGET_BOOT_STACK_SIZE
4953
#endif
5054

5155
; The vector table is loaded at address 0x00000000 in Flash memory region.

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0/device/TOOLCHAIN_GCC_ARM/MPS2.ld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#include "../memory_zones.h"
3232
#include "../cmsis_nvic.h"
3333

34-
#if !defined(MBED_BOOT_STACK_SIZE)
35-
#define MBED_BOOT_STACK_SIZE 0x400
34+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
35+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
3636
#endif
3737

3838
MEMORY
@@ -69,7 +69,7 @@ MEMORY
6969
*/
7070
ENTRY(Reset_Handler)
7171

72-
STACK_SIZE = MBED_BOOT_STACK_SIZE;
72+
STACK_SIZE = MBED_CONF_TARGET_BOOT_STACK_SIZE;
7373

7474
/* Size of the vector table in SRAM */
7575
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4646

4747
/*-Sizes-*/
4848
/* Heap and Stack size */
49-
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
50-
define symbol MBED_BOOT_STACK_SIZE = 0x400;
49+
if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
50+
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
5151
}
5252
define symbol __ICFEDIT_size_heap__ = 0x200000;
53-
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
53+
define symbol __ICFEDIT_size_cstack__ = MBED_CONF_TARGET_BOOT_STACK_SIZE;
5454
/**** End of ICF editor section. ###ICF###*/
5555

5656
define memory mem with size = 4G;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0P/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,18 @@
3838
#include "../memory_zones.h"
3939
#include "../cmsis_nvic.h"
4040

41-
#if !defined(MBED_BOOT_STACK_SIZE)
42-
#define MBED_BOOT_STACK_SIZE 0x400
41+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
42+
# if defined(MBED_BOOT_STACK_SIZE)
43+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
44+
# else
45+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
46+
# endif
4347
#endif
4448

4549
#if (defined(__stack_size__))
4650
#define STACK_SIZE __stack_size__
4751
#else
48-
#define STACK_SIZE MBED_BOOT_STACK_SIZE
52+
#define STACK_SIZE MBED_CONF_TARGET_BOOT_STACK_SIZE
4953
#endif
5054

5155
; The vector table is loaded at address 0x00000000 in Flash memory region.

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0P/device/TOOLCHAIN_GCC_ARM/MPS2.ld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#include "../memory_zones.h"
3232
#include "../cmsis_nvic.h"
3333

34-
#if !defined(MBED_BOOT_STACK_SIZE)
35-
#define MBED_BOOT_STACK_SIZE 0x400
34+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
35+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
3636
#endif
3737

3838
MEMORY
@@ -69,7 +69,7 @@ MEMORY
6969
*/
7070
ENTRY(Reset_Handler)
7171

72-
STACK_SIZE = MBED_BOOT_STACK_SIZE;
72+
STACK_SIZE = MBED_CONF_TARGET_BOOT_STACK_SIZE;
7373

7474
/* Size of the vector table in SRAM */
7575
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0P/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4646

4747
/*-Sizes-*/
4848
/* Heap and Stack size */
49-
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
50-
define symbol MBED_BOOT_STACK_SIZE = 0x400;
49+
if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
50+
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
5151
}
5252
define symbol __ICFEDIT_size_heap__ = 0x200000;
53-
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
53+
define symbol __ICFEDIT_size_cstack__ = MBED_CONF_TARGET_BOOT_STACK_SIZE;
5454
/**** End of ICF editor section. ###ICF###*/
5555

5656
define memory mem with size = 4G;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M3/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,18 @@
3838
#include "../memory_zones.h"
3939
#include "../cmsis_nvic.h"
4040

41-
#if !defined(MBED_BOOT_STACK_SIZE)
42-
#define MBED_BOOT_STACK_SIZE 0x400
41+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
42+
# if defined(MBED_BOOT_STACK_SIZE)
43+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
44+
# else
45+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
46+
# endif
4347
#endif
4448

4549
#if (defined(__stack_size__))
4650
#define STACK_SIZE __stack_size__
4751
#else
48-
#define STACK_SIZE MBED_BOOT_STACK_SIZE
52+
#define STACK_SIZE MBED_CONF_TARGET_BOOT_STACK_SIZE
4953
#endif
5054

5155
; The vector table is loaded at address 0x00000000 in Flash memory region.

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M3/device/TOOLCHAIN_GCC_ARM/MPS2.ld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#include "../memory_zones.h"
3232
#include "../cmsis_nvic.h"
3333

34-
#if !defined(MBED_BOOT_STACK_SIZE)
35-
#define MBED_BOOT_STACK_SIZE 0x400
34+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
35+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
3636
#endif
3737

3838
MEMORY
@@ -69,7 +69,7 @@ MEMORY
6969
*/
7070
ENTRY(Reset_Handler)
7171

72-
STACK_SIZE = MBED_BOOT_STACK_SIZE;
72+
STACK_SIZE = MBED_CONF_TARGET_BOOT_STACK_SIZE;
7373

7474
/* Size of the vector table in SRAM */
7575
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M3/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4646

4747
/*-Sizes-*/
4848
/* Heap and Stack size */
49-
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
50-
define symbol MBED_BOOT_STACK_SIZE = 0x400;
49+
if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
50+
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
5151
}
5252
define symbol __ICFEDIT_size_heap__ = 0x200000;
53-
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
53+
define symbol __ICFEDIT_size_cstack__ = MBED_CONF_TARGET_BOOT_STACK_SIZE;
5454
/**** End of ICF editor section. ###ICF###*/
5555

5656
define memory mem with size = 4G;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M4/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,18 @@
3838
#include "../memory_zones.h"
3939
#include "../cmsis_nvic.h"
4040

41-
#if !defined(MBED_BOOT_STACK_SIZE)
42-
#define MBED_BOOT_STACK_SIZE 0x400
41+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
42+
# if defined(MBED_BOOT_STACK_SIZE)
43+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
44+
# else
45+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
46+
# endif
4347
#endif
4448

4549
#if (defined(__stack_size__))
4650
#define STACK_SIZE __stack_size__
4751
#else
48-
#define STACK_SIZE MBED_BOOT_STACK_SIZE
52+
#define STACK_SIZE MBED_CONF_TARGET_BOOT_STACK_SIZE
4953
#endif
5054

5155
; The vector table is loaded at address 0x00000000 in Flash memory region.

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M4/device/TOOLCHAIN_GCC_ARM/MPS2.ld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#include "../memory_zones.h"
3232
#include "../cmsis_nvic.h"
3333

34-
#if !defined(MBED_BOOT_STACK_SIZE)
35-
#define MBED_BOOT_STACK_SIZE 0x400
34+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
35+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
3636
#endif
3737

3838
MEMORY
@@ -69,7 +69,7 @@ MEMORY
6969
*/
7070
ENTRY(Reset_Handler)
7171

72-
STACK_SIZE = MBED_BOOT_STACK_SIZE;
72+
STACK_SIZE = MBED_CONF_TARGET_BOOT_STACK_SIZE;
7373

7474
/* Size of the vector table in SRAM */
7575
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M4/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4646

4747
/*-Sizes-*/
4848
/* Heap and Stack size */
49-
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
50-
define symbol MBED_BOOT_STACK_SIZE = 0x400;
49+
if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
50+
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
5151
}
5252
define symbol __ICFEDIT_size_heap__ = 0x200000;
53-
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
53+
define symbol __ICFEDIT_size_cstack__ = MBED_CONF_TARGET_BOOT_STACK_SIZE;
5454
/**** End of ICF editor section. ###ICF###*/
5555

5656
define memory mem with size = 4G;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M7/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,18 @@
3838
#include "../memory_zones.h"
3939
#include "../cmsis_nvic.h"
4040

41-
#if !defined(MBED_BOOT_STACK_SIZE)
42-
#define MBED_BOOT_STACK_SIZE 0x400
41+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
42+
# if defined(MBED_BOOT_STACK_SIZE)
43+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
44+
# else
45+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
46+
# endif
4347
#endif
4448

4549
#if (defined(__stack_size__))
4650
#define STACK_SIZE __stack_size__
4751
#else
48-
#define STACK_SIZE MBED_BOOT_STACK_SIZE
52+
#define STACK_SIZE MBED_CONF_TARGET_BOOT_STACK_SIZE
4953
#endif
5054

5155
; The vector table is loaded at address 0x00000000 in Flash memory region.

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M7/device/TOOLCHAIN_GCC_ARM/MPS2.ld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#include "../memory_zones.h"
3232
#include "../cmsis_nvic.h"
3333

34-
#if !defined(MBED_BOOT_STACK_SIZE)
35-
#define MBED_BOOT_STACK_SIZE 0x400
34+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
35+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
3636
#endif
3737

3838
MEMORY
@@ -69,7 +69,7 @@ MEMORY
6969
*/
7070
ENTRY(Reset_Handler)
7171

72-
STACK_SIZE = MBED_BOOT_STACK_SIZE;
72+
STACK_SIZE = MBED_CONF_TARGET_BOOT_STACK_SIZE;
7373

7474
/* Size of the vector table in SRAM */
7575
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M7/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4646

4747
/*-Sizes-*/
4848
/* Heap and Stack size */
49-
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
50-
define symbol MBED_BOOT_STACK_SIZE = 0x400;
49+
if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
50+
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
5151
}
5252
define symbol __ICFEDIT_size_heap__ = 0x200000;
53-
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
53+
define symbol __ICFEDIT_size_cstack__ = MBED_CONF_TARGET_BOOT_STACK_SIZE;
5454
/**** End of ICF editor section. ###ICF###*/
5555

5656
define memory mem with size = 4G;

targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@
2929
#include "../memory_zones.h"
3030
#include "../cmsis_nvic.h"
3131

32-
#if !defined(MBED_BOOT_STACK_SIZE)
33-
#define MBED_BOOT_STACK_SIZE 0x400
32+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
33+
# if defined(MBED_BOOT_STACK_SIZE)
34+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
35+
# else
36+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
37+
# endif
3438
#endif
3539

36-
#define Stack_Size MBED_BOOT_STACK_SIZE
40+
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
3741

3842
; The vector table is loaded at address 0x00000000 in Flash memory region.
3943
LR_IROM1 FLASH_START FLASH_SIZE {

targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/device/TOOLCHAIN_GCC_ARM/MPS2.ld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#include "../memory_zones.h"
2626
#include "../cmsis_nvic.h"
2727

28-
#if !defined(MBED_BOOT_STACK_SIZE)
29-
#define MBED_BOOT_STACK_SIZE 0x400
28+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
29+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
3030
#endif
3131

3232
MEMORY
@@ -65,7 +65,7 @@ MEMORY
6565
ENTRY(Reset_Handler)
6666

6767
HEAP_SIZE = 0x4000;
68-
STACK_SIZE = MBED_BOOT_STACK_SIZE;
68+
STACK_SIZE = MBED_CONF_TARGET_BOOT_STACK_SIZE;
6969

7070
/* Size of the vector table in SRAM */
7171
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;

targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SSRAM23_START + ZBT_SSRAM23_
5757

5858
/* Sizes */
5959
/* Heap and Stack size */
60-
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
61-
define symbol MBED_BOOT_STACK_SIZE = 0x400;
60+
if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
61+
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
6262
}
63-
define symbol __ICFEDIT_size_heap__ = MBED_BOOT_STACK_SIZE;
63+
define symbol __ICFEDIT_size_heap__ = MBED_CONF_TARGET_BOOT_STACK_SIZE;
6464
define symbol __ICFEDIT_size_cstack__ = 0x1000;
6565

6666
define memory mem with size = 4G;

0 commit comments

Comments
 (0)