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

Conversation

wearyzen
Copy link
Contributor

@wearyzen wearyzen commented May 1, 2025

What is the change?

Switch to using CMSIS_6 module for TF-M and Cortex-M while continue to use CMSIS for Cortex-A/R.

Why do we need this change?

Pls refer to the commit messages for more details.

Signed-off-by: Sudan Landge [email protected]

Copy link

github-actions bot commented May 1, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
cmsis_6 zephyrproject-rtos/CMSIS_6@783317a zephyrproject-rtos/CMSIS_6@6dd5043 (main) zephyrproject-rtos/[email protected]
trusted-firmware-m zephyrproject-rtos/trusted-firmware-m@e2288c1 zephyrproject-rtos/trusted-firmware-m@6473899 (main) zephyrproject-rtos/[email protected]

Additional metadata changed:

Name URL Submodules West cmds module.yml
cmsis_6

DNM label due to: 1 project with metadata changes

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@github-actions github-actions bot added manifest manifest-cmsis_6 DNM (manifest) This PR should not be merged (controlled by action-manifest) labels May 1, 2025
@RobinKastberg
Copy link
Contributor

Ah. Good idea just enabling it for M only.

@github-actions github-actions bot added the platform: nRF BSIM Nordic Semiconductors, nRF BabbleSim label May 2, 2025
@github-actions github-actions bot requested a review from aescolar May 2, 2025 01:29
@wearyzen wearyzen force-pushed the cmsis_6_update branch 5 times, most recently from 7f6707d to 320db7b Compare May 2, 2025 17:03
@wearyzen
Copy link
Contributor Author

wearyzen commented May 2, 2025

The twister failures are observed on main branch as well so they are not related to this PR.

@tomi-font
Copy link
Contributor

Thanks for this. Could you also put up a PR in the TF-M fork that removes the copy of the CMSIS 6 files (just reverting the commit)?

@tomi-font tomi-font assigned wearyzen and unassigned stephanosio May 14, 2025
@tomi-font tomi-font requested a review from aescolar May 14, 2025 06:45
Copy link
Member

@aescolar aescolar left a comment

Choose a reason for hiding this comment

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

Doesn't this change warrant a line in the release notes?
(CC @kartben @danieldegrasse @dkalowsk)
(I'm ok with that coming as a follow up PR)

@kartben kartben merged commit f726cb5 into zephyrproject-rtos:main May 14, 2025
29 of 30 checks passed
@fabiobaltieri
Copy link
Member

Doesn't this change warrant a line in the release notes?

Hey, this breaks any downstream project that has hal module filtering enabled does not have cmsis listed and is using ARM.

Going to break the example app too:
https://github.com/zephyrproject-rtos/example-application/actions/runs/15025085627/job/42223734547?pr=84

 /home/runner/work/example-application/example-application/zephyr/include/zephyr/arch/arm/asm_inline_gcc.h:24:10: fatal error: cmsis_core.h: No such file or directory
   24 | #include <cmsis_core.h>
      |          ^~~~~~~~~~~~~~

it really needs this to be mentioned in the release notes, something about the requirement of using the cmsis_6 module instead of cmsis if Cortex-M is used.

Opened zephyrproject-rtos/example-application#84 for the example application.

@fabiobaltieri
Copy link
Member

Or is it meant to need both cmsis and cmsis_6? bumped into an stm32 project that fails with

In file included from /home/fabiobaltieri/zephyrproject/zephyr/arch/arm/core/cortex_m/timing.c:17:
/home/fabiobaltieri/zephyrproject/zephyr/arch/arm/include/cortex_m/dwt.h: In function 'dwt_access':
/home/fabiobaltieri/zephyrproject/zephyr/arch/arm/include/cortex_m/dwt.h:37:29: error: 'ITM_LSR_Present_Msk' undeclared (first use in this function); did you mean 'ITM_LSR_PRESENT_Msk'?
   37 | #define DWT_LSR_Present_Msk ITM_LSR_Present_Msk
      |                             ^~~~~~~~~~~~~~~~~~~

if it only has cmsis_6

@wearyzen
Copy link
Contributor Author

wearyzen commented May 14, 2025

Or is it meant to need both cmsis and cmsis_6? bumped into an stm32 project that fails with

In file included from /home/fabiobaltieri/zephyrproject/zephyr/arch/arm/core/cortex_m/timing.c:17:
/home/fabiobaltieri/zephyrproject/zephyr/arch/arm/include/cortex_m/dwt.h: In function 'dwt_access':
/home/fabiobaltieri/zephyrproject/zephyr/arch/arm/include/cortex_m/dwt.h:37:29: error: 'ITM_LSR_Present_Msk' undeclared (first use in this function); did you mean 'ITM_LSR_PRESENT_Msk'?
   37 | #define DWT_LSR_Present_Msk ITM_LSR_Present_Msk
      |                             ^~~~~~~~~~~~~~~~~~~

if it only has cmsis_6

@fabiobaltieri, the combination is expected atm because some of the hal's like stm32 might be using the older cmsis and we'll have to wait for them to upgrade. This wasn't possible before because there was no CMSIS_6 module for them to update to but now they should be able to do so.
Also, I wasn't aware about the example-application repo so missed it before but please do let me know if there is anything else that breaks in ci because of this.

BTW, could you please share the command you tried for the above error? This looks like something that can be easily fixed with the right path.

@wearyzen
Copy link
Contributor Author

wearyzen commented May 14, 2025

Or is it meant to need both cmsis and cmsis_6? bumped into an stm32 project that fails with

In file included from /home/fabiobaltieri/zephyrproject/zephyr/arch/arm/core/cortex_m/timing.c:17:
/home/fabiobaltieri/zephyrproject/zephyr/arch/arm/include/cortex_m/dwt.h: In function 'dwt_access':
/home/fabiobaltieri/zephyrproject/zephyr/arch/arm/include/cortex_m/dwt.h:37:29: error: 'ITM_LSR_Present_Msk' undeclared (first use in this function); did you mean 'ITM_LSR_PRESENT_Msk'?
   37 | #define DWT_LSR_Present_Msk ITM_LSR_Present_Msk
      |                             ^~~~~~~~~~~~~~~~~~~

if it only has cmsis_6

@fabiobaltieri, the combination is expected atm because some of the hal's like stm32 might be using the older cmsis and we'll have to wait for them to upgrade. This wasn't possible before because there was no CMSIS_6 module for them to update to but now they should be able to do so. Also, I wasn't aware about the example-application repo so missed it before but please do let me know if there is anything else that breaks in ci because of this.

BTW, could you please share the command you tried for the above error? This looks like something that can be easily fixed with the right path.

Tried to build a few stm32 projects (including nucleo_f429zi/stm32f429xx which includes the file dwt.h) but couldn't see the issue reported, let me know if you find the board used to reproduce this error.

Thanks!

@fabiobaltieri
Copy link
Member

fabiobaltieri commented May 14, 2025

Also, I wasn't aware about the example-application repo so missed it before but please do let me know if there is anything else that breaks in ci because of this.

All good, don't worry about it.

BTW, could you please share the command you tried for the above error? This looks like something that can be easily fixed with the right path.

Ah it was from one of my test projects, had a CI run with minimal modules, let's see you can do:

$ rm -rf ../modules/hal/cmsis
$ west build -p -b nucleo_h745zi_q/stm32h745xx/m7 samples/basic/blinky -DCONFIG_CORTEX_M_DWT=y -DCONFIG_TIMING_FUNCTIONS=y
...
zephyrproject/zephyr/arch/arm/include/cortex_m/dwt.h:37:29: error: 'ITM_LSR_Present_Msk' undeclared (first use in this function); did you mean 'ITM_LSR_PRESENT_Msk'?

I think it's enabled from these in the specific project

CONFIG_THREAD_RUNTIME_STATS=y
CONFIG_THREAD_RUNTIME_STATS_USE_TIMING_FUNCTIONS=y

@wearyzen
Copy link
Contributor Author

Also, I wasn't aware about the example-application repo so missed it before but please do let me know if there is anything else that breaks in ci because of this.

All good, don't worry about it.

BTW, could you please share the command you tried for the above error? This looks like something that can be easily fixed with the right path.

Ah it was from one of my test projects, had a CI run with minimal modules, let's see you can do:

$ rm -rf ../modules/hal/cmsis
$ west build -p -b nucleo_h745zi_q/stm32h745xx/m7 samples/basic/blinky -DCONFIG_CORTEX_M_DWT=y -DCONFIG_TIMING_FUNCTIONS=y
...
zephyrproject/zephyr/arch/arm/include/cortex_m/dwt.h:37:29: error: 'ITM_LSR_Present_Msk' undeclared (first use in this function); did you mean 'ITM_LSR_PRESENT_Msk'?

I think it's enabled from these in the specific project

CONFIG_THREAD_RUNTIME_STATS=y
CONFIG_THREAD_RUNTIME_STATS_USE_TIMING_FUNCTIONS=y

Thanks, I found the issue and will be posting a fix soon with the release notes update.

wearyzen added a commit to wearyzen/zephyr that referenced this pull request May 16, 2025
As noted in PR zephyrproject-rtos#89370, the content of these files falls below the
trivial threshold. Therefore, it is not necessary to retain the original
copyright, which was carried over when the files were copied from the
`cmsis` module.

Signed-off-by: Sudan Landge <[email protected]>
@wearyzen wearyzen mentioned this pull request May 16, 2025
wearyzen added a commit to wearyzen/zephyr that referenced this pull request May 16, 2025
As noted in PR zephyrproject-rtos#89370, the content of these files falls below the
trivial threshold. Therefore, it is not necessary to retain the original
copyright, which was carried over when the files were copied from the
`cmsis` module.

Signed-off-by: Sudan Landge <[email protected]>
yashi added a commit to yashi/libcsp-zephyr that referenced this pull request May 18, 2025
Zephyr has migrated to CMSIS v6. While the plan was to transition all
ARM architectures, issues with Cortex-A and Cortex-R prevented full
adoption. As a result, only Cortex-M was updated to v6 in
zephyrproject-rtos/zephyr#89370.

Since the SC-OBC module A1 uses a Cortex-M3, we need to adopt CMSIS
v6.

That PR was merged after Zephyr v4.1.0, so older versions may still
require the legacy CMSIS module. To maintain compatibility, we are
keeping the old module alongside v6.
yashi added a commit to yashi/libcsp-zephyr that referenced this pull request May 18, 2025
Zephyr has migrated to CMSIS v6. While the plan was to transition all
ARM architectures, issues with Cortex-A and Cortex-R prevented full
adoption. As a result, only Cortex-M was updated to v6 in
zephyrproject-rtos/zephyr#89370.

Since the SC-OBC module A1 uses a Cortex-M3, we need to adopt CMSIS
v6.

That PR was merged after Zephyr v4.1.0, so older versions may still
require the legacy CMSIS module. To maintain compatibility, we are
keeping the old module alongside v6.

Signed-off-by: Yasushi SHOJI <[email protected]>
wearyzen added a commit to wearyzen/zephyr that referenced this pull request May 19, 2025
As noted in PR zephyrproject-rtos#89370, the content of these files falls below the
trivial threshold. Therefore, it is not necessary to retain the original
copyright, which was carried over when the files were copied from the
`cmsis` module.

Signed-off-by: Sudan Landge <[email protected]>
wearyzen added a commit to wearyzen/zephyr that referenced this pull request May 19, 2025
As noted in PR zephyrproject-rtos#89370, the content of these files falls below the
trivial threshold. Therefore, it is not necessary to retain the original
copyright, which was carried over when the files were copied from the
`cmsis` module.

Signed-off-by: Sudan Landge <[email protected]>
wearyzen added a commit to wearyzen/zephyr that referenced this pull request May 20, 2025
As noted in PR zephyrproject-rtos#89370, the content of these files falls below the
trivial threshold. Therefore, it is not necessary to retain the original
copyright, which was carried over when the files were copied from the
`cmsis` module.

Signed-off-by: Sudan Landge <[email protected]>
nashif pushed a commit that referenced this pull request May 23, 2025
As noted in PR #89370, the content of these files falls below the
trivial threshold. Therefore, it is not necessary to retain the original
copyright, which was carried over when the files were copied from the
`cmsis` module.

Signed-off-by: Sudan Landge <[email protected]>
moonlight83340 pushed a commit to moonlight83340/libcsp-zephyr-sc that referenced this pull request May 24, 2025
Zephyr has migrated to CMSIS v6. While the plan was to transition all
ARM architectures, issues with Cortex-A and Cortex-R prevented full
adoption. As a result, only Cortex-M was updated to v6 in
zephyrproject-rtos/zephyr#89370.

Since the SC-OBC module A1 uses a Cortex-M3, we need to adopt CMSIS
v6.

That PR was merged after Zephyr v4.1.0, so older versions may still
require the legacy CMSIS module. To maintain compatibility, we are
keeping the old module alongside v6.

Signed-off-by: Yasushi SHOJI <[email protected]>
moonlight83340 pushed a commit to moonlight83340/libcsp-zephyr-sc that referenced this pull request May 24, 2025
Zephyr has migrated to CMSIS v6. While the plan was to transition all
ARM architectures, issues with Cortex-A and Cortex-R prevented full
adoption. As a result, only Cortex-M was updated to v6 in
zephyrproject-rtos/zephyr#89370.

Since the SC-OBC module A1 uses a Cortex-M3, we need to adopt CMSIS
v6.

That PR was merged after Zephyr v4.1.0, so older versions may still
require the legacy CMSIS module. To maintain compatibility, we are
keeping the old module alongside v6.

Signed-off-by: Yasushi SHOJI <[email protected]>
@mikk-leini-krakul
Copy link

This merge created a sudden error for us, so I add a helpful hint for others who have "cmsis" in west.yml import modules whitelist and get such compilation error:

zephyr/include/zephyr/arch/arm/asm_inline_gcc.h:24:10: fatal error: cmsis_core.h: No such file or directory
   #include <cmsis_core.h>

The solution is to whitelist "cmsis_6".

yashi added a commit to spacecubics/libcsp-zephyr that referenced this pull request Jul 18, 2025
Zephyr has migrated to CMSIS v6. While the plan was to transition all
ARM architectures, issues with Cortex-A and Cortex-R prevented full
adoption. As a result, only Cortex-M was updated to v6 in
zephyrproject-rtos/zephyr#89370.

Since the SC-OBC module A1 uses a Cortex-M3, we need to adopt CMSIS
v6.

That PR was merged after Zephyr v4.1.0, so older versions may still
require the legacy CMSIS module. To maintain compatibility, we are
keeping the old module alongside v6.

Signed-off-by: Yasushi SHOJI <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants