Skip to content

Commit da2819e

Browse files
JohnK1987Jan Kamidra
andauthored
Add new STM32U0 family and new target Nucleo-U083RC (#445)
* Add & prepare STM32U0 HALs * add first clock for stm32u083 * add stm32u083xc target * add Nucleo-U083RC as new target * add necessary files for basic stm32u0 port * edit STM files for stm32u0 * update clock * update Vector Num * update timer to TIM2 as OS timer * fix app start * edit pin maps & gpio irq * update startup file * add ADC and DAC * add PWM * add additional APIs * Necessary fixes * Fix FlashIAP * Add initial SPI and I2C * initial USB modification * I2C remove * Some fixes * fix wrong symbol for stylecheck * add basic HSE clock settings * Copyright * fix DMA files * remove timing algo * add macro ARDUINO_UNO * add wmi to requirements for usb tests * Fix clock limitation sentence --------- Co-authored-by: Jan Kamidra <[email protected]>
1 parent e420c07 commit da2819e

File tree

198 files changed

+216397
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+216397
-13
lines changed

targets/TARGET_STM/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ add_subdirectory(TARGET_STM32L0 EXCLUDE_FROM_ALL)
1515
add_subdirectory(TARGET_STM32L1 EXCLUDE_FROM_ALL)
1616
add_subdirectory(TARGET_STM32L4 EXCLUDE_FROM_ALL)
1717
add_subdirectory(TARGET_STM32L5 EXCLUDE_FROM_ALL)
18+
add_subdirectory(TARGET_STM32U0 EXCLUDE_FROM_ALL)
1819
add_subdirectory(TARGET_STM32U5 EXCLUDE_FROM_ALL)
1920
add_subdirectory(TARGET_STM32WB EXCLUDE_FROM_ALL)
2021
add_subdirectory(TARGET_STM32WL EXCLUDE_FROM_ALL)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright (c) 2025 Jan Kamidra
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_subdirectory(STM32Cube_FW EXCLUDE_FROM_ALL)
5+
add_subdirectory(TARGET_STM32U083xC EXCLUDE_FROM_ALL)
6+
7+
add_library(mbed-stm32u0 INTERFACE)
8+
9+
target_sources(mbed-stm32u0
10+
INTERFACE
11+
clock_cfg/system_clock.c
12+
analogin_device.c
13+
analogout_device.c
14+
flash_api.c
15+
gpio_irq_device.c
16+
i2c_device.c
17+
spi_api.c
18+
pwmout_device.c
19+
serial_device.c
20+
)
21+
22+
target_include_directories(mbed-stm32u0
23+
INTERFACE
24+
.
25+
)
26+
27+
target_link_libraries(mbed-stm32u0 INTERFACE mbed-stm mbed-stm32u0cube-fw)
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
/* mbed Microcontroller Library
2+
* SPDX-License-Identifier: BSD-3-Clause
3+
******************************************************************************
4+
*
5+
* Copyright (c) 2015-2025 STMicroelectronics.
6+
* All rights reserved.
7+
*
8+
* This software component is licensed by ST under BSD 3-Clause license,
9+
* the "License"; You may not use this file except in compliance with the
10+
* License. You may obtain a copy of the License at:
11+
* opensource.org/licenses/BSD-3-Clause
12+
*
13+
******************************************************************************
14+
*/
15+
16+
#ifndef MBED_PERIPHERALNAMES_H
17+
#define MBED_PERIPHERALNAMES_H
18+
19+
#include "cmsis.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
typedef enum {
26+
ADC_1 = (int)ADC1_BASE,
27+
} ADCName;
28+
29+
typedef enum {
30+
DAC_1 = (int)DAC1_BASE,
31+
} DACName;
32+
33+
typedef enum {
34+
UART_1 = (int)USART1_BASE,
35+
UART_2 = (int)USART2_BASE,
36+
#if USART3_BASE
37+
UART_3 = (int)USART3_BASE,
38+
#endif
39+
#if USART4_BASE
40+
UART_4 = (int)USART4_BASE,
41+
#endif
42+
LPUART_1 = (int)LPUART1_BASE,
43+
#if LPUART2_BASE
44+
LPUART_2 = (int)LPUART2_BASE,
45+
#endif
46+
#if LPUART3_BASE
47+
LPUART_3 = (int)LPUART3_BASE,
48+
#endif
49+
} UARTName;
50+
51+
#define DEVICE_SPI_COUNT 3
52+
typedef enum {
53+
SPI_1 = (int)SPI1_BASE,
54+
#if SPI2_BASE
55+
SPI_2 = (int)SPI2_BASE,
56+
#endif
57+
#if SPI3_BASE
58+
SPI_3 = (int)SPI3_BASE,
59+
#endif
60+
} SPIName;
61+
62+
typedef enum {
63+
I2C_1 = (int)I2C1_BASE,
64+
#if I2C3_BASE
65+
I2C_2 = (int)I2C2_BASE,
66+
#endif
67+
#if I2C3_BASE
68+
I2C_3 = (int)I2C3_BASE,
69+
#endif
70+
#if I2C4_BASE
71+
I2C_4 = (int)I2C4_BASE,
72+
#endif
73+
} I2CName;
74+
75+
typedef enum {
76+
#if TIM1_BASE
77+
PWM_1 = (int)TIM1_BASE,
78+
#endif
79+
#if TIM2_BASE
80+
PWM_2 = (int)TIM2_BASE,
81+
#endif
82+
#if TIM3_BASE
83+
PWM_3 = (int)TIM3_BASE,
84+
#endif
85+
#if TIM4_BASE
86+
PWM_4 = (int)TIM4_BASE,
87+
#endif
88+
#if TIM5_BASE
89+
PWM_5 = (int)TIM5_BASE,
90+
#endif
91+
#if TIM6_BASE
92+
PWM_6 = (int)TIM6_BASE,
93+
#endif
94+
#if TIM7_BASE
95+
PWM_7 = (int)TIM7_BASE,
96+
#endif
97+
#if TIM8_BASE
98+
PWM_8 = (int)TIM8_BASE,
99+
#endif
100+
#if TIM9_BASE
101+
PWM_9 = (int)TIM9_BASE,
102+
#endif
103+
#if TIM10_BASE
104+
PWM_10 = (int)TIM10_BASE,
105+
#endif
106+
#if TIM11_BASE
107+
PWM_11 = (int)TIM11_BASE,
108+
#endif
109+
#if TIM12_BASE
110+
PWM_12 = (int)TIM12_BASE,
111+
#endif
112+
#if TIM13_BASE
113+
PWM_13 = (int)TIM13_BASE,
114+
#endif
115+
#if TIM14_BASE
116+
PWM_14 = (int)TIM14_BASE,
117+
#endif
118+
#if TIM15_BASE
119+
PWM_15 = (int)TIM15_BASE,
120+
#endif
121+
#if TIM16_BASE
122+
PWM_16 = (int)TIM16_BASE,
123+
#endif
124+
} PWMName;
125+
126+
typedef enum {
127+
USB_FS = (int)USB_DRD_BASE
128+
} USBName;
129+
130+
131+
#ifdef __cplusplus
132+
}
133+
#endif
134+
135+
#endif

0 commit comments

Comments
 (0)