Skip to content

Commit 94f74b4

Browse files
committed
Ambiq_Micro: 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 fc4e435 commit 94f74b4

File tree

1 file changed

+10
-2
lines changed
  • targets/TARGET_Ambiq_Micro/TARGET_Apollo3/TOOLCHAIN_ARM_STD

1 file changed

+10
-2
lines changed

targets/TARGET_Ambiq_Micro/TARGET_Apollo3/TOOLCHAIN_ARM_STD/AMA3B1KK.sct

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
; SOFTWARE.
2424
;
2525

26+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
27+
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
28+
#if defined(MBED_BOOT_STACK_SIZE)
29+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
30+
#else
31+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
32+
#endif
33+
#endif
2634

2735
#define MBED_APP_START 0x0000C000
2836
#define MBED_APP_SIZE 0x000F4000
@@ -32,8 +40,8 @@
3240
#define MBED_RAM0_SIZE 0x100
3341
#define MBED_RAM1_START (MBED_RAM0_START + MBED_RAM0_SIZE)
3442
#define MBED_RAM1_SIZE (MBED_RAM_SIZE - (MBED_RAM0_SIZE))
35-
#define Stack_Size MBED_BOOT_STACK_SIZE
36-
#define RAM_FIXED_SIZE (MBED_BOOT_STACK_SIZE+MBED_RAM0_SIZE)
43+
#define Stack_Size MBED_CONF_TARGET_BOOT_STACK_SIZE
44+
#define RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE+MBED_RAM0_SIZE)
3745

3846

3947
LR_IROM1 MBED_APP_START MBED_APP_SIZE {

0 commit comments

Comments
 (0)