Skip to content

Commit fe24aef

Browse files
committed
boards: arm: Introduce gd32f450i_eval board
Add GD32F450i_EVAL board initial version. Only support hello_world sample. Signed-off-by: HaiLong Yang <[email protected]>
1 parent d7133d1 commit fe24aef

File tree

10 files changed

+122
-0
lines changed

10 files changed

+122
-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/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 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 BrainCo Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_GD32F450I_EVAL
5+
bool "GigaDevice GD32F450I Evaluation Kit"
6+
depends on SOC_GD32F450I
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_GD32F450I_EVAL
5+
6+
config BOARD
7+
default "gd32f450i_eval"
8+
9+
endif # BOARD_GD32F450I_EVAL

boards/arm/gd32f450i_eval/board.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2021 BrainCo Inc.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <init.h>
7+
8+
#include <gd32f4xx.h>
9+
10+
/** Initialize the board's hardware through GD32 HAL */
11+
static int board_init(const struct device *dev)
12+
{
13+
/* Enable GPIOA clock for PA9, PA10 */
14+
rcu_periph_clock_enable(RCU_GPIOA);
15+
16+
/* Pin AF definition can be found in datasheet Device overview section */
17+
gpio_af_set(GPIOA, GPIO_AF_7, GPIO_PIN_9);
18+
gpio_af_set(GPIOA, GPIO_AF_7, GPIO_PIN_10);
19+
20+
/* Configure USART0 Tx as alternate function push-pull */
21+
gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_PULLUP, GPIO_PIN_9);
22+
gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9);
23+
24+
/* Configure USART0 Rx as alternate function push-pull */
25+
gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_PULLUP, GPIO_PIN_10);
26+
gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_10);
27+
28+
return 0;
29+
}
30+
31+
SYS_INIT(board_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2021 BrainCo Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
board_runner_args(jlink "--device=GD32F450IK")
5+
board_runner_args(jlink "--iface=JTAG")
6+
board_runner_args(jlink "--speed=4000")
7+
board_runner_args(jlink "--tool-opt=-jtagconf -1,-1")
8+
board_runner_args(jlink "--tool-opt=-autoconnect 1")
9+
10+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
1.28 MB
Loading
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2021 BrainCo Inc.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <gigadevice/gd32f450ikh6.dtsi>
9+
10+
/ {
11+
model = "GigaDevice GD32F450I Evaluation Kit";
12+
compatible = "gd,gd32f450i";
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 BrainCo Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
identifier: gd32f450i_eval
5+
name: GigaDevice GD32F450I Evaluation Kit
6+
type: mcu
7+
arch: arm
8+
ram: 256
9+
flash: 3072
10+
toolchain:
11+
- zephyr
12+
- gnuarmemb
13+
- xtools
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) 2021 BrainCo Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_SOC_SERIES_GD32F4=y
5+
CONFIG_SOC_GD32F450I=y
6+
CONFIG_BOARD_GD32F450I_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

0 commit comments

Comments
 (0)