Skip to content

Commit 383abae

Browse files
committed
boards: arm: gd32f450i_eval: add initial support
Add initial support for the GD32F450I-EVAL board. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 81c68e9 commit 383abae

File tree

12 files changed

+282
-0
lines changed

12 files changed

+282
-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, Teslabs Engineering S.L.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
zephyr_library()
5+
zephyr_library_sources(board.c)

boards/arm/gd32f450i_eval/Kconfig

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

boards/arm/gd32f450i_eval/board.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2021, Teslabs Engineering S.L.
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+
/* PA9: USART0 TX */
13+
gpio_af_set(GPIOA, GPIO_AF_7, GPIO_PIN_9);
14+
gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_9);
15+
gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_2MHZ, GPIO_PIN_9);
16+
17+
/* PA10: USART0 RX */
18+
gpio_af_set(GPIOA, GPIO_AF_7, GPIO_PIN_10);
19+
gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_10);
20+
gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_2MHZ, GPIO_PIN_10);
21+
22+
rcu_periph_clock_disable(RCU_GPIOA);
23+
24+
return 0;
25+
}
26+
27+
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, Teslabs Engineering S.L.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
661 KB
Loading
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
.. _gd32f450i_eval:
2+
3+
GigaDevice GD32F450I-EVAL
4+
#########################
5+
6+
Overview
7+
********
8+
9+
The GD32F450I-EVAL board is a hardware platform that enables prototyping
10+
on GD32F450IK Cortex-M4F Stretch Performance MCU.
11+
12+
The GD32F450IK features a single-core ARM Cortex-M4F MCU which can run up
13+
to 200 MHz with flash accesses zero wait states, 3072kiB of Flash, 256kiB of
14+
SRAM and 140 GPIOs.
15+
16+
.. image:: img/gd32f450i_eval.png
17+
:align: center
18+
:alt: gd32f450i_eval
19+
20+
21+
Hardware
22+
********
23+
24+
- GD32F450IKT6 MCU
25+
- AT24C02C 2Kb EEPROM
26+
- GD25Q32C 16Mbit SPI and QSPI NOR Flash
27+
- GD9FS1G8F2A 1Gbit NAND Flash
28+
- Micron MT48LC16M16A2P-6AIT 256Mbit SDRAM
29+
- 3 x User LEDs
30+
- 3 x User Push buttons
31+
- 1 x USART (RS-232 at J1 connector)
32+
- 1 x POT connected to an ADC input
33+
- Headphone interface
34+
- Micro SD Card Interface
35+
- USB FS connector
36+
- USB HS connector
37+
- 1 x CAN
38+
- Ethernet Interface
39+
- 3.5" RGB-LCD (320x480)
40+
- OV2640 Digital Camera
41+
- GD-Link on board programmer
42+
- J-Link/JTAG connector
43+
44+
For more information about the GD32F450 SoC and GD32F450I-EVAL board:
45+
46+
- `GigaDevice Cortex-M4F Stretch Performance SoC Website`_
47+
- `GD32F450xx Datasheet`_
48+
- `GD32F4xx User Manual`_
49+
- `GD32F450I-EVAL User Manual`_
50+
51+
Supported Features
52+
==================
53+
54+
The board configuration supports the following hardware features:
55+
56+
.. list-table::
57+
:header-rows: 1
58+
59+
* - Peripheral
60+
- Kconfig option
61+
- Devicetree compatible
62+
* - NVIC
63+
- N/A
64+
- :dtcompatible:`arm,v7m-nvic`
65+
* - SYSTICK
66+
- N/A
67+
- N/A
68+
* - USART
69+
- :kconfig:`CONFIG_SERIAL`
70+
- :dtcompatible:`gd,gd32-usart`
71+
72+
Serial Port
73+
===========
74+
75+
The GD32F450I-EVAL board has one serial communication port. The default port
76+
is USART0 with TX connected at PA9 and RX at PA10.
77+
78+
Programming and Debugging
79+
*************************
80+
81+
Before programming your board make sure to configure boot and serial jumpers
82+
as follows:
83+
84+
- J2/3: Select 2-3 for both (boot from user memory)
85+
- J5: Select 1-2 position (labeled as ``USART0``)
86+
87+
Using GD-Link
88+
=============
89+
90+
The GD32F450I-EVAL includes an onboard programmer/debugger (GD-Link) which
91+
allows flash programming and debugging over USB. There is also a JTAG header
92+
(J1) which can be used with tools like Segger J-Link.
93+
94+
#. Build the Zephyr kernel and the :ref:`hello_world` sample application:
95+
96+
.. zephyr-app-commands::
97+
:zephyr-app: samples/hello_world
98+
:board: gd32f450i_eval
99+
:goals: build
100+
:compact:
101+
102+
#. Run your favorite terminal program to listen for output. On Linux the
103+
terminal should be something like ``/dev/ttyUSB0``. For example:
104+
105+
.. code-block:: console
106+
107+
minicom -D /dev/ttyUSB0 -o
108+
109+
The -o option tells minicom not to send the modem initialization
110+
string. Connection should be configured as follows:
111+
112+
- Speed: 115200
113+
- Data: 8 bits
114+
- Parity: None
115+
- Stop bits: 1
116+
117+
#. To flash an image:
118+
119+
.. zephyr-app-commands::
120+
:zephyr-app: samples/hello_world
121+
:board: gd32f450i_eval
122+
:goals: flash
123+
:compact:
124+
125+
You should see "Hello World! gd32f450i_eval" in your terminal.
126+
127+
#. To debug an image:
128+
129+
.. zephyr-app-commands::
130+
:zephyr-app: samples/hello_world
131+
:board: gd32f450i_eval
132+
:goals: debug
133+
:compact:
134+
135+
136+
.. _GigaDevice Cortex-M4F Stretch Performance SoC Website:
137+
https://www.gigadevice.com/products/microcontrollers/gd32/arm-cortex-m4/stretch-performance-line/
138+
139+
.. _GD32F450xx Datasheet:
140+
https://gd32mcu.21ic.com/data/documents/shujushouce/GD32F450xx_Datasheet_Rev1.1.pdf
141+
142+
.. _GD32F4xx User Manual:
143+
https://www.gigadevice.com/manual/gd32f450xxxx-user-manual/
144+
145+
.. _GD32F450I-EVAL User Manual:
146+
http://www.gd32mcu.com/download/down/document_id/120/path_type/1
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2021, Teslabs Engineering S.L.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <gigadevice/gd32f4xx/gd32f450ik.dtsi>
9+
10+
/ {
11+
model = "GigaDevice GD32F450I-EVAL";
12+
compatible = "gd,gd32f450i-eval";
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+
current-speed = <115200>;
25+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2021, Teslabs Engineering S.L.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
identifier: gd32f450i_eval
5+
name: GigaDevice GD32F450I-EVAL
6+
type: mcu
7+
arch: arm
8+
ram: 112
9+
flash: 3072
10+
toolchain:
11+
- zephyr
12+
- gnuarmemb
13+
- xtools

0 commit comments

Comments
 (0)