1/*
2 * Copyright (c) 2020 Hans Unzner
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/f4/stm32f410Xb.dtsi>
9#include <st/f4/stm32f410r(8-b)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 STM32F410RB-NUCLEO board";
16	compatible = "st,stm32f410rb-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	};
46};
47
48&clk_lsi {
49	status = "okay";
50};
51
52&clk_hse {
53	hse-bypass;
54	clock-frequency = <DT_FREQ_M(8)>; /* STLink 8MHz clock */
55	status = "okay";
56};
57
58&pll {
59	div-m = <8>;
60	mul-n = <384>;
61	div-p = <4>;
62	div-q = <8>;
63	clocks = <&clk_hse>;
64	status = "okay";
65};
66
67&rcc {
68	clocks = <&pll>;
69	clock-frequency = <DT_FREQ_M(96)>;
70	ahb-prescaler = <1>;
71	apb1-prescaler = <2>;
72	apb2-prescaler = <1>;
73};
74
75&usart1 {
76	pinctrl-0 = <&usart1_tx_pb6 &usart1_rx_pb7>;
77	pinctrl-names = "default";
78	current-speed = <115200>;
79	status = "okay";
80};
81
82&usart2 {
83	pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
84	pinctrl-names = "default";
85	current-speed = <115200>;
86	status = "okay";
87};
88
89&i2c1 {
90	pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
91	pinctrl-names = "default";
92	status = "okay";
93	clock-frequency = <I2C_BITRATE_FAST>;
94};
95
96&i2c2 {
97	pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb3>;
98	pinctrl-names = "default";
99	status = "okay";
100	clock-frequency = <I2C_BITRATE_FAST>;
101};
102
103&spi1 {
104	pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5
105		     &spi1_miso_pa6 &spi1_mosi_pa7>;
106	pinctrl-names = "default";
107	status = "okay";
108};
109
110&rtc {
111	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
112		 <&rcc STM32_SRC_LSI RTC_SEL(2)>;
113	status = "okay";
114};
115
116&dac1 {
117	status = "okay";
118	pinctrl-0 = <&dac_out1_pa5>;
119	pinctrl-names = "default";
120};
121
122&flash0 {
123
124	partitions {
125		compatible = "fixed-partitions";
126		#address-cells = <1>;
127		#size-cells = <1>;
128
129		boot_partition: partition@0 {
130			label = "mcuboot";
131			reg = <0x00000000 DT_SIZE_K(32)>;
132			read-only;
133		};
134
135		/*
136		 * The flash sectors 2&3 at 0x00008000 and ending at
137		 * 0x0000ffff
138		 */
139		slot0_partition: partition@8000 {
140			label = "image-0";
141			reg = <0x00008000 DT_SIZE_K(32)>;
142		};
143		/*
144		 * The flash sectors 4 at 0x00010000 and ending at
145		 * 0x001ffff
146		 */
147		slot1_partition: partition@10000 {
148			label = "image-1";
149			reg = <0x00010000 DT_SIZE_K(32)>;
150		};
151		scratch_partition: partition@18000 {
152			label = "image-scratch";
153			reg = <0x00018000 DT_SIZE_K(32)>;
154		};
155	};
156};
157