Skip to content

Commit c9b6c2f

Browse files
committed
boards: st: add nucleo_c092rc
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 no timing parameters can be found for 5MHz, and for 8MHz they have an error of 84/1000. Signed-off-by: Thomas Stranger <[email protected]>
1 parent 6d498f9 commit c9b6c2f

File tree

9 files changed

+408
-0
lines changed

9 files changed

+408
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Thomas Stranger
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_NUCLEO_C092RC
5+
select SOC_STM32C092XX
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2024 STMicroelectronics
3+
* Copyright (c) 2025 Thomas Stranger
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
/ {
9+
arduino_header: connector {
10+
compatible = "arduino-header-r3";
11+
#gpio-cells = <2>;
12+
gpio-map-mask = <0xffffffff 0xffffffc0>;
13+
gpio-map-pass-thru = <0 0x3f>;
14+
gpio-map = <0 0 &gpioa 0 0>, /* A0 */
15+
<1 0 &gpioa 1 0>, /* A1 */
16+
<2 0 &gpioa 4 0>, /* A2 */
17+
<3 0 &gpiob 0 0>, /* A3 */
18+
<4 0 &gpioc 4 0>, /* A4 */
19+
<5 0 &gpioc 5 0>, /* A5 */
20+
<6 0 &gpiob 7 0>, /* D0 */
21+
<7 0 &gpiob 6 0>, /* D1 */
22+
<8 0 &gpioa 10 0>, /* D2 */
23+
<9 0 &gpioc 7 0>, /* D3 */
24+
<10 0 &gpiob 5 0>, /* D4 */
25+
<11 0 &gpiob 4 0>, /* D5 */
26+
<12 0 &gpioc 8 0>, /* D6 */
27+
<13 0 &gpioa 8 0>, /* D7 */
28+
<14 0 &gpioa 9 0>, /* D8 */
29+
<15 0 &gpiob 3 0>, /* D9 */
30+
<16 0 &gpioa 15 0>, /* D10 */
31+
<17 0 &gpioa 7 0>, /* D11 */
32+
<18 0 &gpioa 6 0>, /* D12 */
33+
<19 0 &gpioa 5 0>, /* D13 */
34+
<20 0 &gpiob 9 0>, /* D14 */
35+
<21 0 &gpiob 8 0>; /* D15 */
36+
};
37+
};
38+
39+
arduino_i2c: &i2c1 {};
40+
arduino_spi: &spi1 {};
41+
arduino_serial: &usart1 {};

boards/st/nucleo_c092rc/board.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# keep first
4+
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
5+
6+
board_runner_args(jlink "--device=STM32C092RC" "--speed=4000")
7+
8+
# keep first
9+
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)
10+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/st/nucleo_c092rc/board.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: nucleo_c092rc
3+
full_name: Nucleo C092RC
4+
vendor: st
5+
socs:
6+
- name: stm32c092xx
Binary file not shown.

boards/st/nucleo_c092rc/doc/index.rst

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
.. zephyr:board:: nucleo_c092rc
2+
3+
Overview
4+
********
5+
The STM32 Nucleo-64 development board with STM32C092RC MCU, supports Arduino and ST morpho connectivity.
6+
7+
The STM32 Nucleo board comes with the STM32 comprehensive software HAL library together
8+
with various packaged software examples.
9+
10+
.. image:: img/st_nucleo_c092rc.webp
11+
:align: center
12+
:alt: Nucleo C092RC
13+
14+
More information about the board can be found at the `Nucleo C092RC website`_.
15+
16+
Hardware
17+
********
18+
Nucleo C092RC provides the following hardware components:
19+
20+
- STM32 microcontroller in 64-pin package featuring 256 Kbytes of Flash memory
21+
and 30 Kbytes of SRAM.
22+
23+
- Flexible board power supply:
24+
25+
- USB VBUS or external source (3.3V, 5V, 7 - 12V)
26+
- Current consumption measurement (IDD)
27+
28+
- five LEDs:
29+
30+
- Two user LEDs (LD1, LD2), power LED (LD3),
31+
STLINK LED (LD4), USB power fault LED (LD5)
32+
33+
- Three push-buttons: USER, RESET, BOOT
34+
35+
- On-board ST-LINK/V2-1 debugger/programmer with SWD connector
36+
37+
- Board connectors:
38+
39+
- Arduino* Uno V3 expansion connector
40+
- ST morpho extension pin header
41+
- CAN FD interface with on board transceiver
42+
43+
More information about STM32C092RC can be found here:
44+
`STM32C0x1 reference manual`_
45+
46+
Supported Features
47+
==================
48+
49+
.. zephyr:board-supported-hw::
50+
51+
Connections and IOs
52+
===================
53+
54+
Each of the GPIO pins can be configured by software as output (push-pull or open-drain), as
55+
input (with or without pull-up or pull-down), or as peripheral alternate function. Most of the
56+
GPIO pins are shared with digital or analog alternate functions. All GPIOs are high current
57+
capable except for analog inputs.
58+
59+
Default Zephyr Peripheral Mapping:
60+
----------------------------------
61+
62+
- CAN RX/TX/STBY: PD0/PD1/PD2
63+
- I2C1 SCL/SDA : PB8/PB9 (Arduino I2C)
64+
- LD1 : PA5
65+
- LD2 : PC9
66+
- SPI1 NSS/SCK/MISO/MOSI : PA15/PA5/PA6/PA7 (Arduino SPI)
67+
- UART_1 TX/RX : PB6/PB7 (Arduino Serial)
68+
- UART_2 TX/RX : PA2/PA3 (ST-Link Virtual Port Com)
69+
- USER_PB : PC13
70+
71+
72+
For more details please refer to `STM32 Nucleo-64 board User Manual`_.
73+
74+
Programming and Debugging
75+
*************************
76+
77+
.. zephyr:board-supported-runners::
78+
79+
Nucleo C092RC board includes an ST-LINK/V2-1 embedded debug tool interface.
80+
81+
Applications for the ``nucleo_c092rc`` board can be built and
82+
flashed in the usual way (see :ref:`build_an_application` and
83+
:ref:`application_run` for more details).
84+
85+
Flashing
86+
========
87+
88+
The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
89+
so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
90+
91+
Alternatively, an external JLink (Software and Documentation Package Version >= v8.12e)
92+
can also be used to flash the board using the ``--runner`` option:
93+
94+
.. code-block:: console
95+
96+
$ west flash --runner jlink
97+
98+
99+
Flashing an application to Nucleo C092RC
100+
----------------------------------------
101+
102+
Here is an example for the :zephyr:code-sample:`blinky` application.
103+
104+
.. zephyr-app-commands::
105+
:zephyr-app: samples/basic/blinky
106+
:board: nucleo_c092rc
107+
:goals: build flash
108+
109+
You will see the LED blinking every second.
110+
111+
References
112+
**********
113+
114+
.. target-notes::
115+
116+
.. _Nucleo C092RC website:
117+
https://www.st.com/en/evaluation-tools/nucleo-c092rc.html
118+
119+
.. _STM32C0x1 reference manual:
120+
https://www.st.com/resource/en/reference_manual/rm0490-stm32c0-series-advanced-armbased-32bit-mcus-stmicroelectronics.pdf
121+
122+
.. _STM32 Nucleo-64 board User Manual:
123+
https://www.st.com/resource/en/user_manual/um3353-stm32-nucleo64-board-mb2046-stmicroelectronics.pdf
124+
125+
.. _STM32CubeProgrammer:
126+
https://www.st.com/en/development-tools/stm32cubeprog.html
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
/*
2+
* Copyright (c) 2024 STMicroelectronics
3+
* Copyright (c) 2025 Thomas Stranger
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
/dts-v1/;
9+
#include <st/c0/stm32c092Xc.dtsi>
10+
#include <st/c0/stm32c092rctx-pinctrl.dtsi>
11+
#include "arduino_r3_connector.dtsi"
12+
#include <zephyr/dt-bindings/input/input-event-codes.h>
13+
14+
/ {
15+
model = "STMicroelectronics STM32C092RC-NUCLEO board";
16+
compatible = "st,stm32c092rc-nucleo";
17+
18+
chosen {
19+
zephyr,console = &usart2;
20+
zephyr,shell-uart = &usart2;
21+
zephyr,sram = &sram0;
22+
zephyr,flash = &flash0;
23+
zephyr,canbus = &fdcan1;
24+
};
25+
26+
leds: leds {
27+
compatible = "gpio-leds";
28+
29+
green_led_1: led_1 {
30+
gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>;
31+
label = "User LD1";
32+
};
33+
34+
blue_led: led_2 {
35+
gpios = <&gpioc 9 GPIO_ACTIVE_LOW>;
36+
label = "User LD2";
37+
};
38+
};
39+
40+
pwmleds {
41+
compatible = "pwm-leds";
42+
43+
green_pwm_led: green_pwm_led {
44+
pwms = <&pwm1 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
45+
};
46+
};
47+
48+
gpio_keys {
49+
compatible = "gpio-keys";
50+
51+
user_button: button {
52+
label = "user button";
53+
gpios = <&gpioc 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
54+
status = "okay";
55+
zephyr,code = <INPUT_KEY_0>;
56+
};
57+
};
58+
59+
transceiver0: can-phy0 {
60+
compatible = "microchip,mcp2562fd", "can-transceiver-gpio";
61+
standby-gpios = <&gpiod 2 GPIO_ACTIVE_HIGH>;
62+
max-bitrate = <5000000>;
63+
#phy-cells = <0>;
64+
};
65+
66+
aliases {
67+
led0 = &green_led_1;
68+
led1 = &blue_led;
69+
pwm-led0 = &green_pwm_led;
70+
sw0 = &user_button;
71+
watchdog0 = &iwdg;
72+
die-temp0 = &die_temp;
73+
volt-sensor0 = &vref;
74+
};
75+
};
76+
77+
&clk_lse {
78+
status = "okay";
79+
};
80+
81+
&clk_hse {
82+
clock-frequency = <DT_FREQ_M(48)>;
83+
status = "okay";
84+
};
85+
86+
&clk_hsi {
87+
status = "okay";
88+
};
89+
90+
&rcc {
91+
clocks = <&clk_hse>;
92+
clock-frequency = <DT_FREQ_M(48)>;
93+
ahb-prescaler = <1>;
94+
apb1-prescaler = <1>;
95+
};
96+
97+
&usart1 {
98+
pinctrl-0 = <&usart1_tx_pb6 &usart1_rx_pb7>;
99+
pinctrl-names = "default";
100+
current-speed = <115200>;
101+
status = "okay";
102+
};
103+
104+
&usart2 {
105+
pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
106+
pinctrl-names = "default";
107+
current-speed = <115200>;
108+
status = "okay";
109+
};
110+
111+
&rtc {
112+
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000400>,
113+
<&rcc STM32_SRC_LSE RTC_SEL(1)>;
114+
status = "okay";
115+
};
116+
117+
&iwdg {
118+
status = "okay";
119+
};
120+
121+
&timers1 {
122+
st,prescaler = <10000>;
123+
status = "okay";
124+
125+
pwm1: pwm {
126+
pinctrl-0 = <&tim1_ch1_pa5>;
127+
pinctrl-names = "default";
128+
status = "okay";
129+
};
130+
};
131+
132+
&i2c1 {
133+
pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
134+
pinctrl-names = "default";
135+
status = "okay";
136+
clock-frequency = <I2C_BITRATE_FAST>;
137+
};
138+
139+
&spi1 {
140+
/* Note: PA5 is shared with green led0 */
141+
pinctrl-0 = <&spi1_nss_pa15 &spi1_sck_pa5
142+
&spi1_miso_pa6 &spi1_mosi_pa7>;
143+
pinctrl-names = "default";
144+
status = "okay";
145+
};
146+
147+
&adc1 {
148+
pinctrl-0 = <&adc1_in0_pa0 &adc1_in1_pa1 &adc1_in4_pa4>;
149+
pinctrl-names = "default";
150+
st,adc-clock-source = "ASYNC";
151+
clocks = <&rcc STM32_CLOCK(APB1_2, 20U)>,
152+
<&rcc STM32_SRC_HSI ADC_SEL(2)>;
153+
st,adc-prescaler = <4>;
154+
status = "okay";
155+
vref-mv = <3300>;
156+
};
157+
158+
&die_temp {
159+
status = "okay";
160+
};
161+
162+
&vref {
163+
status = "okay";
164+
};
165+
166+
&dma1 {
167+
status = "okay";
168+
};
169+
170+
&dmamux1 {
171+
status = "okay";
172+
};
173+
174+
/* Make sure SB11, SB12, and SB13 are closed (default configuration).
175+
* Close JP9 to enable 120 Ohm termination on the board.
176+
*/
177+
&fdcan1 {
178+
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00001000>,
179+
<&rcc STM32_SRC_HSE FDCAN_SEL(2)>;
180+
pinctrl-0 = <&fdcan1_rx_pd0 &fdcan1_tx_pd1>;
181+
pinctrl-names = "default";
182+
phys = <&transceiver0>;
183+
status = "okay";
184+
};

0 commit comments

Comments
 (0)