mirror of https://github.com/ARMmbed/mbed-os.git
[Analog_Devices] Support boot stack size configuration option
parent
0111f5d5fe
commit
f0ab08a68c
|
@ -45,6 +45,12 @@
|
|||
|
||||
#define ADUCM_VECTOR_SIZE 0x1A0
|
||||
|
||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
|
||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
||||
|
||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||
FLASH0 MBED_APP_START ADUCM_VECTOR_SIZE {
|
||||
*(.vectors, +First)
|
||||
|
@ -63,11 +69,11 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE {
|
|||
.ANY (+RW)
|
||||
}
|
||||
|
||||
ADUCM_HEAP AlignExpr(+0, 16) EMPTY
|
||||
(0x20003000 - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; heap
|
||||
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY
|
||||
(0x20004000 - AlignExpr(ImageLimit(RW_IRAM1), 16) - Stack_Size) { ; heap
|
||||
}
|
||||
|
||||
ADUCM_STACK AlignExpr(+0, 16) EMPTY 0x1000 { ; stack
|
||||
ARM_LIB_STACK AlignExpr(+0, 16) EMPTY Stack_Size { ; stack
|
||||
}
|
||||
|
||||
ADUCM_IRAM2 0x20004000 0x4000 { ; bss section
|
||||
|
|
|
@ -33,7 +33,10 @@ MEMORY
|
|||
/* Library configurations */
|
||||
GROUP(libgcc.a libc.a libm.a libnosys.a)
|
||||
/* Custom stack and heap sizes */
|
||||
__stack_size__ = 0x1000;
|
||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
__stack_size__ = MBED_BOOT_STACK_SIZE;
|
||||
__heap_size__ = 0x2000;
|
||||
|
||||
/* select custom or default sizes for stack and heap */
|
||||
|
@ -220,13 +223,13 @@ SECTIONS
|
|||
__HeapBase = .;
|
||||
__end__ = .;
|
||||
end = __end__;
|
||||
. += HEAP_SIZE;
|
||||
. = ORIGIN(DSRAM_A) + LENGTH(DSRAM_A) - STACK_SIZE;
|
||||
__HeapLimit = .;
|
||||
} > DSRAM_A
|
||||
|
||||
/* Set stack top to end of DSRAM_A, and move stack limit down by
|
||||
* size of stack_dummy section */
|
||||
__StackTop = ORIGIN(DSRAM_C);
|
||||
__StackTop = ORIGIN(DSRAM_A) + LENGTH(DSRAM_A);
|
||||
__StackLimit = __StackTop - STACK_SIZE;
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
|
|
|
@ -38,6 +38,10 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
|||
define symbol MBED_APP_SIZE = 0x40000;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
||||
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
||||
}
|
||||
|
||||
define symbol ADUCM_SECTOR_SIZE = 0x800;
|
||||
|
||||
define symbol ADUCM_VECTOR_SIZE = 0x1A0;
|
||||
|
@ -49,7 +53,7 @@ define region ROM_REGION = mem:[from MBED_APP_START+ADUCM_SECTO
|
|||
define region RAM_bank1_region = mem:[from 0x20000200 size 0x00003E00];
|
||||
define region RAM_bank2_region = mem:[from 0x20004000 size 0x00004000]
|
||||
| mem:[from 0x20040000 size 0x00007000];
|
||||
define block CSTACK with alignment = 16, size = 0x1000 { };
|
||||
define block CSTACK with alignment = 16, size = MBED_BOOT_STACK_SIZE { };
|
||||
define block HEAP with alignment = 16, size = 0x2000 { };
|
||||
do not initialize { section .noinit };
|
||||
initialize by copy { rw };
|
||||
|
|
|
@ -42,6 +42,12 @@
|
|||
|
||||
#define ADUCM_VECTOR_SIZE 0x1A0
|
||||
|
||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
|
||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
||||
|
||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
|
||||
FLASH0 MBED_APP_START ADUCM_VECTOR_SIZE {
|
||||
*(.vectors, +First)
|
||||
|
@ -62,6 +68,9 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE {
|
|||
|
||||
ADUCM_IRAM3 0x20048000 0x10000 { *(+ZI) }
|
||||
|
||||
ADUCM_HEAP AlignExpr(ImageLimit(RW_IRAM1), 16) EMPTY
|
||||
(ImageBase(ADUCM_IRAM3) - 0x2000 - AlignExpr(ImageLimit(RW_IRAM1), 16)) { } ; heap
|
||||
ARM_LIB_HEAP AlignExpr(ImageLimit(RW_IRAM1), 16) EMPTY
|
||||
(ImageBase(ADUCM_IRAM3) - Stack_Size - AlignExpr(ImageLimit(RW_IRAM1), 16)) { } ; heap
|
||||
|
||||
ARM_LIB_STACK AlignExpr(+0, 16) EMPTY Stack_Size { ; stack
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,10 @@ MEMORY
|
|||
GROUP(libgcc.a libc.a libm.a libnosys.a)
|
||||
|
||||
/* Custom stack and heap sizes */
|
||||
__stack_size__ = 0x2000;
|
||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
__stack_size__ = MBED_BOOT_STACK_SIZE;
|
||||
__heap_size__ = 0x6000;
|
||||
|
||||
/* select custom or default sizes for stack and heap */
|
||||
|
|
|
@ -38,6 +38,10 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
|||
define symbol MBED_APP_SIZE = 0x7F000;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
||||
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
||||
}
|
||||
|
||||
define symbol ADUCM_SECTOR_SIZE = 0x800;
|
||||
|
||||
define symbol ADUCM_VECTOR_SIZE = 0x1A0;
|
||||
|
@ -49,7 +53,7 @@ define region ROM_REGION = mem:[from MBED_APP_START+ADUCM_SECTO
|
|||
define region RAM_bank1_region = mem:[from 0x20040000 size 0x00008000];
|
||||
define region RAM_bank2_region = mem:[from 0x20000200 size 0x00006E00]
|
||||
| mem:[from 0x20048000 size 0x00010000];
|
||||
define block CSTACK with alignment = 16, size = 0x2000 { };
|
||||
define block CSTACK with alignment = 16, size = MBED_BOOT_STACK_SIZE { };
|
||||
define block HEAP with alignment = 16, size = 0x6000 { };
|
||||
do not initialize { section .noinit };
|
||||
initialize by copy { rw };
|
||||
|
|
Loading…
Reference in New Issue