1.. zephyr:board:: mikroe_quail
2
3Overview
4********
5MikroE Quail for STM32 is a development board containing an `STM32F427`_
6microcontroller. It is equipped with four mikroBUS sockets.
7The edges of the board are lined with screw terminals and USB ports for
8additional connectivity.
9
10Hardware
11********
12The Quail board contains the following connections:
13
14  - Four mikroBUS connectors
15  - 32 screw terminals
16  - two USB ports, one for programming and one for external storage
17
18Furthermore the board contains three LEDs that are connected
19to the microcontroller.
20
21Supported Features
22==================
23
24.. zephyr:board-supported-hw::
25
26Connections and IOs
27===================
28
29The four mikroBUS interfaces are aliased in the device tree so that their
30peripherals can be accessed using ``mikrobus_N_INTERFACE`` so e.g. the SPI on
31bus 2 can be found by the alias ``mikrobus_2_spi``. The numbering corresponds
32with the marking on the board.
33
34For connections on the edge connectors, please refer to `Quail for STM32 User Manual`_.
35
36Programming and Debugging
37*************************
38
39.. zephyr:board-supported-runners::
40
41Applications for the ``mikroe_quail`` board can be built and flashed in the usual way
42(see :ref:`build_an_application` and :ref:`application_run` for more details).
43
44
45Flashing
46========
47The board ships with a locked flash, and will fail with the message:
48
49.. code-block:: console
50
51   Error: stm32x device protected
52
53Unlocking 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
61Here 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
68You should see the following message on the console:
69
70.. code-block:: console
71
72   Hello World! mikroe_quail
73
74
75Debugging
76=========
77
78You 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
87References
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
100