1/*
2 * Copyright (c) 2017 Linaro Limited
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/f3/stm32f334X8.dtsi>
9#include <st/f3/stm32f334r(6-8)tx-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 STM32F334R8-NUCLEO board";
16	compatible = "st,stm32f334r8-nucleo";
17
18	chosen {
19		zephyr,console = &usart2;
20		zephyr,shell-uart = &usart2;
21		zephyr,sram = &sram0;
22		zephyr,flash = &flash0;
23	};
24
25	leds: leds {
26		compatible = "gpio-leds";
27		green_led_2: led_2 {
28			gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>;
29			label = "User LD2";
30		};
31	};
32
33	gpio_keys {
34		compatible = "gpio-keys";
35		user_button: button {
36			label = "User";
37			gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
38			zephyr,code = <INPUT_KEY_0>;
39		};
40	};
41
42	aliases {
43		led0 = &green_led_2;
44		sw0 = &user_button;
45		watchdog0 = &iwdg;
46	};
47};
48
49&clk_lsi {
50	status = "okay";
51};
52
53&clk_hse {
54	hse-bypass;
55	clock-frequency = <DT_FREQ_M(8)>; /* STLink 8MHz clock */
56	status = "okay";
57};
58
59&pll {
60	clocks = <&clk_hse>;
61	prediv = <1>;
62	mul = <9>;
63	status = "okay";
64};
65
66&rcc {
67	clocks = <&pll>;
68	clock-frequency = <DT_FREQ_M(72)>;
69	ahb-prescaler = <1>;
70	apb1-prescaler = <2>;
71	apb2-prescaler = <1>;
72};
73
74&usart1 {
75	pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
76	pinctrl-names = "default";
77	current-speed = <115200>;
78	status = "okay";
79};
80
81&usart2 {
82	pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
83	pinctrl-names = "default";
84	current-speed = <115200>;
85	status = "okay";
86};
87
88&usart3 {
89	pinctrl-0 = <&usart3_tx_pb10 &usart3_rx_pb11>;
90	pinctrl-names = "default";
91	current-speed = <115200>;
92};
93
94&i2c1 {
95	pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
96	pinctrl-names = "default";
97	status = "okay";
98	clock-frequency = <I2C_BITRATE_FAST>;
99};
100
101&spi1 {
102	pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>;
103	pinctrl-names = "default";
104	cs-gpios = <&gpiob 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
105	status = "okay";
106};
107
108&timers1 {
109	st,prescaler = <10000>;
110	status = "okay";
111
112	pwm1: pwm {
113		status = "okay";
114		pinctrl-0 = <&tim1_ch1_pa8>;
115		pinctrl-names = "default";
116	};
117};
118
119&rtc {
120	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
121		 <&rcc STM32_SRC_LSI RTC_SEL(2)>;
122	status = "okay";
123};
124
125&iwdg {
126	status = "okay";
127};
128
129&flash0 {
130
131	partitions {
132		compatible = "fixed-partitions";
133		#address-cells = <1>;
134		#size-cells = <1>;
135
136		/* Set 6Kb of storage at the end of the 64Kb of flash */
137		storage_partition: partition@e800 {
138			label = "storage";
139			reg = <0x0000e800 DT_SIZE_K(6)>;
140		};
141	};
142};
143