1/*
2 * Copyright (c) 2023 Evan Perry Grove
3 * Copyright (c) 2024 STMicroelectronics
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8/dts-v1/;
9#include <st/f7/stm32f722Xe.dtsi>
10#include <st/f7/stm32f722z(c-e)tx-pinctrl.dtsi>
11#include "arduino_r3_connector.dtsi"
12#include <zephyr/dt-bindings/input/input-event-codes.h>
13
14/ {
15	model = "STMicroelectronics STM32F722ZE-NUCLEO board";
16	compatible = "st,stm32f722ze-nucleo";
17
18	chosen {
19		zephyr,console = &usart3;
20		zephyr,shell-uart = &usart3;
21		zephyr,sram = &sram0;
22		zephyr,flash = &flash0;
23		zephyr,dtcm = &dtcm;
24		zephyr,canbus = &can1;
25		zephyr,code-partition = &slot0_partition;
26	};
27
28	leds {
29		compatible = "gpio-leds";
30
31		green_led: led_1 {
32			gpios = <&gpiob 0 GPIO_ACTIVE_HIGH>;
33			label = "User LD1";
34		};
35
36		blue_led: led_2 {
37			gpios = <&gpiob 7 GPIO_ACTIVE_HIGH>;
38			label = "User LD2";
39		};
40
41		red_led: led_3 {
42			gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>;
43			label = "User LD3";
44		};
45	};
46
47	gpio_keys {
48		compatible = "gpio-keys";
49
50		user_button: button {
51			label = "User";
52			gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
53			zephyr,code = <INPUT_KEY_0>;
54		};
55	};
56
57	aliases {
58		led0 = &green_led;
59		led1 = &blue_led;
60		led2 = &red_led;
61		sw0 = &user_button;
62		watchdog0 = &iwdg;
63		die-temp0 = &die_temp;
64		volt-sensor0 = &vref;
65	};
66};
67
68&clk_hse {
69	clock-frequency = <DT_FREQ_M(8)>;
70	status = "okay";
71};
72
73&clk_hsi {
74	status = "disabled";
75};
76
77&clk_lsi {
78	status = "okay";
79};
80
81&pll {
82	div-m = <4>;
83	mul-n = <216>;
84	div-p = <2>;
85	div-q = <9>;
86	clocks = <&clk_hse>;
87	status = "okay";
88};
89
90&rcc {
91	clocks = <&pll>;
92	clock-frequency = <DT_FREQ_M(216)>;
93	ahb-prescaler = <1>;
94	apb1-prescaler = <4>;
95	apb2-prescaler = <2>;
96};
97
98&sdmmc1 {
99	status = "okay";
100	pinctrl-0 = <&sdmmc1_d0_pc8 &sdmmc1_d1_pc9 &sdmmc1_d2_pc10
101		&sdmmc1_d3_pc11 &sdmmc1_ck_pc12 &sdmmc1_cmd_pd2>;
102	pinctrl-names = "default";
103	cd-gpios = <&gpioi 15 GPIO_ACTIVE_LOW>;
104	disk-name = "SD";
105};
106
107&adc1 {
108	pinctrl-0 = <&adc1_in3_pa3 &adc1_in10_pc0>;
109	pinctrl-names = "default";
110	st,adc-clock-source = "SYNC";
111	st,adc-prescaler = <2>;
112	status = "okay";
113};
114
115&dac1 {
116	pinctrl-0 = <&dac_out1_pa4>;
117	pinctrl-names = "default";
118	status = "okay";
119};
120
121&i2c2 {
122	pinctrl-0 = <&i2c2_scl_pf1 &i2c2_sda_pf0>;
123	pinctrl-names = "default";
124	status = "okay";
125	clock-frequency = <I2C_BITRATE_FAST>;
126};
127
128&can1 {
129	pinctrl-0 = <&can1_rx_pd0 &can1_tx_pd1>;
130	pinctrl-names = "default";
131	status = "okay";
132};
133
134&usart2 {
135	pinctrl-0 = <&usart2_tx_pd5 &usart2_rx_pd6 &usart2_rts_pd4 &usart2_cts_pd3>;
136	pinctrl-names = "default";
137	current-speed = <115200>;
138	status = "okay";
139};
140
141&usart3 {
142	pinctrl-0 = <&usart3_tx_pd8 &usart3_rx_pd9>;
143	pinctrl-names = "default";
144	current-speed = <115200>;
145	status = "okay";
146};
147
148&i2c1 {
149	pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
150	pinctrl-names = "default";
151	status = "okay";
152};
153
154&spi1 {
155	pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>;
156	pinctrl-names = "default";
157	cs-gpios = <&gpiod 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
158	status = "okay";
159};
160
161&timers1 {
162	status = "okay";
163
164	pwm1: pwm {
165		status = "okay";
166		pinctrl-0 = <&tim1_ch2_pe11 &tim1_ch3_pe13>;
167		pinctrl-names = "default";
168	};
169};
170
171&usart6 {
172	pinctrl-0 = <&usart6_tx_pg14 &usart6_rx_pg9>;
173	pinctrl-names = "default";
174	current-speed = <115200>;
175	status = "okay";
176};
177
178zephyr_udc0: &usbotg_fs {
179	pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12 &usb_otg_fs_id_pa10>;
180	pinctrl-names = "default";
181	status = "okay";
182};
183
184&rtc {
185	clocks = <&rcc STM32_CLOCK(APB1, 28)>,
186		<&rcc STM32_SRC_LSI RTC_SEL(2)>;
187	status = "okay";
188};
189
190&die_temp {
191	status = "okay";
192};
193
194&dma2 {
195	status = "okay";
196};
197
198&iwdg {
199	status = "okay";
200};
201
202&vref {
203	status = "okay";
204};
205
206&rng {
207	status = "okay";
208};
209
210&backup_sram {
211	status = "okay";
212};
213
214&quadspi {
215	pinctrl-names = "default";
216	pinctrl-0 = <&quadspi_clk_pb2 &quadspi_bk1_ncs_pb6
217				&quadspi_bk1_io0_pd11 &quadspi_bk1_io1_pd12
218				&quadspi_bk1_io2_pe2 &quadspi_bk1_io3_pd13>;
219	flash-id = <1>;
220	status = "okay";
221};
222
223&flash0 {
224	partitions {
225		compatible = "fixed-partitions";
226		#address-cells = <1>;
227		#size-cells = <1>;
228
229		/* sectors 0-3 */
230		boot_partition: partition@0 {
231			label = "mcuboot";
232			reg = <0x00000000 DT_SIZE_K(64)>;
233			read-only;
234		};
235
236		/* sector 4 */
237		storage_partition: partition@10000 {
238			label = "storage";
239			reg = <0x00010000 DT_SIZE_K(64)>;
240		};
241
242		/* sector 5 */
243		slot0_partition: partition@20000 {
244			label = "image-0";
245			reg = <0x00020000 DT_SIZE_K(128)>;
246		};
247
248		/* sector 6 */
249		slot1_partition: partition@40000 {
250			label = "image-1";
251			reg = <0x00040000 DT_SIZE_K(128)>;
252		};
253
254		/* sector 7 */
255		scratch_partition: partition@60000 {
256			label = "image-scratch";
257			reg = <0x00060000 DT_SIZE_K(128)>;
258		};
259	};
260};
261