Skip to content

modules: CMSIS_6: fix path and use it for TF-M and Cortex-M #89370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/cmsis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

add_subdirectory(${ZEPHYR_CURRENT_MODULE_DIR} cmsis)

if(CONFIG_CPU_CORTEX_M OR CONFIG_CPU_AARCH32_CORTEX_A OR CONFIG_CPU_AARCH32_CORTEX_R)
if(CONFIG_CPU_AARCH32_CORTEX_A OR CONFIG_CPU_AARCH32_CORTEX_R)
zephyr_include_directories(.)
endif()
16 changes: 0 additions & 16 deletions modules/cmsis/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ config HAS_CMSIS_CORE
bool
select HAS_CMSIS_CORE_A if CPU_AARCH32_CORTEX_A
select HAS_CMSIS_CORE_R if CPU_AARCH32_CORTEX_R
select HAS_CMSIS_CORE_M if CPU_CORTEX_M

if HAS_CMSIS_CORE

Expand All @@ -18,19 +17,4 @@ config HAS_CMSIS_CORE_A
config HAS_CMSIS_CORE_R
bool

config HAS_CMSIS_CORE_M
bool

config CMSIS_M_CHECK_DEVICE_DEFINES
bool "Check device defines"
default n
depends on HAS_CMSIS_CORE_M
help
This options enables the validation of CMSIS configuration flags.

config CMSIS_CORE_HAS_SYSTEM_CORE_CLOCK
bool
help
Enable this option if CMSIS SystemCoreClock symbols is available.

endif
4 changes: 1 addition & 3 deletions modules/cmsis/cmsis_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
#ifndef ZEPHYR_MODULES_CMSIS_CMSIS_H_
#define ZEPHYR_MODULES_CMSIS_CMSIS_H_

#if defined(CONFIG_CPU_CORTEX_M)
#include "cmsis_core_m.h"
#elif defined(CONFIG_CPU_AARCH32_CORTEX_A) || defined(CONFIG_CPU_AARCH32_CORTEX_R)
#if defined(CONFIG_CPU_AARCH32_CORTEX_A) || defined(CONFIG_CPU_AARCH32_CORTEX_R)
#include "cmsis_core_a_r.h"
#endif

Expand Down
9 changes: 9 additions & 0 deletions modules/cmsis_6/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2023 Nordic Semiconductor ASA
# Copyright 2025 Arm Limited and/or its affiliates <[email protected]>
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(${ZEPHYR_CURRENT_MODULE_DIR} cmsis_6)

if(CONFIG_CPU_CORTEX_M)
zephyr_include_directories(.)
endif()
28 changes: 28 additions & 0 deletions modules/cmsis_6/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2016 Intel Corporation
# Copyright 2025 Arm Limited and/or its affiliates <[email protected]>
# SPDX-License-Identifier: Apache-2.0

config ZEPHYR_CMSIS_6_MODULE
bool

config HAS_CMSIS_CORE
bool
select HAS_CMSIS_CORE_M if CPU_CORTEX_M

if HAS_CMSIS_CORE

config HAS_CMSIS_CORE_M
bool

config CMSIS_M_CHECK_DEVICE_DEFINES
bool "Check device defines"
depends on HAS_CMSIS_CORE_M
help
This options enables the validation of CMSIS configuration flags.

config CMSIS_CORE_HAS_SYSTEM_CORE_CLOCK
bool
help
Enable this option if CMSIS SystemCoreClock symbols is available.

endif
14 changes: 14 additions & 0 deletions modules/cmsis_6/cmsis_core.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
* Copyright 2025 Arm Limited and/or its affiliates <[email protected]>
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef ZEPHYR_MODULES_CMSIS_6_CMSIS_CORE_H_
#define ZEPHYR_MODULES_CMSIS_6_CMSIS_CORE_H_

#if defined(CONFIG_CPU_CORTEX_M)
#include "cmsis_core_m.h"
#endif

#endif /* ZEPHYR_MODULES_CMSIS_6_CMSIS_CORE_H_ */
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2017 Nordic Semiconductor ASA
* Copyright (c) 2023 Arm Limited
* Copyright 2023,2025 Arm Limited and/or its affiliates <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -12,8 +12,8 @@
* This header contains the interface to the ARM CMSIS Core headers.
*/

#ifndef ZEPHYR_MODULES_CMSIS_CMSIS_M_H_
#define ZEPHYR_MODULES_CMSIS_CMSIS_M_H_
#ifndef ZEPHYR_MODULES_CMSIS_6_CMSIS_CORE_M_H_
#define ZEPHYR_MODULES_CMSIS_6_CMSIS_CORE_M_H_

#if defined(CONFIG_CMSIS_M_CHECK_DEVICE_DEFINES) && CONFIG_CMSIS_M_CHECK_DEVICE_DEFINES == 1U
#define __CHECK_DEVICE_DEFINES 1U
Expand Down Expand Up @@ -68,4 +68,4 @@
#error "__SAUREGION_PRESENT and CONFIG_CPU_HAS_ARM_SAU are not set to the same value"
#endif

#endif /* ZEPHYR_MODULES_CMSIS_CMSIS_M_H_ */
#endif /* ZEPHYR_MODULES_CMSIS_6_CMSIS_CORE_M_H_ */
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2017 Nordic Semiconductor ASA
* Copyright (c) 2023 Arm Limited
* Copyright 2023,2025 Arm Limited and/or its affiliates <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -13,8 +13,8 @@
* ARM CMSIS Core headers.
*/

#ifndef ZEPHYR_MODULES_CMSIS_CMSIS_M_DEFAULTS_H_
#define ZEPHYR_MODULES_CMSIS_CMSIS_M_DEFAULTS_H_
#ifndef ZEPHYR_MODULES_CMSIS_6_CMSIS_CORE_M_DEFAULTS_H_
#define ZEPHYR_MODULES_CMSIS_6_CMSIS_CORE_M_DEFAULTS_H_

#include <zephyr/arch/arm/cortex_m/nvic.h>

Expand Down Expand Up @@ -143,4 +143,4 @@ typedef enum {
#error "Unknown Cortex-M device"
#endif

#endif /* ZEPHYR_MODULES_CMSIS_CMSIS_M_DEFAULTS_H_ */
#endif /* ZEPHYR_MODULES_CMSIS_6_CMSIS_CORE_M_DEFAULTS_H_ */
2 changes: 1 addition & 1 deletion modules/trusted-firmware-m/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ if (CONFIG_BUILD_WITH_TFM)
${TFM_CMAKE_ARGS}
$<GENEX_EVAL:$<TARGET_PROPERTY:zephyr_property_target,TFM_CMAKE_OPTIONS>>
-DMBEDCRYPTO_PATH=$<IF:$<BOOL:$<TARGET_PROPERTY:zephyr_property_target,TFM_MBEDCRYPTO_PATH>>,$<TARGET_PROPERTY:zephyr_property_target,TFM_MBEDCRYPTO_PATH>,${ZEPHYR_MBEDTLS_MODULE_DIR}>
-DCMSIS_PATH=${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/platform/ext/cmsis
-DCMSIS_PATH=${ZEPHYR_CMSIS_6_MODULE_DIR}
${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}
WORKING_DIRECTORY ${TFM_BINARY_DIR}
COMMAND_EXPAND_LISTS
Expand Down
8 changes: 5 additions & 3 deletions west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ manifest:
path: modules/lib/cmsis-nn
- name: cmsis_6
repo-path: CMSIS_6
revision: 783317a3072554acbac86cca2ff24928cbf98d30
path: modules/lib/cmsis_6
revision: 6dd50439a9b83398ff2ae1376eef0a2a0b95913b
path: modules/hal/cmsis_6
groups:
- hal
- name: edtt
revision: b9ca3c7030518f07b7937dacf970d37a47865a76
path: tools/edtt
Expand Down Expand Up @@ -358,7 +360,7 @@ manifest:
groups:
- tee
- name: trusted-firmware-m
revision: e2288c13ee0abc16163186523897e7910b03dd31
revision: 64738996dca5f5e058e0a358b81033f4b792be27
path: modules/tee/tf-m/trusted-firmware-m
groups:
- tee
Expand Down
Loading