1.. _black_f407ve_board:
2
3Black STM32 F407VE Development Board
4####################################
5
6Overview
7********
8
9The BLACK_F407VE board features an ARM Cortex-M4 based STM32F407xx MCU
10with a wide range of connectivity support and configurations. There are
11multiple version of this board like ``black_f407ve``.
12Here are some highlights of the BLACK_F407VE board:
13
14- STM32 microcontroller in LQFP100 package
15- Extension header for all LQFP100 I/Os for quick connection to prototyping
16  board and easy probing
17- Flexible board power supply:
18
19       - USB VBUS or external source (3.3V, 5V)
20       - Power management access point
21
22- Three LEDs:
23
24       - 3.3 V power on (LD0)
25       - Two user LEDs: green (LD1), green (LD2)
26
27- Four push-buttons: RESET, K0, K1 and WK_UP
28- Mini-AB connector
29
30.. image:: img/black_f407ve.jpg
31     :align: center
32     :alt: BLACK_F407VE
33
34See also board descriptions at `STM32-base website`_,
35`STM32F407VET6 black board`_ and `MCUDev Black STM32F407VET6`_
36
37.. warning:: The +5V pins on this board are directly connected to the +5V pin
38	     of the USB connector. There is no protection in place. Do not
39	     power this board through USB and an external power supply at
40	     the same time.
41
42
43Hardware
44********
45
46BLACK_F407VE board provides the following hardware components:
47
48- STM32F407VET6 in LQFP100 package
49- ARM |reg| 32-bit Cortex |reg| -M4 CPU with FPU
50- 168 MHz max CPU frequency
51- VDD from 1.8 V to 3.6 V
52- 8MHz system crystal
53- 32.768KHz RTC crystal
54- JTAG/SWD header
55- 512 kB Flash
56- 192+4 KB SRAM including 64-Kbyte of core coupled memory
57- GPIO with external interrupt capability
58- 3x12-bit ADC with 24 channels
59- 2x12-bit D/A converters
60- RTC battery CR1220
61- Advanced-control Timer (2)
62- General Purpose Timers (12)
63- Watchdog Timers (2)
64- USART (3), UART (2)
65- I2C (3)
66- I2S (2)
67- SPI (3)
68- SDIO (1)
69- CAN (2)
70- USB 2.0 OTG FS with on-chip PHY
71- USB 2.0 OTG HS/FS with dedicated DMA, on-chip full-speed PHY and ULPI
72- 10/100 Ethernet MAC with dedicated DMA
73- CRC calculation unit
74- True random number generator
75- DMA Controller
76- Micro SD
77- 1x 10/100 Ethernet MAC
78- 1x 8 to 12-bit Parallel Camera interface
79- Micro USB for power and comms
80- 2x jumpers for bootloader selection
81- 2x16 FMSC LCD Interface
82- NRF24L01 socket
83- Dimensions: 85.1mm x 72.45mm
84
85More information about STM32F407VE SOC can be found here:
86       - `STM32F407VE on www.st.com`_
87
88Supported Features
89==================
90
91The Zephyr black_f407ve board configuration supports the following hardware
92features:
93
94+-----------+------------+-------------------------------------+
95| Interface | Controller | Driver/Component                    |
96+===========+============+=====================================+
97| NVIC      | on-chip    | nested vector interrupt controller  |
98+-----------+------------+-------------------------------------+
99| UART      | on-chip    | serial port-polling;                |
100|           |            | serial port-interrupt               |
101+-----------+------------+-------------------------------------+
102| PINMUX    | on-chip    | pinmux                              |
103+-----------+------------+-------------------------------------+
104| GPIO      | on-chip    | gpio                                |
105+-----------+------------+-------------------------------------+
106| PWM       | on-chip    | pwm                                 |
107+-----------+------------+-------------------------------------+
108| USB       | on-chip    | usb                                 |
109+-----------+------------+-------------------------------------+
110| CAN       | on-chip    | CAN controller                      |
111+-----------+------------+-------------------------------------+
112| SPI       | on-chip    | spi                                 |
113+-----------+------------+-------------------------------------+
114
115.. note:: CAN feature requires CAN transceiver.
116	  Zephyr default configuration uses CAN_2 exclusively, as
117	  simultaneous use of CAN_1 and CAN_2 is not yet supported.
118
119Other hardware features are not yet supported on Zephyr porting.
120
121The default configuration can be found in
122:zephyr_file:`boards/others/black_f407ve/black_f407ve_defconfig`
123
124
125Pin Mapping
126===========
127
128BLACK_F407VE has 5 GPIO controllers. These controllers are responsible for pin
129muxing, input/output, pull-up, etc.
130
131.. image:: img/stm32f407vet6_left02.jpg
132     :align: center
133     :alt: left pins
134
135.. image:: img/stm32f407vet6_right01.jpg
136     :align: center
137     :alt: right pins
138
139.. image:: img/stm32f407vet6_st-link02.jpg
140     :align: center
141     :alt: bottom and top pins
142
143Default Zephyr Peripheral Mapping:
144----------------------------------
145
146.. rst-class:: rst-columns
147
148- UART_1_TX : PA9
149- UART_1_RX : PA10
150- UART_2_TX : PA2
151- UART_2_RX : PA3
152- USER_PB : PA0
153- LD3 : PD13
154- LD4 : PD12
155- LD5 : PD14
156- LD6 : PD15
157- USB DM : PA11
158- USB DP : PA12
159- CAN1_RX : PD0
160- CAN1_TX : PD1
161- CAN2_RX : PB12
162- CAN2_TX : PB13
163- SPI1 MISO : PB4
164- SPI1 MOSI : PB5
165- SPI1 SCK : PB3
166- SPI1 Flash CS : PB0
167- SPI2 MISO : PC2
168- SPI2 MOSI : PC3
169- SPI2 SCK : PB10
170
171System Clock
172============
173
174BLACK_F407VE System Clock could be driven by internal or external oscillator,
175as well as main PLL clock. By default System clock is driven by PLL clock
176at 168MHz, driven by 8MHz high speed external clock.
177
178Serial Port
179===========
180
181BLACK_F407VE has up to 6 UARTs. The Zephyr console output is assigned to UART1.
182Default settings are 115200 8N1.
183Please note that ST-Link Virtual Com Port is not wired to chip serial port.
184In order to enable console output you should use a serial cable and connect
185it to UART1 pins (PA9/PA10).
186
187
188Programming and Debugging
189*************************
190
191Applications for the ``black_f407ve`` board configuration can be built and
192flashed in the usual way (see :ref:`build_an_application` and
193:ref:`application_run` for more details).
194
195Flashing
196========
197
198BLACK_F407VE board includes an ST-LINK/V2 embedded debug tool interface.
199This interface is supported by the openocd version included in Zephyr SDK.
200
201Flashing an application to BLACK_F407VE
202---------------------------------------
203
204Here is an example for the :zephyr:code-sample:`blinky` application.
205
206Run a serial host program to connect with your board:
207
208.. code-block:: console
209
210   $ minicom -D /dev/ttyACM0
211
212Build and flash the application:
213
214.. zephyr-app-commands::
215   :zephyr-app: samples/basic/blinky
216   :board: black_f407ve
217   :goals: build flash
218
219You should see user led "LD1" blinking.
220
221Debugging
222=========
223
224You can debug an application in the usual way.  Here is an example for the
225:ref:`hello_world` application.
226
227.. zephyr-app-commands::
228   :zephyr-app: samples/hello_world
229   :board: black_f407ve
230   :maybe-skip-config:
231   :goals: debug
232
233.. _STM32-base website:
234   https://stm32-base.org/boards/STM32F407VET6-STM32-F4VE-V2.0.html
235
236.. _STM32F407VE on www.st.com:
237   https://www.st.com/en/microcontrollers/stm32f407ve.html
238
239.. _STM32F407VET6 black board:
240   https://os.mbed.com/users/hudakz/code/STM32F407VET6_Hello/
241
242.. _MCUDev Black STM32F407VET6:
243   https://github.com/mcauser/BLACK_F407VE
244