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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wearyzen
Copy link
Collaborator

@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
Collaborator 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
Collaborator

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)?

@wearyzen
Copy link
Collaborator Author

wearyzen commented May 6, 2025

The last commit to disable the test is just to check if there are any other failures with this PR. However, I'll keep the commit if it is accepted here

@aescolar aescolar dismissed their stale review May 7, 2025 12:56

addressed

@wearyzen
Copy link
Collaborator Author

wearyzen commented May 7, 2025

Hi @tomi-font , could you please help with review/merge of linked CMSIS and TF-M PRs?

@tomi-font
Copy link
Collaborator

Hi @tomi-font , could you please help with review/merge of linked CMSIS and TF-M PRs?

Sure, will take care of this tomorrow.

tomi-font
tomi-font previously approved these changes May 9, 2025
west.yml Outdated
Comment on lines 130 to 129
- name: cmsis_6
repo-path: CMSIS_6
revision: 783317a3072554acbac86cca2ff24928cbf98d30
path: modules/lib/cmsis_6
revision: 6dd50439a9b83398ff2ae1376eef0a2a0b95913b
path: modules/hal/cmsis_6
groups:
- hal
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about moving the cmsis_6 entry right after the cmsis one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

well, it seems we can't do this as per the compliance check, so I'll have to move them back 😞

@wearyzen wearyzen force-pushed the cmsis_6_update branch 2 times, most recently from 3bf8595 to d7bae60 Compare May 9, 2025 14:02
@wearyzen wearyzen requested a review from tomi-font May 9, 2025 14:03
tomi-font
tomi-font previously approved these changes May 9, 2025
wearyzen added 2 commits May 9, 2025 15:48
What is the change?
Fix the path for module CMSIS_6 and use CMSIS_6 module for TF-M.

Why do we need this change?

After Zephyr updated TF-M to v2.1.0,
bb037d4469842c96f5872b271490aceb0734d965 added a local copy of CMSIS_6
to stop Zephyr's TF-M from downloading the CMSIS_6 from upstream.
The correct way would be to have CMSIS_6 as a module in Zephyr (which
we have now) and pass the path of this module to TF-M.
A fork of the upstream CMSIS_6 was added to Zephyr however,
the path in west.yml makes it a lib and not a module.
Fixing the path generates the ZEPHYR_CMSIS_6_MODULE_DIR symbol which
can now be used to pass to TF-M and the copy in TF-M would no longer be
required.

Signed-off-by: Sudan Landge <[email protected]>
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.

Signed-off-by: Sudan Landge <[email protected]>
Copy link

sonarqubecloud bot commented May 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: CMSIS-Core area: GPIO area: TF-M ARM Trusted Firmware-M (TF-M) DNM (manifest) This PR should not be merged (controlled by action-manifest) manifest manifest-cmsis_6 manifest-hal_nordic manifest-trusted-firmware-m platform: nRF BSIM Nordic Semiconductors, nRF BabbleSim
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants