Skip to content

Commit 4b46630

Browse files
committed
variant(u0): add Nucleo U083RC support
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 86c57ae commit 4b46630

File tree

4 files changed

+362
-0
lines changed

4 files changed

+362
-0
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
146146
| :green_heart: | STM32L452RE | [Nucleo L452RE](http://www.st.com/en/evaluation-tools/nucleo-l452re.html) | *1.5.0* | |
147147
| :green_heart: | STM32L452RE-P | [Nucleo L452RE-P](http://www.st.com/en/evaluation-tools/nucleo-l452re-p.html) | *1.8.0* | |
148148
| :green_heart: | STM32L476RG | [Nucleo L476RG](http://www.st.com/en/evaluation-tools/nucleo-l476rg.html) | *0.1.0* | |
149+
| :yellow_heart: | STM32U083RC | [Nucleo U083RC](http://www.st.com/en/evaluation-tools/nucleo-u083rc.html) | **2.9.0** | |
149150
| :green_heart: | STM32WB15CCU | [Nucleo-WB15CC](https://www.st.com/en/evaluation-tools/nucleo-wb15cc.html) | *2.5.0* | |
150151
| :green_heart: | STM32WBA55CGU | Nucleo-WBA55CG | *2.8.0* | |
151152
| :green_heart: | STM32WB55RG | [P-Nucleo-WB55RG](https://www.st.com/en/evaluation-tools/p-nucleo-wb55.html) | *1.6.0* | BLE support with [STM32duinoBLE](https://github.com/stm32duino/STM32duinoBLE) |

Diff for: boards.txt

+14
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,20 @@ Nucleo_64.menu.pnum.NUCLEO_L476RG.build.variant=STM32L4xx/L475R(C-E-G)T_L476R(C-
768768
Nucleo_64.menu.pnum.NUCLEO_L476RG.debug.server.openocd.scripts.2=target/stm32l4x.cfg
769769
Nucleo_64.menu.pnum.NUCLEO_L476RG.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L4xx/STM32L476.svd
770770

771+
# NUCLEO_U083RC board
772+
Nucleo_64.menu.pnum.NUCLEO_U083RC=Nucleo U083RC
773+
Nucleo_64.menu.pnum.NUCLEO_U083RC.node=NOD_U083RC
774+
Nucleo_64.menu.pnum.NUCLEO_U083RC.upload.maximum_size=262144
775+
Nucleo_64.menu.pnum.NUCLEO_U083RC.upload.maximum_data_size=40960
776+
Nucleo_64.menu.pnum.NUCLEO_U083RC.build.mcu=cortex-m0plus
777+
Nucleo_64.menu.pnum.NUCLEO_U083RC.build.board=NUCLEO_U083RC
778+
Nucleo_64.menu.pnum.NUCLEO_U083RC.build.series=STM32U0xx
779+
Nucleo_64.menu.pnum.NUCLEO_U083RC.build.product_line=STM32U083xx
780+
Nucleo_64.menu.pnum.NUCLEO_U083RC.build.variant=STM32U0xx/U073R(8-B-C)(I-T)_U083RC(I-T)
781+
Nucleo_64.menu.pnum.NUCLEO_U083RC.build.st_extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial} -D__CORTEX_SC=0
782+
Nucleo_64.menu.pnum.NUCLEO_U083RC.debug.server.openocd.scripts.2=target/stm32u0x.cfg
783+
Nucleo_64.menu.pnum.NUCLEO_U083RC.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U0xx/STM32U083.svd
784+
771785
# NUCLEO_WB15CC
772786
Nucleo_64.menu.pnum.NUCLEO_WB15CC=Nucleo WB15CC
773787
Nucleo_64.menu.pnum.NUCLEO_WB15CC.node="NOD_WB15CC"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
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_U083RC)
14+
#include "pins_arduino.h"
15+
16+
// Digital PinName array
17+
const PinName digitalPin[] = {
18+
PA_3, // D0
19+
PA_2, // D1
20+
PA_10, // D2
21+
PB_3, // D3
22+
PB_5, // D4
23+
PB_4, // D5
24+
PB_10, // D6
25+
PA_8, // D7
26+
PA_9, // D8
27+
PC_7, // D9
28+
PB_6, // D10/A6
29+
PA_7, // D11/A7
30+
PA_6, // D12/A8
31+
PA_5, // D13
32+
PB_9, // D14
33+
PB_8, // D15
34+
PA_0, // D16/A0
35+
PA_1, // D17/A1
36+
PA_4, // D18/A2
37+
PB_0, // D19/A3
38+
PC_1, // D20/A4
39+
PC_0, // D21/A5
40+
PC_10, // D22
41+
PC_12, // D23
42+
PA_13, // D24
43+
PA_14, // D25
44+
PA_15, // D26
45+
PB_7, // D27
46+
PC_13, // D28
47+
PC_14, // D29
48+
PC_15, // D30
49+
PF_0, // D31
50+
PF_1, // D32
51+
PC_2, // D33/A9
52+
PC_3, // D34/A10
53+
PC_11, // D35
54+
PD_2, // D36
55+
PC_9, // D37
56+
PC_8, // D38
57+
PC_6, // D39/A11
58+
PC_5, // D40
59+
PA_12, // D41
60+
PA_11, // D42
61+
PB_12, // D43
62+
PB_11, // D44
63+
PB_2, // D45
64+
PB_1, // D46/A12
65+
PB_15, // D47
66+
PB_14, // D48
67+
PB_13, // D49
68+
PC_4, // D50/A13
69+
PF_2, // D51
70+
PF_3 // D52
71+
};
72+
73+
// Analog (Ax) pin number array
74+
const uint32_t analogInputPin[] = {
75+
16, // A0, PA0
76+
17, // A1, PA1
77+
18, // A2, PA4
78+
19, // A3, PB0
79+
20, // A4, PC1
80+
21, // A5, PC0
81+
11, // A6, PA7
82+
12, // A7, PA6
83+
13, // A8, PA5
84+
33, // A9, PC2
85+
34, // A10, PC3
86+
40, // A11, PC5
87+
46, // A12, PB1
88+
50 // A13, PC4
89+
};
90+
91+
// ----------------------------------------------------------------------------
92+
93+
#ifdef __cplusplus
94+
extern "C" {
95+
#endif
96+
97+
/**
98+
* @brief System Clock Configuration
99+
* @param None
100+
* @retval None
101+
*/
102+
WEAK void SystemClock_Config(void)
103+
{
104+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
105+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
106+
RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
107+
108+
/** Configure the main internal regulator output voltage
109+
*/
110+
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);
111+
112+
/** Initializes the RCC Oscillators according to the specified parameters
113+
* in the RCC_OscInitTypeDef structure.
114+
*/
115+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSI48;
116+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
117+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
118+
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
119+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
120+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
121+
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1;
122+
RCC_OscInitStruct.PLL.PLLN = 7;
123+
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
124+
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2;
125+
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
126+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
127+
Error_Handler();
128+
}
129+
130+
/** Initializes the CPU, AHB and APB buses clocks
131+
*/
132+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
133+
| RCC_CLOCKTYPE_PCLK1;
134+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
135+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
136+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
137+
138+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
139+
Error_Handler();
140+
}
141+
142+
/** Initializes the peripherals clocks
143+
*/
144+
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_LPUART1 | RCC_PERIPHCLK_LPUART2
145+
| RCC_PERIPHCLK_LPUART3 | RCC_PERIPHCLK_USB;
146+
PeriphClkInit.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_HSI;
147+
PeriphClkInit.Lpuart2ClockSelection = RCC_LPUART2CLKSOURCE_HSI;
148+
PeriphClkInit.Lpuart3ClockSelection = RCC_LPUART3CLKSOURCE_HSI;
149+
PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
150+
151+
152+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
153+
Error_Handler();
154+
}
155+
156+
157+
}
158+
159+
#ifdef __cplusplus
160+
}
161+
#endif
162+
#endif /* ARDUINO_NUCLEO_U083RC */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
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 PA3 0 // Rx
19+
#define PA2 1 // Tx
20+
#define PA10 2
21+
#define PB3 3
22+
#define PB5 4
23+
#define PB4 5
24+
#define PB10 6
25+
#define PA8 7
26+
#define PA9 8
27+
#define PC7 9
28+
#define PB6 10
29+
#define PA7 PIN_A6
30+
#define PA6 PIN_A7
31+
#define PA5 PIN_A8
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 PC1 PIN_A4
39+
#define PC0 PIN_A5
40+
// Morpho
41+
// CN7 Left Side
42+
#define PC10 22
43+
#define PC12 23
44+
#define PA13 24 // SWDIO - NC by default SB15 off
45+
#define PA14 25 // SWCLK - NC by default SB17 off
46+
#define PA15 26
47+
#define PB7 27
48+
#define PC13 28 // USER_BTN
49+
#define PC14 29 // OSC32_IN - NC by default SB22 off
50+
#define PC15 30 // OSC32_OUT - NC by default SB24 off
51+
#define PF0 31
52+
#define PF1 32
53+
#define PC2 PIN_A9
54+
#define PC3 PIN_A10
55+
// CN7 Right Side
56+
#define PC11 35
57+
#define PD2 36
58+
// CN10 Left Side
59+
#define PC9 37
60+
// CN10 Right Side
61+
#define PC8 38
62+
#define PC6 39
63+
#define PC5 PIN_A11
64+
#define PA12 41
65+
#define PA11 42
66+
#define PB12 43
67+
#define PB11 44
68+
#define PB2 45
69+
#define PB1 PIN_A12
70+
#define PB15 47
71+
#define PB14 48
72+
#define PB13 49
73+
#define PC4 PIN_A13
74+
// Other
75+
#define PF2 51 // NRST
76+
#define PF3 52 // BOOT0
77+
78+
// Alternate pins number
79+
#define PA1_ALT1 (PA1 | ALT1)
80+
#define PA2_ALT1 (PA2 | ALT1)
81+
#define PA3_ALT1 (PA3 | ALT1)
82+
#define PA4_ALT1 (PA4 | ALT1)
83+
#define PA6_ALT1 (PA6 | ALT1)
84+
#define PA7_ALT1 (PA7 | ALT1)
85+
#define PA9_ALT1 (PA9 | ALT1)
86+
#define PA10_ALT1 (PA10 | ALT1)
87+
#define PA11_ALT1 (PA11 | ALT1)
88+
#define PA12_ALT1 (PA12 | ALT1)
89+
#define PA15_ALT1 (PA15 | ALT1)
90+
#define PB0_ALT1 (PB0 | ALT1)
91+
#define PB1_ALT1 (PB1 | ALT1)
92+
#define PB1_ALT2 (PB1 | ALT2)
93+
#define PB3_ALT1 (PB3 | ALT1)
94+
#define PB4_ALT1 (PB4 | ALT1)
95+
#define PB5_ALT1 (PB5 | ALT1)
96+
#define PB6_ALT1 (PB6 | ALT1)
97+
#define PB6_ALT2 (PB6 | ALT2)
98+
#define PB7_ALT1 (PB7 | ALT1)
99+
#define PB7_ALT2 (PB7 | ALT2)
100+
#define PB8_ALT1 (PB8 | ALT1)
101+
#define PB9_ALT1 (PB9 | ALT1)
102+
#define PB10_ALT1 (PB10 | ALT1)
103+
#define PB11_ALT1 (PB11 | ALT1)
104+
#define PB13_ALT1 (PB13 | ALT1)
105+
#define PB14_ALT1 (PB14 | ALT1)
106+
#define PB15_ALT1 (PB15 | ALT1)
107+
#define PC0_ALT1 (PC0 | ALT1)
108+
#define PC1_ALT1 (PC1 | ALT1)
109+
#define PC4_ALT1 (PC4 | ALT1)
110+
#define PC5_ALT1 (PC5 | ALT1)
111+
#define PC10_ALT1 (PC10 | ALT1)
112+
#define PC11_ALT1 (PC11 | ALT1)
113+
114+
#define NUM_DIGITAL_PINS 53
115+
#define NUM_ANALOG_INPUTS 14
116+
117+
// On-board LED pin number
118+
#ifndef LED_BUILTIN
119+
#define LED_BUILTIN PA5
120+
#endif
121+
#ifndef LED_GREEN
122+
#define LED_GREEN LED_BUILTIN
123+
#endif
124+
125+
126+
// On-board user button
127+
#ifndef USER_BTN
128+
#define USER_BTN PC13
129+
#endif
130+
131+
// Timer Definitions
132+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
133+
#ifndef TIMER_TONE
134+
#define TIMER_TONE TIM6
135+
#endif
136+
#ifndef TIMER_SERVO
137+
#define TIMER_SERVO TIM7
138+
#endif
139+
140+
// UART Definitions
141+
#ifndef SERIAL_UART_INSTANCE
142+
#define SERIAL_UART_INSTANCE 101
143+
#endif
144+
145+
// Default pin used for generic 'Serial' instance
146+
// Mandatory for Firmata
147+
#ifndef PIN_SERIAL_RX
148+
#define PIN_SERIAL_RX PA3
149+
#endif
150+
#ifndef PIN_SERIAL_TX
151+
#define PIN_SERIAL_TX PA2
152+
#endif
153+
154+
// Extra HAL modules
155+
#if !defined(HAL_DAC_MODULE_DISABLED)
156+
#define HAL_DAC_MODULE_ENABLED
157+
#endif
158+
159+
/*----------------------------------------------------------------------------
160+
* Arduino objects - C++ only
161+
*----------------------------------------------------------------------------*/
162+
163+
#ifdef __cplusplus
164+
// These serial port names are intended to allow libraries and architecture-neutral
165+
// sketches to automatically default to the correct port name for a particular type
166+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
167+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
168+
//
169+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
170+
//
171+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
172+
//
173+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
174+
//
175+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
176+
//
177+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
178+
// pins are NOT connected to anything by default.
179+
#ifndef SERIAL_PORT_MONITOR
180+
#define SERIAL_PORT_MONITOR Serial
181+
#endif
182+
#ifndef SERIAL_PORT_HARDWARE
183+
#define SERIAL_PORT_HARDWARE Serial
184+
#endif
185+
#endif

0 commit comments

Comments
 (0)