1/*
2 * Copyright (c) 2020-2024 STMicroelectronics
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/wl/stm32wl55Xc.dtsi>
9#include <st/wl/stm32wl55jcix-pinctrl.dtsi>
10#include "arduino_r3_connector.dtsi"
11#include "st_morpho_connector.dtsi"
12#include <zephyr/dt-bindings/input/input-event-codes.h>
13
14/ {
15	model = "STMicroelectronics STM32WL55JC-NUCLEO board";
16	compatible = "st,stm32wl55-nucleo";
17
18	chosen {
19		zephyr,console = &lpuart1;
20		zephyr,shell-uart = &lpuart1;
21		zephyr,sram = &sram0;
22		zephyr,flash = &flash0;
23		zephyr,code-partition = &slot0_partition;
24	};
25
26	leds: leds {
27		compatible = "gpio-leds";
28
29		blue_led_1: led_0 {
30			gpios = <&gpiob 15 GPIO_ACTIVE_HIGH>;
31			label = "User LED1";
32		};
33
34		green_led_2: led_1 {
35			gpios = <&gpiob 9 GPIO_ACTIVE_HIGH>;
36			label = "User LED2";
37		};
38
39		green_led_3: led_2 {
40			gpios = <&gpiob 11 GPIO_ACTIVE_HIGH>;
41			label = "User LED3";
42		};
43	};
44
45	gpio_keys {
46		compatible = "gpio-keys";
47
48		user_button_1: button_0 {
49			label = "SW1";
50			gpios = <&gpioa 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
51			zephyr,code = <INPUT_KEY_0>;
52		};
53
54		user_button_2: button_1 {
55			label = "SW2";
56			gpios = <&gpioa 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
57			zephyr,code = <INPUT_KEY_1>;
58		};
59
60		user_button_3: button_2 {
61			label = "SW3";
62			gpios = <&gpioc 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
63			zephyr,code = <INPUT_KEY_2>;
64		};
65	};
66
67	aliases {
68		led0 = &green_led_2;
69		sw0 = &user_button_1;
70		sw1 = &user_button_2;
71		sw2 = &user_button_3;
72		lora0 = &lora;
73		watchdog0 = &iwdg;
74		die-temp0 = &die_temp;
75		volt-sensor0 = &vref;
76		volt-sensor1 = &vbat;
77	};
78};
79
80&clk_lsi {
81	status = "okay";
82};
83
84stm32_lp_tick_source: &lptim1 {
85	clocks = <&rcc STM32_CLOCK(APB1, 31)>,
86		 <&rcc STM32_SRC_LSI LPTIM1_SEL(1)>;
87	status = "okay";
88};
89
90&clk_hsi {
91	status = "okay";
92};
93
94&clk_lse {
95	status = "okay";
96};
97
98&pll {
99	div-m = <1>;
100	mul-n = <6>;
101	div-r = <2>;
102	div-q = <2>;
103	clocks = <&clk_hsi>;
104	status = "okay";
105};
106
107&rcc {
108	clocks = <&pll>;
109	clock-frequency = <DT_FREQ_M(48)>;
110	cpu1-prescaler = <1>;
111	cpu2-prescaler = <1>;
112	ahb3-prescaler = <1>;
113	apb1-prescaler = <1>;
114	apb2-prescaler = <1>;
115};
116
117&lpuart1 {
118	pinctrl-0 = <&lpuart1_tx_pa2 &lpuart1_rx_pa3>;
119	pinctrl-names = "default";
120	current-speed = <115200>;
121	status = "okay";
122};
123
124&i2c2 {
125	pinctrl-0 = <&i2c2_scl_pa12 &i2c2_sda_pa11>;
126	pinctrl-names = "default";
127	status = "okay";
128	clock-frequency = <I2C_BITRATE_FAST>;
129};
130
131&spi1 {
132	pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5
133		     &spi1_miso_pa6 &spi1_mosi_pa7>;
134	pinctrl-names = "default";
135	status = "okay";
136};
137
138
139&dac1 {
140	pinctrl-0 = <&dac_out1_pa10>;
141	pinctrl-names = "default";
142	status = "okay";
143};
144
145&timers2 {
146	status = "okay";
147
148	pwm2: pwm {
149		status = "okay";
150		pinctrl-0 = <&tim2_ch4_pb11>;
151		pinctrl-names = "default";
152	};
153};
154
155
156&adc1 {
157	pinctrl-0 = <&adc_in5_pb1 &adc_in0_pb13>;
158	pinctrl-names = "default";
159	st,adc-clock-source = "SYNC";
160	st,adc-prescaler = <4>;
161	status = "okay";
162};
163
164&die_temp {
165	status = "okay";
166};
167
168&aes {
169	status = "okay";
170};
171
172&rng {
173	status = "okay";
174};
175
176&iwdg {
177	status = "okay";
178};
179
180&subghzspi {
181	status = "okay";
182
183	lora: radio@0 {
184		status = "okay";
185		tx-enable-gpios = <&gpioc 4 GPIO_ACTIVE_LOW>; /* FE_CTRL1 */
186		rx-enable-gpios = <&gpioc 5 GPIO_ACTIVE_LOW>; /* FE_CTRL2 */
187		dio3-tcxo-voltage = <SX126X_DIO3_TCXO_1V7>;
188		tcxo-power-startup-delay-ms = <5>;
189		/* High-power output is selected as a consequence of using
190		 * tx/rx-enable-gpio to control FE_CTRL1 and FE_CTRL2. Low-power
191		 * output would require both FE_CTRL1 and FE_CTRL2 to be high,
192		 * which is not currently supported by the driver.
193		 */
194		power-amplifier-output = "rfo-hp";
195		rfo-lp-max-power = <15>;
196		rfo-hp-max-power = <22>;
197	};
198};
199
200&flash0 {
201	partitions {
202		compatible = "fixed-partitions";
203		#address-cells = <1>;
204		#size-cells = <1>;
205
206		boot_partition: partition@0 {
207			label = "mcuboot";
208			reg = <0x00000000 DT_SIZE_K(32)>;
209			read-only;
210		};
211
212		slot0_partition: partition@8000 {
213			label = "image-0";
214			reg = <0x00008000 DT_SIZE_K(104)>;
215		};
216
217		slot1_partition: partition@22000 {
218			label = "image-1";
219			reg = <0x00022000 DT_SIZE_K(104)>;
220		};
221
222		/*
223		 * Set 16kB of storage (8x2kB pages) at the end of the 256kB of
224		 * flash.
225		 */
226		storage_partition: partition@3c000 {
227			label = "storage";
228			reg = <0x0003c000 DT_SIZE_K(16)>;
229		};
230	};
231};
232
233&rtc {
234	clocks = <&rcc STM32_CLOCK(APB1, 10)>,
235		 <&rcc STM32_SRC_LSE RTC_SEL(1)>;
236	status = "okay";
237};
238
239&vref {
240	status = "okay";
241};
242
243&vbat {
244	status = "okay";
245};
246