1/*
2 * Copyright (c)  2023 STMicroelectronics
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/wba/stm32wba55Xg.dtsi>
9#include <st/wba/stm32wba55cgux-pinctrl.dtsi>
10#include "arduino_r3_connector.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	model = "STMicroelectronics STM32WBA55CG-NUCLEO board";
15	compatible = "st,stm32wba55cg-nucleo";
16
17	#address-cells = <1>;
18	#size-cells = <1>;
19
20	chosen {
21		zephyr,bt-c2h-uart = &usart1;
22		zephyr,uart-pipe = &usart1;
23		zephyr,console = &usart1;
24		zephyr,shell-uart = &usart1;
25		zephyr,sram = &sram0;
26		zephyr,flash = &flash0;
27		zephyr,code-partition = &slot0_partition;
28	};
29
30	leds: leds {
31		compatible = "gpio-leds";
32		blue_led_1: led_0 {
33			gpios = <&gpiob 4 GPIO_ACTIVE_LOW>;
34			label = "User LD1";
35		};
36		green_led_2: led_1 {
37			gpios = <&gpioa 9 GPIO_ACTIVE_LOW>;
38			label = "User LD2";
39		};
40		red_led_3: led_2 {
41			gpios = <&gpiob 8 GPIO_ACTIVE_LOW>;
42			label = "User LD3";
43		};
44	};
45
46	gpio_keys {
47		compatible = "gpio-keys";
48		user_button_1: button_0 {
49			label = "User B1";
50			gpios = <&gpioc 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
51			zephyr,code = <INPUT_KEY_0>;
52		};
53		user_button_2: button_1 {
54			label = "User B2";
55			gpios = <&gpiob 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
56			zephyr,code = <INPUT_KEY_1>;
57		};
58		user_button_3: button_2 {
59			label = "User B3";
60			gpios = <&gpiob 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
61			zephyr,code = <INPUT_KEY_2>;
62		};
63	};
64
65	aliases {
66		led0 = &blue_led_1;
67		led1 = &green_led_2;
68		led2 = &red_led_3;
69		sw0 = &user_button_1;
70		sw1 = &user_button_2;
71		sw2 = &user_button_3;
72		mcuboot-led0 = &blue_led_1;
73		mcuboot-button0 = &user_button_1;
74		die-temp0 = &die_temp;
75	};
76};
77
78&clk_lsi {
79	status = "okay";
80};
81
82&clk_lse {
83	status = "okay";
84};
85
86&clk_hse {
87	status = "okay";
88	hse-div2;
89};
90
91&clk_hsi {
92	status = "okay";
93};
94
95&rcc {
96	clocks = <&clk_hse>;
97	clock-frequency = <DT_FREQ_M(16)>;
98	ahb-prescaler = <1>;
99	ahb5-prescaler = <2>;
100	apb1-prescaler = <1>;
101	apb2-prescaler = <2>;
102	apb7-prescaler = <1>;
103};
104
105&iwdg {
106	status = "okay";
107};
108
109&rtc {
110	status = "okay";
111	clocks = <&rcc STM32_CLOCK_BUS_APB7 0x00200000>,
112			<&rcc STM32_SRC_LSE RTC_SEL(1)>;
113	prescaler = <32768>;
114};
115
116&usart1 {
117	clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>,
118		 <&rcc STM32_SRC_HSI16 USART1_SEL(2)>;
119	pinctrl-0 = <&usart1_tx_pb12 &usart1_rx_pa8>;
120	pinctrl-1 = <&analog_pb12 &analog_pa8>;
121	pinctrl-names = "default", "sleep";
122	current-speed = <115200>;
123	status = "okay";
124};
125
126&lpuart1 {
127	pinctrl-0 = <&lpuart1_tx_pb5 &lpuart1_rx_pa10>;
128	pinctrl-names = "default";
129	current-speed = <115200>;
130	status = "okay";
131};
132
133&spi1 {
134	pinctrl-0 = <&spi1_nss_pa12 &spi1_sck_pb4
135		     &spi1_miso_pb3 &spi1_mosi_pa15>;
136	pinctrl-names = "default";
137	status = "okay";
138};
139
140&i2c1 {
141	pinctrl-0 = <&i2c1_scl_pb2 &i2c1_sda_pb1>;
142	pinctrl-names = "default";
143	status = "okay";
144	clock-frequency = <I2C_BITRATE_FAST>;
145};
146
147&adc4 {
148	pinctrl-0 = <&adc4_in8_pa1 &adc4_in9_pa0>;
149	pinctrl-names = "default";
150	st,adc-clock-source = "ASYNC";
151	st,adc-prescaler = <4>;
152	status = "okay";
153};
154
155&die_temp {
156	status = "okay";
157};
158
159stm32_lp_tick_source: &lptim1 {
160	clocks = <&rcc STM32_CLOCK_BUS_APB7 0x00000800>,
161		 <&rcc STM32_SRC_LSE LPTIM1_SEL(3)>;
162	status = "okay";
163};
164
165&rng {
166	status = "okay";
167};
168
169&flash0 {
170	partitions {
171		compatible = "fixed-partitions";
172		#address-cells = <1>;
173		#size-cells = <1>;
174
175		boot_partition: partition@0 {
176			label = "mcuboot";
177			reg = <0x00000000 DT_SIZE_K(64)>;
178		};
179		slot0_partition: partition@10000 {
180			label = "image-0";
181			reg = <0x00010000 DT_SIZE_K(456)>;
182		};
183		slot1_partition: partition@82000 {
184			label = "image-1";
185			reg = <0x00082000 DT_SIZE_K(448)>;
186		};
187		storage_partition: partition@f2000 {
188			label = "storage";
189			reg = <0x000f2000 DT_SIZE_K(56)>;
190		};
191	};
192};
193