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