Skip to content

Commit 10d35ce

Browse files
facchinmcfriedt
authored andcommitted
boards: add Arduino UNO Q
Uses an STM32U585 microcontroller. Some drivers will need to be developed (led matrix, internal RPC) Signed-off-by: Martino Facchin <[email protected]> Signed-off-by: Luca Burelli <[email protected]>
1 parent 6ddb4aa commit 10d35ce

File tree

11 files changed

+503
-0
lines changed

11 files changed

+503
-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 Arduino SA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_ARDUINO_UNO_Q
5+
select SOC_STM32U585XX
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2025 Arduino SA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_ARDUINO_UNO_Q
5+
6+
config SPI_STM32_INTERRUPT
7+
default y
8+
depends on SPI
9+
10+
endif # BOARD_ARDUINO_UNO_Q
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright (c) 2025 Arduino SA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/gpio/arduino-header-r3.h>
8+
9+
/ {
10+
arduino_header: connector {
11+
compatible = "arduino-header-r3";
12+
#gpio-cells = <2>;
13+
gpio-map-mask = <0xffffffff 0xffffffc0>;
14+
gpio-map-pass-thru = <0 0x3f>;
15+
gpio-map = <ARDUINO_HEADER_R3_A0 0 &gpioa 4 0>,
16+
<ARDUINO_HEADER_R3_A1 0 &gpioa 5 0>,
17+
<ARDUINO_HEADER_R3_A2 0 &gpioa 6 0>,
18+
<ARDUINO_HEADER_R3_A3 0 &gpioa 7 0>,
19+
<ARDUINO_HEADER_R3_A4 0 &gpioc 1 0>,
20+
<ARDUINO_HEADER_R3_A5 0 &gpioc 0 0>,
21+
<ARDUINO_HEADER_R3_D0 0 &gpiob 7 0>,
22+
<ARDUINO_HEADER_R3_D1 0 &gpiob 6 0>,
23+
<ARDUINO_HEADER_R3_D2 0 &gpiob 3 0>,
24+
<ARDUINO_HEADER_R3_D3 0 &gpiob 0 0>,
25+
<ARDUINO_HEADER_R3_D4 0 &gpioa 12 0>,
26+
<ARDUINO_HEADER_R3_D5 0 &gpioa 11 0>,
27+
<ARDUINO_HEADER_R3_D6 0 &gpiob 1 0>,
28+
<ARDUINO_HEADER_R3_D7 0 &gpiob 2 0>,
29+
<ARDUINO_HEADER_R3_D8 0 &gpiob 4 0>,
30+
<ARDUINO_HEADER_R3_D9 0 &gpiob 8 0>,
31+
<ARDUINO_HEADER_R3_D10 0 &gpiob 9 0>,
32+
<ARDUINO_HEADER_R3_D11 0 &gpiob 15 0>,
33+
<ARDUINO_HEADER_R3_D12 0 &gpiob 14 0>,
34+
<ARDUINO_HEADER_R3_D13 0 &gpiob 13 0>;
35+
};
36+
};
37+
38+
arduino_spi: &spi2 {};
39+
40+
arduino_i2c: &i2c2 {};
41+
42+
arduino_serial: &usart1 {};
Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
/*
2+
* Copyright (c) 2021 Linaro Limited
3+
* Copyright (c) 2024 STMicroelectronics
4+
* Copyright (c) 2025 Arduino SA
5+
*
6+
* SPDX-License-Identifier: Apache-2.0
7+
*/
8+
9+
#include <st/u5/stm32u585Xi.dtsi>
10+
#include <st/u5/stm32u585aiixq-pinctrl.dtsi>
11+
#include "arduino_r3_connector.dtsi"
12+
#include <zephyr/dt-bindings/input/input-event-codes.h>
13+
14+
/ {
15+
leds {
16+
compatible = "gpio-leds";
17+
18+
led3_red: led3_red {
19+
gpios = <&gpioh 10 GPIO_ACTIVE_LOW>;
20+
label = "RGB LED 3 Red";
21+
};
22+
23+
led3_green: led3_green {
24+
gpios = <&gpioh 11 GPIO_ACTIVE_LOW>;
25+
label = "RGB LED 3 Green";
26+
};
27+
28+
led3_blue: led3_blue {
29+
gpios = <&gpioh 12 GPIO_ACTIVE_LOW>;
30+
label = "RGB LED 3 Blue";
31+
};
32+
33+
led4_red: led4_red {
34+
gpios = <&gpioh 13 GPIO_ACTIVE_LOW>;
35+
label = "RGB LED 4 Red";
36+
};
37+
38+
led4_green: led4_green {
39+
gpios = <&gpioh 14 GPIO_ACTIVE_LOW>;
40+
label = "RGB LED 4 Green";
41+
};
42+
43+
led4_blue: led4_blue {
44+
gpios = <&gpioh 15 GPIO_ACTIVE_LOW>;
45+
label = "RGB LED 4 Blue";
46+
};
47+
};
48+
49+
aliases {
50+
watchdog0 = &iwdg;
51+
die-temp0 = &die_temp;
52+
volt-sensor0 = &vref1;
53+
volt-sensor1 = &vbat4;
54+
};
55+
};
56+
57+
&clk_hsi48 {
58+
status = "okay";
59+
};
60+
61+
&clk_hse {
62+
clock-frequency = <DT_FREQ_M(16)>;
63+
status = "okay";
64+
};
65+
66+
&clk_lse {
67+
clock-frequency = <32768>;
68+
status = "okay";
69+
};
70+
71+
&clk_msis {
72+
status = "okay";
73+
msi-range = <4>;
74+
msi-pll-mode;
75+
};
76+
77+
&pll1 {
78+
div-m = <1>;
79+
mul-n = <80>;
80+
div-q = <2>;
81+
div-r = <2>;
82+
clocks = <&clk_msis>;
83+
status = "okay";
84+
};
85+
86+
&rcc {
87+
clocks = <&pll1>;
88+
clock-frequency = <DT_FREQ_M(160)>;
89+
ahb-prescaler = <1>;
90+
apb1-prescaler = <1>;
91+
apb2-prescaler = <1>;
92+
apb3-prescaler = <1>;
93+
};
94+
95+
stm32_lp_tick_source: &lptim1 {
96+
clocks = <&rcc STM32_CLOCK(APB3, 11)>,
97+
<&rcc STM32_SRC_LSE LPTIM1_SEL(3)>;
98+
status = "okay";
99+
};
100+
101+
&lpuart1 {
102+
pinctrl-0 = <&lpuart1_tx_pg7 &lpuart1_rx_pg8 &lpuart1_rts_pg6 &lpuart1_cts_pg5>;
103+
pinctrl-names = "default";
104+
current-speed = <115200>;
105+
status = "okay";
106+
};
107+
108+
&usart1 {
109+
status = "okay";
110+
pinctrl-0 = <&usart1_tx_pb6 &usart1_rx_pb7>;
111+
pinctrl-names = "default";
112+
current-speed = <115200>;
113+
};
114+
115+
&i2c2 {
116+
status = "okay";
117+
pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>;
118+
pinctrl-names = "default";
119+
clock-frequency = <I2C_BITRATE_FAST>;
120+
};
121+
122+
&i2c4 {
123+
status = "okay";
124+
pinctrl-0 = <&i2c4_scl_pd12 &i2c4_sda_pd13>;
125+
/* use <&i2c4_scl_pf14 &i2c4_sda_pf15> for the JMISC connector */
126+
pinctrl-names = "default";
127+
clock-frequency = <I2C_BITRATE_FAST>;
128+
};
129+
130+
&spi2 {
131+
status = "okay";
132+
pinctrl-0 = <&spi2_sck_pb13 &spi2_miso_pb14 &spi2_mosi_pb15 &spi2_nss_pb9>;
133+
/* use <&spi2_sck_pd1 &spi2_miso_pc2 &spi2_mosi_pc3> for the ICSP connector */
134+
pinctrl-names = "default";
135+
};
136+
137+
&spi3 {
138+
status = "okay";
139+
pinctrl-0 = <&spi3_sck_pg9 &spi3_miso_pg10 &spi3_mosi_pb5 &spi3_nss_pg12>;
140+
pinctrl-names = "default";
141+
};
142+
143+
&aes {
144+
status = "okay";
145+
};
146+
147+
&rng {
148+
status = "okay";
149+
};
150+
151+
zephyr_udc0: &usbotg_fs {
152+
pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
153+
pinctrl-names = "default";
154+
status = "disabled";
155+
};
156+
157+
&adc1 {
158+
pinctrl-0 = <&adc1_in9_pa4
159+
&adc1_in10_pa5
160+
&adc1_in11_pa6
161+
&adc1_in12_pa7
162+
&adc1_in2_pc1
163+
&adc1_in1_pc0>;
164+
pinctrl-names = "default";
165+
status = "okay";
166+
167+
#address-cells = <1>;
168+
#size-cells = <0>;
169+
170+
channel@1 {
171+
reg = <1>;
172+
zephyr,gain = "ADC_GAIN_1";
173+
zephyr,reference = "ADC_REF_INTERNAL";
174+
zephyr,acquisition-time = <ADC_ACQ_TIME_MAX>;
175+
zephyr,resolution = <14>;
176+
};
177+
178+
channel@2 {
179+
reg = <2>;
180+
zephyr,gain = "ADC_GAIN_1";
181+
zephyr,reference = "ADC_REF_INTERNAL";
182+
zephyr,acquisition-time = <ADC_ACQ_TIME_MAX>;
183+
zephyr,resolution = <14>;
184+
};
185+
186+
channel@9 {
187+
reg = <9>;
188+
zephyr,gain = "ADC_GAIN_1";
189+
zephyr,reference = "ADC_REF_INTERNAL";
190+
zephyr,acquisition-time = <ADC_ACQ_TIME_MAX>;
191+
zephyr,resolution = <14>;
192+
};
193+
194+
channel@a {
195+
reg = <10>;
196+
zephyr,gain = "ADC_GAIN_1";
197+
zephyr,reference = "ADC_REF_INTERNAL";
198+
zephyr,acquisition-time = <ADC_ACQ_TIME_MAX>;
199+
zephyr,resolution = <14>;
200+
};
201+
202+
channel@b {
203+
reg = <11>;
204+
zephyr,gain = "ADC_GAIN_1";
205+
zephyr,reference = "ADC_REF_INTERNAL";
206+
zephyr,acquisition-time = <ADC_ACQ_TIME_MAX>;
207+
zephyr,resolution = <14>;
208+
};
209+
210+
channel@c {
211+
reg = <12>;
212+
zephyr,gain = "ADC_GAIN_1";
213+
zephyr,reference = "ADC_REF_INTERNAL";
214+
zephyr,acquisition-time = <ADC_ACQ_TIME_MAX>;
215+
zephyr,resolution = <14>;
216+
};
217+
};
218+
219+
&adc4 {
220+
/* needed by vbat */
221+
st,adc-clock-source = "ASYNC";
222+
st,adc-prescaler = <4>;
223+
status = "okay";
224+
};
225+
226+
&die_temp {
227+
status = "okay";
228+
};
229+
230+
&dac1 {
231+
pinctrl-0 = <&dac1_out1_pa4 &dac1_out2_pa5>;
232+
pinctrl-names = "default";
233+
status = "okay";
234+
};
235+
236+
&rtc {
237+
clocks = <&rcc STM32_CLOCK(APB3, 21)>,
238+
<&rcc STM32_SRC_LSE RTC_SEL(1)>;
239+
status = "okay";
240+
};
241+
242+
&iwdg {
243+
status = "okay";
244+
};
245+
246+
&vref1 {
247+
status = "okay";
248+
};
249+
250+
&vbat4 {
251+
status = "okay";
252+
};
253+
254+
&gpiog {
255+
status = "okay";
256+
};
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Copyright (c) 2025 Arduino SA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include "arduino_uno_q-common.dtsi"
9+
#include <zephyr/dt-bindings/memory-attr/memory-attr.h>
10+
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>
11+
12+
/ {
13+
model = "Arduino UNO Q";
14+
compatible = "arduino,uno_q";
15+
16+
chosen {
17+
zephyr,console = &usart1;
18+
zephyr,shell-uart = &usart1;
19+
zephyr,sram = &sram0;
20+
zephyr,flash = &flash0;
21+
zephyr,code-partition = &slot0_partition;
22+
};
23+
24+
aliases {
25+
led0 = &led3_green;
26+
led1 = &led3_red;
27+
die-temp0 = &die_temp;
28+
};
29+
};
30+
31+
&flash0 {
32+
partitions {
33+
compatible = "fixed-partitions";
34+
#address-cells = <1>;
35+
#size-cells = <1>;
36+
37+
/*
38+
* Following flash partition is dedicated to the use of stm32u585
39+
* with TZEN=0 (so w/o TFM).
40+
* Set the partitions with first MB to make use of the whole Bank1
41+
*/
42+
boot_partition: partition@0 {
43+
label = "mcuboot";
44+
reg = <0x00000000 DT_SIZE_K(64)>;
45+
};
46+
47+
slot0_partition: partition@10000 {
48+
label = "image-0";
49+
reg = <0x00010000 DT_SIZE_K(416)>;
50+
};
51+
52+
slot1_partition: partition@78000 {
53+
label = "image-1";
54+
reg = <0x00078000 DT_SIZE_K(416)>;
55+
};
56+
57+
storage_partition: partition@f0000 {
58+
label = "storage";
59+
reg = <0x000e0000 DT_SIZE_K(128)>;
60+
};
61+
};
62+
};
63+
64+
&gpdma1 {
65+
status = "okay";
66+
};
67+
68+
&adc1 {
69+
st,adc-prescaler = <4>;
70+
status = "okay";
71+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
identifier: arduino_uno_q
2+
name: Arduino UNO Q
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
ram: 786
9+
flash: 2048
10+
vendor: arduino

0 commit comments

Comments
 (0)