Skip to content

Commit 612b148

Browse files
committed
stack: armc: Workaround config passing bug
Workaround a bug where the boot stack size configuration option is not passed on to armlink, the Arm Compiler's linker. Prefer MBED_CONF_TARGET_BOOT_STACK_SIZE if present, as this is what the configuration system should provide. Fall back to MBED_BOOT_STACK_SIZE if MBED_CONF_TARGET_BOOT_STACK_SIZE is not defined, as in the case of buggy tools. If both MBED_CONF_TARGET_BOOT_STACK_SIZE and MBED_BOOT_STACK_SIZE are not defined, then we fall back to a hard-coded value provided by the linkerscript. See #13474 for more information.
1 parent 2ed7403 commit 612b148

File tree

154 files changed

+827
-211
lines changed

Some content is hidden

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

154 files changed

+827
-211
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939
#include "../cmsis_nvic.h"
4040

4141
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
42-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
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__))

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939
#include "../cmsis_nvic.h"
4040

4141
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
42-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
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__))

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939
#include "../cmsis_nvic.h"
4040

4141
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
42-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
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__))

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939
#include "../cmsis_nvic.h"
4040

4141
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
42-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
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__))

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939
#include "../cmsis_nvic.h"
4040

4141
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
42-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
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__))

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030
#include "../cmsis_nvic.h"
3131

3232
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
33-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
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

3640
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE

targets/TARGET_ARM_SSG/TARGET_MPS2/TARGET_MPS2_M0/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535
; *************************************************************
3636

3737
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
38-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
38+
# if defined(MBED_BOOT_STACK_SIZE)
39+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
40+
# else
41+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
42+
# endif
3943
#endif
4044

4145
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE

targets/TARGET_ARM_SSG/TARGET_MPS2/TARGET_MPS2_M0P/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535
; *************************************************************
3636

3737
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
38-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
38+
# if defined(MBED_BOOT_STACK_SIZE)
39+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
40+
# else
41+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
42+
# endif
3943
#endif
4044

4145
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE

targets/TARGET_ARM_SSG/TARGET_MPS2/TARGET_MPS2_M3/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535
; *************************************************************
3636

3737
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
38-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
38+
# if defined(MBED_BOOT_STACK_SIZE)
39+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
40+
# else
41+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
42+
# endif
3943
#endif
4044

4145
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE

targets/TARGET_ARM_SSG/TARGET_MPS2/TARGET_MPS2_M4/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@
3636
; *************************************************************
3737

3838
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
39-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
39+
# if defined(MBED_BOOT_STACK_SIZE)
40+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
41+
# else
42+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
43+
# endif
4044
#endif
4145

4246
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE

0 commit comments

Comments
 (0)