Skip to content

Commit 4ff6639

Browse files
feilongflcarlescufi
authored andcommitted
boards: arm: Introduce gd32e103v_eval board
Add gigadevice gd32e103v_eval board initial version. Signed-off-by: YuLong Yao <[email protected]>
1 parent 988ae30 commit 4ff6639

File tree

10 files changed

+333
-0
lines changed

10 files changed

+333
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2021, YuLong Yao <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_GD32E103V_EVAL
5+
bool "GigaDevice GD32E103V Evaluation Kit"
6+
depends on SOC_GD32E103
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2021 YuLong Yao <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_GD32E103V_EVAL
5+
6+
config BOARD
7+
default "gd32e103v_eval"
8+
9+
endif # BOARD_GD32E103V_EVAL
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) 2021, YuLong Yao <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
5+
6+
board_runner_args(gd32isp "--device=GD32E103VBT6")
7+
include(${ZEPHYR_BASE}/boards/common/gd32isp.board.cmake)
558 KB
Loading
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
.. _gd32e103v_eval:
2+
3+
GigaDevice GD32E103V-EVAL
4+
#########################
5+
6+
7+
Overview
8+
********
9+
10+
The GD32E103V-EVAL board is a hardware platform that enables design and debug
11+
of the GigaDevice E103 Cortex-M4F High Performance MCU.
12+
13+
The GD32E103VB features a single-core ARM Cortex-M4F MCU which can run up
14+
to 120-MHz with flash accesses zero wait states, 128kiB of Flash, 32kiB of
15+
SRAM and 80 GPIOs.
16+
17+
.. image:: img/gd32e103v_eval.png
18+
:width: 800px
19+
:align: center
20+
:alt: gd32e103v_eval
21+
22+
23+
Hardware
24+
********
25+
26+
- USB interface with mini-USB connector
27+
- 4 user LEDs
28+
- 4 user push buttons
29+
- Reset Button
30+
- ADC connected to a potentiometer
31+
- 2 DAC channels
32+
- GD25Q16 2Mib SPI Flash
33+
- AT24C02C 2KiB EEPROM
34+
- 3.2 TFT LCD (320x240)
35+
- PCM1770 Stereo DAC with Headphone Amplifier
36+
- GD-Link interface
37+
38+
- CMSIS-DAP swd debug interface over USB HID.
39+
40+
- 2 CAN port(support CAN-FD)
41+
42+
- This function is not available in this board due to hardware issues, please check ``GD32C103`` .
43+
44+
For more information about the GD32E103 SoC and GD32E103V-EVAL board:
45+
46+
- `GigaDevice Cortex-M4F High Performance SoC Website`_
47+
- `GD32E103 Datasheet`_
48+
- `GD32E103 Reference Manual`_
49+
- `GD32E103V Eval Schematics`_
50+
- `GD32 ISP Console`_
51+
52+
53+
Supported Features
54+
==================
55+
56+
The board configuration supports the following hardware features:
57+
58+
.. list-table::
59+
:header-rows: 1
60+
61+
* - Peripheral
62+
- Kconfig option
63+
- Devicetree compatible
64+
* - NVIC
65+
- N/A
66+
- :dtcompatible:`arm,v7m-nvic`
67+
* - SYSTICK
68+
- N/A
69+
- N/A
70+
* - USART
71+
- :kconfig:`CONFIG_SERIAL`
72+
- :dtcompatible:`gd,gd32-usart`
73+
74+
75+
Serial Port
76+
===========
77+
78+
The GD32E103V-EVAL board has 5 serial communication ports. The default port
79+
is UART0 at PIN-9 and PIN-10.
80+
81+
Programming and Debugging
82+
*************************
83+
84+
Before program your board make sure to configure boot setting and serial port.
85+
The default serial port is USART0. This port uses header JP-5/6 to route
86+
signals between USB VBUS/ID and USART J2.
87+
88+
+--------+--------+------------+
89+
| Boot-0 | Boot-1 | Function |
90+
+========+========+============+
91+
| 1-2 | 1-2 | SRAM |
92+
+--------+--------+------------+
93+
| 1-2 | 2-3 | Bootloader |
94+
+--------+--------+------------+
95+
| 2-3 | Any | Flash |
96+
+--------+--------+------------+
97+
98+
+------+------+-------------+
99+
| JP-5 | JP-6 | Function |
100+
+======+======+=============+
101+
| 1-2 | 1-2 | USART0 / J2 |
102+
+------+------+-------------+
103+
| 2-3 | 2-3 | USB VBUS/ID |
104+
+------+------+-------------+
105+
| open | open | Free |
106+
+------+------+-------------+
107+
108+
Using GD-Link
109+
=============
110+
111+
The GD32E103V-EVAL includes an onboard programmer/debugger (GD-Link) which
112+
allow flash programming and debug over USB. There are also program and debug
113+
headers J1 and J100 that can be used with any ARM compatible tools.
114+
115+
#. Build the Zephyr kernel and the :ref:`hello_world` sample application:
116+
117+
.. zephyr-app-commands::
118+
:zephyr-app: samples/hello_world
119+
:board: gd32e103v_eval
120+
:goals: build
121+
:compact:
122+
123+
#. Run your favorite terminal program to listen for output. Under Linux the
124+
terminal should be :code:`/dev/ttyUSB0`. For example:
125+
126+
.. code-block:: console
127+
128+
$ minicom -D /dev/ttyUSB0 -o
129+
130+
The -o option tells minicom not to send the modem initialization
131+
string. Connection should be configured as follows:
132+
133+
- Speed: 115200
134+
- Data: 8 bits
135+
- Parity: None
136+
- Stop bits: 1
137+
138+
#. To flash an image:
139+
140+
.. zephyr-app-commands::
141+
:zephyr-app: samples/hello_world
142+
:board: gd32e103v_eval
143+
:goals: flash
144+
:compact:
145+
146+
You should see "Hello World! gd32e103v_eval" in your terminal.
147+
148+
#. To debug an image:
149+
150+
.. zephyr-app-commands::
151+
:zephyr-app: samples/hello_world
152+
:board: gd32e103v_eval
153+
:goals: debug
154+
:compact:
155+
156+
157+
Using ROM bootloader
158+
====================
159+
160+
The GD32E103 MCU have a ROM bootloader which allow flash programming. User
161+
should install `GD32 ISP Console`_ software at some Linux path. The recommended
162+
is :code:`$HOME/.local/bin`.
163+
164+
#. Build the Zephyr kernel and the :ref:`hello_world` sample application:
165+
166+
.. zephyr-app-commands::
167+
:zephyr-app: samples/hello_world
168+
:board: gd32e103v_eval
169+
:goals: build
170+
:compact:
171+
172+
#. Enable board bootloader:
173+
174+
- Remove boot-0 jumper
175+
- press reset button
176+
177+
#. To flash an image:
178+
179+
.. code-block:: console
180+
181+
west build -b gd32e103v_eval samples/hello_world
182+
west flash -r gd32isp [--port=/dev/ttyUSB0]
183+
184+
#. Run your favorite terminal program to listen for output. Under Linux the
185+
terminal should be :code:`/dev/ttyUSB0`. For example:
186+
187+
.. code-block:: console
188+
189+
$ minicom -D /dev/ttyUSB0 -o
190+
191+
The -o option tells minicom not to send the modem initialization
192+
string. Connection should be configured as follows:
193+
194+
- Speed: 115200
195+
- Data: 8 bits
196+
- Parity: None
197+
- Stop bits: 1
198+
199+
Press reset button
200+
201+
You should see "Hello World! gd32e103v_eval" in your terminal.
202+
203+
204+
.. _GigaDevice Cortex-M4F High Performance SoC Website:
205+
https://www.gigadevice.com/products/microcontrollers/gd32/arm-cortex-m4/value-line/gd32e103-series/
206+
207+
.. _GD32E103 Datasheet:
208+
http://www.gd32mcu.com/download/down/document_id/235/path_type/1
209+
210+
.. _GD32E103 Reference Manual:
211+
http://www.gd32mcu.com/download/down/document_id/163/path_type/1
212+
213+
.. _GD32E103V Eval Schematics:
214+
http://www.gd32mcu.com/download/down/document_id/178/path_type/1
215+
216+
.. _GD32 ISP Console:
217+
http://www.gd32mcu.com/download/down/document_id/175/path_type/1
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2021, YuLong Yao <[email protected]>
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <dt-bindings/pinctrl/gd32e103v(b-8)xx-pinctrl.h>
7+
8+
&pinctrl {
9+
usart0_default: usart0_default {
10+
group1 {
11+
pinmux = <USART0_TX_PA9_NORMP>, <USART0_RX_PA10_NORMP>;
12+
};
13+
};
14+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2021, YuLong Yao <[email protected]>
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <gigadevice/gd32e10x/gd32e103vbt6.dtsi>
9+
#include "gd32e103v_eval-pinctrl.dtsi"
10+
11+
/ {
12+
model = "GigaDevice gd32e103v Evaluation Kit";
13+
compatible = "gd,gd32e103v";
14+
15+
chosen {
16+
zephyr,sram = &sram0;
17+
zephyr,flash = &flash0;
18+
zephyr,console = &usart0;
19+
zephyr,shell-uart = &usart0;
20+
};
21+
};
22+
23+
&usart0 {
24+
status = "okay";
25+
current-speed = <115200>;
26+
pinctrl-0 = <&usart0_default>;
27+
pinctrl-names = "default";
28+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2021, YuLong Yao <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
identifier: gd32e103v_eval
5+
name: GigaDevice GD32E103V Evaluation Kit
6+
type: mcu
7+
arch: arm
8+
ram: 32
9+
flash: 128
10+
toolchain:
11+
- zephyr
12+
- gnuarmemb
13+
- xtools
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2021, YuLong Yao <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_SOC_SERIES_GD32E10X=y
5+
CONFIG_SOC_GD32E103=y
6+
CONFIG_BOARD_GD32E103V_EVAL=y
7+
8+
CONFIG_GD32_HXTAL_8MHZ=y
9+
CONFIG_CORTEX_M_SYSTICK=y
10+
11+
CONFIG_CONSOLE=y
12+
CONFIG_UART_CONSOLE=y
13+
CONFIG_SERIAL=y
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2021, ATL-Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
source [find interface/cmsis-dap.cfg]
4+
transport select swd
5+
6+
# chip name
7+
set CHIPNAME gd32e103vb
8+
set ENDIAN little
9+
set CPUTAPID 0x2ba01477
10+
set FLASH_SIZE 0x20000
11+
12+
source [find target/stm32f1x.cfg]
13+
14+
reset_config trst_and_srst separate
15+
16+
$_TARGETNAME configure -event gdb-attach {
17+
echo "Debugger attaching: halting execution"
18+
reset halt
19+
gdb_breakpoint_override hard
20+
}
21+
22+
$_TARGETNAME configure -event gdb-detach {
23+
echo "Debugger detaching: resuming execution"
24+
resume
25+
}
26+

0 commit comments

Comments
 (0)