Skip to content

Commit 094434f

Browse files
committed
boards: arm: Introduce gd32f403z_eval board
Add gigadevice gd32f403z_eval board initial version. Signed-off-by: Gerson Fernando Budke <[email protected]>
1 parent 3c6bb1a commit 094434f

File tree

12 files changed

+294
-0
lines changed

12 files changed

+294
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2021, ATL Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
zephyr_library()
5+
zephyr_library_sources(board.c)

boards/arm/gd32f403z_eval/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2021 ATL-Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_INIT_PRIORITY
5+
int "Board initialization priority"
6+
default 50
7+
help
8+
Board initialization priority.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2021, ATL Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_GD32F403Z_EVAL
5+
bool "GigaDevice GD32F403Z Evaluation Kit"
6+
depends on SOC_GD32F403Z
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2021 ATL Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_GD32F403Z_EVAL
5+
6+
config BOARD
7+
default "gd32f403z_eval"
8+
9+
endif # BOARD_GD32F403Z_EVAL

boards/arm/gd32f403z_eval/board.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2021 ATL Electronics
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <init.h>
7+
8+
static int board_init(const struct device *dev)
9+
{
10+
rcu_periph_clock_enable(RCU_GPIOA);
11+
12+
gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9);
13+
gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_10);
14+
15+
return 0;
16+
}
17+
18+
SYS_INIT(board_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2021, ATL Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
558 KB
Loading
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
.. _gd32f403z_eval:
2+
3+
GigaDevice GD32F403Z-EVAL
4+
#########################
5+
6+
7+
Overview
8+
********
9+
10+
The GD32F403Z-EVAL board is a hardware platform that enables design and debug
11+
of the GigaDevice F403 Cortex-M4F High Performance MCU.
12+
13+
The GD32F403ZE features a single-core ARM Cortex-M4F MCU which can run up
14+
to 168-MHz with flash accesses zero wait states, 512kiB of Flash, 96kiB of
15+
SRAM and 112 GPIOs.
16+
17+
.. image:: img/gd32f403z_eval.png
18+
:width: 800px
19+
:align: center
20+
:alt: gd32f403z_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+
- CAN port
31+
- ADC connected to a potentiometer
32+
- 2 DAC channels
33+
- GD25Q40 4Mib SPI Flash
34+
- HY27UF081G2A 1GiB NAND Flash
35+
- AT24C02C 2KiB EEPROM
36+
- 3.2 TFT LCD (320x240)
37+
- PCM1770 Stereo DAC with Headphone Amplifier
38+
- Micro-SDHC interface
39+
- GD-Link interface
40+
41+
- CMSIS-DAP swd debug interface over USB HID.
42+
43+
44+
For more information about the GD32F403 SoC and GD32F403Z-Eval board:
45+
46+
- `GigaDevice Cortex-M4F High Performance SoC Website`_
47+
- `GD32F403 Datasheet`_
48+
- `GD32F403 Reference Manual`_
49+
- `GD32F403Z Eval Schematics`_
50+
- `GD32 ISP Console`_
51+
52+
53+
Supported Features
54+
==================
55+
56+
The board configuration supports the following hardware features:
57+
58+
+-----------+------------+-----------------------+
59+
| Interface | Controller | Driver/Component |
60+
+===========+============+=======================+
61+
| NVIC | on-chip | nested vectored |
62+
| | | interrupt controller |
63+
+-----------+------------+-----------------------+
64+
| SYSTICK | on-chip | system clock |
65+
+-----------+------------+-----------------------+
66+
| UART | on-chip | serial port-polling |
67+
+-----------+------------+-----------------------+
68+
69+
70+
Serial Port
71+
===========
72+
73+
The GD32F403Z-EVAL board has 5 serial communication ports. The default port
74+
is UART0 at PIN-9 and PIN-10.
75+
76+
Programming and Debugging
77+
*************************
78+
79+
Before program your board make sure to configure boot setting and serial port.
80+
The default serial port is USART0. This port uses header JP-5/6 to route
81+
signals between USB VBUS/ID and USART J2.
82+
83+
+--------+--------+------------+
84+
| Boot-0 | Boot-1 | Function |
85+
+========+========+============+
86+
| 1-2 | 1-2 | SRAM |
87+
+--------+--------+------------+
88+
| 1-2 | 2-3 | Bootloader |
89+
+--------+--------+------------+
90+
| 2-3 | Any | Flash |
91+
+--------+--------+------------+
92+
93+
+------+------+-------------+
94+
| JP-5 | JP-6 | Function |
95+
+======+======+=============+
96+
| 1-2 | 1-2 | USART0 / J2 |
97+
+------+------+-------------+
98+
| 2-3 | 2-3 | USB VBUS/ID |
99+
+------+------+-------------+
100+
| open | open | Free |
101+
+------+------+-------------+
102+
103+
Using GD-Link
104+
=============
105+
106+
The GD32F403Z-EVAL includes an onboard programmer/debugger (GD-Link) which
107+
allow flash programming and debug over USB. There are also program and debug
108+
headers J1 and J100 that can be used with any ARM compatible tools.
109+
110+
#. Build the Zephyr kernel and the :ref:`hello_world` sample application:
111+
112+
.. zephyr-app-commands::
113+
:zephyr-app: samples/hello_world
114+
:board: gd32f403z_eval
115+
:goals: build
116+
:compact:
117+
118+
#. Run your favorite terminal program to listen for output. Under Linux the
119+
terminal should be :code:`/dev/ttyUSB0`. For example:
120+
121+
.. code-block:: console
122+
123+
$ minicom -D /dev/ttyUSB0 -o
124+
125+
The -o option tells minicom not to send the modem initialization
126+
string. Connection should be configured as follows:
127+
128+
- Speed: 115200
129+
- Data: 8 bits
130+
- Parity: None
131+
- Stop bits: 1
132+
133+
#. To flash an image:
134+
135+
.. zephyr-app-commands::
136+
:zephyr-app: samples/hello_world
137+
:board: gd32f403z_eval
138+
:goals: flash
139+
:compact:
140+
141+
You should see "Hello World! gd32f403z_eval" in your terminal.
142+
143+
#. To debug an image:
144+
145+
.. zephyr-app-commands::
146+
:zephyr-app: samples/hello_world
147+
:board: gd32f403z_eval
148+
:goals: debug
149+
:compact:
150+
151+
152+
.. _GigaDevice Cortex-M4F High Performance SoC Website:
153+
https://www.gigadevice.com/products/microcontrollers/gd32/arm-cortex-m4/high-performance-line/gd32f403-series/
154+
155+
.. _GD32F403 Datasheet:
156+
http://www.gd32mcu.com/data/documents/shujushouce/GD32F403xx_Datasheet_Rev1.3.pdf
157+
158+
.. _GD32F403 Reference Manual:
159+
http://www.gd32mcu.com/data/documents/yingyongbiji/GD32F403_User_Manual_Rev2.4.pdf
160+
161+
.. _GD32F403Z Eval Schematics:
162+
http://www.gd32mcu.com/download/down/document_id/270/path_type/1
163+
164+
.. _GD32 ISP Console:
165+
http://www.gd32mcu.com/download/down/document_id/175/path_type/1
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2021, ATL Electronics
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <gigadevice/gd32f403zet6.dtsi>
9+
10+
/ {
11+
model = "GigaDevice GD32F403Z Evaluation Kit";
12+
compatible = "gd,gd32f403z";
13+
14+
chosen {
15+
zephyr,sram = &sram0;
16+
zephyr,flash = &flash0;
17+
zephyr,console = &usart0;
18+
zephyr,shell-uart = &usart0;
19+
};
20+
};
21+
22+
&usart0 {
23+
status = "okay";
24+
25+
current-speed = <115200>;
26+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2021, ATL Electronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
identifier: gd32f403z_eval
5+
name: GigaDevice GD32F403Z Evaluation Kit
6+
type: mcu
7+
arch: arm
8+
ram: 96
9+
flash: 512
10+
toolchain:
11+
- zephyr
12+
- gnuarmemb
13+
- xtools

0 commit comments

Comments
 (0)