From 5747a4502d68390cbe9e96a7e724b6106db0ea14 Mon Sep 17 00:00:00 2001 From: 0xc0170 Date: Sun, 15 Dec 2013 23:30:03 +0100 Subject: [PATCH] One section for vectors and flash protection bits. The unused space is filled with 0xff --- .../TARGET_KL05Z/TOOLCHAIN_GCC_ARM/MKL05Z4.ld | 11 +---------- .../TOOLCHAIN_GCC_ARM/startup_MKL05Z4.s | 17 ++++++----------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/MKL05Z4.ld b/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/MKL05Z4.ld index 00f147647a..5585ee7b83 100644 --- a/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/MKL05Z4.ld +++ b/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/MKL05Z4.ld @@ -4,8 +4,7 @@ MEMORY { - VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000400 - FLASH_PROTECTION (rx) : ORIGIN = 0x00000400, LENGTH = 0x00000010 + VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000410 FLASH (rx) : ORIGIN = 0x00000410, LENGTH = 32K - 0x00000410 RAM (rwx) : ORIGIN = 0x1FFFFC00, LENGTH = 4K - 0xC0 } @@ -44,17 +43,9 @@ SECTIONS { __vector_table = .; KEEP(*(.vector_table)) - *(.text.Reset_Handler) - *(.text.System_Init) . = ALIGN(4); } > VECTORS - .flash_protect : - { - KEEP(*(.kinetis_flash_config_field)) - . = ALIGN(4); - } > FLASH_PROTECTION - .text : { *(.text*) diff --git a/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/startup_MKL05Z4.s b/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/startup_MKL05Z4.s index e1fae7c4a2..384c489e2e 100644 --- a/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/startup_MKL05Z4.s +++ b/libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KL05Z/TOOLCHAIN_GCC_ARM/startup_MKL05Z4.s @@ -130,6 +130,12 @@ __isr_vector: .long PORTB_IRQHandler /* Port B interrupt */ .size __isr_vector, . - __isr_vector + .org 0x400, 0xff + + .long 0xffffffff + .long 0xffffffff + .long 0xffffffff + .long 0xfffffffe .section .text.Reset_Handler .thumb @@ -216,15 +222,4 @@ Reset_Handler: .weak DEF_IRQHandler .set DEF_IRQHandler, Default_Handler -/* Flash protection region, placed at 0x400 */ - .text - .thumb - .align 2 - .section .kinetis_flash_config_field,"a",%progbits -kinetis_flash_config: - .long 0xffffffff - .long 0xffffffff - .long 0xffffffff - .long 0xfffffffe - .end