Skip to content

Commit 50e13ab

Browse files
feilongflcarlescufi
authored andcommitted
boards: arm: gd32a503v_eval: introduce gd32a503v_eval board
introduce gd32a503v_eval board Signed-off-by: YuLong Yao <[email protected]>
1 parent aed1f1a commit 50e13ab

File tree

9 files changed

+420
-0
lines changed

9 files changed

+420
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2022 YuLong Yao <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_GD32A503V_EVAL
5+
bool "GigaDevice GD32A503V-EVAL"
6+
depends on SOC_GD32A503
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2022 YuLong Yao <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_GD32A503V_EVAL
5+
6+
config BOARD
7+
default "gd32a503v_eval"
8+
9+
endif # BOARD_GD32A503V_EVAL

boards/arm/gd32a503v_eval/board.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2022 YuLong Yao <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
board_runner_args(pyocd "--target=gd32a503vd" "--tool-opt=--pack=${ZEPHYR_HAL_GIGADEVICE_MODULE_DIR}/${CONFIG_SOC_SERIES}/support/GigaDevice.GD32A50x_DFP.1.0.0.pack")
5+
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
6+
7+
board_runner_args(gd32isp "--device=GD32A503VDT3")
8+
include(${ZEPHYR_BASE}/boards/common/gd32isp.board.cmake)
98.4 KB
Loading
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
.. _gd32a503v_eval:
2+
3+
GigaDevice GD32A503V-EVAL
4+
#########################
5+
6+
7+
Overview
8+
********
9+
10+
The GD32A503V-EVAL board is a hardware platform that enables design and debug
11+
of the GigaDevice A503 Cortex-M4F High Performance MCU.
12+
13+
The GD32A503VD features a single-core ARM Cortex-M4F MCU which can run up
14+
to 120-MHz with flash accesses zero wait states, 384kiB of Flash, 48kiB of
15+
SRAM and 88 GPIOs.
16+
17+
.. image:: img/gd32a503v_eval.jpg
18+
:align: center
19+
:alt: gd32a503v_eval
20+
21+
22+
Hardware
23+
********
24+
25+
- 2 user LEDs
26+
- 2 user push buttons
27+
- Reset Button
28+
- ADC connected to a potentiometer
29+
- 1 DAC channels
30+
- GD25Q16 2Mib SPI Flash
31+
- AT24C02C 2KiB EEPROM
32+
- CS4344 Stereo DAC with Headphone Amplifier
33+
- GD-Link interface
34+
35+
- CMSIS-DAP swd debug interface over USB HID.
36+
37+
- 2 CAN port(support CAN-FD)
38+
39+
For more information about the GD32A503 SoC and GD32A503V-EVAL board:
40+
41+
- `GigaDevice Cortex-M33 High Performance SoC Website`_
42+
- `GD32A503 Datasheet`_
43+
- `GD32A503 Reference Manual`_
44+
- `GD32A503V Eval Schematics`_
45+
- `GD32 ISP Console`_
46+
47+
48+
Supported Features
49+
==================
50+
51+
The board configuration supports the following hardware features:
52+
53+
.. list-table::
54+
:header-rows: 1
55+
56+
* - Peripheral
57+
- Kconfig option
58+
- Devicetree compatible
59+
* - EXTI
60+
- :kconfig:option:`CONFIG_GD32_EXTI`
61+
- :dtcompatible:`gd,gd32-exti`
62+
* - GPIO
63+
- :kconfig:option:`CONFIG_GPIO`
64+
- :dtcompatible:`gd,gd32-gpio`
65+
* - NVIC
66+
- N/A
67+
- :dtcompatible:`arm,v8m-nvic`
68+
* - PWM
69+
- :kconfig:option:`CONFIG_PWM`
70+
- :dtcompatible:`gd,gd32-pwm`
71+
* - SYSTICK
72+
- N/A
73+
- N/A
74+
* - USART
75+
- :kconfig:option:`CONFIG_SERIAL`
76+
- :dtcompatible:`gd,gd32-usart`
77+
* - PINMUX
78+
- :kconfig:option:`CONFIG_PINCTRL`
79+
- :dtcompatible:`gd,gd32-pinctrl-af`
80+
* - ADC
81+
- :kconfig:option:`CONFIG_ADC`
82+
- :dtcompatible:`gd,gd32-adc`
83+
* - DAC
84+
- :kconfig:option:`CONFIG_DAC`
85+
- :dtcompatible:`gd,gd32-dac`
86+
* - FMC
87+
- N/A
88+
- :dtcompatible:`gd,gd32-flash-controller`
89+
* - SPI
90+
- :kconfig:option:`CONFIG_SPI`
91+
- :dtcompatible:`gd,gd32-spi`
92+
93+
Serial Port
94+
===========
95+
96+
The GD32A503V-EVAL board has 3 serial communication ports. The default port
97+
is UART0 at PIN-72 and PIN-73.
98+
99+
Programming and Debugging
100+
*************************
101+
102+
Before program your board make sure to configure boot setting and serial port.
103+
The default serial port is USART0.
104+
105+
+--------+--------+------------+
106+
| Boot-0 | Boot-1 | Function |
107+
+========+========+============+
108+
| 1-2 | 1-2 | SRAM |
109+
+--------+--------+------------+
110+
| 1-2 | 2-3 | Bootloader |
111+
+--------+--------+------------+
112+
| 2-3 | Any | Flash |
113+
+--------+--------+------------+
114+
115+
Using GD-Link
116+
=============
117+
118+
The GD32A503V-EVAL includes an onboard programmer/debugger (GD-Link) which
119+
allow flash programming and debug over USB. There are also program and debug
120+
headers J2 and J100 that can be used with any ARM compatible tools.
121+
122+
#. Build the Zephyr kernel and the :ref:`hello_world` sample application:
123+
124+
.. zephyr-app-commands::
125+
:zephyr-app: samples/hello_world
126+
:board: gd32a503v_eval
127+
:goals: build
128+
:compact:
129+
130+
#. Run your favorite terminal program to listen for output. Under Linux the
131+
terminal should be :code:`/dev/ttyUSB0`. For example:
132+
133+
.. code-block:: console
134+
135+
$ minicom -D /dev/ttyUSB0 -o
136+
137+
The -o option tells minicom not to send the modem initialization
138+
string. Connection should be configured as follows:
139+
140+
- Speed: 115200
141+
- Data: 8 bits
142+
- Parity: None
143+
- Stop bits: 1
144+
145+
#. To flash an image:
146+
147+
.. zephyr-app-commands::
148+
:zephyr-app: samples/hello_world
149+
:board: gd32a503v_eval
150+
:goals: flash
151+
:compact:
152+
153+
You should see "Hello World! gd32a503v_eval" in your terminal.
154+
155+
#. To debug an image:
156+
157+
.. zephyr-app-commands::
158+
:zephyr-app: samples/hello_world
159+
:board: gd32a503v_eval
160+
:goals: debug
161+
:compact:
162+
163+
164+
Using ROM bootloader
165+
====================
166+
167+
The GD32A503 MCU have a ROM bootloader which allow flash programming. User
168+
should install `GD32 ISP Console`_ software at some Linux path. The recommended
169+
is :code:`$HOME/.local/bin`.
170+
171+
#. Build the Zephyr kernel and the :ref:`hello_world` sample application:
172+
173+
.. zephyr-app-commands::
174+
:zephyr-app: samples/hello_world
175+
:board: gd32a503v_eval
176+
:goals: build
177+
:compact:
178+
179+
#. Enable board bootloader:
180+
181+
- Remove boot-0 jumper
182+
- press reset button
183+
184+
#. To flash an image:
185+
186+
.. code-block:: console
187+
188+
west flash -r gd32isp [--port=/dev/ttyUSB0]
189+
190+
#. Run your favorite terminal program to listen for output. Under Linux the
191+
terminal should be :code:`/dev/ttyUSB0`. For example:
192+
193+
.. code-block:: console
194+
195+
$ minicom -D /dev/ttyUSB0 -o
196+
197+
The -o option tells minicom not to send the modem initialization
198+
string. Connection should be configured as follows:
199+
200+
- Speed: 115200
201+
- Data: 8 bits
202+
- Parity: None
203+
- Stop bits: 1
204+
205+
Press reset button
206+
207+
You should see "Hello World! gd32a503v_eval" in your terminal.
208+
209+
210+
.. _GigaDevice Cortex-M33 High Performance SoC Website:
211+
https://www.gigadevice.com.cn/product/mcu/arm-cortex-m33/gd32a503vdt3
212+
213+
.. _GD32A503 Datasheet:
214+
https://www.gd32mcu.com/download/down/document_id/401/path_type/1
215+
216+
.. _GD32A503 Reference Manual:
217+
https://www.gd32mcu.com/download/down/document_id/402/path_type/1
218+
219+
.. _GD32A503V Eval Schematics:
220+
https://www.gd32mcu.com/download/down/document_id/404/path_type/1
221+
222+
.. _GD32 ISP Console:
223+
http://www.gd32mcu.com/download/down/document_id/175/path_type/1
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2022 YuLong Yao <[email protected]>
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <dt-bindings/pinctrl/gd32a503v(b-c-d)xx-pinctrl.h>
7+
8+
&pinctrl {
9+
usart0_default: usart0_default {
10+
group1 {
11+
pinmux = <USART0_TX_PA10>, <USART0_RX_PA11>;
12+
};
13+
};
14+
15+
adc0_default: adc0_default {
16+
group1 {
17+
pinmux = <ADC0_IN1_PC10>;
18+
};
19+
};
20+
21+
dac_default: dac_default {
22+
group1 {
23+
pinmux = <DAC_OUT_PA7>;
24+
};
25+
};
26+
27+
spi0_default: spi0_default {
28+
group1 {
29+
pinmux = <SPI0_SCK_PE14>, <SPI0_MOSI_PA2>,
30+
<SPI0_MISO_PE13>,
31+
/* Use pinmux to pullup pg10 and pg11. */
32+
<SPI0_IO2_PE15>, <SPI0_IO3_PB10>;
33+
};
34+
};
35+
};
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* Copyright (c) 2022 YuLong Yao <[email protected]>
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <gigadevice/gd32a50x/gd32a503vdt3.dtsi>
9+
#include "gd32a503v_eval-pinctrl.dtsi"
10+
11+
/ {
12+
model = "GigaDevice GD32A503V-EVAL";
13+
compatible = "gd,gd32a503v-eval";
14+
15+
chosen {
16+
zephyr,sram = &sram0;
17+
zephyr,flash = &flash0;
18+
zephyr,console = &usart0;
19+
zephyr,shell-uart = &usart0;
20+
zephyr,flash-controller = &fmc;
21+
};
22+
23+
leds {
24+
compatible = "gpio-leds";
25+
led1: led1 {
26+
gpios = <&gpioc 0 GPIO_ACTIVE_LOW>;
27+
label = "LED1";
28+
};
29+
led2: led2 {
30+
gpios = <&gpioc 1 GPIO_ACTIVE_LOW>;
31+
label = "LED2";
32+
};
33+
};
34+
35+
aliases {
36+
led0 = &led1;
37+
led1 = &led2;
38+
spi-flash0 = &nor_flash;
39+
};
40+
};
41+
42+
&gpioa {
43+
status = "okay";
44+
};
45+
46+
&gpiob {
47+
status = "okay";
48+
};
49+
50+
&gpioc {
51+
status = "okay";
52+
};
53+
54+
&gpiod {
55+
status = "okay";
56+
};
57+
58+
&gpioe {
59+
status = "okay";
60+
};
61+
62+
&gpiof {
63+
status = "okay";
64+
};
65+
66+
&usart0 {
67+
status = "okay";
68+
current-speed = <115200>;
69+
pinctrl-0 = <&usart0_default>;
70+
pinctrl-names = "default";
71+
};
72+
73+
&adc0 {
74+
status = "okay";
75+
pinctrl-0 = <&adc0_default>;
76+
pinctrl-names = "default";
77+
};
78+
79+
&dac {
80+
status = "okay";
81+
pinctrl-0 = <&dac_default>;
82+
pinctrl-names = "default";
83+
};
84+
85+
&fwdgt {
86+
status = "okay";
87+
};
88+
89+
&spi0 {
90+
status = "okay";
91+
pinctrl-0 = <&spi0_default>;
92+
pinctrl-names = "default";
93+
cs-gpios = <&gpioa 1 GPIO_ACTIVE_LOW>;
94+
95+
nor_flash: gd25q16@0 {
96+
compatible ="jedec,spi-nor";
97+
size = <0x1000000>;
98+
reg = <0>;
99+
spi-max-frequency = <4000000>;
100+
status = "okay";
101+
jedec-id = [c8 40 15];
102+
};
103+
};

0 commit comments

Comments
 (0)