Skip to content

STMC5xx support based on HALv2#2987

Merged
fpistm merged 51 commits into
stm32duino:mainfrom
fpistm:c5_support
Jul 7, 2026
Merged

STMC5xx support based on HALv2#2987
fpistm merged 51 commits into
stm32duino:mainfrom
fpistm:c5_support

Conversation

@fpistm

@fpistm fpistm commented Jun 3, 2026

Copy link
Copy Markdown
Member

This PR adds support of the STM32C5xx series.
This new series introduces the STM32Cube HAL2-based Embedded Software.
More information here: https://dev.st.com/stm32cube-docs/hal1-to-hal2-migration/1.0.0/en/docs/markup/drivers_documentation/drivers_toc.html

Therefore, several changes have been done to support it vs HALv1.

  • scripts
    • to add/update HALv2 sources and CMSIS devices to the core
    • generate variants based on pinouts json files (vs xml description)
    • cmake support
  • USE_HALV2_DRIVER is and can be used as differentiator vs USE_HAL_DRIVER
  • startup files management (.c vs .s)
  • HAL modules management:
    • HALv1: #define HAL_RCC_MODULE_ENABLED
    • HALv2: #define USE_HAL_RCC_MODULE 1U

Note

To disable HAL module usage or Arduino API usage of the HAL, there is no change
HAL_DAC_MODULE_DISABLED
HAL_DAC_MODULE_ONLY

  • Features support:

  • Features not (yet) supported:

  • ❌ USB Device (CDC/HID) --> HALv2 not compatible with current USB Device library. Option: move to TinyUSB?

  • ❌ I3C --> library is in beta and required some rework.

  • ❌ EEPROM emulation -> New architecture, will be support later

  • board added: NUCLEO-C562RE

Fixes #2986.

/cc @csajisynco

@fpistm fpistm added this to the 3.0.0 milestone Jun 3, 2026
@fpistm fpistm added the enhancement New feature or request label Jun 3, 2026
@fpistm fpistm marked this pull request as draft June 3, 2026 13:43
@fpistm fpistm force-pushed the c5_support branch 5 times, most recently from 2284713 to 63fc1b8 Compare June 9, 2026 15:00
@fpistm fpistm force-pushed the c5_support branch 2 times, most recently from 74732f2 to e767f7a Compare June 18, 2026 07:23
@fpistm fpistm marked this pull request as ready for review June 18, 2026 07:38
@fpistm fpistm force-pushed the c5_support branch 2 times, most recently from 3842284 to 4918717 Compare June 18, 2026 14:53
@fpistm fpistm force-pushed the c5_support branch 2 times, most recently from 5e484a0 to 9930246 Compare June 29, 2026 14:30
fpistm added 13 commits July 3, 2026 09:12
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Included in STM32CubeC5 FW 2.0.0

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Included in STM32CubeC5 FW 2.0.0

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
By default: -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER
To use HAL version2 add this recipe:
build.hal=-DUSE_HALV2_DRIVER

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
fpistm added 25 commits July 3, 2026 09:12
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Since uart rework, LPUART source have to be properly set in
SystemClock_Config() to ensure 9600 baudrate is supported.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
- remove unused analogOutputInit function
- reorder functions per features

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
ARDUINO_ARCH_STM32F4 was for first stm32 core version.
One core per series.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
I3C required some rework to support HALv2 driver,
so disable it for now.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
EEPROM required some rework to support HALv2 driver,
so disable it for now.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
USB support is not compatible with current USB Device library.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Included in STM32CubeC5 FW 2.1.0

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Included in STM32CubeC5 FW 2.1.0

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
@fpistm fpistm merged commit d9f5492 into stm32duino:main Jul 7, 2026
28 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in STM32 core based on ST HAL Jul 7, 2026
@fpistm fpistm deleted the c5_support branch July 7, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

STM32C5 Support

1 participant