Skip to content

Commit 8753bf6

Browse files
committed
boards: arm: Introduce gd32f350r_eval board
Add GD32F350R-EVAL board support on Zephyr. Signed-off-by: HaiLong Yang <[email protected]>
1 parent 2f9cf2d commit 8753bf6

File tree

10 files changed

+251
-0
lines changed

10 files changed

+251
-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 BrainCo Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_GD32F350R_EVAL
5+
bool "GigaDevice GD32F350R Evaluation Kit"
6+
depends on SOC_GD32F350
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2021 BrainCo Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_GD32F350R_EVAL
5+
6+
config BOARD
7+
default "gd32f350r_eval"
8+
9+
endif # BOARD_GD32F350R_EVAL
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) 2021 BrainCo Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
5+
6+
board_runner_args(jlink "--device=GD32F350G6" "--iface=SWD" "--speed=4000")
7+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
328 KB
Loading
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
.. _gd32f350r_eval:
2+
3+
GigaDevice GD32F350R-EVAL
4+
#########################
5+
6+
Overview
7+
********
8+
9+
The GD32F350R-EVAL board is a hardware platform that enables design and debug
10+
of the GigaDevice F350 Cortex-M4F High Performance MCU.
11+
12+
The GD32F350RBT6 features a single-core ARM Cortex-M4F MCU which can run up
13+
to 108-MHz with flash accesses zero wait states, 128kB of Flash, 16kB of
14+
SRAM and 55 GPIOs.
15+
16+
.. image:: img/gd32f350r_eval.png
17+
:align: center
18+
:alt: gd32f350r_eval
19+
20+
Hardware
21+
********
22+
23+
- GD32F350RBT6 MCU
24+
- AT24C02C 2Kb EEPROM
25+
- 4 x User LEDs
26+
- 4 x User Push buttons
27+
- 1 x USART (RS-232 at J2 connector)
28+
- 1 x POT connected to an ADC input
29+
- Headphone interface
30+
- Micro SD Card Interface
31+
- 2.4'' TFT-LCD (36x48)
32+
- GD-Link on board programmer
33+
- J-Link/SWD connector
34+
35+
For more information about the GD32F350 SoC and GD32F350R-EVAL board:
36+
37+
- `GigaDevice Cortex-M4F Stretch Performance SoC Website`_
38+
- `GD32F350xx Datasheet`_
39+
- `GD32F3x0 User Manual`_
40+
- `GD32F350R-EVAL User Manual`_
41+
42+
Supported Features
43+
==================
44+
45+
The board configuration supports the following hardware features:
46+
47+
.. list-table::
48+
:header-rows: 1
49+
50+
* - Peripheral
51+
- Kconfig option
52+
- Devicetree compatible
53+
* - NVIC
54+
- N/A
55+
- :dtcompatible:`arm,v7m-nvic`
56+
* - SYSTICK
57+
- N/A
58+
- N/A
59+
* - USART
60+
- :kconfig:`CONFIG_SERIAL`
61+
- :dtcompatible:`gd,gd32-usart`
62+
* - PINMUX
63+
- :kconfig:`CONFIG_PINCTRL`
64+
- :dtcompatible:`gd,gd32-pinctrl-af`
65+
66+
Serial Port
67+
===========
68+
69+
The GD32F350R-EVAL board has one serial communication port. The default port
70+
is USART0 with TX connected at PA9 and RX at PA10.
71+
72+
Programming and Debugging
73+
*************************
74+
75+
Before programming your board make sure to configure boot and serial jumpers as follows:
76+
77+
- J4: Select 2-3 for both (labeled as ``L``)
78+
- J13: Select 1-2 position (labeled as ``USART``)
79+
80+
Using GD-Link
81+
=============
82+
83+
The GD32F350R-EVAL includes an onboard programmer/debugger (GD-Link) which
84+
allows flash programming and debugging over USB. There is also a SWD header
85+
(J3) which can be used with tools like Segger J-Link.
86+
87+
#. Build the Zephyr kernel and the :ref:`hello_world` sample application:
88+
89+
.. zephyr-app-commands::
90+
:zephyr-app: samples/hello_world
91+
:board: gd32f350r_eval
92+
:goals: build
93+
:compact:
94+
95+
#. Run your favorite terminal program to listen for output. On Linux the
96+
terminal should be something like ``/dev/ttyUSB0``. For example:
97+
98+
.. code-block:: console
99+
100+
minicom -D /dev/ttyUSB0 -o
101+
102+
The -o option tells minicom not to send the modem initialization
103+
string. Connection should be configured as follows:
104+
105+
- Speed: 115200
106+
- Data: 8 bits
107+
- Parity: None
108+
- Stop bits: 1
109+
110+
#. To flash an image:
111+
112+
.. zephyr-app-commands::
113+
:zephyr-app: samples/hello_world
114+
:board: gd32f350r_eval
115+
:goals: flash
116+
:compact:
117+
118+
You should see "Hello World! gd32f350r_eval" in your terminal.
119+
120+
#. To debug an image:
121+
122+
.. zephyr-app-commands::
123+
:zephyr-app: samples/hello_world
124+
:board: gd32f350r_eval
125+
:goals: debug
126+
:compact:
127+
128+
.. _GigaDevice Cortex-M4F Stretch Performance SoC Website:
129+
https://www.gigadevice.com/products/microcontrollers/gd32/arm-cortex-m4/stretch-performance-line/
130+
131+
.. _GD32F350xx Datasheet:
132+
http://gd32mcu.com/download/down/document_id/133/path_type/1
133+
134+
.. _GD32F3x0 User Manual:
135+
http://gd32mcu.com/download/down/document_id/136/path_type/1
136+
137+
.. _GD32F350R-EVAL User Manual:
138+
https://www.tme.com/Document/ff0a3609934053c07d78ef8662781da9/GD32350R-EVAL%20User%20Manual-V1.0.pdf
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2021 BrainCo Inc.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <dt-bindings/pinctrl/gd32f350r(8-b)xx-pinctrl.h>
7+
8+
&pinctrl {
9+
usart0_default: usart0_default {
10+
group1 {
11+
pinmux = <USART0_TX_PA9>, <USART0_RX_PA10>;
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 BrainCo Inc.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <gigadevice/gd32f3x0/gd32f350rb.dtsi>
9+
#include "gd32f350r_eval-pinctrl.dtsi"
10+
11+
/ {
12+
model = "GigaDevice GD32F350R Evaluation Kit";
13+
compatible = "gd,gd32f350r-eval";
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 BrainCO Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
identifier: gd32f350r_eval
5+
name: GigaDevice GD32F350R Evaluation Kit
6+
type: mcu
7+
arch: arm
8+
ram: 16
9+
flash: 128
10+
toolchain:
11+
- zephyr
12+
- gnuarmemb
13+
- xtools
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2021 BrainCo Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_SOC_SERIES_GD32F3X0=y
5+
CONFIG_SOC_GD32F350=y
6+
CONFIG_BOARD_GD32F350R_EVAL=y
7+
8+
CONFIG_CORTEX_M_SYSTICK=y
9+
10+
CONFIG_CONSOLE=y
11+
CONFIG_UART_CONSOLE=y
12+
CONFIG_SERIAL=y
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2021, ATL-Electronics
2+
# Copyright (c) 2021, BrainCo Inc.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
source [find interface/cmsis-dap.cfg]
6+
transport select swd
7+
8+
set CHIPNAME gd32f350rb
9+
set CPUTAPID 0x790007a3
10+
11+
source [find target/stm32f3x.cfg]
12+
13+
reset_config trst_and_srst separate
14+
15+
$_TARGETNAME configure -event gdb-attach {
16+
echo "Debugger attaching: halting execution"
17+
reset halt
18+
gdb_breakpoint_override hard
19+
}
20+
21+
$_TARGETNAME configure -event gdb-detach {
22+
echo "Debugger detaching: resuming execution"
23+
resume
24+
}

0 commit comments

Comments
 (0)