Skip to content

Commit 037fe9b

Browse files
authored
NUVOTON: Fix for target.boot-stack-size config in linker script (#351)
"target.boot-stack-size" can expand to MBED_CONF_TARGET_BOOT_STACK_SIZE or legacy MBED_BOOT_STACK_SIZE. Though MBED_BOOT_STACK_SIZE is unsupported in Mbed CE, make its preprocess consistent in linker scripts by prioritizing MBED_CONF_TARGET_BOOT_STACK_SIZE, then MBED_BOOT_STACK_SIZE for being compatible.
1 parent cfee81c commit 037fe9b

File tree

10 files changed

+56
-16
lines changed
  • targets/TARGET_NUVOTON
    • TARGET_M2354/device
    • TARGET_M251/device/TOOLCHAIN_GCC_ARM
    • TARGET_M261/device/TOOLCHAIN_GCC_ARM
    • TARGET_M451/device/TOOLCHAIN_GCC_ARM
    • TARGET_M460/device/TOOLCHAIN_GCC_ARM
    • TARGET_M480/device/TOOLCHAIN_GCC_ARM
    • TARGET_NANO100/device/TOOLCHAIN_GCC_ARM
    • TARGET_NUC472/device/TOOLCHAIN_GCC_ARM

10 files changed

+56
-16
lines changed

targets/TARGET_NUVOTON/TARGET_M2354/device/TOOLCHAIN_ARMC6/M2354.sct

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@
2020

2121
#include "../partition_M2354_mem.h"
2222

23-
#if !defined(MBED_BOOT_STACK_SIZE)
24-
#define MBED_BOOT_STACK_SIZE 0x400
23+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
24+
# if defined(MBED_BOOT_STACK_SIZE)
25+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
26+
# else
27+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
28+
# endif
2529
#endif
2630

2731
LR_IROM1 MBED_APP_START
@@ -34,7 +38,7 @@ LR_IROM1 MBED_APP_START
3438
.ANY (+RO)
3539
}
3640

37-
ARM_LIB_STACK MBED_RAM_APP_START EMPTY MBED_BOOT_STACK_SIZE
41+
ARM_LIB_STACK MBED_RAM_APP_START EMPTY MBED_CONF_TARGET_BOOT_STACK_SIZE
3842
{
3943
}
4044

targets/TARGET_NUVOTON/TARGET_M2354/device/TOOLCHAIN_GCC_ARM/M2354.ld

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@
2222

2323
#include "../partition_M2354_mem.h"
2424

25-
#if !defined(MBED_BOOT_STACK_SIZE)
26-
#define MBED_BOOT_STACK_SIZE 0x400
25+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
26+
# if defined(MBED_BOOT_STACK_SIZE)
27+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
28+
# else
29+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
30+
# endif
2731
#endif
2832

29-
StackSize = MBED_BOOT_STACK_SIZE;
33+
StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
3034

3135
MEMORY
3236
{

targets/TARGET_NUVOTON/TARGET_M251/device/TOOLCHAIN_GCC_ARM/M251.ld

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
#include "../M251_mem.h"
2222

2323
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
24-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
24+
# if defined(MBED_BOOT_STACK_SIZE)
25+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
26+
# else
27+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
28+
# endif
2529
#endif
2630

2731
StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;

targets/TARGET_NUVOTON/TARGET_M261/device/TOOLCHAIN_GCC_ARM/M261.ld

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
#include "../M261_mem.h"
2424

2525
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
26-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
26+
# if defined(MBED_BOOT_STACK_SIZE)
27+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
28+
# else
29+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
30+
# endif
2731
#endif
2832

2933
M_CRASH_DATA_RAM_SIZE = 0x100;

targets/TARGET_NUVOTON/TARGET_M451/device/TOOLCHAIN_GCC_ARM/M453.ld

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
#include "../M451_mem.h"
2424

2525
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
26-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
26+
# if defined(MBED_BOOT_STACK_SIZE)
27+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
28+
# else
29+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
30+
# endif
2731
#endif
2832

2933
StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;

targets/TARGET_NUVOTON/TARGET_M460/device/TOOLCHAIN_GCC_ARM/M467.ld

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@
2222

2323
#include "../M460_mem.h"
2424

25-
#if !defined(MBED_BOOT_STACK_SIZE)
26-
#define MBED_BOOT_STACK_SIZE 0x400
25+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
26+
# if defined(MBED_BOOT_STACK_SIZE)
27+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
28+
# else
29+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
30+
# endif
2731
#endif
2832

2933
#if !defined(NU_HYPERRAM_START)
@@ -35,7 +39,7 @@
3539
#endif
3640

3741
M_CRASH_DATA_RAM_SIZE = 0x100;
38-
StackSize = MBED_BOOT_STACK_SIZE;
42+
StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
3943

4044
MEMORY
4145
{

targets/TARGET_NUVOTON/TARGET_M480/device/TOOLCHAIN_GCC_ARM/M487.ld

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
#include "../M480_mem.h"
2424

2525
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
26-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
26+
# if defined(MBED_BOOT_STACK_SIZE)
27+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
28+
# else
29+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
30+
# endif
2731
#endif
2832

2933
M_CRASH_DATA_RAM_SIZE = 0x100;

targets/TARGET_NUVOTON/TARGET_NANO100/device/TOOLCHAIN_GCC_ARM/NANO130.ld

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
#include "../NANO100_mem.h"
2424

2525
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
26-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
26+
# if defined(MBED_BOOT_STACK_SIZE)
27+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
28+
# else
29+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
30+
# endif
2731
#endif
2832

2933
StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;

targets/TARGET_NUVOTON/TARGET_NUC472/device/TOOLCHAIN_GCC_ARM/TARGET_NU_XRAM_SUPPORTED/NUC472.ld

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
#endif
1212

1313
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
14-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
14+
# if defined(MBED_BOOT_STACK_SIZE)
15+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
16+
# else
17+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
18+
# endif
1519
#endif
1620

1721
M_CRASH_DATA_RAM_SIZE = 0x100;

targets/TARGET_NUVOTON/TARGET_NUC472/device/TOOLCHAIN_GCC_ARM/TARGET_NU_XRAM_UNSUPPORTED/NUC472.ld

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
#endif
1212

1313
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
14-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
14+
# if defined(MBED_BOOT_STACK_SIZE)
15+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
16+
# else
17+
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
18+
# endif
1519
#endif
1620

1721
M_CRASH_DATA_RAM_SIZE = 0x100;

0 commit comments

Comments
 (0)