8000 variant(c0): add Nucleo-C092RBT · stm32duino/Arduino_Core_STM32@c577008 · GitHub
[go: up one dir, main page]

Skip to content

Commit c577008

Browse files
committed
variant(c0): add Nucleo-C092RBT
Co-authored-by: Frederic Pillon <frederic.pillon@st.com> Signed-off-by: Hugo <10338882+showengineer@users.noreply.github.com>
1 parent a1bed6a commit c577008

File tree

5 files changed

+368
-0
lines changed

5 files changed

+368
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
129129
| :----: | :-------: | ---- | :-----: | :---- |
130130
| :green_heart: | STM32C031C6 | [Nucleo C031C6](https://www.st.com/en/evaluation-tools/nucleo-c031c6.html) | *2.5.0* | |
131131
| :green_heart: | STM32C071RB | [Nucleo C071RB](https://www.st.com/en/evaluation-tools/nucleo-c071rb.html) | *2.9.0* | |
132+
| :yellow_heart: | STM32C092RC | [Nucleo C092RC](https://www.st.com/en/evaluation-tools/nucleo-c092rc.html)| **2.11.0** | |
132133
| :green_heart: | STM32F030R8 | [Nucleo F030R8](http://www.st.com/en/evaluation-tools/nucleo-f030r8.html) | *0.2.0* | |
133134
| :green_heart: | STM32F070RB | [Nucleo F070RB](http://www.st.com/en/evaluation-tools/nucleo-f070rb.html) | *2.0.0* | |
134135
| :green_heart: | STM32F072RB | [Nucleo F072RB](http://www.st.com/en/evaluation-tools/nucleo-f072rb.html) | *1.9.0* | |

boards.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,20 @@ Nucleo_64.menu.pnum.NUCLEO_C071RB.build.st_extra_flags=-D{build.product_line} {b
492492
Nucleo_64.menu.pnum.NUCLEO_C071RB.openocd.target=stm32c0x
493493
Nucleo_64.menu.pnum.NUCLEO_C071RB.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32C0xx/STM32C071.svd
494494

495+
# NUCLEO_C092RC board
496+
Nucleo_64.menu.pnum.NUCLEO_C092RC=Nucleo C092RC
497+
Nucleo_64.menu.pnum.NUCLEO_C092RC.node="NOD_C092RC"
498+
Nucleo_64.menu.pnum.NUCLEO_C092RC.upload.maximum_size=262144
499+
Nucleo_64.menu.pnum.NUCLEO_C092RC.upload.maximum_data_size=30720
500+
Nucleo_64.menu.pnum.NUCLEO_C092RC.build.mcu=cortex-m0plus
501+
Nucleo_64.menu.pnum.NUCLEO_C092RC.build.board=NUCLEO_C092RC
502+
Nucleo_64.menu.pnum.NUCLEO_C092RC.build.series=STM32C0xx
503+
Nucleo_64.menu.pnum.NUCLEO_C092RC.build.product_line=STM32C092xx
504+
Nucleo_64.menu.pnum.NUCLEO_C092RC.build.variant=STM32C0xx/C092CBT_C092RBT_C092RC(I-T)
505+
Nucleo_64.menu.pnum.NUCLEO_C092RC.build.st_extra_flags=-DSTM32C092xx {build.xSerial} -D__CORTEX_SC=0
506+
Nucleo_64.menu.pnum.NUCLEO_C092RC.openocd.target=stm32c0x
507+
Nucleo_64.menu.pnum.NUCLEO_C092RC.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32C0xx/STM32C092.svd
508+
495509
# NUCLEO_F030R8 board
496510
Nucleo_64.menu.pnum.NUCLEO_F030R8=Nucleo F030R8
497511
Nucleo_64.menu.pnum.NUCLEO_F030R8.node="NODE_F030R8,NUCLEO"

variants/STM32C0xx/C092CBT_C092RBT_C092RC(I-T)/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ target_link_libraries(variant INTERFACE variant_usage)
2121
add_library(variant_bin STATIC EXCLUDE_FROM_ALL
2222
generic_clock.c
2323
PeripheralPins.c
24+
PeripheralPins_NUCLEO_C092RC.c
2425
variant_generic.cpp
26+
variant_NUCLEO_C092RC.cpp
2527
)
2628
target_link_libraries(variant_bin PUBLIC variant_usage)
2729

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2024, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
#if defined(ARDUINO_NUCLEO_C092RC)
14+
#include "pins_arduino.h"
15+
#include "stm32yyxx_ll_utils.h"
16+
17+
// Digital PinName array
18+
const PinName digitalPin[] = {
19+
PB_7, // D0
20+
PB_6, // D1
21+
PA_10, // D2
22+
PC_7, // D3
23+
PB_5, // D4
24+
PB_4, // D5
25+
PC_8, // D6
26+
PA_8, // D7/A6
27+
PA_9, // D8
28+
PB_3, // D9
29+
PA_15, // D10
30+
PA_7, // D11/A7
31+
PA_6, // D12/A8
32+
PA_5, // D13/A9
33+
PB_9, // D14
34+
PB_8, // D15
35+
PA_0, // D16/A0
36+
PA_1, // D17/A1
37+
PA_4, // D18/A2
38+
PB_0, // D19/A3
39+
PC_4, // D20/A4
40+
PC_5, // D21/A5
41+
PC_10, // D22
42+
PC_12, // D23
43+
PD_4, // D24
44+
PD_0, // D25
45+
PD_3, // D26
46+
PA_13, // D27
47+
PA_14, // D28
48+
PC_6, // D29
49+
PC_2, // D30
50+
PC_13, // D31
51+
PC_14, // D32
52+
PC_15, // D33
53+
PF_0, // D34
54+
PF_1, // D35
55+
PF_3, // D36
56+
PB_2, // D37/A10
57+
PB_11, // D38/A11
58+
PC_11, // D39
59+
PD_2, // D40
60+
PD_1, // D41
61+
PF_2, // D42
62+
PD_5, // D43
63+
PC_3, // D44
64+
PC_9, // D45
65+
PC_1, // D46
66+
PA_3, // D47
67+
PD_6, // D48
68+
PA_12, // D49
69+
PA_11, // D50
70+
PB_12, // D51/A12
71+
PA_2, // D52
72+
PC_0, // D53
73+
PB_1, // D54/A13
74+
PB_15, // D55
75+
PB_14, // D56
76+
PB_13, // D57
77+
PB_10, // D58/A14
78+
PD_8, // D59
79+
PD_9, // D60
80+
PA_9_R, // D61
81+
PA_10_R // D62
82+
};
83+
84+
// Analog (Ax) pin number array
85+
const uint32_t analogInputPin[] = {
86+
16, // A0, PA0
87+
17, // A1, PA1
88+
18, // A2, PA4
89+
19, // A3, PB0
90+
20, // A4, PC4
91+
21, // A5, PC5
92+
7, // A6, PA8
93+
11, // A7, PA7
94+
12, // A8, PA6
95+
13, // A9, PA5
96+
37, // A10, PB2
97+
38, // A11, PB11
98+
51, // A12, PB12
99+
54, // A13, PB1
100+
58 // A14, PB10
101+
};
102+
103+
// ----------------------------------------------------------------------------
104+
#ifdef __cplusplus
105+
extern "C" {
106+
#endif
107+
108+
/**
109+
* @brief System Clock Configuration
110+
* @retval None
111+
*/
112+
void SystemClock_Config(void)
113+
{
114+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
115+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
116+
117+
__HAL_FLASH_SET_LATENCY(FLASH_LATENCY_1);
118+
119+
/** Initializes the RCC Oscillators according to the specified parameters
120+
* in the RCC_OscInitTypeDef structure.
121+
*/
122+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
123+
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
124+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
125+
Error_Handler();
126+
}
127+
128+
/** Initializes the CPU, AHB and APB buses clocks
129+
*/
130+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
131+
| RCC_CLOCKTYPE_PCLK1;
132+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE;
133+
RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
134+
RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1;
135+
RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV1;
136+
137+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) {
138+
Error_Handler();
139+
}
140+
}
141+
142+
143+
#ifdef __cplusplus
144+
}
145+
#endif
146+
#endif /* ARDUINO_NUCLEO_C092RC */
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2024, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
#pragma once
14+
15+
/*----------------------------------------------------------------------------
16+
* STM32 pins number
17+
*----------------------------------------------------------------------------*/
18+
#define PB7 0
19+
#define PB6 1
20+
#define PA10 2
21+
#define PC7 3
22+
#define PB5 4
23+
#define PB4 5
24+
#define PC8 6
25+
#define PA8 PIN_A6
26+
#define PA9 8
27+
#define PB3 9
28+
#define PA15 10
29+
#define PA7 PIN_A7
30+
#define PA6 PIN_A8
31+
#define PA5 PIN_A9 // LED1
32+
#define PB9 14
33+
#define PB8 15
34+
#define PA0 PIN_A0
35+
#define PA1 PIN_A1
36+
#define PA4 PIN_A2
37+
#define PB0 PIN_A3
38+
#define PC4 PIN_A4
39+
#define PC5 PIN_A5
40+
// ST Morpho
41+
// CN7 Left Side
42+
#define PC10 22
43+
#define PC12 23
44+
#define PD4 24
45+
#define PD0 25
46+
#define PD3 26
47+
#define PA13 27 // SWD
48+
#define PA14 28 // SWD
49+
#define PC6 29
50+
#define PC2 30 // FDCAN_RX
51+
#define PC13 31 // USER_BTN
52+
#define PC14 32 // OSCX_IN
53+
#define PC15 33 // OSCX_OUT
54+
#define PF0 34 // OSC_IN
55+
#define PF1 35 // OSC_OUT
56+
#define PF3 36 // VBAT
57+
#define PB2 PIN_A10
58+
#define PB11 PIN_A11
59+
// CN7 Right Side
60+
#define PC11 39
61+
#define PD2 40
62+
#define PD1 41
63+
#define PF2 42 // NRST
64+
#define PD5 43
65+
// CN10 Left Side
66+
#define PC3 44 // FDCAN_TX
67+
// CN10 Right side
68+
#define PC9 45 // LED2
69+
#define PC1 46
70+
#define PA3 47 // RX
71+
#define PD6 48
72+
#define PA12 49
73+
#define PA11 50
74+
#define PB12 PIN_A12
75+
#define PA2 52 // TX
76+
#define PC0 53
77+
#define PB1 PIN_A13
78+
#define PB15 55
79+
#define PB14 56
80+
#define PB13 57
81+
#define PB10 PIN_A14
82+
#define PD8 59
83+
#define PD9 60
84+
#define PA9_R 61
85+
#define PA10_R 62
86+
87+
// Alternate pins number
88+
#define PA0_ALT1 (PA0 | ALT1)
89+
#define PA0_ALT2 (PA0 | ALT2)
90+
#define PA1_ALT1 (PA1 | ALT1)
91+
#define PA1_ALT2 (PA1 | ALT2)
92 10000 +
#define PA2_ALT1 (PA2 | ALT1)
93+
#define PA2_ALT2 (PA2 | ALT2)
94+
#define PA3_ALT1 (PA3 | ALT1)
95+
#define PA3_ALT2 (PA3 | ALT2)
96+
#define PA4_ALT1 (PA4 | ALT1)
97+
#define PA4_ALT2 (PA4 | ALT2)
98+
#define PA5_ALT1 (PA5 | ALT1)
99+
#define PA5_ALT2 (PA5 | ALT2)
100+
#define PA6_ALT1 (PA6 | ALT1)
101+
#define PA7_ALT1 (PA7 | ALT1)
102+
#define PA7_ALT2 (PA7 | ALT2)
103+
#define PA7_ALT3 (PA7 | ALT3)
104+
#define PA8_ALT1 (PA8 | ALT1)
105+
#define PA8_ALT2 (PA8 | ALT2)
106+
#define PA8_ALT3 (PA8 | ALT3)
107+
#define PA8_ALT4 (PA8 | ALT4)
108+
#define PA8_ALT5 (PA8 | ALT5)
109+
#define PA9_ALT1 (PA9 | ALT1)
110+
#define PA10_ALT1 (PA10 | ALT1)
111+
#define PA15_ALT1 (PA15 | ALT1)
112+
#define PB0_ALT1 (PB0 | ALT1)
113+
#define PB1_ALT1 (PB1 | ALT1)
114+
#define PB1_ALT2 (PB1 | ALT2)
115+
#define PB1_ALT3 (PB1 | ALT3)
116+
#define PB3_ALT1 (PB3 | ALT1)
117+
#define PB3_ALT2 (PB3 | ALT2)
118+
#define PB5_ALT1 (PB5 | ALT1)
119+
#define PB6_ALT1 (PB6 | ALT1)
120+
#define PB6_ALT2 (PB6 | ALT2)
121+
#define PB6_ALT3 (PB6 | ALT3)
122+
#define PB6_ALT4 (PB6 | ALT4)
123+
#define PB6_ALT5 (PB6 | ALT5)
124+
#define PB7_ALT1 (PB7 | ALT1)
125+
#define PB7_ALT2 (PB7 | ALT2)
126+
#define PB7_ALT3 (PB7 | ALT3)
127+
#define PB7_ALT4 (PB7 | ALT4)
128+
#define PB8_ALT1 (PB8 | ALT1)
129+
#define PB9_ALT1 (PB9 | ALT1)
130+
#define PC6_ALT1 (PC6 | ALT1)
131+
#define PC7_ALT1 (PC7 | ALT1)
132+
#define PC8_ALT1 (PC8 | ALT1)
133+
#define PC9_ALT1 (PC9 | ALT1)
134+
#define PC14_ALT1 (PC14 | ALT1)
135+
136+
#define NUM_DIGITAL_PINS 63
137+
#define NUM_REMAP_PINS 2
138+
#define NUM_ANALOG_INPUTS 15
139+
140+
// On-board LED pin number
141+
#define LED1 PA5
142+
#define LED2 PC9
143+
#define LED_GREEN LED1
144+
#define LED_BLUE LED2
145+
#ifndef LED_BUILTIN
146+
#define LED_BUILTIN LED_GREEN
147+
#endif
148+
149+
// On-board user button
150+
#ifndef USER_BTN
151+
#define USER_BTN PC13
152+
#endif
153+
154+
// Timer Definitions
155+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
156+
#ifndef TIMER_TONE
157+
#define TIMER_TONE TIM14
158+
#endif
159+
#ifndef TIMER_SERVO
160+
#define TIMER_SERVO TIM16
161+
#endif
162+
163+
// UART Definitions
164+
#ifndef SERIAL_UART_INSTANCE
165+
#define SERIAL_UART_INSTANCE 2
166+
#endif
167+
168+
// Default pin used for generic 'Serial' instance
169+
// Mandatory for Firmata
170+
#ifndef PIN_SERIAL_RX
171+
#define PIN_SERIAL_RX PA3
172+
#endif
173+
#ifndef PIN_SERIAL_TX
174+
#define PIN_SERIAL_TX PA2
175+
#endif
176+
177+
#define HSE_VALUE (48000000U) /*!< Value of the External oscillator in Hz */
178+
179+
/*----------------------------------------------------------------------------
180+
* Arduino objects - C++ only
181+
*----------------------------------------------------------------------------*/
182+
183+
#ifdef __cplusplus
184+
// These serial port names are intended to allow libraries and architecture-neutral
185+
// sketches to automatically default to the correct port name for a particular type
186+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
187+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
188+
//
189+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
190+
//
191+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
192+
//
193+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
194+
//
195+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
196+
//
197+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
198+
// pins are NOT connected to anything by default.
199+
#ifndef SERIAL_PORT_MONITOR
200+
#define SERIAL_PORT_MONITOR Serial
201+
#endif
202+
#ifndef SERIAL_PORT_HARDWARE
203+
#define SERIAL_PORT_HARDWARE Serial
204+
#endif
205+
#endif

0 commit comments

Comments
 (0)
0