24 |
24 |
25 #if !defined(MBED_APP_SIZE) |
25 #if !defined(MBED_APP_SIZE) |
26 #define MBED_APP_SIZE MBED_ROM_SIZE |
26 #define MBED_APP_SIZE MBED_ROM_SIZE |
27 #endif |
27 #endif |
28 |
28 |
29 #if !defined(MBED_BOOT_STACK_SIZE) |
29 #if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE) |
30 /* This value is normally defined by the tools |
30 /* This value is normally defined by the tools |
31 to 0x1000 for bare metal and 0x400 for RTOS */ |
31 to 0x1000 for bare metal and 0x400 for RTOS */ |
32 #define MBED_BOOT_STACK_SIZE 0x400 |
32 #define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400 |
33 #endif |
33 #endif |
34 |
34 |
35 /* Round up VECTORS_SIZE to 8 bytes */ |
35 /* Round up VECTORS_SIZE to 8 bytes */ |
36 #define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8) |
36 #define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8) |
37 |
37 |
193 |
193 |
194 /* Set stack top to end of RAM, and stack limit move down by |
194 /* Set stack top to end of RAM, and stack limit move down by |
195 * size of stack_dummy section */ |
195 * size of stack_dummy section */ |
196 __StackTop = ORIGIN(RAM) + LENGTH(RAM); |
196 __StackTop = ORIGIN(RAM) + LENGTH(RAM); |
197 _estack = __StackTop; |
197 _estack = __StackTop; |
198 __StackLimit = __StackTop - MBED_BOOT_STACK_SIZE; |
198 __StackLimit = __StackTop - MBED_CONF_TARGET_BOOT_STACK_SIZE; |
199 PROVIDE(__stack = __StackTop); |
199 PROVIDE(__stack = __StackTop); |
200 |
200 |
201 /* Check if data + heap + stack exceeds RAM limit */ |
201 /* Check if data + heap + stack exceeds RAM limit */ |
202 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") |
202 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") |
203 } |
203 } |