1.. _gd32f403z_eval: 2 3GigaDevice GD32F403Z-EVAL 4######################### 5 6 7Overview 8******** 9 10The GD32F403Z-EVAL board is a hardware platform that enables design and debug 11of the GigaDevice F403 Cortex-M4F High Performance MCU. 12 13The GD32F403ZE features a single-core ARM Cortex-M4F MCU which can run up 14to 168-MHz with flash accesses zero wait states, 512kiB of Flash, 96kiB of 15SRAM and 112 GPIOs. 16 17.. image:: img/gd32f403z_eval.jpg 18 :align: center 19 :alt: gd32f403z_eval 20 21 22Hardware 23******** 24 25- USB interface with mini-USB connector 26- 4 user LEDs 27- 4 user push buttons 28- Reset Button 29- CAN port 30- ADC connected to a potentiometer 31- 2 DAC channels 32- GD25Q40 4Mib SPI Flash 33- HY27UF081G2A 1GiB NAND Flash 34- AT24C02C 2KiB EEPROM 35- 3.2 TFT LCD (320x240) 36- PCM1770 Stereo DAC with Headphone Amplifier 37- Micro-SDHC interface 38- GD-Link interface 39 40 - CMSIS-DAP swd debug interface over USB HID. 41 42 43For more information about the GD32F403 SoC and GD32F403Z-Eval board: 44 45- `GigaDevice Cortex-M4F High Performance SoC Website`_ 46- `GD32F403 Datasheet`_ 47- `GD32F403 Reference Manual`_ 48- `GD32F403Z Eval Schematics`_ 49- `GD32 ISP Console`_ 50 51 52Supported Features 53================== 54 55The board configuration supports the following hardware features: 56 57+-----------+------------+-----------------------+ 58| Interface | Controller | Driver/Component | 59+===========+============+=======================+ 60| EXTI | on-chip | EXTI interrupt | 61| | | controller | 62+-----------+------------+-----------------------+ 63| GPIO | on-chip | gpio | 64+-----------+------------+-----------------------+ 65| NVIC | on-chip | nested vectored | 66| | | interrupt controller | 67+-----------+------------+-----------------------+ 68| PWM | on-chip | PWM | 69+-----------+------------+-----------------------+ 70| SYSTICK | on-chip | system clock | 71+-----------+------------+-----------------------+ 72| UART | on-chip | serial port-polling | 73+-----------+------------+-----------------------+ 74| ADC | on-chip | ADC | 75+-----------+------------+-----------------------+ 76 77Serial Port 78=========== 79 80The GD32F403Z-EVAL board has 5 serial communication ports. The default port 81is UART0 at PIN-9 and PIN-10. 82 83Programming and Debugging 84************************* 85 86Before program your board make sure to configure boot setting and serial port. 87The default serial port is USART0. This port uses header JP-5/6 to route 88signals between USB VBUS/ID and USART J2. 89 90+--------+--------+------------+ 91| Boot-0 | Boot-1 | Function | 92+========+========+============+ 93| 1-2 | 1-2 | SRAM | 94+--------+--------+------------+ 95| 1-2 | 2-3 | Bootloader | 96+--------+--------+------------+ 97| 2-3 | Any | Flash | 98+--------+--------+------------+ 99 100+------+------+-------------+ 101| JP-5 | JP-6 | Function | 102+======+======+=============+ 103| 1-2 | 1-2 | USART0 / J2 | 104+------+------+-------------+ 105| 2-3 | 2-3 | USB VBUS/ID | 106+------+------+-------------+ 107| open | open | Free | 108+------+------+-------------+ 109 110Using GD-Link 111============= 112 113The GD32F403Z-EVAL includes an onboard programmer/debugger (GD-Link) which 114allow flash programming and debug over USB. There are also program and debug 115headers J1 and J100 that can be used with any ARM compatible tools. 116 117#. Build the Zephyr kernel and the :ref:`hello_world` sample application: 118 119 .. zephyr-app-commands:: 120 :zephyr-app: samples/hello_world 121 :board: gd32f403z_eval 122 :goals: build 123 :compact: 124 125#. Run your favorite terminal program to listen for output. Under Linux the 126 terminal should be :code:`/dev/ttyUSB0`. For example: 127 128 .. code-block:: console 129 130 $ minicom -D /dev/ttyUSB0 -o 131 132 The -o option tells minicom not to send the modem initialization 133 string. Connection should be configured as follows: 134 135 - Speed: 115200 136 - Data: 8 bits 137 - Parity: None 138 - Stop bits: 1 139 140#. To flash an image: 141 142 .. zephyr-app-commands:: 143 :zephyr-app: samples/hello_world 144 :board: gd32f403z_eval 145 :goals: flash 146 :compact: 147 148 You should see "Hello World! gd32f403z_eval" in your terminal. 149 150#. To debug an image: 151 152 .. zephyr-app-commands:: 153 :zephyr-app: samples/hello_world 154 :board: gd32f403z_eval 155 :goals: debug 156 :compact: 157 158 159Using ROM bootloader 160==================== 161 162The GD32F403 MCU have a ROM bootloader which allow flash programming. User 163should install `GD32 ISP Console`_ software at some Linux path. The recommended 164is :code:`$HOME/.local/bin`. 165 166#. Build the Zephyr kernel and the :ref:`hello_world` sample application: 167 168 .. zephyr-app-commands:: 169 :zephyr-app: samples/hello_world 170 :board: gd32f403z_eval 171 :goals: build 172 :compact: 173 174#. Enable board bootloader: 175 176 - Remove boot-0 jumper 177 - press reset button 178 179#. To flash an image: 180 181 .. code-block:: console 182 183 west build -b gd32f403z_eval samples/hello_world 184 west flash -r gd32isp [--port=/dev/ttyUSB0] 185 186#. Run your favorite terminal program to listen for output. Under Linux the 187 terminal should be :code:`/dev/ttyUSB0`. For example: 188 189 .. code-block:: console 190 191 $ minicom -D /dev/ttyUSB0 -o 192 193 The -o option tells minicom not to send the modem initialization 194 string. Connection should be configured as follows: 195 196 - Speed: 115200 197 - Data: 8 bits 198 - Parity: None 199 - Stop bits: 1 200 201 Press reset button 202 203 You should see "Hello World! gd32f403z_eval" in your terminal. 204 205 206.. _GigaDevice Cortex-M4F High Performance SoC Website: 207 https://www.gigadevice.com/products/microcontrollers/gd32/arm-cortex-m4/high-performance-line/gd32f403-series/ 208 209.. _GD32F403 Datasheet: 210 https://gd32mcu.com/data/documents/datasheet/GD32F403xx_Datasheet_Rev1.3.pdf 211 212.. _GD32F403 Reference Manual: 213 https://gd32mcu.com/data/documents/userManual/GD32F403_User_Manual_Rev2.6.pdf 214 215.. _GD32F403Z Eval Schematics: 216 http://www.gd32mcu.com/download/down/document_id/270/path_type/1 217 218.. _GD32 ISP Console: 219 http://www.gd32mcu.com/download/down/document_id/175/path_type/1 220