1/*
2 * Copyright (c) 2019 Linaro Limited
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/wb/stm32wb55Xg.dtsi>
9#include <st/wb/stm32wb55rgvx-pinctrl.dtsi>
10#include "arduino_r3_connector.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	model = "STMicroelectronics STM32WB55RG-NUCLEO board";
15	compatible = "st,stm32wb55rg-nucleo";
16
17	chosen {
18		zephyr,console = &usart1;
19		zephyr,shell-uart = &usart1;
20		zephyr,bt-mon-uart = &lpuart1;
21		zephyr,bt-c2h-uart = &lpuart1;
22		zephyr,sram = &sram0;
23		zephyr,flash = &flash0;
24		zephyr,code-partition = &slot0_partition;
25	};
26
27	leds: leds {
28		compatible = "gpio-leds";
29		blue_led_1: led_0 {
30			gpios = <&gpiob 5 GPIO_ACTIVE_HIGH>;
31			label = "User LED1";
32		};
33		green_led_2: led_1 {
34			gpios = <&gpiob 0 GPIO_ACTIVE_HIGH>;
35			label = "User LED2";
36		};
37		green_led_3: led_2 {
38			gpios = <&gpiob 1 GPIO_ACTIVE_HIGH>;
39			label = "User LED3";
40		};
41	};
42
43	gpio_keys {
44		compatible = "gpio-keys";
45		user_button_1: button_0 {
46			label = "SW1";
47			gpios = <&gpioc 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
48			zephyr,code = <INPUT_KEY_0>;
49		};
50		user_button_2: button_1 {
51			label = "SW2";
52			gpios = <&gpiod 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
53			zephyr,code = <INPUT_KEY_1>;
54		};
55		user_button_3: button_2 {
56			label = "SW3";
57			gpios = <&gpiod 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
58			zephyr,code = <INPUT_KEY_2>;
59		};
60	};
61
62	aliases {
63		led0 = &green_led_2;
64		sw0 = &user_button_1;
65		sw1 = &user_button_2;
66		sw2 = &user_button_3;
67		watchdog0 = &iwdg;
68		die-temp0 = &die_temp;
69		volt-sensor0 = &vref;
70		volt-sensor1 = &vbat;
71	};
72};
73
74&die_temp {
75	status = "okay";
76};
77
78&clk_lsi1 {
79	status = "okay";
80};
81
82&clk_hse {
83	status = "okay";
84};
85
86&clk_lse {
87	status = "okay";
88};
89
90&clk_hsi48 {
91	status = "okay";
92};
93
94&clk48 {
95	/* Node is disabled by default as default source is HSI48 */
96	/* To select another clock, enable the node */
97	clocks = <&rcc STM32_SRC_HSI48 CLK48_SEL(0)>;
98};
99
100&rcc {
101	clocks = <&clk_hse>;
102	clock-frequency = <DT_FREQ_M(32)>;
103	cpu1-prescaler = <1>;
104	cpu2-prescaler = <1>;
105	ahb4-prescaler = <1>;
106	apb1-prescaler = <1>;
107	apb2-prescaler = <1>;
108};
109
110&usart1 {
111	pinctrl-0 = <&usart1_tx_pb6 &usart1_rx_pb7>;
112	pinctrl-names = "default";
113	current-speed = <115200>;
114	status = "okay";
115};
116
117&i2c1 {
118	pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
119	pinctrl-names = "default";
120	status = "okay";
121	clock-frequency = <I2C_BITRATE_FAST>;
122};
123
124&i2c3 {
125	pinctrl-0 = <&i2c3_scl_pc0 &i2c3_sda_pc1>;
126	pinctrl-names = "default";
127	status = "okay";
128	clock-frequency = <I2C_BITRATE_FAST>;
129};
130
131&rtc {
132	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000400>,
133		 <&rcc STM32_SRC_LSI RTC_SEL(2)>;
134	status = "okay";
135
136	backup_regs {
137		status = "okay";
138	};
139};
140
141&spi1 {
142	pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5
143		     &spi1_miso_pa6 &spi1_mosi_pa7>;
144	pinctrl-names = "default";
145	status = "okay";
146};
147
148&timers1 {
149	st,prescaler = <10000>;
150	status = "okay";
151
152	pwm1: pwm {
153		status = "okay";
154		pinctrl-0 = <&tim1_ch1_pa8>;
155		pinctrl-names = "default";
156	};
157};
158
159&timers2 {
160	status = "okay";
161	pwm2: pwm {
162		status = "okay";
163		pinctrl-0 = <&tim2_ch1_pa15>;
164		pinctrl-names = "default";
165	};
166};
167
168&lpuart1 {
169	pinctrl-0 = <&lpuart1_tx_pc1 &lpuart1_rx_pc0
170			&lpuart1_cts_pa6 &lpuart1_rts_pb12>;
171	hw-flow-control;
172	pinctrl-names = "default";
173	current-speed = <115200>;
174	status = "okay";
175};
176
177&adc1 {
178	pinctrl-0 = <&adc1_in3_pc2>;
179	pinctrl-names = "default";
180	st,adc-clock-source = <SYNC>;
181	st,adc-prescaler = <4>;
182	status = "okay";
183};
184
185&iwdg {
186	status = "okay";
187};
188
189stm32_lp_tick_source: &lptim1 {
190	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x80000000>,
191		 <&rcc STM32_SRC_LSE LPTIM1_SEL(3)>;
192	status = "okay";
193};
194
195zephyr_udc0: &usb {
196	status = "okay";
197	pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
198	pinctrl-names = "default";
199};
200
201&rng {
202	status = "okay";
203};
204
205&aes1 {
206	status = "okay";
207};
208
209&flash0 {
210	partitions {
211		compatible = "fixed-partitions";
212		#address-cells = <1>;
213		#size-cells = <1>;
214
215		/*
216		 * Configure partitions while leaving space for M0 BLE f/w
217		 * Since STM32WBCube release V1.13.2, only _HCIOnly_ f/w are supported.
218		 * These FW are expected to be located not before 0x080DB000
219		 * Current partition is using the first 876K of the flash for M4
220		 */
221
222		boot_partition: partition@0 {
223			label = "mcuboot";
224			reg = <0x00000000 DT_SIZE_K(48)>;
225		};
226		slot0_partition: partition@c000 {
227			label = "image-0";
228			reg = <0x0000c000 DT_SIZE_K(400)>;
229		};
230		slot1_partition: partition@70000 {
231			label = "image-1";
232			reg = <0x00070000 DT_SIZE_K(400)>;
233		};
234		scratch_partition: partition@d4000 {
235			label = "image-scratch";
236			reg = <0x000d4000 DT_SIZE_K(16)>;
237		};
238		storage_partition: partition@d8000 {
239			label = "storage";
240			reg = <0x000d8000 DT_SIZE_K(8)>;
241		};
242
243	};
244};
245
246&vref {
247	status = "okay";
248};
249
250&vbat {
251	status = "okay";
252};
253