1.. _stm32f412g_disco_board:
2
3ST STM32F412G Discovery
4#######################
5
6Overview
7********
8
9The STM32F412 Discovery kit features an ARM Cortex-M4 based STM32F412ZG MCU
10with a wide range of connectivity support and configurations Here are
11some highlights of the STM32F412G-DISCO board:
12
13
14- STM32F412ZGT6 microcontroller featuring 1 Mbyte of Flash memory and 256 Kbytes of RAM in an LQFP144 package
15- On-board ST-LINK/V2-1 SWD debugger supporting USB re-enumeration capability:
16
17       - USB virtual COM port
18       - mass storage
19       - debug port
20
21- 1.54 inch 240x240 pixel TFT color LCD with parallel interface and capacitive touchscreen
22- I2S Audio CODEC, with a stereo headset jack, including analog microphone input and a loudspeaker output
23- Stereo digital MEMS microphones
24- MicroSD card connector extension
25- I2C extension connector
26- 128 Mbit Quad-SPI Nor Flash
27- Reset button and Joystick
28- Four color user LEDs.
29- USB OTG FS with Micro-AB connector
30- Four power supply options:
31
32       - ST-LINK/V2-1 USB connector
33       - User USB FS connector
34       - VIN from Arduino* connectors
35       - + 5 V from Arduino* connectors
36
37- Two power supplies for MCU: 2.0 V and 3.3 V
38- Compatible with Arduino(tm) Uno revision 3 connectors
39- Extension connector for direct access to various features of STM32F412ZGT6 MCU
40- Comprehensive free software including a variety of examples, part of STM32Cube package
41
42.. image:: img/stm32f412g_disco.jpg
43     :align: center
44     :alt: STM32F412G-DISCO
45
46More information about the board can be found at the `32F412GDISCOVERY website`_.
47
48Hardware
49********
50
51STM32F469I-DISCO Discovery kit provides the following hardware components:
52
53- STM32F412ZGT6 in LQFP144 package
54- ARM |reg| 32-bit Cortex |reg| -M4 CPU with FPU
55- 100 MHz max CPU frequency
56- VDD from 1.7 V to 3.6 V
57- 1 MB Flash
58- 256 KB SRAM
59- GPIO with external interrupt capability
60- LCD parallel interface, 8080/6800 modes
61- 1x12-bit ADC with 16 channels
62- RTC
63- Advanced-control Timer
64- General Purpose Timers (12)
65- Watchdog Timers (2)
66- USART/UART (4)
67- I2C (4)
68- SPI (5)
69- SDIO
70- 2xCAN
71- CRC calculation unit
72- True random number generator
73- DMA Controller
74
75More information about STM32F412ZG can be found here:
76       - `STM32F412ZG on www.st.com`_
77       - `STM32F412 reference manual`_
78
79Supported Features
80==================
81
82The Zephyr stm32f412g_disco board configuration supports the following hardware features:
83
84+-----------+------------+-------------------------------------+
85| Interface | Controller | Driver/Component                    |
86+===========+============+=====================================+
87| NVIC      | on-chip    | nested vector interrupt controller  |
88+-----------+------------+-------------------------------------+
89| UART      | on-chip    | serial port-polling;                |
90|           |            | serial port-interrupt               |
91+-----------+------------+-------------------------------------+
92| PINMUX    | on-chip    | pinmux                              |
93+-----------+------------+-------------------------------------+
94| GPIO      | on-chip    | gpio                                |
95+-----------+------------+-------------------------------------+
96| I2C       | on-chip    | i2c                                 |
97+-----------+------------+-------------------------------------+
98| SPI       | on-chip    | spi                                 |
99+-----------+------------+-------------------------------------+
100| QSPI NOR  | on-chip    | off-chip flash                      |
101+-----------+------------+-------------------------------------+
102
103Other hardware features are not yet supported on Zephyr porting.
104
105The default configuration can be found in
106:zephyr_file:`boards/st/stm32f412g_disco/stm32f412g_disco_defconfig`
107
108
109Pin Mapping
110===========
111
112STM32F412G-DISCO Discovery kit has 8 GPIO controllers. These controllers are responsible for pin muxing,
113input/output, pull-up, etc.
114
115For more details please refer to `32F412GDISCOVERY board User Manual`_.
116
117Default Zephyr Peripheral Mapping:
118----------------------------------
119- UART_2_TX : PA2
120- UART_2_RX : PA3
121- LD1 : PE0
122- LD2 : PE1
123- LD3 : PE2
124- LD4 : PE3
125
126System Clock
127============
128
129STM32F412G-DISCO System Clock could be driven by internal or external oscillator,
130as well as main PLL clock. By default System clock is driven by PLL clock at 100MHz,
131driven internal oscillator.
132
133Serial Port
134===========
135
136The STM32F412G Discovery kit has up to 4 UARTs. The Zephyr console output is assigned to UART2.
137Default settings are 115200 8N1.
138
139
140Programming and Debugging
141*************************
142
143Applications for the ``stm32f412g_disco`` board configuration can be built and
144flashed in the usual way (see :ref:`build_an_application` and
145:ref:`application_run` for more details).
146
147Flashing
148========
149
150STM32F412G-DISCO Discovery kit includes an ST-LINK/V2 embedded debug tool interface.
151This interface is supported by the openocd version included in Zephyr SDK.
152
153Flashing an application to STM32F412G-DISCO
154-------------------------------------------
155
156Connect the STM32F412G-DISCO Discovery kit to your host computer using
157the USB port, then run a serial host program to connect with your
158board:
159
160.. code-block:: console
161
162   $ minicom -D /dev/ttyACM0
163
164Then build and flash an application. Here is an example for the
165:ref:`hello_world` application.
166
167.. zephyr-app-commands::
168   :zephyr-app: samples/hello_world
169   :board: stm32f412g_disco
170   :goals: build flash
171
172You should see the following message on the console:
173
174.. code-block:: console
175
176   Hello World! arm
177
178
179Debugging
180=========
181
182You can debug an application in the usual way.  Here is an example for the
183:ref:`hello_world` application.
184
185.. zephyr-app-commands::
186   :zephyr-app: samples/hello_world
187   :board: stm32f412g_disco
188   :maybe-skip-config:
189   :goals: debug
190
191.. _32F412GDISCOVERY website:
192   https://www.st.com/en/evaluation-tools/32f412gdiscovery.html
193
194.. _32F412GDISCOVERY board User Manual:
195   https://www.st.com/resource/en/user_manual/dm00275919.pdf
196
197.. _STM32F412ZG on www.st.com:
198   https://www.st.com/en/microcontrollers/stm32f412zg.html
199
200.. _STM32F412 reference manual:
201   https://www.st.com/resource/en/reference_manual/dm00180369.pdf
202