diff --git a/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/CMakeLists.txt b/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/CMakeLists.txt index 3695d5bd1e2..e25cbf8067f 100644 --- a/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/CMakeLists.txt +++ b/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/CMakeLists.txt @@ -39,11 +39,7 @@ if(${CMAKE_CROSSCOMPILING}) _mbed_get_cortex_a_exception_handlers() - if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - _mbed_get_cortex_m_exception_handlers(TOOLCHAIN_GCC) - elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") - _mbed_get_cortex_m_exception_handlers(TOOLCHAIN_ARM) - endif() + _mbed_get_cortex_m_exception_handlers(TOOLCHAIN_GCC) endif() target_include_directories(mbed-rtos diff --git a/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_GCC/TARGET_M0/irq_cm0.S b/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_GCC/TARGET_M0/irq_cm0.S index e261cd066fe..4d1359116e6 100644 --- a/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_GCC/TARGET_M0/irq_cm0.S +++ b/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_GCC/TARGET_M0/irq_cm0.S @@ -102,7 +102,7 @@ SVC_ContextRestore: SUBS R0,R0,#32 // Adjust address LDMIA R0!,{R4-R7} // Restore R4..R7 - MOVS R0,#~0xFFFFFFFD + MOVS R0,#2 // Binary complement of 0xFFFFFFFD MVNS R0,R0 // Set EXC_RETURN value BX R0 // Exit from handler diff --git a/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_GCC/TARGET_M0P/irq_cm0.S b/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_GCC/TARGET_M0P/irq_cm0.S index e261cd066fe..4d1359116e6 100644 --- a/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_GCC/TARGET_M0P/irq_cm0.S +++ b/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_GCC/TARGET_M0P/irq_cm0.S @@ -102,7 +102,7 @@ SVC_ContextRestore: SUBS R0,R0,#32 // Adjust address LDMIA R0!,{R4-R7} // Restore R4..R7 - MOVS R0,#~0xFFFFFFFD + MOVS R0,#2 // Binary complement of 0xFFFFFFFD MVNS R0,R0 // Set EXC_RETURN value BX R0 // Exit from handler diff --git a/platform/source/TARGET_CORTEX_M/CMakeLists.txt b/platform/source/TARGET_CORTEX_M/CMakeLists.txt index 481d09bd215..298fa20a28b 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 a40e743cf1e..ac95155fd4a 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 diff --git a/tools/cmake/cores/Cortex-M55.cmake b/tools/cmake/cores/Cortex-M55.cmake index 796ee4823dc..37410aa9f39 100644 --- a/tools/cmake/cores/Cortex-M55.cmake +++ b/tools/cmake/cores/Cortex-M55.cmake @@ -17,13 +17,6 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") ) endif() -# We'd like to use just "-mcpu=cortex-m55" in common_options, but due to a bug -# in armclang passing options to armasm, we use the following flags as a -# workaround to select M55. -list(APPEND asm_compile_options - -mcpu=cortex-r7 - -Wa,--cpu=cortex-m55 -) function(mbed_set_cpu_core_definitions target) target_compile_definitions(${target}