Skip to content

STM32CubeC5 initial release#352

Merged
erwango merged 6 commits intozephyrproject-rtos:mainfrom
gautierg-st:stm32c5
Mar 18, 2026
Merged

STM32CubeC5 initial release#352
erwango merged 6 commits intozephyrproject-rtos:mainfrom
gautierg-st:stm32c5

Conversation

@gautierg-st
Copy link
Copy Markdown
Collaborator

This PR adds the STM32CubeC5 (HAL, LL and CMSIS) along with the pinctrl dts.

STM32CubeC5 introduces the new HAL2 and therefore uses a different layout than former HAL.

Pinctrl generation is different (extracted from json instead of xml) and necessitates a new generation script.

@gautierg-st gautierg-st changed the title STM32CubeC5 introduction STM32CubeC5 initial release Mar 16, 2026
Copy link
Copy Markdown
Collaborator

@mathieuchopstm mathieuchopstm Mar 16, 2026

Choose a reason for hiding this comment

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

Nit: rename commit scripts: genpinctrl: add jinja template to scripts: genpinctrl: add jinja template for HAL2 or something like that

Also: since this template is identical to pinctrl-template.j2 (minus STM32F1 support) except for genpinctrl.py --> genpinctrl_cubev2.py, why not just make the tool's name a Jinja template variable instead, and share the template between HAL1 and HAL2 scripts? (or rather, pass whether target is HAL1 or HAL2 - see other comment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree having a single template would be preferred

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Templates are not strictly identical. I'll leave as is for the moment. It can be reworked later.

Comment thread dts/README.rst Outdated
Comment thread scripts/genpinctrl/genpinctrl_hal2.py
Comment thread stm32cube/CMakeLists.txt
Comment thread stm32cube/stm32c5xx/CMakeLists.txt Outdated
Comment thread stm32cube/stm32c5xx/CMakeLists.txt Outdated
Comment thread stm32cube/stm32c5xx/CMakeLists.txt Outdated
Comment thread stm32cube/common_ll/README.rst Outdated
Comment thread stm32cube/CMakeLists.txt Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree having a single template would be preferred

Comment thread stm32cube/stm32c5xx/README Outdated
https://github.com/STMicroelectronics/STM32CubeC5

Commit:
NA
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

bfb39f1c987ed1c6e49de19655d2c299a4aee462

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

Comment thread stm32cube/CMakeLists.txt
Comment thread scripts/genpinctrl/pinctrl-template_cubev2.j2 Outdated
@gautierg-st gautierg-st force-pushed the stm32c5 branch 2 times, most recently from 7192986 to c31e8f6 Compare March 16, 2026 16:51
Comment thread dts/README.rst Outdated

Status:
Generated using STM32 Open Pin Data
Generated using external batabase:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Generated using external batabase:
Generated using external database:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

Comment thread scripts/genpinctrl/readme-template.j2 Outdated
@@ -5,25 +5,28 @@ Origin:
Generated

Status:
Generated using STM32 Open Pin Data
Generated using external batabase:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Generated using external batabase:
Generated using external database:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -5,25 +5,28 @@ Origin:
Generated

Status:
Generated using STM32 Open Pin Data
Generated using external batabase:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Generated using external batabase:
Generated using external database:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Collaborator

@mathieuchopstm mathieuchopstm left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

Comment thread stm32cube/stm32c5xx/CMakeLists.txt Outdated
Comment thread dts/README.rst Outdated
Comment thread scripts/genpinctrl/stm32-pinctrl-config.yaml Outdated
This script automates the generation of pinctrl files for STM32 HAL2.

It will work the same way as the generation script for the HAL1
version with the consideration of several soc folders present in the
directory given as input.
It adds a new Jinja template for HAL2.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
Update readme file to indicate the source files for STM32 HAL2
pinctrl generation.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Update pinctrl matches for STM32C5 pinctrl generation.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Generate pinctrl files for STM32C5x series.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Copy link
Copy Markdown

@str4t0m str4t0m left a comment

Choose a reason for hiding this comment

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

Not really familiar with the HAL2 yet, but made two observations.

Comment thread stm32cube/common_ll/include/stm32_ll_adc.h
Comment thread stm32cube/stm32c5xx/CMakeLists.txt Outdated
Add Cube HAL and LL drivers and SoC files for STM32C5x series.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Generate LL headers for STM32C5x series.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
@erwango erwango requested a review from str4t0m March 18, 2026 10:06
Copy link
Copy Markdown

@str4t0m str4t0m left a comment

Choose a reason for hiding this comment

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

My Remarks have been addressed.

@erwango erwango requested a review from mathieuchopstm March 18, 2026 10:21
@erwango erwango merged commit 88f09de into zephyrproject-rtos:main Mar 18, 2026
3 checks passed
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.

6 participants