Skip to content

STM32: Add STM32C092 SoC support and NUCLEO-C092RC #93263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

str4t0m
Copy link
Contributor

@str4t0m str4t0m commented Jul 17, 2025

Add STM32C091/STM32C092 as a member of the STM32C0 family with additional timer, serial interfaces and CAN-FD(C092 only) support.

  • soc: st: stm32: add stm32c091/c092 support
  • dt-bindings: clock: stm32c0: add can-fd domain clock helper
  • dts: arm: st: stm32c0: add stm32c091/c092 support
  • dts: arm: st: stm32c0: add counter nodes to all timers
  • Add overlays for the ADC API, UART async API, the counter basic API tests, as well as the st wkup-pin sample.
  • boards: st: add nucleo_c092rc

@str4t0m str4t0m marked this pull request as ready for review July 18, 2025 22:35
@zephyrbot zephyrbot added platform: STM32 ST Micro STM32 area: UART Universal Asynchronous Receiver-Transmitter area: Counter area: ADC Analog-to-Digital Converter (ADC) area: Clock Control labels Jul 18, 2025
@str4t0m str4t0m assigned erwango and unassigned nordic-krch Jul 19, 2025

.. zephyr:board-supported-runners::
Nucleo C092RE board includes an ST-LINK/V2-1 embedded debug tool interface.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Nucleo C092RE board includes an ST-LINK/V2-1 embedded debug tool interface.
Nucleo C092RC board includes an ST-LINK/V2-1 embedded debug tool interface.

Please check for similar typos you might have elsewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for spotting the typo. Should be fixed now.

@str4t0m str4t0m force-pushed the stm32c092 branch 2 times, most recently from c9b6c2f to e412578 Compare July 19, 2025 11:39
@str4t0m str4t0m requested a review from kartben July 19, 2025 12:17
Copy link
Contributor

@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.

There is a typo in message for commit tests: drivers: uart: uart_async_api: add nucleo_c092rc overlay (STM32CO instead of STM32C0).

The following commits should come after the board is introduced:

  • tests: drivers: adc: adc_api: add overlay for nucleo_c092rc
  • tests: drivers: uart: uart_async_api: add nucleo_c092rc overlay
  • tests: drivers: counter: counter_basic_api: add nucleo_c092rc overlay

+ some remarks but otherwise LGTM on surface

str4t0m added 9 commits July 22, 2025 06:15
Adds SoC support for the STM32C091, and the STM32C092 SoCs
which are part of the STM32C0 series.

Signed-off-by: Thomas Stranger <[email protected]>
On STM32C092 variants CAN-FD is supported, and the clock
source can be chosen in the CCIPR1 register.
This commit adds the helper to prepare that choice for the register.

Signed-off-by: Thomas Stranger <[email protected]>
Add dts support for the STM32C091 and STM32C092 SoCs,
that are part of the STM32C0 series.

Signed-off-by: Thomas Stranger <[email protected]>
Add the counter nodes (compat st,stm32-counter)
to all timers of the STM32C0 series.

Signed-off-by: Thomas Stranger <[email protected]>
Adds definitions for the nucleo_c092rc supporting
the STM32C092RC entry-level MCU with CAN-FD support.

The series does not have a pll, so with the given 48MHz
CAN core clock frequency the internal timing calculation
can't find parameters for 5MHz data bitrate,
and for 8MHz they have an error of 84/1000.

Signed-off-by: Thomas Stranger <[email protected]>
Add an overlay to use adc1 channel 0 (on PA0) for testing.

Signed-off-by: Thomas Stranger <[email protected]>
Add a overlay for the nucleo_c092 testing usart4 and dma
channels 6 and 7. These are all not available in smaller STM32C0 SoCs.

Signed-off-by: Thomas Stranger <[email protected]>
Add a overlay to the counter_basic_api test to enable the counter node
of TIM2, TIM3, and TIM14 to TIM17.

Signed-off-by: Thomas Stranger <[email protected]>
Add an overlay to the st specific power_mgmt wkup_pins sample
for the nucleo_c092rc board.
The user_button on pc13 is used as the wakeup-src.

Signed-off-by: Thomas Stranger <[email protected]>
Copy link

@str4t0m str4t0m requested a review from mathieuchopstm July 22, 2025 04:50
Copy link
Contributor

@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.

Minor cosmetic remarks but LGTM otherwise.

Comment on lines +79 to +80
reg = <0x2>;
wkup-gpios = <&gpioc 13 STM32_PWR_WKUP_PIN_NOT_MUXED>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
reg = <0x2>;
wkup-gpios = <&gpioc 13 STM32_PWR_WKUP_PIN_NOT_MUXED>;
reg = <0x2>;
wkup-gpios = <&gpioc 13 STM32_PWR_WKUP_PIN_NOT_MUXED>;

Comment on lines +83 to +84
reg = <0x5>;
wkup-gpios = <&gpioc 5 STM32_PWR_WKUP_PIN_NOT_MUXED>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
reg = <0x5>;
wkup-gpios = <&gpioc 5 STM32_PWR_WKUP_PIN_NOT_MUXED>;
reg = <0x5>;
wkup-gpios = <&gpioc 5 STM32_PWR_WKUP_PIN_NOT_MUXED>;

Comment on lines +87 to +88
reg = <0x6>;
wkup-gpios = <&gpiob 5 STM32_PWR_WKUP_PIN_NOT_MUXED>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
reg = <0x6>;
wkup-gpios = <&gpiob 5 STM32_PWR_WKUP_PIN_NOT_MUXED>;
reg = <0x6>;
wkup-gpios = <&gpiob 5 STM32_PWR_WKUP_PIN_NOT_MUXED>;

reg-names = "m_can", "message_ram";
interrupts = <30 0>, <31 0>;
interrupt-names = "int0", "int1";
clocks = <&rcc STM32_CLOCK(APB1, 12U)>;
Copy link
Contributor

Choose a reason for hiding this comment

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

U suffix should not be used in DTS (yes, the entire file uses it...... I really ought to fix this one day)

Suggested change
clocks = <&rcc STM32_CLOCK(APB1, 12U)>;
clocks = <&rcc STM32_CLOCK(APB1, 12)>;

Comment on lines +20 to +21
clocks = <&rcc STM32_CLOCK(APB1_2, 16U)>;
resets = <&rctl STM32_RESET(APB1H, 16U)>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
clocks = <&rcc STM32_CLOCK(APB1_2, 16U)>;
resets = <&rctl STM32_RESET(APB1H, 16U)>;
clocks = <&rcc STM32_CLOCK(APB1_2, 16)>;
resets = <&rctl STM32_RESET(APB1H, 16)>;

Comment on lines +42 to +43
clocks = <&rcc STM32_CLOCK(APB1, 18U)>;
resets = <&rctl STM32_RESET(APB1L, 18U)>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
clocks = <&rcc STM32_CLOCK(APB1, 18U)>;
resets = <&rctl STM32_RESET(APB1L, 18U)>;
clocks = <&rcc STM32_CLOCK(APB1, 18)>;
resets = <&rctl STM32_RESET(APB1L, 18)>;

Comment on lines +51 to +52
clocks = <&rcc STM32_CLOCK(APB1, 19U)>;
resets = <&rctl STM32_RESET(APB1L, 19U)>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
clocks = <&rcc STM32_CLOCK(APB1, 19U)>;
resets = <&rctl STM32_RESET(APB1L, 19U)>;
clocks = <&rcc STM32_CLOCK(APB1, 19)>;
resets = <&rctl STM32_RESET(APB1L, 19)>;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ADC Analog-to-Digital Converter (ADC) area: CAN area: Clock Control area: Counter area: Samples Samples area: UART Universal Asynchronous Receiver-Transmitter platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants