|
| 1 | +/* |
| 2 | + * Copyright (c) 2025 ThoseBoards |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + */ |
| 6 | + |
| 7 | +/dts-v1/; |
| 8 | +#include <st/f4/stm32f427vi.dtsi> |
| 9 | +#include <st/f4/stm32f427v(g-i)tx-pinctrl.dtsi> |
| 10 | +#include <zephyr/dt-bindings/input/input-event-codes.h> |
| 11 | + |
| 12 | +/ { |
| 13 | + model = "MikroE Quail for STM32"; |
| 14 | + compatible = "mikroe,stm32-e427", "st,stm32f427"; |
| 15 | + |
| 16 | + chosen { |
| 17 | + zephyr,sram = &sram0; |
| 18 | + zephyr,flash = &flash0; |
| 19 | + zephyr,flash-controller = &flash1; |
| 20 | + zephyr,ccm = &ccm0; |
| 21 | + }; |
| 22 | + |
| 23 | + leds { |
| 24 | + compatible = "gpio-leds"; |
| 25 | + ld1: led_1 { |
| 26 | + gpios = <&gpioe 15 GPIO_ACTIVE_HIGH>; |
| 27 | + label = "User LD1"; |
| 28 | + }; |
| 29 | + ld2: led_2 { |
| 30 | + gpios = <&gpioe 10 GPIO_ACTIVE_HIGH>; |
| 31 | + label = "User LD2"; |
| 32 | + }; |
| 33 | + ld3: led_3 { |
| 34 | + gpios = <&gpioc 3 GPIO_ACTIVE_HIGH>; |
| 35 | + label = "User LD3"; |
| 36 | + }; |
| 37 | + }; |
| 38 | + |
| 39 | + aliases { |
| 40 | + led0 = &ld1; |
| 41 | + led1 = &ld2; |
| 42 | + led2 = &ld3; |
| 43 | + volt-sensor0 = &vref; |
| 44 | + volt-sensor1 = &vbat; |
| 45 | + }; |
| 46 | +}; |
| 47 | + |
| 48 | +&clk_lsi { |
| 49 | + status = "okay"; |
| 50 | +}; |
| 51 | + |
| 52 | +&clk_hsi { |
| 53 | + clock-frequency = <DT_FREQ_M(16)>; |
| 54 | + status = "okay"; |
| 55 | +}; |
| 56 | + |
| 57 | +&pll { |
| 58 | + div-m = <8>; |
| 59 | + mul-n = <96>; |
| 60 | + div-p = <2>; |
| 61 | + div-q = <4>; |
| 62 | + clocks = <&clk_hsi>; |
| 63 | + status = "okay"; |
| 64 | +}; |
| 65 | + |
| 66 | +&rcc { |
| 67 | + clocks = <&pll>; |
| 68 | + clock-frequency = <DT_FREQ_M(96)>; |
| 69 | + ahb-prescaler = <1>; |
| 70 | + apb1-prescaler = <4>; |
| 71 | + apb2-prescaler = <2>; |
| 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_pd5 &usart2_rx_pd6>; |
| 83 | + pinctrl-names = "default"; |
| 84 | + current-speed = <115200>; |
| 85 | + status = "okay"; |
| 86 | +}; |
| 87 | + |
| 88 | +&usart3 { |
| 89 | + pinctrl-0 = <&usart3_tx_pd8 &usart3_rx_pd9>; |
| 90 | + pinctrl-names = "default"; |
| 91 | + current-speed = <115200>; |
| 92 | + status = "okay"; |
| 93 | +}; |
| 94 | + |
| 95 | +&usart6 { |
| 96 | + pinctrl-0 = <&usart6_tx_pc6 &usart6_rx_pc7>; |
| 97 | + pinctrl-names = "default"; |
| 98 | + current-speed = <115200>; |
| 99 | + status = "okay"; |
| 100 | +}; |
| 101 | + |
| 102 | +&rtc { |
| 103 | + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>, |
| 104 | + <&rcc STM32_SRC_LSI RTC_SEL(2)>; |
| 105 | + status = "okay"; |
| 106 | +}; |
| 107 | + |
| 108 | +zephyr_udc0: &usbotg_fs { |
| 109 | + pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>; |
| 110 | + pinctrl-names = "default"; |
| 111 | + status = "okay"; |
| 112 | +}; |
| 113 | + |
| 114 | +#include <../boards/common/usb/cdc_acm_serial.dtsi> |
| 115 | + |
| 116 | +&spi1 { |
| 117 | + pinctrl-0 = <&spi1_sck_pb3 &spi1_miso_pb4 &spi1_mosi_pb5>; |
| 118 | + pinctrl-names = "default"; |
| 119 | + cs-gpios = <&gpioa 3 GPIO_ACTIVE_LOW>, <&gpioe 0 GPIO_ACTIVE_LOW>; |
| 120 | + status = "okay"; |
| 121 | +}; |
| 122 | + |
| 123 | +&spi3 { |
| 124 | + status = "okay"; |
| 125 | + pinctrl-0 = <&spi3_sck_pc10 &spi3_miso_pc11 &spi3_mosi_pc12>; |
| 126 | + pinctrl-names = "default"; |
| 127 | + |
| 128 | + cs-gpios = |
| 129 | + <&gpiod 11 GPIO_ACTIVE_LOW>, // CS0 |
| 130 | + <&gpiod 1 GPIO_ACTIVE_LOW>, // CS1 |
| 131 | + <&gpioa 13 GPIO_ACTIVE_LOW>; // CS2 |
| 132 | + |
| 133 | + //max-frequency = <100000000>; // Max frequency for the SPI bus (100 MHz in this case) |
| 134 | + //bus-width = <1>; /* 1-bit data width */ |
| 135 | +}; |
| 136 | + |
| 137 | +/* Flash chip 1 (extra flash connected to CS2) */ |
| 138 | +&spi3 { |
| 139 | + flash1: flash@2 { |
| 140 | + compatible = "jedec,spi-nor"; // Typical flash chip compatibility string |
| 141 | + reg = <2>; // The CS0 pin on the SPI bus |
| 142 | + /* S25FL164K flash's actual JEDEC: Device ID = 16h, Device Type = 40h, Capacity = 17h */ |
| 143 | + //jedec-id = [16 40 17]; |
| 144 | + jedec-id = [01 60 17]; |
| 145 | + spi-max-frequency = <50000000>; // Max frequency for the flash chip (e.g., 50 MHz) |
| 146 | + size = <0x800000>; // Flash memory size (16MB example) |
| 147 | + page-size = <256>; // Flash page size (usually 256 or 512 bytes) |
| 148 | + //sector-size = <4096>; // Flash sector size (4KB typically) |
| 149 | + //erase-block-size = <4096>; // Erase block size (typically 4KB) |
| 150 | + //label = "flash1"; |
| 151 | + status = "okay"; |
| 152 | + }; |
| 153 | +}; |
| 154 | + |
| 155 | +&i2c1 { |
| 156 | + pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; |
| 157 | + pinctrl-names = "default"; |
| 158 | + status = "okay"; |
| 159 | +}; |
| 160 | + |
| 161 | +&adc1 { |
| 162 | + status ="okay"; |
| 163 | + pinctrl-0 = <&adc1_in4_pa4 &adc1_in5_pa5>; |
| 164 | + pinctrl-names = "default"; |
| 165 | + st,adc-clock-source = "SYNC"; |
| 166 | + st,adc-prescaler = <2>; |
| 167 | +}; |
| 168 | + |
| 169 | +&adc2 { |
| 170 | + status ="okay"; |
| 171 | + pinctrl-0 = <&adc2_in6_pa6 &adc2_in7_pa7>; |
| 172 | + pinctrl-names = "default"; |
| 173 | + st,adc-clock-source = "SYNC"; |
| 174 | + st,adc-prescaler = <2>; |
| 175 | +}; |
| 176 | + |
| 177 | +&vref { |
| 178 | + status = "okay"; |
| 179 | +}; |
| 180 | + |
| 181 | +&vbat { |
| 182 | + status = "okay"; |
| 183 | +}; |
| 184 | + |
| 185 | +mikrobus_1_i2c: &i2c1 {}; |
| 186 | + |
| 187 | +mikrobus_1_spi: &spi1 {}; |
| 188 | + |
| 189 | +mikrobus_1_uart: &usart3 {}; |
| 190 | + |
| 191 | +mikrobus_2_i2c: &i2c1 {}; |
| 192 | + |
| 193 | +mikrobus_2_spi: &spi1 {}; |
| 194 | + |
| 195 | +mikrobus_2_uart: &usart2 {}; |
| 196 | + |
| 197 | +mikrobus_3_i2c: &i2c1 {}; |
| 198 | + |
| 199 | +mikrobus_3_spi: &spi3 {}; |
| 200 | + |
| 201 | +mikrobus_3_uart: &usart6 {}; |
| 202 | + |
| 203 | +mikrobus_4_i2c: &i2c1 {}; |
| 204 | + |
| 205 | +mikrobus_4_spi: &spi3 {}; |
| 206 | + |
| 207 | +mikrobus_4_uart: &usart1 {}; |
0 commit comments