1.. _stm32f412g_disco_board: 2 3ST STM32F412G Discovery 4####################### 5 6Overview 7******** 8 9The STM32F412 Discovery kit features an ARM Cortex-M4 based STM32F412ZG MCU 10with a wide range of connectivity support and configurations Here are 11some highlights of the STM32F412G-DISCO board: 12 13 14- STM32F412ZGT6 microcontroller featuring 1 Mbyte of Flash memory and 256 Kbytes of RAM in an LQFP144 package 15- On-board ST-LINK/V2-1 SWD debugger supporting USB re-enumeration capability: 16 17 - USB virtual COM port 18 - mass storage 19 - debug port 20 21- 1.54 inch 240x240 pixel TFT color LCD with parallel interface and capacitive touchscreen 22- I2S Audio CODEC, with a stereo headset jack, including analog microphone input and a loudspeaker output 23- Stereo digital MEMS microphones 24- MicroSD card connector extension 25- I2C extension connector 26- 128 Mbit Quad-SPI Nor Flash 27- Reset button and Joystick 28- Four color user LEDs. 29- USB OTG FS with Micro-AB connector 30- Four power supply options: 31 32 - ST-LINK/V2-1 USB connector 33 - User USB FS connector 34 - VIN from Arduino* connectors 35 - + 5 V from Arduino* connectors 36 37- Two power supplies for MCU: 2.0 V and 3.3 V 38- Compatible with Arduino(tm) Uno revision 3 connectors 39- Extension connector for direct access to various features of STM32F412ZGT6 MCU 40- Comprehensive free software including a variety of examples, part of STM32Cube package 41 42.. image:: img/stm32f412g_disco.jpg 43 :align: center 44 :alt: STM32F412G-DISCO 45 46More information about the board can be found at the `32F412GDISCOVERY website`_. 47 48Hardware 49******** 50 51STM32F469I-DISCO Discovery kit provides the following hardware components: 52 53- STM32F412ZGT6 in LQFP144 package 54- ARM |reg| 32-bit Cortex |reg| -M4 CPU with FPU 55- 100 MHz max CPU frequency 56- VDD from 1.7 V to 3.6 V 57- 1 MB Flash 58- 256 KB SRAM 59- GPIO with external interrupt capability 60- LCD parallel interface, 8080/6800 modes 61- 1x12-bit ADC with 16 channels 62- RTC 63- Advanced-control Timer 64- General Purpose Timers (12) 65- Watchdog Timers (2) 66- USART/UART (4) 67- I2C (4) 68- SPI (5) 69- SDIO 70- 2xCAN 71- CRC calculation unit 72- True random number generator 73- DMA Controller 74 75More information about STM32F412ZG can be found here: 76 - `STM32F412ZG on www.st.com`_ 77 - `STM32F412 reference manual`_ 78 79Supported Features 80================== 81 82The Zephyr stm32f412g_disco board configuration supports the following hardware features: 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| I2C | on-chip | i2c | 97+-----------+------------+-------------------------------------+ 98| SPI | on-chip | spi | 99+-----------+------------+-------------------------------------+ 100| QSPI NOR | on-chip | off-chip flash | 101+-----------+------------+-------------------------------------+ 102 103Other hardware features are not yet supported on Zephyr porting. 104 105The default configuration can be found in the defconfig file: 106 107 ``boards/arm/stm32f412g_disco/stm32f412g_disco_defconfig`` 108 109 110Pin Mapping 111=========== 112 113STM32F412G-DISCO Discovery kit has 8 GPIO controllers. These controllers are responsible for pin muxing, 114input/output, pull-up, etc. 115 116For mode details please refer to `32F412GDISCOVERY board User Manual`_. 117 118Default Zephyr Peripheral Mapping: 119---------------------------------- 120- UART_2_TX : PA2 121- UART_2_RX : PA3 122- LD1 : PE0 123- LD2 : PE1 124- LD3 : PE2 125- LD4 : PE3 126 127System Clock 128============ 129 130STM32F412G-DISCO System Clock could be driven by internal or external oscillator, 131as well as main PLL clock. By default System clock is driven by PLL clock at 100MHz, 132driven internal oscillator. 133 134Serial Port 135=========== 136 137The STM32F412G Discovery kit has up to 4 UARTs. The Zephyr console output is assigned to UART2. 138Default settings are 115200 8N1. 139 140 141Programming and Debugging 142************************* 143 144Applications for the ``stm32f412g_disco`` board configuration can be built and 145flashed in the usual way (see :ref:`build_an_application` and 146:ref:`application_run` for more details). 147 148Flashing 149======== 150 151STM32F412G-DISCO Discovery kit includes an ST-LINK/V2 embedded debug tool interface. 152This interface is supported by the openocd version included in Zephyr SDK. 153 154Flashing an application to STM32F412G-DISCO 155------------------------------------------- 156 157Connect the STM32F412G-DISCO Discovery kit to your host computer using 158the USB port, then run a serial host program to connect with your 159board: 160 161.. code-block:: console 162 163 $ minicom -D /dev/ttyACM0 164 165Then build and flash an application. Here is an example for the 166:ref:`hello_world` application. 167 168.. zephyr-app-commands:: 169 :zephyr-app: samples/hello_world 170 :board: stm32f412g_disco 171 :goals: build flash 172 173You should see the following message on the console: 174 175.. code-block:: console 176 177 Hello World! arm 178 179 180Debugging 181========= 182 183You can debug an application in the usual way. Here is an example for the 184:ref:`hello_world` application. 185 186.. zephyr-app-commands:: 187 :zephyr-app: samples/hello_world 188 :board: stm32f412g_disco 189 :maybe-skip-config: 190 :goals: debug 191 192.. _32F412GDISCOVERY website: 193 https://www.st.com/en/evaluation-tools/32f412gdiscovery.html 194 195.. _32F412GDISCOVERY board User Manual: 196 https://www.st.com/resource/en/user_manual/dm00275919.pdf 197 198.. _STM32F412ZG on www.st.com: 199 https://www.st.com/en/microcontrollers/stm32f412zg.html 200 201.. _STM32F412 reference manual: 202 https://www.st.com/resource/en/reference_manual/dm00180369.pdf 203