From c730c63f1d5711d0755d37af514a9cae18aa67df Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Mon, 30 May 2016 23:49:12 -0500 Subject: [PATCH] Update K64F memory map for for larger static data The KSDK2 update restricts static data to the first 64K of RAM. This breaks some applications which require more than 64K of static data. This patch moves the static data sections (bss and data) into the second ram region which is 192K. Changes taken from similar patches here: https://github.com/ARMmbed/target-kinetis-k64-gcc/pull/5 https://github.com/ARMmbed/target-kinetis-k64-gcc/pull/6 Previous layout --------------- 0x1FFF0000 m_data .interrupts_ram 0x1FFF0400 data, bss 0x1FFFFFFF end of bss 0x20000000 m_data_2 start of heap, end of stack 0x2002ffff end of heap, start of stack New layout ---------- 0x1FFF0000 m_data .interrupts_ram 0x1FFF0400 start of unused ram 0x1FFFFFFF end of unused ram 0x20000000 m_data_2 data, bss 0x200XXXXX end of bss 0x200XXXXX+1 start of heap, end of stack 0x2002ffff end of heap, start of stack --- .../TARGET_K64F/TOOLCHAIN_GCC_ARM/MK64FN1M0xxx12.ld | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hal/targets/cmsis/TARGET_Freescale/TARGET_K64F/TOOLCHAIN_GCC_ARM/MK64FN1M0xxx12.ld b/hal/targets/cmsis/TARGET_Freescale/TARGET_K64F/TOOLCHAIN_GCC_ARM/MK64FN1M0xxx12.ld index d77d225f64..05e35b744b 100644 --- a/hal/targets/cmsis/TARGET_Freescale/TARGET_K64F/TOOLCHAIN_GCC_ARM/MK64FN1M0xxx12.ld +++ b/hal/targets/cmsis/TARGET_Freescale/TARGET_K64F/TOOLCHAIN_GCC_ARM/MK64FN1M0xxx12.ld @@ -202,7 +202,7 @@ SECTIONS KEEP(*(.jcr*)) . = ALIGN(4); __data_end__ = .; /* define a global symbol at data end */ - } > m_data + } > m_data_2 __DATA_END = __DATA_ROM + (__data_end__ - __data_start__); text_end = ORIGIN(m_text) + LENGTH(m_text); @@ -225,7 +225,7 @@ SECTIONS . = ALIGN(4); __bss_end__ = .; __END_BSS = .; - } > m_data + } > m_data_2 .heap : {