1.. _stm32f072b_disco_board:
2
3ST STM32F072B Discovery
4#######################
5
6Overview
7********
8
9The STM32F072B-DISCO Discovery kit features an ARM Cortex-M0 based STM32F072RB
10MCU with everything required for beginners and experienced users to get
11started quickly. Here are some highlights of the STM32F072B-DISCO board:
12
13- STM32 microcontroller in LQFP64 package
14- Extension header for LQFP64 I/Os for a quick connection to the prototyping
15  board and easy probing
16- On-board ST-LINK/V2, debugger/programmer with SWD connector
17- Board power supply: through USB bus or from an external 5 V supply voltage
18- External application power supply: 3 V and 5 V
19
20- Six LEDs:
21
22  - LD1 (red/green) for USB communication
23  - LD2 (red) for 3.3 V power on
24  - Four user LEDs: LD3 (orange), LD4 (green), LD5 (red) and LD6 (blue)
25
26- Two push-buttons: USER and RESET
27- USB USER with Mini-B connector
28- L3GD20, ST MEMS motion sensor, 3-axis digital output gyroscope
29- One linear touch sensor or four touch keys
30- RF EEprom daughter board connector
31
32.. image:: img/stm32f072b_disco.jpg
33     :align: center
34     :alt: STM32F072B-DISCO
35
36More information about the board can be found at the
37`STM32F072B-DISCO website`_.
38
39Hardware
40********
41
42STM32F072B-DISCO Discovery kit provides the following hardware components:
43
44- STM32F072RBTT6 in LQFP64 package
45- ARM |reg| 32-bit Cortex |reg| -M0 CPU
46- 48 MHz max CPU frequency
47- VDD from 2.0 V to 3.6 V
48- 128 KB Flash
49- 16 KB SRAM
50- GPIO with external interrupt capability
51- 12-bit ADC with 39 channels
52- 12-bit D/A converters
53- RTC
54- General Purpose Timers (12)
55- USART/UART (4)
56- I2C (2)
57- SPI (2)
58- CAN
59- USB 2.0 full speed interface
60- DMA Controller
61- 24 capacitive sensing channels for touchkey, linear and rotary touch sensors
62
63More information about STM32F072RB can be found here:
64       - `STM32F072RB on www.st.com`_
65       - `STM32F072xB reference manual`_
66
67Supported Features
68==================
69
70The Zephyr stm32f072b_disco board configuration supports the following hardware
71features:
72
73+-----------+------------+-------------------------------------+
74| Interface | Controller | Driver/Component                    |
75+===========+============+=====================================+
76| NVIC      | on-chip    | nested vector interrupt controller  |
77+-----------+------------+-------------------------------------+
78| UART      | on-chip    | serial port-polling;                |
79|           |            | serial port-interrupt               |
80+-----------+------------+-------------------------------------+
81| PINMUX    | on-chip    | pinmux                              |
82+-----------+------------+-------------------------------------+
83| GPIO      | on-chip    | gpio                                |
84+-----------+------------+-------------------------------------+
85| CLOCK     | on-chip    | reset and clock control             |
86+-----------+------------+-------------------------------------+
87| WATCHDOG  | on-chip    | independent watchdog                |
88+-----------+------------+-------------------------------------+
89| I2C       | on-chip    | i2c controller                      |
90+-----------+------------+-------------------------------------+
91| SPI       | on-chip    | SPI controller                      |
92+-----------+------------+-------------------------------------+
93| CAN       | on-chip    | CAN controller                      |
94+-----------+------------+-------------------------------------+
95
96.. note:: CAN feature requires CAN transceiver, such as `SK Pang CAN breakout board`_.
97
98Other hardware features are not yet supported in this Zephyr port.
99
100The default configuration can be found in
101:zephyr_file:`boards/st/stm32f072b_disco/stm32f072b_disco_defconfig`
102
103
104Pin Mapping
105===========
106
107STM32F072B-DISCO Discovery kit has 6 GPIO controllers. These controllers are
108responsible for pin muxing, input/output, pull-up, etc.
109
110For more details please refer to `STM32F072B-DISCO board User Manual`_.
111
112Default Zephyr Peripheral Mapping:
113----------------------------------
114- UART_1_TX : PB6
115- UART_1_RX : PB7
116- I2C1_SCL : PB8
117- I2C1_SDA : PB9
118- I2C2_SCL : PB10
119- I2C2_SDA : PB11
120- SPI1_SCK : PB3
121- SPI1_MISO : PB4
122- SPI1_MOSI : PB5
123- USER_PB : PA0
124- LD3 : PC6
125- LD4 : PC8
126- LD5 : PC9
127- LD6 : PC7
128- CAN_RX : PB8
129- CAN_TX : PB9
130
131System Clock
132============
133
134STM32F072B-DISCO System Clock could be driven by internal or external
135oscillator, as well as main PLL clock. By default System clock is driven
136by PLL clock at 72 MHz, driven by internal 8 MHz oscillator.
137
138Serial Port
139===========
140
141STM32F072B-DISCO Discovery kit has up to 4 UARTs. The Zephyr console output
142is assigned to UART 1. Default settings are 115200 8N1.
143
144Programming and Debugging
145*************************
146
147Applications for the ``stm32f072b_disco`` board configuration can be built and
148flashed in the usual way (see :ref:`build_an_application` and
149:ref:`application_run` for more details).
150
151Flashing
152========
153
154STM32F072B-DISCO board includes an ST-LINK/V2 embedded debug tool interface.
155This interface is supported by the openocd version included in the Zephyr SDK.
156
157
158Flashing an application to STM32F072B-DISCO
159-------------------------------------------
160
161First, connect the STM32F072B-DISCO Discovery kit to your host computer using
162the USB port to prepare it for flashing. Then build and flash your application.
163
164Here is an example for the :ref:`hello_world` application.
165
166.. zephyr-app-commands::
167   :zephyr-app: samples/hello_world
168   :board: stm32f072b_disco
169   :goals: build flash
170
171Run a serial host program to connect with your board. A TTL(3.3V) serial
172adapter is required.
173
174.. code-block:: console
175
176   $ minicom -D /dev/<tty device>
177
178Replace <tty_device> with the port where the serial adapter can be found.
179For example, under Linux, /dev/ttyUSB0.
180
181You should see the following message on the console:
182
183.. code-block:: console
184
185   Hello World! arm
186
187
188Debugging
189=========
190
191You can debug an application in the usual way.  Here is an example for the
192:ref:`hello_world` application.
193
194.. zephyr-app-commands::
195   :zephyr-app: samples/hello_world
196   :board: stm32f072b_disco
197   :goals: debug
198
199References
200**********
201
202.. target-notes::
203
204.. _STM32F072B-DISCO website:
205   https://www.st.com/en/evaluation-tools/32f072bdiscovery.html
206
207
208.. _STM32F072B-DISCO board User Manual:
209   https://www.st.com/resource/en/user_manual/dm00099401.pdf
210
211.. _STM32F072RB on www.st.com:
212   https://www.st.com/en/microcontrollers/stm32f072rb.html
213
214.. _STM32F072xB reference manual:
215   https://www.st.com/resource/en/reference_manual/dm00031936.pdf
216
217.. _SK Pang CAN breakout board:
218   https://www.skpang.co.uk/products/can-bus-can-fd-breakout-board-5v-supply-and-5v-logic
219