Skip to content

Commit eedab17

Browse files
gmarullfabiobaltieri
authored andcommitted
boards: gd32e507z_eval: add initial support
Add initial support for the GD32E507Z-EVAL board. Only basic peripherals are enabled for now: - UART - GPIO (LEDs, keys) - PWM Others, e.g. I2C, EEPROM, DAC, etc. require further testing and likely some driver adjustments. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 515b0ce commit eedab17

File tree

9 files changed

+344
-0
lines changed

9 files changed

+344
-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, Teslabs Engineering S.L.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_GD32E507Z_EVAL
5+
bool "GigaDevice GD32E507Z-EVAL"
6+
depends on SOC_GD32E507
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (c) 2022 Teslabs Engineering S.L.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_GD32E507Z_EVAL
5+
6+
config BOARD
7+
default "gd32e507z_eval"
8+
9+
endif # BOARD_GD32E507Z_EVAL

boards/arm/gd32e507z_eval/board.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2022, Teslabs Engineering S.L.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
board_runner_args(pyocd "--target=gd32e507ze")
5+
board_runner_args(
6+
jlink
7+
"--device=GD32E507ZE" "--iface=jtag" "--tool-opt=-JTAGConf -1,-1"
8+
)
9+
10+
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
11+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
166 KB
Loading
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
.. _gd32e507z_eval:
2+
3+
GigaDevice GD32E507Z-EVAL
4+
#########################
5+
6+
Overview
7+
********
8+
9+
The GD32E507Z-EVAL board is a hardware platform that enables prototyping
10+
on GD32E507ZE Cortex-M33 High Performance MCU.
11+
12+
The GD32E507ZE features a single-core ARM Cortex-M33 MCU which can run up
13+
to 180 MHz with flash accesses zero wait states, 512kiB of Flash, 128kiB of
14+
SRAM and 112 GPIOs.
15+
16+
.. image:: img/gd32e507z_eval.jpg
17+
:align: center
18+
:alt: gd32e507z_eval
19+
20+
Hardware
21+
********
22+
23+
- GD32E507ZET6 MCU
24+
- AT24C02C 2Kb EEPROM
25+
- GD25Q16 16Mbit SPI and QSPI NOR Flash
26+
- GD9FU1G8F2A 1Gbit NAND Flash
27+
- Micron MT48LC16M16A2P-6AIT 256Mbit SDRAM
28+
- 4 x User LEDs
29+
- 1 x Joystick (L/R/U/D/C)
30+
- 1 x USART (connected to USB VCOM at J1 connector)
31+
- 1 x POT connected to an ADC input
32+
- Headphone interface
33+
- USB FS connector
34+
- 1 x CAN (includes SN65HVD230 PHY)
35+
- Ethernet Interface
36+
- 3.2" RGB-LCD (320x240)
37+
- GD-Link on board programmer
38+
- J-Link/JTAG connector
39+
40+
For more information about the GD32E507 SoC and GD32E507Z-EVAL board:
41+
42+
- `GigaDevice Cortex-M33 High Performance SoC Website`_
43+
- `GD32E507X Datasheet`_
44+
- `GD32E50X User Manual`_
45+
- `GD32E507Z-EVAL User Manual`_
46+
47+
Supported Features
48+
==================
49+
50+
The board configuration supports the following hardware features:
51+
52+
.. list-table::
53+
:header-rows: 1
54+
55+
* - Peripheral
56+
- Kconfig option
57+
- Devicetree compatible
58+
* - EXTI
59+
- :kconfig:option:`CONFIG_GD32_EXTI`
60+
- :dtcompatible:`gd,gd32-exti`
61+
* - GPIO
62+
- :kconfig:option:`CONFIG_GPIO`
63+
- :dtcompatible:`gd,gd32-gpio`
64+
* - NVIC
65+
- N/A
66+
- :dtcompatible:`arm,v8m-nvic`
67+
* - PWM
68+
- :kconfig:option:`CONFIG_PWM`
69+
- :dtcompatible:`gd,gd32-pwm`
70+
* - SYSTICK
71+
- N/A
72+
- N/A
73+
* - USART
74+
- :kconfig:option:`CONFIG_SERIAL`
75+
- :dtcompatible:`gd,gd32-usart`
76+
77+
Serial Port
78+
===========
79+
80+
The GD32E507Z-EVAL board has one serial communication port. The default port
81+
is USART0 with TX connected at PA9 and RX at PA10. USART0 is exposed as a
82+
virtual COM port via the J1 USB connector.
83+
84+
Programming and Debugging
85+
*************************
86+
87+
Before programming your board make sure to configure boot jumpers as
88+
follows:
89+
90+
- JP3/4: Select 2-3 for both (boot from user memory)
91+
92+
Using GD-Link or J-Link
93+
=======================
94+
95+
The board comes with an embedded GD-Link programmer. It can be used with pyOCD
96+
provided you install the necessary CMSIS-Pack:
97+
98+
.. code-block:: console
99+
100+
pyocd pack install gd32e507ze
101+
102+
J-Link can also be used to program the board using the JTAG interface exposed in
103+
the JP2 header.
104+
105+
#. Build the Zephyr kernel and the :ref:`hello_world` sample application:
106+
107+
.. zephyr-app-commands::
108+
:zephyr-app: samples/hello_world
109+
:board: gd32e507z_eval
110+
:goals: build
111+
:compact:
112+
113+
#. Run your favorite terminal program to listen for output. On Linux the
114+
terminal should be something like ``/dev/ttyUSB0``. For example:
115+
116+
.. code-block:: console
117+
118+
minicom -D /dev/ttyUSB0 -o
119+
120+
The -o option tells minicom not to send the modem initialization
121+
string. Connection should be configured as follows:
122+
123+
- Speed: 115200
124+
- Data: 8 bits
125+
- Parity: None
126+
- Stop bits: 1
127+
128+
#. To flash an image:
129+
130+
.. zephyr-app-commands::
131+
:zephyr-app: samples/hello_world
132+
:board: gd32e507z_eval
133+
:goals: flash
134+
:compact:
135+
136+
You should see "Hello World! gd32e507z_eval" in your terminal.
137+
138+
#. To debug an image:
139+
140+
.. zephyr-app-commands::
141+
:zephyr-app: samples/hello_world
142+
:board: gd32e507z_eval
143+
:goals: debug
144+
:compact:
145+
146+
.. _GigaDevice Cortex-M33 High Performance SoC Website:
147+
https://www.gigadevice.com/products/microcontrollers/gd32/arm-cortex-m33/high-performance-line/
148+
149+
.. _GD32E507X Datasheet:
150+
https://gd32mcu.com/download/down/document_id/252/path_type/1
151+
152+
.. _GD32E50X User Manual:
153+
https://www.gd32mcu.com/download/down/document_id/249/path_type/1
154+
155+
.. _GD32E507Z-EVAL User Manual:
156+
https://www.gd32mcu.com/data/documents/evaluationBoard/GD32E50x_Demo_Suites_V1.2.1.rar
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) 2022, Teslabs Engineering S.L.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <dt-bindings/pinctrl/gd32e507z(e-c)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+
15+
pwm0_default: pwm0_default {
16+
group1 {
17+
pinmux = <TIMER0_CH0_PA8_OUT_NORMP>;
18+
};
19+
};
20+
};
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/*
2+
* Copyright (c) 2022, Teslabs Engineering S.L.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <arm/gigadevice/gd32e50x/gd32e507xe.dtsi>
9+
#include "gd32e507z_eval-pinctrl.dtsi"
10+
11+
/ {
12+
model = "GigaDevice GD32E507Z-EVAL";
13+
compatible = "gd,gd32e507z-eval";
14+
15+
chosen {
16+
zephyr,sram = &sram0;
17+
zephyr,flash = &flash0;
18+
zephyr,console = &usart0;
19+
zephyr,shell-uart = &usart0;
20+
};
21+
22+
leds {
23+
compatible = "gpio-leds";
24+
led1: led1 {
25+
gpios = <&gpiog 10 GPIO_ACTIVE_HIGH>;
26+
};
27+
led2: led2 {
28+
gpios = <&gpiog 11 GPIO_ACTIVE_HIGH>;
29+
};
30+
led3: led3 {
31+
gpios = <&gpiog 12 GPIO_ACTIVE_HIGH>;
32+
};
33+
led4: led4 {
34+
gpios = <&gpiog 13 GPIO_ACTIVE_HIGH>;
35+
};
36+
};
37+
38+
gpio_keys {
39+
compatible = "gpio-keys";
40+
key_a: key_a {
41+
label = "KEY_A";
42+
gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
43+
};
44+
key_b: key_b {
45+
label = "KEY_B";
46+
gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
47+
};
48+
key_c: key_c {
49+
label = "KEY_C";
50+
gpios = <&gpiof 13 GPIO_ACTIVE_LOW>;
51+
};
52+
key_d: key_d {
53+
label = "KEY_D";
54+
gpios = <&gpiof 14 GPIO_ACTIVE_LOW>;
55+
};
56+
key_cet: key_cet {
57+
label = "KEY_CET";
58+
gpios = <&gpiof 15 GPIO_ACTIVE_LOW>;
59+
};
60+
};
61+
62+
pwmleds {
63+
compatible = "pwm-leds";
64+
65+
/* NOTE: bridge TIMER0_CH0 (PA8) and LED1 (PG10)*/
66+
pwm_led: pwm_led {
67+
pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
68+
};
69+
};
70+
71+
aliases {
72+
led0 = &led1;
73+
sw0 = &key_a;
74+
pwm-led0 = &pwm_led;
75+
};
76+
};
77+
78+
&gpioa {
79+
status = "okay";
80+
};
81+
82+
&gpioc {
83+
status = "okay";
84+
};
85+
86+
&gpiof {
87+
status = "okay";
88+
};
89+
90+
&gpiog {
91+
status = "okay";
92+
};
93+
94+
&usart0 {
95+
status = "okay";
96+
current-speed = <115200>;
97+
pinctrl-0 = <&usart0_default>;
98+
pinctrl-names = "default";
99+
};
100+
101+
&timer0 {
102+
status = "okay";
103+
prescaler = <256>;
104+
105+
pwm0: pwm {
106+
status = "okay";
107+
pinctrl-0 = <&pwm0_default>;
108+
pinctrl-names = "default";
109+
};
110+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2022, Teslabs Engineering S.L.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
identifier: gd32e507z_eval
5+
name: GigaDevice GD32E507Z-EVAL
6+
type: mcu
7+
arch: arm
8+
ram: 128
9+
flash: 512
10+
toolchain:
11+
- zephyr
12+
- gnuarmemb
13+
- xtools
14+
supported:
15+
- pwm
16+
- gpio
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2022, Teslabs Engineering S.L.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_SOC_SERIES_GD32E50X=y
5+
CONFIG_SOC_GD32E507=y
6+
CONFIG_BOARD_GD32E507Z_EVAL=y
7+
8+
CONFIG_ARM_MPU=y
9+
CONFIG_HW_STACK_PROTECTION=y
10+
CONFIG_CORTEX_M_SYSTICK=y
11+
12+
CONFIG_CONSOLE=y
13+
CONFIG_UART_CONSOLE=y
14+
CONFIG_SERIAL=y
15+
16+
CONFIG_GPIO=y

0 commit comments

Comments
 (0)