Skip to content

Enable split heap in K64F/K66F devices #10950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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_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
.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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@ SECTIONS
__data_end__ = .; /* define a global symbol at data end */
} > m_data

.heap_0 :
{
. = ALIGN(8);
__mbed_sbrk_start_0 = .;
. += (ORIGIN(m_data) + LENGTH(m_data) - .);
__mbed_krbs_start_0 = .;
} > m_data

__DATA_END = __DATA_ROM + (__data_end__ - __data_start__);
text_end = ORIGIN(m_text) + LENGTH(m_text);
ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
Expand All @@ -249,8 +257,10 @@ SECTIONS
. = ALIGN(8);
__end__ = .;
PROVIDE(end = .);
__mbed_sbrk_start = .;
__HeapBase = .;
. = ORIGIN(m_data_2) + LENGTH(m_data_2) - STACK_SIZE;
__mbed_krbs_start = .;
__HeapLimit = .;
__heap_limit = .; /* Add for _sbrk */
} > m_data_2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_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
.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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ SECTIONS
. = ALIGN(8);
__interrupts_ram_end__ = .; /* Define a global symbol at data end */
} > m_data

.crash_data_ram :
{
. = ALIGN(8);
Expand All @@ -209,6 +209,13 @@ SECTIONS
__CRASH_DATA_RAM_END__ = .; /* Define a global symbol at data end */
} > 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);
__RAM_VECTOR_TABLE_SIZE_BYTES = DEFINED(__ram_vector_table__) ? (__interrupts_ram_end__ - __interrupts_ram_start__) : 0x0;
Expand Down Expand Up @@ -270,8 +277,10 @@ SECTIONS
. = ALIGN(8);
__end__ = .;
PROVIDE(end = .);
__mbed_sbrk_start = .;
__HeapBase = .;
. = ORIGIN(m_data_2) + LENGTH(m_data_2) - STACK_SIZE;
__mbed_krbs_start = .;
__HeapLimit = .;
__heap_limit = .; /* Add for _sbrk */
} > m_data_2
Expand Down
4 changes: 2 additions & 2 deletions targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@
"PSA"
],
"is_disk_virtual": true,
"macros": ["CPU_MK64FN1M0VMD12", "FSL_RTOS_MBED"],
"macros": ["CPU_MK64FN1M0VMD12", "FSL_RTOS_MBED", "MBED_SPLIT_HEAP"],
"inherits": ["Target"],
"detect_code": ["0240"],
"device_has": [
Expand Down Expand Up @@ -1777,7 +1777,7 @@
"PSA"
],
"is_disk_virtual": true,
"macros": ["CPU_MK66FN2M0VMD18", "FSL_RTOS_MBED"],
"macros": ["CPU_MK66FN2M0VMD18", "FSL_RTOS_MBED", "MBED_SPLIT_HEAP"],
"inherits": ["Target"],
"detect_code": ["0311"],
"device_has": [
Expand Down
5 changes: 3 additions & 2 deletions tools/profiles/debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"asm": [],
"c": ["-D__ASSERT_MSG", "-std=gnu11"],
"cxx": ["-fno-rtti", "-std=gnu++14"],
"ld": ["--verbose", "--remove", "--show_full_path", "--legacyalign", "--keep=os_cb_sections"]
"ld": ["--verbose", "--remove", "--show_full_path", "--legacyalign",
"--any_contingency", "--keep=os_cb_sections"]
},
"ARM": {
"common": ["-c", "--gnu", "-Otime", "--split_sections",
Expand All @@ -36,7 +37,7 @@
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp11", "--no_rtti", "--no_vla"],
"ld": ["--show_full_path", "--keep=os_cb_sections"]
"ld": ["--show_full_path", "--any_contingency", "--keep=os_cb_sections"]
},
"uARM": {
"common": ["-c", "--gnu", "-Otime", "--split_sections",
Expand Down
5 changes: 3 additions & 2 deletions tools/profiles/develop.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"asm": [],
"c": ["-D__ASSERT_MSG", "-std=gnu11"],
"cxx": ["-fno-rtti", "-std=gnu++14"],
"ld": ["--show_full_path", "--legacyalign", "--keep=os_cb_sections"]
"ld": ["--show_full_path", "--legacyalign", "--any_contingency",
"--keep=os_cb_sections"]
},
"ARM": {
"common": ["-c", "--gnu", "-Otime", "--split_sections",
Expand All @@ -33,7 +34,7 @@
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp11", "--no_rtti", "--no_vla"],
"ld": ["--show_full_path", "--keep=os_cb_sections"]
"ld": ["--show_full_path", "--any_contingency", "--keep=os_cb_sections"]
},
"uARM": {
"common": ["-c", "--gnu", "-Otime", "--split_sections",
Expand Down
5 changes: 3 additions & 2 deletions tools/profiles/release.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"asm": [],
"c": ["-D__ASSERT_MSG", "-std=gnu11"],
"cxx": ["-fno-rtti", "-std=gnu++14"],
"ld": ["--show_full_path", "--legacyalign", "--keep=os_cb_sections"]
"ld": ["--show_full_path", "--legacyalign", "--any_contingency",
"--keep=os_cb_sections"]
},
"ARM": {
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
Expand All @@ -33,7 +34,7 @@
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp11", "--no_rtti", "--no_vla"],
"ld": ["--show_full_path", "--keep=os_cb_sections"]
"ld": ["--show_full_path", "--any_contingency", "--keep=os_cb_sections"]
},
"uARM": {
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
Expand Down