Skip to content

Commit d7ac051

Browse files
authored
porting: Rename MBED_BOOT_STACK_SIZE to MBED_CONF_TARGET_BOOT_STACK_SIZE (#1362)
MBED_BOOT_STACK_SIZE is a duplicated definition of MBED_CONF_TARGET_BOOT_STACK_SIZE, which we are removing as it is causing issues in mbed-os. This commit updates the porting guide to only mention MBED_CONF_TARGET_BOOT_STACK_SIZE when referring to the define for the boot stack size.
1 parent 5212d38 commit d7ac051

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

docs/porting/target/bootstrap.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ If you are updating your own linker script, you must:
2828
- Arm - The boot stack is the `ARM_LIB_STACK` region.
2929
- GCC_ARM - The boot stack starts at the symbol `__StackLimit` and ends at the symbol `__StackTop`.
3030
- Add defines for a relocatable application - `MBED_APP_START` and `MBED_APP_SIZE`.
31-
- Add the define for boot stack size - `MBED_BOOT_STACK_SIZE`.
31+
- Add the define for boot stack size - `MBED_CONF_TARGET_BOOT_STACK_SIZE`.
3232
- Add preprocessing directive `#! armcc -E` (ARM compiler only).
3333

3434
If you are using the below linker script, then you need to update all the defines in the `/* Device specific values */` section for your target.
@@ -54,9 +54,9 @@ If you are using the below linker script, then you need to update all the define
5454
#define MBED_APP_SIZE MBED_ROM_SIZE
5555
#endif
5656
57-
#if !defined(MBED_BOOT_STACK_SIZE)
57+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
5858
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
59-
#define MBED_BOOT_STACK_SIZE 0x400
59+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
6060
#endif
6161
6262
/* Round up VECTORS_SIZE to 8 bytes */
@@ -74,10 +74,10 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE {
7474
.ANY (+RW +ZI)
7575
}
7676
77-
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
77+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - MBED_CONF_TARGET_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
7878
}
7979
80-
ARM_LIB_STACK (RAM_START + RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; Stack region growing down
80+
ARM_LIB_STACK (RAM_START + RAM_SIZE) EMPTY -MBED_CONF_TARGET_BOOT_STACK_SIZE { ; Stack region growing down
8181
}
8282
}
8383
```
@@ -102,10 +102,10 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) {
102102
define symbol MBED_APP_SIZE = MBED_ROM_SIZE;
103103
}
104104
105-
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
105+
if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
106106
/* This value is normally defined by the tools
107107
to 0x1000 for bare metal and 0x400 for RTOS */
108-
define symbol MBED_BOOT_STACK_SIZE = 0x400;
108+
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
109109
}
110110
111111
/* Round up VECTORS_SIZE to 8 bytes */
@@ -117,7 +117,7 @@ define memory mem with size = 4G;
117117
define region ROM_region = mem:[from MBED_APP_START size MBED_APP_SIZE];
118118
define region RAM_region = mem:[from RAM_REGION_START size RAM_REGION_SIZE];
119119
120-
define block CSTACK with alignment = 8, size = MBED_BOOT_STACK_SIZE { };
120+
define block CSTACK with alignment = 8, size = MBED_CONF_TARGET_BOOT_STACK_SIZE { };
121121
define block HEAP with alignment = 8, size = HEAP_SIZE { };
122122
123123
initialize by copy { readwrite };
@@ -150,10 +150,10 @@ GCC linker script template:
150150
#define MBED_APP_SIZE MBED_ROM_SIZE
151151
#endif
152152
153-
#if !defined(MBED_BOOT_STACK_SIZE)
153+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
154154
/* This value is normally defined by the tools
155155
to 0x1000 for bare metal and 0x400 for RTOS */
156-
#define MBED_BOOT_STACK_SIZE 0x400
156+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
157157
#endif
158158
159159
/* Round up VECTORS_SIZE to 8 bytes */
@@ -300,7 +300,7 @@ SECTIONS
300300
__end__ = .;
301301
PROVIDE(end = .);
302302
*(.heap*)
303-
. = ORIGIN(RAM) + LENGTH(RAM) - MBED_BOOT_STACK_SIZE;
303+
. = ORIGIN(RAM) + LENGTH(RAM) - MBED_CONF_TARGET_BOOT_STACK_SIZE;
304304
__HeapLimit = .;
305305
} > RAM
306306
@@ -315,7 +315,7 @@ SECTIONS
315315
/* Set stack top to end of RAM, and stack limit move down by
316316
* size of stack_dummy section */
317317
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
318-
__StackLimit = __StackTop - MBED_BOOT_STACK_SIZE;
318+
__StackLimit = __StackTop - MBED_CONF_TARGET_BOOT_STACK_SIZE;
319319
PROVIDE(__stack = __StackTop);
320320
321321
/* Check if data + heap + stack exceeds RAM limit */

0 commit comments

Comments
 (0)