1/*
2 * Copyright (c) 2017 Linaro Limited
3 * Copyright (c) 2019 Centaur Analytics, Inc
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8/dts-v1/;
9#include <st/f4/stm32f401Xe.dtsi>
10#include <st/f4/stm32f401r(d-e)tx-pinctrl.dtsi>
11#include "arduino_r3_connector.dtsi"
12
13/ {
14	model = "STMicroelectronics STM32F401RE-NUCLEO board";
15	compatible = "st,stm32f401re-nucleo";
16
17	chosen {
18		zephyr,console = &usart2;
19		zephyr,shell-uart = &usart2;
20		zephyr,sram = &sram0;
21		zephyr,flash = &flash0;
22		zephyr,code-partition = &slot0_partition;
23	};
24
25	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	pwmleds {
34		compatible = "pwm-leds";
35		green_pwm_led: green_pwm_led {
36			pwms = <&pwm2 1 0 PWM_POLARITY_NORMAL>;
37		};
38	};
39
40	gpio_keys {
41		compatible = "gpio-keys";
42		user_button: button {
43			label = "User";
44			gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
45		};
46	};
47
48	aliases {
49		led0 = &green_led_2;
50		sw0 = &user_button;
51		pwm-led0 = &green_pwm_led;
52	};
53};
54
55&clk_hse {
56	hse-bypass;
57	clock-frequency = <DT_FREQ_M(8)>; /* STLink 8MHz clock */
58	status = "okay";
59};
60
61&pll {
62	div-m = <8>;
63	mul-n = <336>;
64	div-p = <4>;
65	div-q = <7>;
66	clocks = <&clk_hse>;
67	status = "okay";
68};
69
70&rcc {
71	clocks = <&pll>;
72	clock-frequency = <DT_FREQ_M(84)>;
73	ahb-prescaler = <1>;
74	apb1-prescaler = <2>;
75	apb2-prescaler = <1>;
76};
77
78&usart1 {
79	pinctrl-0 = <&usart1_tx_pb6 &usart1_rx_pb7>;
80	current-speed = <115200>;
81	status = "okay";
82};
83
84&usart2 {
85	pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
86	current-speed = <115200>;
87	status = "okay";
88};
89
90&i2c1 {
91	pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
92	status = "okay";
93	clock-frequency = <I2C_BITRATE_FAST>;
94};
95
96&spi1 {
97	pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>;
98	cs-gpios = <&gpiob 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
99	status = "okay";
100};
101
102&spi2 {
103	pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13
104		     &spi2_miso_pb14 &spi2_mosi_pb15>;
105	status = "okay";
106};
107
108&flash0 {
109
110	partitions {
111		compatible = "fixed-partitions";
112		#address-cells = <1>;
113		#size-cells = <1>;
114
115		boot_partition: partition@0 {
116			label = "mcuboot";
117			reg = <0x00000000 0x00010000>;
118			read-only;
119		};
120
121		/*
122		 * The flash starting at offset 0x10000 and ending at
123		 * offset 0x1ffff is reserved for use by the application.
124		 */
125
126		slot0_partition: partition@20000 {
127			label = "image-0";
128			reg = <0x00020000 0x00020000>;
129		};
130		slot1_partition: partition@40000 {
131			label = "image-1";
132			reg = <0x00040000 0x00020000>;
133		};
134		scratch_partition: partition@60000 {
135			label = "image-scratch";
136			reg = <0x00060000 0x00020000>;
137		};
138	};
139};
140
141&timers2 {
142	status = "okay";
143
144	pwm2: pwm {
145		status = "okay";
146		pinctrl-0 = <&tim2_ch1_pa5>;
147	};
148};
149
150&rtc {
151	status = "okay";
152};
153
154&adc1 {
155	pinctrl-0 = <&adc1_in0_pa0>;
156	status = "okay";
157};
158
159&wwdg {
160	status = "okay";
161};
162