Skip to content

Commit e18d280

Browse files
authored
Merge pull request #14588 from Patater/mbed-libs-for-m55
Add v8.1-M architecture awareness
2 parents c54b089 + a29a5e1 commit e18d280

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

drivers/include/drivers/MbedCRC.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ class MbedCRC {
649649
#if (__ARM_ARCH_7M__ == 1U) || \
650650
(__ARM_ARCH_7EM__ == 1U) || \
651651
(__ARM_ARCH_8M_MAIN__ == 1U) || \
652+
(__ARM_ARCH_8_1M_MAIN__ == 1U) || \
652653
(__ARM_ARCH_7A__ == 1U)
653654
/* ARM that has Thumb-2 - same unified assembly is good for either ARM or Thumb state (LSRS; IT CS; EORCS reg/imm) */
654655
#define MBED_CRC_ARM_THUMB2 1

hal/source/mpu/mbed_mpu_v8m.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "platform/mbed_assert.h"
1919
#include "cmsis.h"
2020

21-
#if ((__ARM_ARCH_8M_BASE__ == 1U) || (__ARM_ARCH_8M_MAIN__ == 1U)) && \
21+
#if ((__ARM_ARCH_8M_BASE__ == 1U) || (__ARM_ARCH_8M_MAIN__ == 1U) || (__ARM_ARCH_8_1M_MAIN__ == 1U)) && \
2222
defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) && \
2323
!defined(MBED_MPU_CUSTOM)
2424

hal/tests/TESTS/mbed_hal/mpu/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ utest::v1::status_t fault_override_teardown(const Case *const source, const size
177177
Case cases[] = {
178178
Case("MPU - init", fault_override_setup, mpu_init_test, fault_override_teardown),
179179
Case("MPU - free", fault_override_setup, mpu_free_test, fault_override_teardown),
180-
#if !((__ARM_ARCH_8M_BASE__ == 1U) || (__ARM_ARCH_8M_MAIN__ == 1U))
180+
#if !((__ARM_ARCH_8M_BASE__ == 1U) || \
181+
(__ARM_ARCH_8M_MAIN__ == 1U) || \
182+
(__ARM_ARCH_8_1M_MAIN__ == 1U) \
183+
)
181184
// Skip fault tests for ARMv8-M until a fault handler hook is provided
182185
Case("MPU - data fault", fault_override_setup, mpu_fault_test_data, fault_override_teardown),
183186
Case("MPU - bss fault", fault_override_setup, mpu_fault_test_bss, fault_override_teardown),

platform/include/platform/mbed_atomic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ typedef enum mbed_memory_order {
6969
#if ((__ARM_ARCH_7M__ == 1U) || \
7070
(__ARM_ARCH_7EM__ == 1U) || \
7171
(__ARM_ARCH_8M_BASE__ == 1U) || \
72-
(__ARM_ARCH_8M_MAIN__ == 1U)) || \
72+
(__ARM_ARCH_8M_MAIN__ == 1U) || \
73+
(__ARM_ARCH_8_1M_MAIN__ == 1U)) || \
7374
(__ARM_ARCH_7A__ == 1U)
7475
#define MBED_EXCLUSIVE_ACCESS 1U
7576
#define MBED_EXCLUSIVE_ACCESS_THUMB1 (__ARM_ARCH_8M_BASE__ == 1U)

tools/cmake/cores/Cortex-M55.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ 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+
)
27+
2028
function(mbed_set_cpu_core_definitions target)
2129
target_compile_definitions(${target}
2230
INTERFACE

0 commit comments

Comments
 (0)