Skip to content

Conversation

@dchansen06
Copy link
Contributor

@dchansen06 dchansen06 commented Nov 14, 2025

Unify CMSIS Together

Problem and Scope

Each Lib/Platform/<CHIP> has its own CMSIS library, which are all directly from Arm and have different versions and different behavior, and also copies upwards of 5 MiB each time

It also does not scale well for including other CMSIS functionalities

Description

Implement a CMSIS_5_CORE vendor library that can be linked to from within a given platform that contains all of the CMSIS functionalities

Gotchas and Limitations

Cannot upgrade to CMSIS 6 due to STM support

Testing

  • HOOTL testing
  • HITL testing
  • Human tested

Testing Details

Compiles and flashes

  • Nucleo-G474RE projects
    • G4BLINKY
    • G4HELLO
    • ECU
  • STM32U5
    • U5BLINKY
  • STM32L4
    • L4BLINKY

Larger Impact

Extensible and modular things are nice

Additional Context and Ticket

Resolves #115

- Add centralized CMSIS Core 5 headers (upstream 5.9.0 evaluated)
- Include ST device headers for G4 (v1.2.5), L4 (v1.7.4), U5 (v1.4.1)
- Create CMSIS_5_CORE interface target in cmsis_5.cmake
- Single include tree for all STM32 families
- Comprehensive README documenting version matrix and usage
- STM32G474xE: HAL/LL drivers for G4 series
- STM32L476xG: HAL/LL drivers for L4 series
- STM32U5A9xJ: HAL/LL drivers for U5 series

Reorganized from previous Drivers/stm32-hal-driver structure.
Keeps HAL separate from CMSIS (now centralized).
- All platforms now link CMSIS_5_CORE instead of local CMSIS
- Update HAL include paths to STM32_HAL_LL directory
- Add Lib/Vendor/CMSIS_5 subdirectory in root CMakeLists.txt
- Update PlatformTemplate with new structure
- Delete STM32G474xE/Drivers/CMSIS (now in Lib/Vendor/CMSIS_5)
- Delete STM32L476xG/Drivers/CMSIS (now in Lib/Vendor/CMSIS_5)
- Delete STM32U5A9xJ/Drivers/CMSIS (now in Lib/Vendor/CMSIS_5)
- Delete per-family Drivers/stm32-hal-driver (moved to STM32_HAL_LL)

Consolidates CMSIS into single vendor directory;
HAL/LL drivers reorganized per-platform without CMSIS duplication.
@dchansen06 dchansen06 added this to the Monorepo Setup milestone Nov 14, 2025
@dchansen06 dchansen06 self-assigned this Nov 14, 2025
@dchansen06 dchansen06 added Documentation Improvements or additions to documentation Enhancement New feature or request Help | Review Extra attention is needed CMake Anything related to or dealing with CMake 2 PRIORITY Important and a priority, but less than URGENT Big Fry Something that is complex and/or large Boards Related to or involving any physical boards labels Nov 14, 2025
@dchansen06
Copy link
Contributor Author

@JayWango Could you please verify that L4BLINKY works on your board? Thanks!

@dchansen06 dchansen06 requested a review from JayWango November 14, 2025 05:19
@dchansen06
Copy link
Contributor Author

dchansen06 commented Nov 14, 2025

A similar operation could be down for HAL/LL libraries which would help with cleaning up /Lib/Platform... #127

Signed-off-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
@dchansen06
Copy link
Contributor Author

Everything but L4 has tested and passed so I will merge and if we come across problems we can fix then

@dchansen06 dchansen06 merged commit a0896fe into main Dec 2, 2025
1 check passed
@dchansen06 dchansen06 deleted the UnifyCmsisToVersion5 branch December 2, 2025 04:17
dchansen06 added a commit that referenced this pull request Dec 2, 2025
# Demystify `Platform`

## Problem and Scope
`Platform` contains HAL, LL, CMSIS, linker scripts, startup scripts,
compiler flags, and linker flags. This leads to a large block of obtuse
code that does not support easy modularization.

## Description
Move CMSIS, HAL, and LL to `Vendor` since they are libraries and package
each as appropriate as a separate CMake `INTERFACE`

## Gotchas and Limitations
None, simpler to make new boards and cleaner for sub-groupings

## Testing

- [x] HOOTL testing
- [ ] HITL testing
- [x] Human tested

### Testing Details

- [x] `G4BLINKY`
- [x] `G4HELLO`
- [x] `U5BLINKY`
- [ ] `L4BLINKY`
- [x] Current version of `ECU`

## Larger Impact
Makes code easier to maintain

## Additional Context and Ticket
Builds off of #126, plan to merge #126 before #128 for ease of upgrade
paths

Resolves #127

---------

Signed-off-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
dchansen06 added a commit that referenced this pull request Dec 4, 2025
# Unify CMSIS Together

## Problem and Scope
Each `Lib/Platform/<CHIP>` has its own CMSIS library, which are all
directly from Arm and have different versions and different behavior,
and also copies upwards of 5 MiB each time

It also does not scale well for including other CMSIS functionalities

## Description
Implement a `CMSIS_5_CORE` vendor library that can be linked to from
within a given platform that contains all of the CMSIS functionalities

## Gotchas and Limitations
Cannot upgrade to CMSIS 6 due to STM support

## Testing

- [x] HOOTL testing
- [ ] HITL testing
- [x] Human tested

### Testing Details

Compiles and flashes

- [x] Nucleo-G474RE projects
  - [x] `G4BLINKY`
  - [x] `G4HELLO`
  - [x] `ECU`
- [x] STM32U5
  - [x] `U5BLINKY`
- [ ] STM32L4
  - [ ] `L4BLINKY`

## Larger Impact
Extensible and modular things are nice

## Additional Context and Ticket
Resolves #115

---------

Signed-off-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
dchansen06 added a commit that referenced this pull request Dec 4, 2025
# Demystify `Platform`

## Problem and Scope
`Platform` contains HAL, LL, CMSIS, linker scripts, startup scripts,
compiler flags, and linker flags. This leads to a large block of obtuse
code that does not support easy modularization.

## Description
Move CMSIS, HAL, and LL to `Vendor` since they are libraries and package
each as appropriate as a separate CMake `INTERFACE`

## Gotchas and Limitations
None, simpler to make new boards and cleaner for sub-groupings

## Testing

- [x] HOOTL testing
- [ ] HITL testing
- [x] Human tested

### Testing Details

- [x] `G4BLINKY`
- [x] `G4HELLO`
- [x] `U5BLINKY`
- [ ] `L4BLINKY`
- [x] Current version of `ECU`

## Larger Impact
Makes code easier to maintain

## Additional Context and Ticket
Builds off of #126, plan to merge #126 before #128 for ease of upgrade
paths

Resolves #127

---------

Signed-off-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
@dchansen06 dchansen06 mentioned this pull request Dec 4, 2025
3 tasks
dchansen06 added a commit that referenced this pull request Dec 4, 2025
# `CMAKE.md` Documentation Update

## Problem and Scope
Lots of changes with #128 and #126 among others, out of date

## Description
Updates the documentation

## Gotchas and Limitations
None

## Testing

- [ ] HOOTL testing
- [ ] HITL testing
- [x] Human tested

### Testing Details
Renders correctly, looks accurate

## Larger Impact
Provides updated documentation

## Additional Context and Ticket
Not updated since the first commit
ec304fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 PRIORITY Important and a priority, but less than URGENT Big Fry Something that is complex and/or large Boards Related to or involving any physical boards CMake Anything related to or dealing with CMake Documentation Improvements or additions to documentation Enhancement New feature or request Help | Review Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CMSIS Library Deduplication and Unified Upgrade

1 participant