1.. zephyr:board:: stm32f4_disco
2
3Overview
4********
5
6The STM32F4DISCOVERY Discovery kit features an ARM Cortex-M4 based STM32F407VG MCU
7with a wide range of connectivity support and configurations Here are
8some highlights of the STM32F4DISCOVERY board:
9
10
11- STM32 microcontroller in LQFP100 package
12- Extension header for all LQFP100 I/Os for quick connection to prototyping board and easy probing
13- On-board ST-LINK/V2 debugger/programmer with SWD connector
14- Flexible board power supply:
15
16       - USB VBUS or external source(3.3V, 5V, 7 - 12V)
17       - Power management access point
18
19- Eight LEDs:
20
21       - USB communication (LD1)
22       - 3.3 V power on (LD2)
23       - Four user LEDs: orange (LD3), green (LD4), red (LD5), and blue (LD6)
24       - 2 USB OTG LEDs for VBUS (LD7) and over-current (LD8)
25
26- Two push-buttons: USER and RESET
27- USB OTG FS with micro-AB connector
28- LIS302DL or LIS3DSH ST MEMS 3-axis accelerometer
29- MP45DT02 ST-MEMS audio sensor omni-directional digital microphone
30- CS43L22 audio DAC with integrated class D speaker driver
31
32More information about the board can be found at the `STM32F4DISCOVERY website`_.
33
34Hardware
35********
36
37STM32F4DISCOVERY Discovery kit provides the following hardware components:
38
39- STM32F407VGT6 in LQFP100 package
40- ARM |reg| 32-bit Cortex |reg| -M4 CPU with FPU
41- 168 MHz max CPU frequency
42- VDD from 1.8 V to 3.6 V
43- 1 MB Flash
44- 192+4 KB SRAM including 64-Kbyte of core coupled memory
45- GPIO with external interrupt capability
46- 3x12-bit ADC with 24 channels
47- 2x12-bit D/A converters
48- RTC
49- Advanced-control Timer
50- General Purpose Timers (17)
51- Watchdog Timers (2)
52- USART/UART (6)
53- I2C (3)
54- SPI (3)
55- SDIO
56- 2xCAN
57- USB 2.0 OTG FS with on-chip PHY
58- USB 2.0 OTG HS/FS with dedicated DMA, on-chip full-speed PHY and ULPI
59- 10/100 Ethernet MAC with dedicated DMA
60- 8- to 14-bit parallel camera
61- CRC calculation unit
62- True random number generator
63- DMA Controller
64
65More information about STM32F407VG can be found here:
66       - `STM32F407VG on www.st.com`_
67       - `STM32F407 reference manual`_
68
69Supported Features
70==================
71
72.. zephyr:board-supported-hw::
73
74.. note:: CAN feature requires CAN transceiver, such as `SK Pang CAN breakout board`_.
75          Zephyr default configuration uses CAN_2 exclusively, as simultaneous use
76          of CAN_1 and CAN_2 is not yet supported.
77
78Pin Mapping
79===========
80
81STM32F4DISCOVERY Discovery kit has 8 GPIO controllers. These controllers are responsible for pin muxing,
82input/output, pull-up, etc.
83
84For more details please refer to `STM32F4DISCOVERY board User Manual`_.
85
86Default Zephyr Peripheral Mapping:
87----------------------------------
88
89.. rst-class:: rst-columns
90
91- UART_2_TX : PA2
92- UART_2_RX : PA3
93- USER_PB : PA0
94- LD3 : PD13
95- LD4 : PD12
96- LD5 : PD14
97- LD6 : PD15
98- USB DM : PA11
99- USB DP : PA12
100- CAN2_RX : PB5
101- CAN2_TX : PB13
102- I2C1_SDA : PB9
103- I2C1_SCL : PB6
104- I2S3_MCK : PC7
105- I2S3_CK : PC10
106- I2S3_SD : PC12
107- I2S3_WS : PA4
108
109System Clock
110============
111
112STM32F4DISCOVERY System Clock could be driven by internal or external oscillator,
113as well as main PLL clock. By default System clock is driven by PLL clock at 168MHz,
114driven by 8MHz high speed external clock.
115
116Serial Port
117===========
118
119STM32F4DISCOVERY Discovery kit has up to 6 UARTs. The Zephyr console output is assigned to UART2.
120Default settings are 115200 8N1.
121Please note that ST-Link Virtual Com Port is not wired to chip serial port. In order to
122enable console output you should use a serial cable and connect it to UART2 pins (PA2/PA3).
123
124
125Programming and Debugging
126*************************
127
128STM32F4DISCOVERY Discovery kit includes an ST-LINK/V2 embedded debug tool interface.
129
130Applications for the ``stm32f4_disco`` board configuration can be built and
131flashed in the usual way (see :ref:`build_an_application` and
132:ref:`application_run` for more details).
133
134Flashing
135========
136
137The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
138so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
139
140Alternatively, OpenOCD or JLink can also be used to flash the board using
141the ``--runner`` (or ``-r``) option:
142
143.. code-block:: console
144
145   $ west flash --runner openocd
146   $ west flash --runner jlink
147
148Flashing an application to STM32F4DISCOVERY
149-------------------------------------------
150
151Here is an example for the :zephyr:code-sample:`blinky` application.
152
153Run a serial host program to connect with your board:
154
155.. code-block:: console
156
157   $ minicom -D /dev/ttyACM0
158
159Build and flash the application:
160
161.. zephyr-app-commands::
162   :zephyr-app: samples/basic/blinky
163   :board: stm32f4_disco
164   :goals: build flash
165
166You should see user led "LD4" blinking.
167
168Debugging
169=========
170
171You can debug an application in the usual way.  Here is an example for the
172:zephyr:code-sample:`hello_world` application.
173
174.. zephyr-app-commands::
175   :zephyr-app: samples/hello_world
176   :board: stm32f4_disco
177   :maybe-skip-config:
178   :goals: debug
179
180.. _STM32F4DISCOVERY website:
181   https://www.st.com/en/evaluation-tools/stm32f4discovery.html
182
183.. _STM32F4DISCOVERY board User Manual:
184   https://www.st.com/resource/en/user_manual/dm00039084.pdf
185
186.. _STM32F407VG on www.st.com:
187   https://www.st.com/en/microcontrollers/stm32f407vg.html
188
189.. _STM32F407 reference manual:
190   https://www.st.com/resource/en/reference_manual/dm00031020.pdf
191
192.. _SK Pang CAN breakout board:
193   https://www.skpang.co.uk/products/can-bus-can-fd-breakout-board-5v-supply-and-3-3v-logic
194
195.. _STM32CubeProgrammer:
196   https://www.st.com/en/development-tools/stm32cubeprog.html
197