Skip to content

Commit 3443cad

Browse files
committed
boards: quail: MikroBUS
boards: mikroe: Add quail board Signed-off-by: Oleg Kokorin <[email protected]>
1 parent 379eb7a commit 3443cad

9 files changed

+395
-0
lines changed

boards/mikroe/quail/Kconfig.defconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# MikroE Quail board configuration
2+
3+
# Copyright (c) 2025 ThoseBoards
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
7+
8+
config SPI_STM32_INTERRUPT
9+
default y
10+
depends on SPI
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 ThoseBoards
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_MIKROE_QUAIL
5+
select SOC_STM32F427XX

boards/mikroe/quail/board.cmake

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
board_runner_args(dfu-util "--pid=0483:df11" "--alt=0" "--dfuse")
4+
board_runner_args(jlink "--device=STM32F427VIT6" "--speed=4000")
5+
6+
include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
7+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/mikroe/quail/board.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: mikroe_quail
3+
full_name: MikroE Quail
4+
vendor: mikroe
5+
socs:
6+
- name: stm32f427xx
57.7 KB
Binary file not shown.
+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
.. zephyr:board:: mikroe_quail
2+
3+
Overview
4+
********
5+
MikroE Quail for STM32 is a development board containing an `STM32F427`_
6+
microcontroller. It is equipped with four mikrobus sockets.
7+
The edges of the board are lined with screw terminals and USB ports for
8+
additional connectivity.
9+
10+
Hardware
11+
********
12+
The Quail board contains the following connections:
13+
14+
- Four MikroBUS connectors
15+
- lined with 32 screw terminals and USB ports for
16+
17+
Furthermore the board contains three LEDs that are connected
18+
to the microcontroller.
19+
20+
Supported Features
21+
==================
22+
23+
.. zephyr:board-supported-hw::
24+
25+
Connections and IOs
26+
===================
27+
28+
The four mikroBUS interfaces are aliased in the device tree so that their
29+
peripherals can be accessed using ``mikrobus_N_INTERFACE`` so e.g. the spi on
30+
bus 2 can be found by the alias ``mikrobus_2_spi``. The counting corresponds
31+
with the marking on the board.
32+
33+
For connections on the edge connectors, please refer to `Quail for STM32 User Manual`_.
34+
35+
Programming and Debugging
36+
*************************
37+
38+
.. zephyr:board-supported-runners::
39+
40+
Applications for the ``mikroe_quail`` board can be built and flashed in the usual way
41+
(see :ref:`build_an_application` and :ref:`application_run` for more details).
42+
43+
44+
Flashing
45+
========
46+
The initial state of the board is set to lock.
47+
When you flash, it will fail with the message:
48+
49+
.. code-block:: console
50+
51+
Error: stm32x device protected
52+
53+
Unlocking with openocd makes it possible to flash.
54+
55+
.. code-block:: console
56+
57+
$ openocd -f /usr/share/openocd/scripts/interface/stlink-v2.cfg \
58+
-f /usr/share/openocd/scripts/target/stm32f4x.cfg -c init\
59+
-c "reset halt" -c "stm32f4x unlock 0" -c "reset run" -c shutdown
60+
61+
Here is an example for the :zephyr:code-sample:`hello_world` application.
62+
63+
.. zephyr-app-commands::
64+
:zephyr-app: samples/hello_world
65+
:board: mikroe_quail
66+
:goals: build flash
67+
68+
You should see the following message on the console:
69+
70+
.. code-block:: console
71+
72+
Hello World! mikroe_quail
73+
74+
75+
Debugging
76+
=========
77+
78+
You can debug an application in the usual way. Here is an example for the
79+
:zephyr:code-sample:`hello_world` application.
80+
81+
.. zephyr-app-commands::
82+
:zephyr-app: samples/hello_world
83+
:board: mikroe_quail
84+
:maybe-skip-config:
85+
:goals: debug
86+
87+
References
88+
**********
89+
90+
.. target-notes::
91+
92+
.. _Quail website:
93+
https://www.mikroe.com/quail
94+
.. _Quail for STM32 User Manual:
95+
https://download.mikroe.com/documents/starter-boards/other/quail/quail-board-manual-v100.pdf
96+
.. _STM32F427VIT6 Website:
97+
https://www.st.com/en/microcontrollers-microprocessors/stm32f427vi.html
98+
.. _STM32F427:
99+
https://www.st.com/resource/en/datasheet/stm32f427vg.pdf

boards/mikroe/quail/mikroe_quail.dts

+240
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
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+
26+
ld1: led_1 {
27+
gpios = <&gpioe 15 GPIO_ACTIVE_HIGH>;
28+
label = "User LD1";
29+
};
30+
31+
ld2: led_2 {
32+
gpios = <&gpioe 10 GPIO_ACTIVE_HIGH>;
33+
label = "User LD2";
34+
};
35+
36+
ld3: led_3 {
37+
gpios = <&gpioc 3 GPIO_ACTIVE_HIGH>;
38+
label = "User LD3";
39+
};
40+
};
41+
42+
zephyr,user {
43+
io-channels = <&adc1 0>, <&adc1 1>, <&adc2 0>, <&adc2 1>;
44+
};
45+
46+
aliases {
47+
led0 = &ld1;
48+
led1 = &ld2;
49+
led2 = &ld3;
50+
volt-sensor0 = &vref;
51+
volt-sensor1 = &vbat;
52+
};
53+
54+
skd1: socket_1_adc {
55+
status = "okay";
56+
io-channels = <&adc2 0>;
57+
};
58+
59+
skd2: socket_2_adc {
60+
status = "okay";
61+
io-channels = <&adc1 0>;
62+
};
63+
64+
skd3: socket_3_adc {
65+
status = "okay";
66+
io-channels = <&adc2 1>;
67+
};
68+
69+
skd4: socket_4_adc {
70+
status = "okay";
71+
io-channels = <&adc1 1>;
72+
};
73+
};
74+
75+
&clk_lsi {
76+
status = "okay";
77+
};
78+
79+
&clk_hsi {
80+
clock-frequency = <DT_FREQ_M(16)>;
81+
status = "okay";
82+
};
83+
84+
&pll {
85+
div-m = <8>;
86+
mul-n = <96>;
87+
div-p = <2>;
88+
div-q = <4>;
89+
clocks = <&clk_hsi>;
90+
status = "okay";
91+
};
92+
93+
&rcc {
94+
clocks = <&pll>;
95+
clock-frequency = <DT_FREQ_M(96)>;
96+
ahb-prescaler = <1>;
97+
apb1-prescaler = <4>;
98+
apb2-prescaler = <2>;
99+
};
100+
101+
&usart1 {
102+
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
103+
pinctrl-names = "default";
104+
current-speed = <115200>;
105+
status = "okay";
106+
};
107+
108+
&usart2 {
109+
pinctrl-0 = <&usart2_tx_pd5 &usart2_rx_pd6>;
110+
pinctrl-names = "default";
111+
current-speed = <115200>;
112+
status = "okay";
113+
};
114+
115+
&usart3 {
116+
pinctrl-0 = <&usart3_tx_pd8 &usart3_rx_pd9>;
117+
pinctrl-names = "default";
118+
current-speed = <115200>;
119+
status = "okay";
120+
};
121+
122+
&usart6 {
123+
pinctrl-0 = <&usart6_tx_pc6 &usart6_rx_pc7>;
124+
pinctrl-names = "default";
125+
current-speed = <115200>;
126+
status = "okay";
127+
};
128+
129+
&rtc {
130+
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
131+
<&rcc STM32_SRC_LSI RTC_SEL(2)>;
132+
status = "okay";
133+
};
134+
135+
zephyr_udc0: &usbotg_fs {
136+
pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
137+
pinctrl-names = "default";
138+
status = "okay";
139+
};
140+
141+
#include <../boards/common/usb/cdc_acm_serial.dtsi>
142+
143+
&spi1 {
144+
pinctrl-0 = <&spi1_sck_pb3 &spi1_miso_pb4 &spi1_mosi_pb5>;
145+
pinctrl-names = "default";
146+
cs-gpios = <&gpioa 3 GPIO_ACTIVE_LOW>, <&gpioe 0 GPIO_ACTIVE_LOW>;
147+
status = "okay";
148+
};
149+
150+
&spi3 {
151+
status = "okay";
152+
pinctrl-0 = <&spi3_sck_pc10 &spi3_miso_pc11 &spi3_mosi_pc12>;
153+
pinctrl-names = "default";
154+
155+
cs-gpios =
156+
<&gpiod 11 GPIO_ACTIVE_LOW>, // CS0
157+
<&gpiod 1 GPIO_ACTIVE_LOW>, // CS1
158+
<&gpioa 13 GPIO_ACTIVE_LOW>; // CS2
159+
};
160+
161+
/* Flash chip 1 (extra flash connected to CS2) */
162+
&spi3 {
163+
flash1: flash@2 {
164+
compatible = "jedec,spi-nor"; // Typical flash chip compatibility string
165+
reg = <2>; // The CS0 pin on the SPI bus
166+
// S25FL164K flash's actual JEDEC: Device ID = 16h, Device Type = 40h,
167+
// Capacity = 17h
168+
//jedec-id = [16 40 17];
169+
jedec-id = [01 60 17];
170+
spi-max-frequency = <50000000>; // Max frequency for the flash chip (e.g., 50 MHz)
171+
size = <0x800000>; // Flash memory size (16MB example)
172+
page-size = <256>; // Flash page size (usually 256 or 512 bytes)
173+
//sector-size = <4096>; // Flash sector size (4KB typically)
174+
//erase-block-size = <4096>; // Erase block size (typically 4KB)
175+
//label = "flash1";
176+
status = "okay";
177+
};
178+
};
179+
180+
&i2c1 {
181+
pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
182+
pinctrl-names = "default";
183+
status = "okay";
184+
};
185+
186+
&adc1 {
187+
status ="okay";
188+
pinctrl-0 = <&adc1_in4_pa4 &adc1_in5_pa5>;
189+
pinctrl-names = "default";
190+
st,adc-clock-source = "SYNC";
191+
st,adc-prescaler = <2>;
192+
};
193+
194+
&adc2 {
195+
status ="okay";
196+
pinctrl-0 = <&adc2_in6_pa6 &adc2_in7_pa7>;
197+
pinctrl-names = "default";
198+
st,adc-clock-source = "SYNC";
199+
st,adc-prescaler = <2>;
200+
};
201+
202+
&vref {
203+
status = "okay";
204+
};
205+
206+
&vbat {
207+
status = "okay";
208+
};
209+
210+
mikrobus_1_adc: &skd1 {};
211+
212+
mikrobus_1_i2c: &i2c1 {};
213+
214+
mikrobus_1_spi: &spi1 {};
215+
216+
mikrobus_1_uart: &usart3 {};
217+
218+
mikrobus_2_adc: &skd2 {};
219+
220+
mikrobus_2_i2c: &i2c1 {};
221+
222+
mikrobus_2_spi: &spi1 {};
223+
224+
mikrobus_2_uart: &usart2 {};
225+
226+
mikrobus_3_adc: &skd3 {};
227+
228+
mikrobus_3_i2c: &i2c1 {};
229+
230+
mikrobus_3_spi: &spi3 {};
231+
232+
mikrobus_3_uart: &usart6 {};
233+
234+
mikrobus_4_adc: &skd4 {};
235+
236+
mikrobus_4_i2c: &i2c1 {};
237+
238+
mikrobus_4_spi: &spi3 {};
239+
240+
mikrobus_4_uart: &usart1 {};

boards/mikroe/quail/mikroe_quail.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
identifier: mikroe_quail
2+
name: MikroE Quail for STM32
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
ram: 256
9+
flash: 2048
10+
supported:
11+
- spi
12+
- i2c
13+
- uart
14+
- adc
15+
- gpio
16+
vendor: mikroe

0 commit comments

Comments
 (0)