Skip to content

STMC5xx support based on HALv2#2987

Draft
fpistm wants to merge 38 commits into
stm32duino:mainfrom
fpistm:c5_support
Draft

STMC5xx support based on HALv2#2987
fpistm wants to merge 38 commits into
stm32duino:mainfrom
fpistm:c5_support

Conversation

@fpistm
Copy link
Copy Markdown
Member

@fpistm fpistm commented Jun 3, 2026

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:

    • clock
    • GPIO
    • ADC
    • ADC internal
    • HardwareTimer
    • Tone
    • EXTI
    • Serial
    • I2C
    • SPI
    • EEPROM emulation
    • RTC
    • LowPower
    • IWDG
    • USB Device (CDC/HID)
    • CMSIS DSP
  • board added: NUCLEO-C562RE

Fixes #2986.

/cc @csajisynco

fpistm added 30 commits May 27, 2026 14:58
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>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Allow some redefinition.

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Available in stm32_external_env.h

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>
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>
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>
fpistm added 5 commits May 27, 2026 14:58
- 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>
@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 added 3 commits June 4, 2026 17:48
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>
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

Status: In progress

Development

Successfully merging this pull request may close these issues.

STM32C5 Support

1 participant