1.. zephyr:board:: gd32vf103c_starter
2
3Overview
4********
5
6The GD32VF103C-STARTER board is a hardware platform that enables prototyping
7on GD32VF103CB RISC-V MCU.
8
9The GD32VF103CB features a single-core RISC-V 32-bit MCU which can run up
10to 108 MHz with flash accesses zero wait states, 128 KiB of Flash, 32 KiB of
11SRAM and 37 GPIOs.
12
13Hardware
14********
15
16- GD32VF103CBT6 MCU
17- 1 x User LEDs
18- 1 x USART (USB port with CH340E)
19- USB FS connector
20- GD-Link on board programmer
21- J-Link/JTAG connector
22
23For more information about the GD32VF103 SoC and GD32VF103C-STARTER board:
24
25- `GigaDevice RISC-V Mainstream SoC Website`_
26- `GD32VF103 Datasheet`_
27- `GD32VF103 User Manual`_
28- `GD32VF103C-STARTER Documents`_
29
30Supported Features
31==================
32
33The board configuration supports the following hardware features:
34
35.. list-table::
36   :header-rows: 1
37
38   * - Peripheral
39     - Kconfig option
40     - Devicetree compatible
41   * - GPIO
42     - :kconfig:option:`CONFIG_GPIO`
43     - :dtcompatible:`gd,gd32-gpio`
44   * - Machine timer
45     - :kconfig:option:`CONFIG_RISCV_MACHINE_TIMER`
46     - :dtcompatible:`riscv,machine-timer`
47   * - Nuclei ECLIC Interrupt Controller
48     - :kconfig:option:`CONFIG_NUCLEI_ECLIC`
49     - :dtcompatible:`nuclei,eclic`
50   * - PWM
51     - :kconfig:option:`CONFIG_PWM`
52     - :dtcompatible:`gd,gd32-pwm`
53   * - USART
54     - :kconfig:option:`CONFIG_SERIAL`
55     - :dtcompatible:`gd,gd32-usart`
56
57Serial Port
58===========
59
60The GD32VF103C-STARTER board has one serial communications port.
61TX connected at PA9 and RX at PA10.
62
63Programming and Debugging
64*************************
65
66Before programming your board make sure to configure boot and serial jumpers
67as follows:
68
69- JP2/3: Select 2-3 for both (boot from user memory)
70- JP5/6: Select 1-2 positions (labeled as ``USART0``)
71
72Using GD-Link
73=============
74
75The GD32VF103C-STARTER includes an onboard programmer/debugger (GD-Link) which
76allows flash programming and debugging over USB. There is also a JTAG header
77(JP1) which can be used with tools like Segger J-Link.
78
79#. Build the Zephyr kernel and the :zephyr:code-sample:`hello_world` sample application:
80
81   .. zephyr-app-commands::
82      :zephyr-app: samples/hello_world
83      :board: gd32vf103c_starter
84      :goals: build
85      :compact:
86
87#. Run your favorite terminal program to listen for output. On Linux the
88   terminal should be something like ``/dev/ttyUSB0``. For example:
89
90   .. code-block:: console
91
92      minicom -D /dev/ttyUSB0 -o
93
94   The -o option tells minicom not to send the modem initialization
95   string. Connection should be configured as follows:
96
97      - Speed: 115200
98      - Data: 8 bits
99      - Parity: None
100      - Stop bits: 1
101
102#. To flash an image:
103
104   .. zephyr-app-commands::
105      :zephyr-app: samples/hello_world
106      :board: gd32vf103c_starter
107      :goals: flash
108      :compact:
109
110   You should see "Hello World! gd32vf103c_starter" in your terminal.
111
112#. To debug an image:
113
114   .. zephyr-app-commands::
115      :zephyr-app: samples/hello_world
116      :board: gd32vf103c_starter
117      :goals: debug
118      :compact:
119
120
121.. _GigaDevice RISC-V Mainstream SoC Website:
122   https://www.gigadevice.com/products/microcontrollers/gd32/risc-v/mainstream-line/
123
124.. _GD32VF103 Datasheet:
125   https://www.gigadevice.com/datasheet/gd32vf103xxxx-datasheet/
126
127.. _GD32VF103 User Manual:
128   http://www.gd32mcu.com/download/down/document_id/222/path_type/1
129
130.. _GD32VF103C-STARTER Documents:
131   https://github.com/riscv-mcu/GD32VF103_Demo_Suites/tree/master/GD32VF103C_START_Demo_Suites/Docs
132