Skip to content

Commit 9eb3ad3

Browse files
committed
modules: CMSIS_6: Switch to CMSIS_6 for Cortex-M
What is the change? Switch to module CMSIS_6 for Cortex-M while continuing to use cmsis module (version 5.9.0) for Cortex-A/R. Why do we need this change? The current cmsis module consists of: - Cortex-M support from upstream cmsis 5.9.0 - Cortex-A/R support which was not upstreamed to CMSIS Upstream cmsis 5.9 was deprecated so we should be using CMSIS_6 however, it seems due to lack of Cortex-A/R support in upstream and other reasons, this was pushed back. While upstreaming Cortex-A/R support to CMSIS_6 could take its time, this shouldn't stop Cortex-M to start using CMSIS_6. Also, if we do not use CMSIS_6 for Cortex-M then using the newer GCC 14.2 toolchain will return below compiler error: ``` zephyrproject/modules/hal/cmsis/CMSIS/Core/Include/core_cm85.h:4406:10: fatal error: pac_armv81.h: No such file or directory 4406 | #include "pac_armv81.h" ``` Using CMSIS_6 for Cortex-M will fix this. Note: The files are moved from modules/hal/cmsis to modules/cmsis_6 to isolate Cortex-M support and no functional changes were made so, all files retain their original copyright. Signed-off-by: Sudan Landge <[email protected]>
1 parent c041661 commit 9eb3ad3

File tree

8 files changed

+51
-20
lines changed

8 files changed

+51
-20
lines changed

modules/cmsis/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
add_subdirectory(${ZEPHYR_CURRENT_MODULE_DIR} cmsis)
55

6-
if(CONFIG_CPU_CORTEX_M OR CONFIG_CPU_AARCH32_CORTEX_A OR CONFIG_CPU_AARCH32_CORTEX_R)
6+
if(CONFIG_CPU_AARCH32_CORTEX_A OR CONFIG_CPU_AARCH32_CORTEX_R)
77
zephyr_include_directories(.)
88
endif()

modules/cmsis/Kconfig

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ config HAS_CMSIS_CORE
88
bool
99
select HAS_CMSIS_CORE_A if CPU_AARCH32_CORTEX_A
1010
select HAS_CMSIS_CORE_R if CPU_AARCH32_CORTEX_R
11-
select HAS_CMSIS_CORE_M if CPU_CORTEX_M
1211

1312
if HAS_CMSIS_CORE
1413

@@ -18,19 +17,4 @@ config HAS_CMSIS_CORE_A
1817
config HAS_CMSIS_CORE_R
1918
bool
2019

21-
config HAS_CMSIS_CORE_M
22-
bool
23-
24-
config CMSIS_M_CHECK_DEVICE_DEFINES
25-
bool "Check device defines"
26-
default n
27-
depends on HAS_CMSIS_CORE_M
28-
help
29-
This options enables the validation of CMSIS configuration flags.
30-
31-
config CMSIS_CORE_HAS_SYSTEM_CORE_CLOCK
32-
bool
33-
help
34-
Enable this option if CMSIS SystemCoreClock symbols is available.
35-
3620
endif

modules/cmsis/cmsis_core.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
#ifndef ZEPHYR_MODULES_CMSIS_CMSIS_H_
77
#define ZEPHYR_MODULES_CMSIS_CMSIS_H_
88

9-
#if defined(CONFIG_CPU_CORTEX_M)
10-
#include "cmsis_core_m.h"
11-
#elif defined(CONFIG_CPU_AARCH32_CORTEX_A) || defined(CONFIG_CPU_AARCH32_CORTEX_R)
9+
#if defined(CONFIG_CPU_AARCH32_CORTEX_A) || defined(CONFIG_CPU_AARCH32_CORTEX_R)
1210
#include "cmsis_core_a_r.h"
1311
#endif
1412

modules/cmsis_6/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2023 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_subdirectory(${ZEPHYR_CURRENT_MODULE_DIR} cmsis_6)
5+
6+
if(CONFIG_CPU_CORTEX_M)
7+
zephyr_include_directories(.)
8+
endif()

modules/cmsis_6/Kconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (c) 2016 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config ZEPHYR_CMSIS_MODULE
5+
bool
6+
7+
config HAS_CMSIS_CORE
8+
bool
9+
select HAS_CMSIS_CORE_M if CPU_CORTEX_M
10+
11+
if HAS_CMSIS_CORE
12+
13+
config HAS_CMSIS_CORE_M
14+
bool
15+
16+
config CMSIS_M_CHECK_DEVICE_DEFINES
17+
bool "Check device defines"
18+
default n
19+
depends on HAS_CMSIS_CORE_M
20+
help
21+
This options enables the validation of CMSIS configuration flags.
22+
23+
config CMSIS_CORE_HAS_SYSTEM_CORE_CLOCK
24+
bool
25+
help
26+
Enable this option if CMSIS SystemCoreClock symbols is available.
27+
28+
endif

modules/cmsis_6/cmsis_core.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#ifndef ZEPHYR_MODULES_CMSIS_CMSIS_H_
7+
#define ZEPHYR_MODULES_CMSIS_CMSIS_H_
8+
9+
#if defined(CONFIG_CPU_CORTEX_M)
10+
#include "cmsis_core_m.h"
11+
#endif
12+
13+
#endif /* ZEPHYR_MODULES_CMSIS_CMSIS_H_ */
File renamed without changes.

0 commit comments

Comments
 (0)