From a08fc2bb7a853dae831f31c4b0cb990be228fb96 Mon Sep 17 00:00:00 2001 From: Chris Snow Date: Tue, 5 Sep 2017 16:35:55 +0100 Subject: [PATCH] Move CRP out of startup and into CRP.c so it can be conditionally compiled --- targets/TARGET_NXP/TARGET_LPC176X/device/CRP.c | 18 ++++++++++++++++++ .../device/TOOLCHAIN_ARM_STD/startup_LPC17xx.S | 6 ------ 2 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 targets/TARGET_NXP/TARGET_LPC176X/device/CRP.c diff --git a/targets/TARGET_NXP/TARGET_LPC176X/device/CRP.c b/targets/TARGET_NXP/TARGET_LPC176X/device/CRP.c new file mode 100644 index 0000000000..6b1c5a94a0 --- /dev/null +++ b/targets/TARGET_NXP/TARGET_LPC176X/device/CRP.c @@ -0,0 +1,18 @@ +/* mbed Microcontroller Library + * Copyright (c) 2017 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#if !defined(MBED_APP_START) // do not include CRP if there is a bootloader. + long CRP_Key __attribute__((section(".ARM.__at_0x000002FC "))) = 0xFFFFFFFF; +#endif diff --git a/targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_ARM_STD/startup_LPC17xx.S b/targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_ARM_STD/startup_LPC17xx.S index 32e2abf7fb..e844d2f9ac 100644 --- a/targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_ARM_STD/startup_LPC17xx.S +++ b/targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_ARM_STD/startup_LPC17xx.S @@ -82,12 +82,6 @@ __Vectors DCD __initial_sp ; Top of Stack DCD PLL1_IRQHandler ; 48: PLL1 Lock (USB PLL) - IF :LNOT::DEF:NO_CRP - AREA |.ARM.__at_0x02FC|, CODE, READONLY -CRP_Key DCD 0xFFFFFFFF - ENDIF - - AREA |.text|, CODE, READONLY