Skip to content

Add CI test for relative path handling in STM32_CUBE_<FAMILY>_PATH#364

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-relative-paths-issue
Draft

Add CI test for relative path handling in STM32_CUBE_<FAMILY>_PATH#364
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-relative-paths-issue

Conversation

Copy link

Copilot AI commented Jan 26, 2026

Relative paths specified via STM32_CUBE_<FAMILY>_PATH fail during CMSIS discovery. This adds a CI test to validate the behavior.

Changes

  • Added relative path test to .github/workflows/cmake.yml
    • Configures tests/cmsis with relative path to fetched STM32Cube packages
    • Path: ../../fetch/build/_deps/stm32cube<family>-src from build directory
    • Validates FindCMSIS.cmake can locate CMSIS headers/sources via relative paths
    • Runs for all families except MP1 (consistent with existing tests)

Test Flow

# Working directory: /path/to/tests/cmsis/build-relative
cmake -DSTM32_CUBE_F4_PATH=../../fetch/build/_deps/stm32cubef4-src \
      -DTEST_FAMILIES=F4 \
      /path/to/tests/cmsis/

The test currently exposes the relative path bug - it will fail until FindCMSIS.cmake properly resolves relative paths in find_path() calls.

Original prompt

This section details on the original issue you should resolve

<issue_title>Relative paths fail consistently</issue_title>
<issue_description>Describe the bug
If your Cube directories are not in the default paths and you use relative paths for STM32_CUBE_<FAMILY>_PATH it will fail to find CMSIS.

Sources to reproduce
Please provide link to repository showing the problem.

  • In main branch

Steps to reproduce

  1. Download of fetch Cube code from examples/fetch-cube
  2. Place it somewhere other than the default location of /opt/STM32Cube<FAMILY>
  3. Go to root/examples/blinky
  4. Create a build folder and cd build
  5. Run cmake .. -DSTM32_CUBE_F4_PATH=<absolute-path>/stm32-cmake/thirdParty/STM32CubeF4
  6. This builds successfully.
  7. rm -rf ./* in build
  8. Run cmake .. -DSTM32_CUBE_F4_PATH=<relative-path>/stm32-cmake/thirdParty/STM32CubeF4 leads to
    CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:290 (message): Could NOT find CMSIS (missing: CMSIS_INCLUDE_DIRS CMSIS_SOURCES STM32F4)

Expected behavior
Expected behavior is that this project should be able to handle relative paths or at least mention it in big bold letters in the documentation.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Linux x86_64
  • Compiler: arm-none-eabi-gcc 15.2.Rel1
  • stm32-cmake: ecc5acc
  • cmake: 4.2.2

Additional context
Add any other context about the problem here.
</issue_description>

<agent_instructions>Add a test in .GitHub/workflows to be ran by the CI using tests/cmsis folder.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Hish15 <29129731+Hish15@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix relative paths failing to find CMSIS Add CI test for relative path handling in STM32_CUBE_<FAMILY>_PATH Jan 26, 2026
Copilot AI requested a review from Hish15 January 26, 2026 13:48
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.

Relative paths fail consistently

2 participants