Enable split heap in K64F/K66F devices

-Enable MBED_SPLIT_HEAP for K64F and K66F
-Allow GCC_ARM toolchain to utilize remaining 64K memory area
-Make ARM toolchain to start memory filling from 64K region to leave
 more space to bigger 192K region.
pull/10950/head
Kevin Bracey 2019-07-03 11:47:32 +03:00 committed by Arto Kinnunen
parent 149d53cc89
commit 810cb8de4a
5 changed files with 28 additions and 9 deletions

View File

@ -114,12 +114,12 @@ LR_IROM1 m_interrupts_start m_text_start+m_text_size-m_interrupts_start { ; lo
RW_m_crash_data m_crash_report_ram_start EMPTY m_crash_report_ram_size { ; RW data RW_m_crash_data m_crash_report_ram_start EMPTY m_crash_report_ram_size { ; RW data
} }
RW_m_data m_data_start m_data_size { ; RW data RW_m_data m_data_start m_data_size { ; RW data
.ANY (+RW +ZI) .ANY2 (+RW +ZI)
} }
RW_m_data_2 m_data_2_start m_data_2_size { ; RW data RW_m_data_2 m_data_2_start m_data_2_size { ; RW data
.ANY (+RW +ZI) .ANY1 (+RW +ZI)
} }
RW_IRAM1 ImageLimit(RW_m_data_2) { RW_IRAM1 ImageLimit(RW_m_data_2) EMPTY 0 {
} }
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (m_data_2_start + m_data_2_size - Stack_Size - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap region growing up ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (m_data_2_start + m_data_2_size - Stack_Size - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap region growing up
} }

View File

@ -210,6 +210,14 @@ SECTIONS
__CRASH_DATA_RAM_END__ = .; /* Define a global symbol at data end */ __CRASH_DATA_RAM_END__ = .; /* Define a global symbol at data end */
} > m_data } > m_data
.heap_0 :
{
. = ALIGN(8);
__mbed_sbrk_start_0 = .;
. += (ORIGIN(m_data) + LENGTH(m_data) - .);
__mbed_krbs_start_0 = .;
} > m_data
__VECTOR_RAM = DEFINED(__ram_vector_table__) ? __VECTOR_RAM__ : ORIGIN(m_interrupts); __VECTOR_RAM = DEFINED(__ram_vector_table__) ? __VECTOR_RAM__ : ORIGIN(m_interrupts);
__RAM_VECTOR_TABLE_SIZE_BYTES = DEFINED(__ram_vector_table__) ? (__interrupts_ram_end__ - __interrupts_ram_start__) : 0x0; __RAM_VECTOR_TABLE_SIZE_BYTES = DEFINED(__ram_vector_table__) ? (__interrupts_ram_end__ - __interrupts_ram_start__) : 0x0;
@ -249,8 +257,10 @@ SECTIONS
. = ALIGN(8); . = ALIGN(8);
__end__ = .; __end__ = .;
PROVIDE(end = .); PROVIDE(end = .);
__mbed_sbrk_start = .;
__HeapBase = .; __HeapBase = .;
. = ORIGIN(m_data_2) + LENGTH(m_data_2) - STACK_SIZE; . = ORIGIN(m_data_2) + LENGTH(m_data_2) - STACK_SIZE;
__mbed_krbs_start = .;
__HeapLimit = .; __HeapLimit = .;
__heap_limit = .; /* Add for _sbrk */ __heap_limit = .; /* Add for _sbrk */
} > m_data_2 } > m_data_2

View File

@ -118,12 +118,12 @@ LR_IROM1 m_interrupts_start m_text_start+m_text_size-m_interrupts_start { ; load
RW_m_crash_data m_crash_report_ram_start EMPTY m_crash_report_ram_size { ; RW data RW_m_crash_data m_crash_report_ram_start EMPTY m_crash_report_ram_size { ; RW data
} }
RW_m_data m_data_start m_data_size { ; RW data RW_m_data m_data_start m_data_size { ; RW data
.ANY (+RW +ZI) .ANY2 (+RW +ZI)
} }
RW_m_data_2 m_data_2_start m_data_2_size { ; RW data RW_m_data_2 m_data_2_start m_data_2_size { ; RW data
.ANY (+RW +ZI) .ANY1 (+RW +ZI)
} }
RW_IRAM1 ImageLimit(RW_m_data_2) { RW_IRAM1 ImageLimit(RW_m_data_2) EMPTY 0 {
} }
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (m_data_2_start + m_data_2_size - Stack_Size - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap region growing up ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (m_data_2_start + m_data_2_size - Stack_Size - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap region growing up
} }

View File

@ -196,7 +196,7 @@ SECTIONS
. = ALIGN(8); . = ALIGN(8);
__interrupts_ram_end__ = .; /* Define a global symbol at data end */ __interrupts_ram_end__ = .; /* Define a global symbol at data end */
} > m_data } > m_data
.crash_data_ram : .crash_data_ram :
{ {
. = ALIGN(8); . = ALIGN(8);
@ -209,6 +209,13 @@ SECTIONS
__CRASH_DATA_RAM_END__ = .; /* Define a global symbol at data end */ __CRASH_DATA_RAM_END__ = .; /* Define a global symbol at data end */
} > m_data } > m_data
.heap_0 :
{
. = ALIGN(8);
__mbed_sbrk_start_0 = .;
. += (ORIGIN(m_data) + LENGTH(m_data) - .);
__mbed_krbs_start_0 = .;
} > m_data
__VECTOR_RAM = DEFINED(__ram_vector_table__) ? __VECTOR_RAM__ : ORIGIN(m_interrupts); __VECTOR_RAM = DEFINED(__ram_vector_table__) ? __VECTOR_RAM__ : ORIGIN(m_interrupts);
__RAM_VECTOR_TABLE_SIZE_BYTES = DEFINED(__ram_vector_table__) ? (__interrupts_ram_end__ - __interrupts_ram_start__) : 0x0; __RAM_VECTOR_TABLE_SIZE_BYTES = DEFINED(__ram_vector_table__) ? (__interrupts_ram_end__ - __interrupts_ram_start__) : 0x0;
@ -270,8 +277,10 @@ SECTIONS
. = ALIGN(8); . = ALIGN(8);
__end__ = .; __end__ = .;
PROVIDE(end = .); PROVIDE(end = .);
__mbed_sbrk_start = .;
__HeapBase = .; __HeapBase = .;
. = ORIGIN(m_data_2) + LENGTH(m_data_2) - STACK_SIZE; . = ORIGIN(m_data_2) + LENGTH(m_data_2) - STACK_SIZE;
__mbed_krbs_start = .;
__HeapLimit = .; __HeapLimit = .;
__heap_limit = .; /* Add for _sbrk */ __heap_limit = .; /* Add for _sbrk */
} > m_data_2 } > m_data_2

View File

@ -1489,7 +1489,7 @@
"PSA" "PSA"
], ],
"is_disk_virtual": true, "is_disk_virtual": true,
"macros": ["CPU_MK64FN1M0VMD12", "FSL_RTOS_MBED"], "macros": ["CPU_MK64FN1M0VMD12", "FSL_RTOS_MBED", "MBED_SPLIT_HEAP"],
"inherits": ["Target"], "inherits": ["Target"],
"detect_code": ["0240"], "detect_code": ["0240"],
"device_has": [ "device_has": [
@ -1777,7 +1777,7 @@
"PSA" "PSA"
], ],
"is_disk_virtual": true, "is_disk_virtual": true,
"macros": ["CPU_MK66FN2M0VMD18", "FSL_RTOS_MBED"], "macros": ["CPU_MK66FN2M0VMD18", "FSL_RTOS_MBED", "MBED_SPLIT_HEAP"],
"inherits": ["Target"], "inherits": ["Target"],
"detect_code": ["0311"], "detect_code": ["0311"],
"device_has": [ "device_has": [