Skip to content

Commit 94c74f9

Browse files
facchinmpillo79
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 c8d9103 commit 94c74f9

14 files changed

+645
-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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
if BUILD_WITH_TFM
11+
12+
# Initial Attestation key provisioned by the BL1 bootloader
13+
config TFM_INITIAL_ATTESTATION_KEY
14+
default y
15+
16+
config TFM_DUMMY_PROVISIONING
17+
default n
18+
19+
endif # BUILD_WITH_TFM
20+
21+
endif # BOARD_ARDUINO_UNO_Q
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2025 Arduino SA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
arduino_header: connector {
9+
compatible = "arduino-header-r3";
10+
#gpio-cells = <2>;
11+
gpio-map-mask = <0xffffffff 0xffffffc0>;
12+
gpio-map-pass-thru = <0 0x3f>;
13+
gpio-map = <0 0 &gpioa 4 0>, /* A0 */
14+
<1 0 &gpioa 5 0>, /* A1 */
15+
<2 0 &gpioa 6 0>, /* A2 */
16+
<3 0 &gpioa 7 0>, /* A3 */
17+
<4 0 &gpioc 1 0>, /* A4 */
18+
<5 0 &gpioc 0 0>, /* A5 */
19+
<6 0 &gpiob 7 GPIO_ACTIVE_HIGH>, /* D0 */
20+
<7 0 &gpiob 6 GPIO_ACTIVE_HIGH>, /* D1 */
21+
<8 0 &gpiob 3 GPIO_ACTIVE_HIGH>, /* D2 */
22+
<9 0 &gpiob 0 GPIO_ACTIVE_HIGH>, /* D3 */
23+
<10 0 &gpioa 12 GPIO_ACTIVE_HIGH>, /* D4 */
24+
<11 0 &gpioa 11 GPIO_ACTIVE_HIGH>, /* D5 */
25+
<12 0 &gpiob 1 GPIO_ACTIVE_HIGH>, /* D6 */
26+
<13 0 &gpiob 2 GPIO_ACTIVE_HIGH>, /* D7 */
27+
<14 0 &gpiob 4 GPIO_ACTIVE_HIGH>, /* D8 */
28+
<15 0 &gpiob 8 GPIO_ACTIVE_HIGH>, /* D9 */
29+
<16 0 &gpiob 9 GPIO_ACTIVE_HIGH>, /* D10 */
30+
<17 0 &gpiob 15 GPIO_ACTIVE_HIGH>, /* D11 */
31+
<18 0 &gpiob 14 GPIO_ACTIVE_HIGH>, /* D12 */
32+
<19 0 &gpiob 13 GPIO_ACTIVE_HIGH>; /* D13 */
33+
};
34+
};
35+
36+
arduino_spi: &spi2 {};
37+
38+
arduino_i2c: &i2c2 {};
39+
40+
arduino_serial: &usart1 {};
Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
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_BUS_APB3 0x00000800>,
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+
&die_temp {
220+
status = "okay";
221+
};
222+
223+
&dac1 {
224+
pinctrl-0 = <&dac1_out1_pa4 &dac1_out2_pa5>;
225+
pinctrl-names = "default";
226+
status = "okay";
227+
};
228+
229+
&rtc {
230+
clocks = <&rcc STM32_CLOCK_BUS_APB3 0x00200000>,
231+
<&rcc STM32_SRC_LSE RTC_SEL(1)>;
232+
status = "okay";
233+
};
234+
235+
&iwdg {
236+
status = "okay";
237+
};
238+
239+
&vref1 {
240+
status = "okay";
241+
};
242+
243+
&vbat4 {
244+
status = "okay";
245+
};
246+
247+
&gpiog {
248+
status = "okay";
249+
};
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
scratch_partition: partition@e0000 {
58+
label = "image-scratch";
59+
reg = <0x000e0000 DT_SIZE_K(64)>;
60+
};
61+
62+
storage_partition: partition@f0000 {
63+
label = "storage";
64+
reg = <0x000f0000 DT_SIZE_K(64)>;
65+
};
66+
};
67+
};
68+
69+
&gpdma1 {
70+
status = "okay";
71+
};
72+
73+
&adc1 {
74+
st,adc-prescaler = <4>;
75+
status = "okay";
76+
};

0 commit comments

Comments
 (0)