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