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