Skip to content

Conversation

ashen1queter
Copy link

Added support for setting a custom CMSIS version by defining the CMSIS_CUSTOM_VERSION cache variable. This allows users to override the default CMSIS version during CMake configuration by passing:

-DCMSIS_CUSTOM_VERSION=

If not specified, the script defaults to version v5.6.0

Added support for setting a custom CMSIS version by defining the
CMSIS_CUSTOM_VERSION cache variable. This allows users to override
the default CMSIS version during CMake configuration by passing:

  -DCMSIS_CUSTOM_VERSION=<version>

If not specified, the script defaults to version v5.6.0
…ectness via CMake cache variable

Added support for setting a custom CMSIS version by defining the
CMSIS_CUSTOM_VERSION cache variable. This allows users to override
the default CMSIS version during CMake configuration by passing:

  -DCMSIS_CUSTOM_VERSION=<version>

Additionally, validation has been added to check if the custom CMSIS version
is valid, ensuring that only supported versions are used and a list of valid versions are displayed too. If not specified,
the script defaults to version v5.6.0
@Hish15 Hish15 closed this Aug 5, 2025
@Hish15 Hish15 reopened this Aug 5, 2025
@Hish15
Copy link
Collaborator

Hish15 commented Aug 7, 2025

Hi @ashen1queter, It would be nice to add a UT before merging this. Are you willing to do it ?
The idea is to check that this does indeed fetch a CMSIS version other than the default one when requested, and that it does retrieve the default too.

if(DEFINED CMSIS_CUSTOM_VERSION AND NOT "${CMSIS_CUSTOM_VERSION}" STREQUAL "")
list(FIND VALID_CMSIS_VERSIONS " ${CMSIS_CUSTOM_VERSION}" VALID_VERSION_INDEX)
if(VALID_VERSION_INDEX EQUAL -1)
message(FATAL_ERROR "Invalid CMSIS version provided ${CMSIS_CUSTOM_VERSION}. Supported versions are: ${VALID_CMSIS_VERSIONS}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like this, but it does make us follow the releases... Isn't letting the Fetch fail enough ?

What do you think @atsju ?

Copy link
Collaborator

@atsju atsju Aug 13, 2025

Choose a reason for hiding this comment

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

Same. Have an explicit error message on how the user can find valid versions when fetch fails (with one or two examples).
But avoid having stm32-cmake to follow CMSIS releases. We have no automation for this.

Copy link
Author

Choose a reason for hiding this comment

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

I will get back to this, I am currently involved in an internship

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants