Update the K64F to use boot stack size config

Update the K64F linker scripts to make use of the newly added stack
size target config.
pull/8039/head
Russ Butler 2018-09-07 16:30:02 +01:00
parent 1ead033423
commit 66cce67d38
3 changed files with 25 additions and 12 deletions

View File

@ -64,6 +64,10 @@
#define MBED_APP_SIZE 0x100000 #define MBED_APP_SIZE 0x100000
#endif #endif
#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif
#define m_interrupts_start MBED_APP_START #define m_interrupts_start MBED_APP_START
#define m_interrupts_size 0x00000400 #define m_interrupts_size 0x00000400
@ -86,7 +90,7 @@
#if (defined(__stack_size__)) #if (defined(__stack_size__))
#define Stack_Size __stack_size__ #define Stack_Size __stack_size__
#else #else
#define Stack_Size 0x0400 #define Stack_Size MBED_BOOT_STACK_SIZE
#endif #endif
#if (defined(__heap_size__)) #if (defined(__heap_size__))
@ -122,4 +126,6 @@ LR_IROM1 m_interrupts_start m_text_start+m_text_size-m_interrupts_start { ; lo
} }
RW_IRAM1 ImageLimit(RW_m_data_2) { ; Heap region growing up RW_IRAM1 ImageLimit(RW_m_data_2) { ; Heap region growing up
} }
ARM_LIB_STACK m_data_2_start+m_data_2_size EMPTY -Stack_Size { ; Stack region growing down
}
} }

View File

@ -53,12 +53,6 @@ ENTRY(Reset_Handler)
__ram_vector_table__ = 1; __ram_vector_table__ = 1;
/* With the RTOS in use, this does not affect the main stack size. The size of
* the stack where main runs is determined via the RTOS. */
__stack_size__ = 0x400;
__heap_size__ = 0x6000;
#if !defined(MBED_APP_START) #if !defined(MBED_APP_START)
#define MBED_APP_START 0 #define MBED_APP_START 0
#endif #endif
@ -67,6 +61,16 @@ __heap_size__ = 0x6000;
#define MBED_APP_SIZE 0x100000 #define MBED_APP_SIZE 0x100000
#endif #endif
#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif
/* With the RTOS in use, this does not affect the main stack size. The size of
* the stack where main runs is determined via the RTOS. */
__stack_size__ = MBED_BOOT_STACK_SIZE;
__heap_size__ = 0x6000;
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400; HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400; STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x0400 : 0x0; M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x0400 : 0x0;
@ -259,7 +263,7 @@ SECTIONS
__end__ = .; __end__ = .;
PROVIDE(end = .); PROVIDE(end = .);
__HeapBase = .; __HeapBase = .;
. += HEAP_SIZE; . = ORIGIN(m_data_2) + LENGTH(m_data_2) - STACK_SIZE;
__HeapLimit = .; __HeapLimit = .;
__heap_limit = .; /* Add for _sbrk */ __heap_limit = .; /* Add for _sbrk */
} > m_data_2 } > m_data_2

View File

@ -49,10 +49,6 @@
*/ */
define symbol __ram_vector_table__ = 1; define symbol __ram_vector_table__ = 1;
/* Heap 1/4 of ram and stack 1/8 */
define symbol __stack_size__=0x8000;
define symbol __heap_size__=0x10000;
if (!isdefinedsymbol(MBED_APP_START)) { if (!isdefinedsymbol(MBED_APP_START)) {
define symbol MBED_APP_START = 0; define symbol MBED_APP_START = 0;
} }
@ -61,6 +57,13 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) {
define symbol MBED_APP_SIZE = 0x100000; define symbol MBED_APP_SIZE = 0x100000;
} }
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
define symbol MBED_BOOT_STACK_SIZE = 0x400;
}
define symbol __stack_size__=MBED_BOOT_STACK_SIZE;
define symbol __heap_size__=0x10000;
define symbol __ram_vector_table_size__ = isdefinedsymbol(__ram_vector_table__) ? 0x00000400 : 0; define symbol __ram_vector_table_size__ = isdefinedsymbol(__ram_vector_table__) ? 0x00000400 : 0;
define symbol __ram_vector_table_offset__ = isdefinedsymbol(__ram_vector_table__) ? 0x000003FF : 0; define symbol __ram_vector_table_offset__ = isdefinedsymbol(__ram_vector_table__) ? 0x000003FF : 0;