Skip to content

CMSIS 6 update #90063

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 3 commits into from
May 23, 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
10 changes: 8 additions & 2 deletions arch/arm/include/cortex_m/dwt.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,18 @@ extern "C" {
/* Define DWT LSR masks which are currently not defined by the CMSIS V5.1.2.
* (LSR register is defined but not its bitfields).
* Reuse ITM LSR mask as it is the same offset than DWT LSR one.
* TODO: update these to use only CMSIS_6 when all of zephyr and modules have
* update to CMSIS_6.
*/
#if !defined DWT_LSR_Present_Msk
#define DWT_LSR_Present_Msk ITM_LSR_Present_Msk
#define DWT_LSR_Present_Msk \
IF_ENABLED(CONFIG_ZEPHYR_CMSIS_MODULE, (ITM_LSR_Present_Msk)) \
IF_DISABLED(CONFIG_ZEPHYR_CMSIS_MODULE, (ITM_LSR_PRESENT_Msk))
#endif
#if !defined DWT_LSR_Access_Msk
#define DWT_LSR_Access_Msk ITM_LSR_Access_Msk
#define DWT_LSR_Access_Msk \
IF_ENABLED(CONFIG_ZEPHYR_CMSIS_MODULE, (ITM_LSR_Access_Msk)) \
IF_DISABLED(CONFIG_ZEPHYR_CMSIS_MODULE, (ITM_LSR_ACCESS_Msk))
#endif

static inline void dwt_access(bool ena)
Expand Down
12 changes: 10 additions & 2 deletions doc/hardware/arch/arm_cortex_m.rst
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,16 @@ script as well.
CMSIS
*****

Cortex-M CMSIS headers are hosted in a standalone module repository:
`zephyrproject-rtos/cmsis <https://github.com/zephyrproject-rtos/cmsis>`_.
Cortex-M CMSIS headers are provided through standalone module repositories:

- **CMSIS 5**: `zephyrproject-rtos/cmsis <https://github.com/zephyrproject-rtos/cmsis>`_
- **CMSIS 6**: `zephyrproject-rtos/CMSIS_6 <https://github.com/zephyrproject-rtos/CMSIS_6>`_

Zephyr has begun transitioning to **CMSIS 6** as the default source for Cortex-M core headers.
However, at present, Zephyr includes headers from **both** the CMSIS 6 and legacy CMSIS 5 modules.

The legacy CMSIS 5 headers remain available primarily for compatibility with vendor HALs, while all
new architecture-level development should use **CMSIS 6** headers whenever possible.

:kconfig:option:`CONFIG_CPU_CORTEX_M` selects :kconfig:option:`CONFIG_HAS_CMSIS_CORE` to signify that
CMSIS headers are available for all supported Cortex-M variants.
Expand Down
14 changes: 14 additions & 0 deletions doc/releases/migration-guide-4.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,20 @@ ZBus
Modules
*******

CMSIS
=====

* Cortex-M boards/socs now require the ``CMSIS_6`` module to build properly (instead of ``cmsis``
which was CMSIS 5.9.0).
If trying to build a Cortex-M board, do a ``west update`` to make sure that ``CMSIS_6`` module is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor suggestion, not a blocker to merge though
Before building a Cortex-M board, run west update to ensure that the CMSIS_6 module is...

available before running ``west build`` or other commands.

Boards or SOCs or modules using the older ``cmsis`` module either with a local copy or via the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boards, SOCs, or modules using the older...

:kconfig:option:`CONFIG_ZEPHYR_CMSIS_MODULE_DIR` are requested to move to the ``CMSIS_6`` module
which can be accessed via the :kconfig:option:`CONFIG_ZEPHYR_CMSIS_6_MODULE_DIR` configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be a line adding when the deprecation of CMSIS 5 for Cortex-M projects is expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure when this would happen since we request the HAL owners to move to CMSIS_6 but its really up to them when to actually do this.


Note: Zephyr will continue using the older ``cmsis`` module for Cortex-A and Cortex-R targets.

Architectures
*************

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

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