From a1653f27085e823495e1a54b3a74209088fac107 Mon Sep 17 00:00:00 2001 From: Adam Green Date: Tue, 23 Dec 2014 19:03:09 -0800 Subject: [PATCH] Fix KL05Z GCC_ARM linker script Issue originally reported on mbed site here: https://developer.mbed.org/questions/5695/FRDM-KL05z-hardfault-when-compiled-with-/ The RAM base address was incorrectly set to the beginning of RAM instead of at a 0xC0 byte offset to reserve room for the interrupt vectors. Without this fix, the global variables and the interrupt vectors were occupying the same space in RAM once the user enabled the timer interrupt. The user who originally reported the issue on the mbed site has tested this fix and verified that it corrected the hard fault issue that they were encountering. --- .../TARGET_KLXX/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/MKL05Z4.ld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KLXX/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/MKL05Z4.ld b/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KLXX/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/MKL05Z4.ld index 5585ee7b83..65eba85be1 100644 --- a/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KLXX/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/MKL05Z4.ld +++ b/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KLXX/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/MKL05Z4.ld @@ -6,7 +6,7 @@ MEMORY { VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000410 FLASH (rx) : ORIGIN = 0x00000410, LENGTH = 32K - 0x00000410 - RAM (rwx) : ORIGIN = 0x1FFFFC00, LENGTH = 4K - 0xC0 + RAM (rwx) : ORIGIN = 0x1FFFFCC0, LENGTH = 4K - 0xC0 } /* Linker script to place sections and symbol values. Should be used together