1.. zephyr:board:: black_f407zg_pro
2
3Overview
4********
5
6The BLACK_F407ZG_PRO board features an ARM Cortex-M4 based STM32F407zg 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_F407ZG_PRO board:
10
11- STM32 microcontroller in LQFP144 package
12- Extension header for all LQFP144 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
27.. warning:: The +5V pins on this board are directly connected to the +5V pin
28	     of the USB connector. There is no protection in place. Do not
29	     power this board through USB and an external power supply at
30	     the same time.
31
32
33Hardware
34********
35
36BLACK_F407ZG_PRO board provides the following hardware components:
37
38- STM32F407ZGT6 in LQFP144 package
39- ARM |reg| 32-bit Cortex |reg| -M4 CPU with FPU
40- 168 MHz max CPU frequency
41- VDD from 1.8 V to 3.6 V
42- 8MHz system crystal
43- 32.768KHz RTC crystal
44- JTAG/SWD header
45- 1024 kB Flash
46- 192+4 KB SRAM including 64-Kbyte of core coupled memory
47- GPIO with external interrupt capability
48- 3x12-bit ADC with 24 channels
49- 2x12-bit D/A converters
50- RTC battery CR1220
51- Advanced-control Timer (2)
52- General Purpose Timers (12)
53- Watchdog Timers (2)
54- USART (3), UART (2)
55- I2C (3)
56- I2S (2)
57- SPI (3)
58- SDIO (1)
59- CAN (2)
60- USB 2.0 OTG FS with on-chip PHY
61- USB 2.0 OTG HS/FS with dedicated DMA, on-chip full-speed PHY and ULPI
62- 10/100 Ethernet MAC with dedicated DMA
63- CRC calculation unit
64- True random number generator
65- DMA Controller
66- Micro SD
67- 1x 10/100 Ethernet MAC
68- 1x 8 to 12-bit Parallel Camera interface
69- Micro USB for power and comms
70- 2x jumpers for bootloader selection
71- 2x16 FMSC LCD Interface
72- NRF24L01 socket
73- Dimensions: 102.5mm x 74.56mm
74
75More information about STM32F407ZG SOC can be found here:
76       - `STM32F407ZG on www.st.com`_
77
78Supported Features
79==================
80
81The Zephyr black_f407zg_pro board configuration supports the following hardware
82features:
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| PWM       | on-chip    | pwm                                 |
97+-----------+------------+-------------------------------------+
98| USB       | on-chip    | usb                                 |
99+-----------+------------+-------------------------------------+
100| CAN       | on-chip    | CAN controller                      |
101+-----------+------------+-------------------------------------+
102| SPI       | on-chip    | spi                                 |
103+-----------+------------+-------------------------------------+
104
105.. note:: CAN feature requires CAN transceiver.
106	  Zephyr default configuration uses CAN_2 exclusively, as
107	  simultaneous use of CAN_1 and CAN_2 is not yet supported.
108
109Other hardware features are not yet supported on Zephyr porting.
110
111The default configuration can be found in
112:zephyr_file:`boards/others/black_f407zg_pro/black_f407zg_pro_defconfig`
113
114
115Pin Mapping
116===========
117
118BLACK_F407ZG_PRO has 7 GPIO controllers. These controllers are responsible for pin
119muxing, input/output, pull-up, etc.
120
121
122Default Zephyr Peripheral Mapping:
123----------------------------------
124
125.. rst-class:: rst-columns
126
127- UART_1_TX : PB6
128- UART_1_RX : PB7
129- UART_2_TX : PA2
130- UART_2_RX : PA3
131- USER_PB : PA0
132- LD3 : PD13
133- LD4 : PD12
134- LD5 : PD14
135- LD6 : PD15
136- USB DM : PA11
137- USB DP : PA12
138- CAN1_RX : PD0
139- CAN1_TX : PD1
140- CAN2_RX : PB12
141- CAN2_TX : PB13
142- SPI2 MISO : PC2
143- SPI2 MOSI : PC3
144- SPI2 SCK : PB10
145
146System Clock
147============
148
149BLACK_F407ZG_PRO System Clock could be driven by internal or external oscillator,
150as well as main PLL clock. By default System clock is driven by PLL clock
151at 168MHz, driven by 8MHz high speed external clock.
152
153Serial Port
154===========
155
156BLACK_F407ZG_PRO has up to 6 UARTs. The Zephyr console output is assigned to UART2.
157Default settings are 115200 8N1.
158Please note that ST-Link Virtual Com Port is not wired to chip serial port.
159In order to enable console output you should use a serial cable and connect
160it to UART2 pins (PA2/PA3).
161
162
163Programming and Debugging
164*************************
165
166Applications for the ``black_f407zg_pro`` board configuration can be built and
167flashed in the usual way (see :ref:`build_an_application` and
168:ref:`application_run` for more details).
169
170Flashing
171========
172
173BLACK_F407ZG_PRO board includes an ST-LINK/V2 embedded debug tool interface.
174This interface is supported by the openocd version included in Zephyr SDK.
175
176Flashing an application to BLACK_F407ZG_PRO
177-------------------------------------------
178
179Here is an example for the :zephyr:code-sample:`blinky` application.
180
181Run a serial host program to connect with your board:
182
183.. code-block:: console
184
185   $ minicom -D /dev/ttyACM0
186
187Build and flash the application:
188
189.. zephyr-app-commands::
190   :zephyr-app: samples/basic/blinky
191   :board: black_f407zg_pro
192   :goals: build flash
193
194You should see user led "LD1" blinking.
195
196Debugging
197=========
198
199You can debug an application in the usual way.  Here is an example for the
200:zephyr:code-sample:`hello_world` application.
201
202.. zephyr-app-commands::
203   :zephyr-app: samples/hello_world
204   :board: black_f407zg_pro
205   :maybe-skip-config:
206   :goals: debug
207
208.. _STM32F407ZG on www.st.com:
209   https://www.st.com/en/microcontrollers-microprocessors/stm32f407zg.html
210