Skip to content

Commit 3dd9140

Browse files
authored
Merge pull request ARMmbed#14667 from wernerlewis/use-gcc-except
Update GCC except.S to support ARMC6 and use GCC assembly with ARM toolchain in CMake
2 parents 2ea0386 + c97dcd0 commit 3dd9140

File tree

6 files changed

+8
-19
lines changed

6 files changed

+8
-19
lines changed

cmsis/CMSIS_5/CMSIS/RTOS2/RTX/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ if(${CMAKE_CROSSCOMPILING})
3939

4040
_mbed_get_cortex_a_exception_handlers()
4141

42-
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
43-
_mbed_get_cortex_m_exception_handlers(TOOLCHAIN_GCC)
44-
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
45-
_mbed_get_cortex_m_exception_handlers(TOOLCHAIN_ARM)
46-
endif()
42+
_mbed_get_cortex_m_exception_handlers(TOOLCHAIN_GCC)
4743
endif()
4844

4945
target_include_directories(mbed-rtos

cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_GCC/TARGET_M0/irq_cm0.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ SVC_ContextRestore:
102102
SUBS R0,R0,#32 // Adjust address
103103
LDMIA R0!,{R4-R7} // Restore R4..R7
104104

105-
MOVS R0,#~0xFFFFFFFD
105+
MOVS R0,#2 // Binary complement of 0xFFFFFFFD
106106
MVNS R0,R0 // Set EXC_RETURN value
107107
BX R0 // Exit from handler
108108

cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_GCC/TARGET_M0P/irq_cm0.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ SVC_ContextRestore:
102102
SUBS R0,R0,#32 // Adjust address
103103
LDMIA R0!,{R4-R7} // Restore R4..R7
104104

105-
MOVS R0,#~0xFFFFFFFD
105+
MOVS R0,#2 // Binary complement of 0xFFFFFFFD
106106
MVNS R0,R0 // Set EXC_RETURN value
107107
BX R0 // Exit from handler
108108

platform/source/TARGET_CORTEX_M/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
5-
target_sources(mbed-core INTERFACE TOOLCHAIN_GCC/except.S)
6-
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
7-
target_sources(mbed-core INTERFACE TOOLCHAIN_ARM/except.S)
8-
endif()
4+
target_sources(mbed-core INTERFACE TOOLCHAIN_GCC/except.S)
95

106
target_sources(mbed-core
117
INTERFACE

platform/source/TARGET_CORTEX_M/TOOLCHAIN_GCC/except.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ UsageFault_Handler:
105105
Fault_Handler:
106106
#if (DOMAIN_NS == 1)
107107
#if MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED
108+
#if defined(__ARMCC_VERSION)
109+
#define mbed_fault_context Image$$RW_m_crash_data$$ZI$$Base
110+
#else
108111
#define mbed_fault_context __CRASH_DATA_RAM_START__
112+
#endif
109113
#endif
110114

111115
MOV R12,R3

tools/cmake/cores/Cortex-M55.cmake

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
1717
)
1818
endif()
1919

20-
# We'd like to use just "-mcpu=cortex-m55" in common_options, but due to a bug
21-
# in armclang passing options to armasm, we use the following flags as a
22-
# workaround to select M55.
23-
list(APPEND asm_compile_options
24-
-mcpu=cortex-r7
25-
-Wa,--cpu=cortex-m55
26-
)
2720

2821
function(mbed_set_cpu_core_definitions target)
2922
target_compile_definitions(${target}

0 commit comments

Comments
 (0)