From 046fa7831983dc0b5564f6c5f33db4761baa3469 Mon Sep 17 00:00:00 2001 From: Werner Lewis Date: Mon, 17 May 2021 11:17:51 +0100 Subject: [PATCH] Update GCC except.S to support ARMC6 ARM Compiler 6 supports GNU-style assembly with armclang. Instead of relying on armasm with the legacy syntax, GCC except.S is updated so that it can be used with ARM as well as GCC_ARM toolchains. CMake is updated to use this version. --- platform/source/TARGET_CORTEX_M/CMakeLists.txt | 6 +----- platform/source/TARGET_CORTEX_M/TOOLCHAIN_GCC/except.S | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/source/TARGET_CORTEX_M/CMakeLists.txt b/platform/source/TARGET_CORTEX_M/CMakeLists.txt index 481d09bd21..298fa20a28 100644 --- a/platform/source/TARGET_CORTEX_M/CMakeLists.txt +++ b/platform/source/TARGET_CORTEX_M/CMakeLists.txt @@ -1,11 +1,7 @@ # Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - target_sources(mbed-core INTERFACE TOOLCHAIN_GCC/except.S) -elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") - target_sources(mbed-core INTERFACE TOOLCHAIN_ARM/except.S) -endif() +target_sources(mbed-core INTERFACE TOOLCHAIN_GCC/except.S) target_sources(mbed-core INTERFACE diff --git a/platform/source/TARGET_CORTEX_M/TOOLCHAIN_GCC/except.S b/platform/source/TARGET_CORTEX_M/TOOLCHAIN_GCC/except.S index a40e743cf1..ac95155fd4 100644 --- a/platform/source/TARGET_CORTEX_M/TOOLCHAIN_GCC/except.S +++ b/platform/source/TARGET_CORTEX_M/TOOLCHAIN_GCC/except.S @@ -105,7 +105,11 @@ UsageFault_Handler: Fault_Handler: #if (DOMAIN_NS == 1) #if MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED +#if defined(__ARMCC_VERSION) +#define mbed_fault_context Image$$RW_m_crash_data$$ZI$$Base +#else #define mbed_fault_context __CRASH_DATA_RAM_START__ +#endif #endif MOV R12,R3