1.. _stm32f0_disco_board:
2
3ST STM32F0 Discovery
4####################
5
6Overview
7********
8
9The STM32F0 Discovery development board uses an STM32F051R8T6 MCU and
10integrates the ST-LINK/V2-1 debugger and programmer.  It also comes with a
11comprehensive STM32 software HAL library and various packaged software
12examples.
13
14.. image:: img/stm32f0_disco.jpg
15     :align: center
16     :alt: STM32F0DISCOVERY
17
18More information about the board can be found at the `STM32F0DISCOVERY website`_.
19
20Hardware
21********
22
23The STM32 Discovery board features:
24
25- STM32F051R8T6 microcontroller featuring 64 KB Flash memory, 8 KB RAM in an
26  LQFP64 package
27- On-board ST-LINK/V2 with selection mode switch to use the kit as a standalone
28  ST-LINK/V2 (with SWD connector for programming and debugging)
29- Board power supply: through USB bus or from an external 5 V supply voltage
30- External application power supply: 3 V and 5 V
31- Four LEDs:
32
33    - LD1 (red) for 3.3 V power on
34    - LD2 (red/green) for USB communication
35    - LD3 (green) for PC9 output
36    - LD4 (blue) for PC8 output
37- Two push buttons (user and reset)
38- Extension header for all LQFP64 I/Os for quick connection to prototyping board
39  and easy probing
40- An additional board is provided which can be connected to the extension
41  connector for even easier prototyping and probing.
42- Comprehensive free software including a variety of examples, part of
43  STM32CubeF0 package or STSW-STM32049 for legacy Standard Libraries usage
44
45More information about STM32F051R8 can be found in the `STM32F0x8 reference manual`_.
46
47Supported Features
48==================
49
50The Zephyr stm32f0_disco board configuration supports the following hardware features:
51
52+-----------+------------+-------------------------------------+
53| Interface | Controller | Driver/Component                    |
54+===========+============+=====================================+
55| NVIC      | on-chip    | nested vector interrupt controller  |
56+-----------+------------+-------------------------------------+
57| UART      | on-chip    | serial port-polling;                |
58|           |            | serial port-interrupt               |
59+-----------+------------+-------------------------------------+
60| PINMUX    | on-chip    | pinmux                              |
61+-----------+------------+-------------------------------------+
62| GPIO      | on-chip    | gpio                                |
63+-----------+------------+-------------------------------------+
64| CLOCK     | on-chip    | reset and clock control             |
65+-----------+------------+-------------------------------------+
66| FLASH     | on-chip    | flash memory                        |
67+-----------+------------+-------------------------------------+
68| WATCHDOG  | on-chip    | independent watchdog                |
69+-----------+------------+-------------------------------------+
70
71Other hardware features are not yet supported in this Zephyr port.
72
73The default configuration can be found in the defconfig file:
74``boards/arm/stm32f0_disco/stm32f0_disco_defconfig``
75
76Connections and IOs
77===================
78
79Each of the GPIO pins can be configured by software as output (push-pull or open-drain), as
80input (with or without pull-up or pull-down), or as peripheral alternate function. Most of the
81GPIO pins are shared with digital or analog alternate functions. All GPIOs are high current
82capable except for analog inputs.
83
84Default Zephyr Peripheral Mapping:
85----------------------------------
86
87- UART_1_TX : PA9
88- UART_1_RX : PA10
89- UART_2_TX : PA2
90- UART_2_RX : PA3
91
92For mode details please refer to `STM32F0DISCOVERY board User Manual`_.
93
94Programming and Debugging
95*************************
96
97Applications for the ``stm32f0_disco`` board configuration can be built and
98flashed in the usual way (see :ref:`build_an_application` and
99:ref:`application_run` for more details).
100
101Flashing
102========
103
104STM32F0DISCOVERY board includes an ST-LINK/V2-1 embedded debug tool interface.
105This interface is supported by the openocd version included in the Zephyr SDK.
106
107Flashing an application to Nucleo F030R8
108----------------------------------------
109
110Here is an example for the :zephyr:code-sample:`blinky` application.
111
112.. zephyr-app-commands::
113   :zephyr-app: samples/basic/blinky
114   :board: stm32f0_disco
115   :goals: build flash
116
117You will see the LED blinking every second.
118
119Debugging
120=========
121
122You can debug an application in the usual way.  Here is an example for the
123:zephyr:code-sample:`blinky` application.
124
125.. zephyr-app-commands::
126   :zephyr-app: samples/basic/blinky
127   :board: stm32f0_disco
128   :maybe-skip-config:
129   :goals: debug
130
131References
132**********
133
134.. target-notes::
135
136.. _STM32F0DISCOVERY website:
137   https://www.st.com/en/evaluation-tools/stm32f0discovery.html
138
139.. _STM32F0x8 reference manual:
140   https://www.st.com/resource/en/reference_manual/dm00031936.pdf
141
142.. _STM32F0DISCOVERY board User Manual:
143   https://www.st.com/resource/en/user_manual/dm00050135.pdf
144