Skip to content

Commit

Permalink
NUVOTON: Fix for target.boot-stack-size config in linker script (#351)
Browse files Browse the repository at this point in the history
"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.
  • Loading branch information
ccli8 authored Sep 23, 2024
1 parent cfee81c commit 037fe9b
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@

#include "../partition_M2354_mem.h"

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
# if defined(MBED_BOOT_STACK_SIZE)
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
# else
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# endif
#endif

LR_IROM1 MBED_APP_START
Expand All @@ -34,7 +38,7 @@ LR_IROM1 MBED_APP_START
.ANY (+RO)
}

ARM_LIB_STACK MBED_RAM_APP_START EMPTY MBED_BOOT_STACK_SIZE
ARM_LIB_STACK MBED_RAM_APP_START EMPTY MBED_CONF_TARGET_BOOT_STACK_SIZE
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@

#include "../partition_M2354_mem.h"

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
# if defined(MBED_BOOT_STACK_SIZE)
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
# else
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# endif
#endif

StackSize = MBED_BOOT_STACK_SIZE;
StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;

MEMORY
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
#include "../M251_mem.h"

#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# if defined(MBED_BOOT_STACK_SIZE)
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
# else
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# endif
#endif

StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
#include "../M261_mem.h"

#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# if defined(MBED_BOOT_STACK_SIZE)
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
# else
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# endif
#endif

M_CRASH_DATA_RAM_SIZE = 0x100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
#include "../M451_mem.h"

#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# if defined(MBED_BOOT_STACK_SIZE)
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
# else
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# endif
#endif

StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@

#include "../M460_mem.h"

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
# if defined(MBED_BOOT_STACK_SIZE)
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
# else
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# endif
#endif

#if !defined(NU_HYPERRAM_START)
Expand All @@ -35,7 +39,7 @@
#endif

M_CRASH_DATA_RAM_SIZE = 0x100;
StackSize = MBED_BOOT_STACK_SIZE;
StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;

MEMORY
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
#include "../M480_mem.h"

#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# if defined(MBED_BOOT_STACK_SIZE)
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
# else
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# endif
#endif

M_CRASH_DATA_RAM_SIZE = 0x100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
#include "../NANO100_mem.h"

#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# if defined(MBED_BOOT_STACK_SIZE)
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
# else
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# endif
#endif

StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
#endif

#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# if defined(MBED_BOOT_STACK_SIZE)
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
# else
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# endif
#endif

M_CRASH_DATA_RAM_SIZE = 0x100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
#endif

#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# if defined(MBED_BOOT_STACK_SIZE)
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
# else
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# endif
#endif

M_CRASH_DATA_RAM_SIZE = 0x100;
Expand Down

0 comments on commit 037fe9b

Please sign in to comment.