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