diff --git a/connectivity/mbedtls/CMakeLists.txt b/connectivity/mbedtls/CMakeLists.txt index cac099b0a6e..e857db00fa3 100644 --- a/connectivity/mbedtls/CMakeLists.txt +++ b/connectivity/mbedtls/CMakeLists.txt @@ -102,3 +102,20 @@ target_compile_definitions(mbed-mbedtls INTERFACE MBED_CONF_MBEDTLS_PRESENT=1 ) + +# Workaround for https://github.com/ARMmbed/mbedtls/issues/1077 +# which affects cores without __thumb2__ set by the compiler +# due to the lack of full Thumb-2 support +set(partial-thumb2-cores + Cortex-M0 + Cortex-M0+ + Cortex-M1 + Cortex-M23 + Cortex-M23-NS +) +if(MBED_CPU_CORE IN_LIST partial-thumb2-cores) + target_compile_definitions(mbed-mbedtls + INTERFACE + MULADDC_CANNOT_USE_R7 + ) +endif() diff --git a/tools/cmake/profiles/debug.cmake b/tools/cmake/profiles/debug.cmake index 0c1d9181082..62f391dd2aa 100644 --- a/tools/cmake/profiles/debug.cmake +++ b/tools/cmake/profiles/debug.cmake @@ -78,7 +78,6 @@ function(mbed_set_profile_options target mbed_toolchain) target_compile_definitions(${target} INTERFACE __ASSERT_MSG - MULADDC_CANNOT_USE_R7 ) endif()