Skip to content

Commit 9bac5ba

Browse files
committed
[add] bsp gd32f527i-eval
1 parent 24cf724 commit 9bac5ba

File tree

203 files changed

+110495
-35
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+110495
-35
lines changed

bsp/gd32/arm/gd32527I-eval/.config

+1,306
Large diffs are not rendered by default.

bsp/gd32/arm/gd32527I-eval/Kconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
mainmenu "RT-Thread Configuration"
2+
3+
BSP_DIR := .
4+
5+
RTT_DIR := ../../../..
6+
7+
PKGS_DIR := packages
8+
9+
source "$(RTT_DIR)/Kconfig"
10+
osource "$PKGS_DIR/Kconfig"
11+
rsource "../libraries/Kconfig"
12+
rsource "board/Kconfig"

bsp/gd32/arm/gd32527I-eval/README.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# GDF527I-Eval开发板BSP说明
2+
3+
## 外设支持
4+
5+
本 BSP 目前对外设的支持情况如下:
6+
7+
| **片上外设** | **支持情况** | **备注** |
8+
|:-------- |:--------:|:-------------------------------- |
9+
| GPIO | 支持 | PA0, PA1... ---> PIN: 0, 1...113 |
10+
| UART | 支持 | UART0 - UART7 |
11+
| **扩展模块** | **支持情况** | **备注** |
12+
| 暂无 | 暂不支持 | 暂不支持 |
13+
14+
## 使用说明
15+
16+
使用说明分为如下两个章节:
17+
18+
- 快速上手
19+
20+
本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。
21+
22+
- 进阶使用
23+
24+
本章节是为需要在 RT-Thread 操作系统上使用更多开发板资源的开发者准备的。通过使用 ENV 工具对 BSP 进行配置,可以开启更多板载资源,实现更多高级功能。
25+
26+
### 快速上手
27+
28+
本 BSP 为开发者提供 MDK5工程,支持 GCC 开发环境,也可使用RT-Thread Studio开发。下面以 MDK5 开发环境为例,介绍如何将系统运行起来。
29+
30+
#### 硬件连接
31+
32+
使用调试器连接开发板到 PC,使用USB2TTL连接USART0,并给开发板供电。
33+
34+
#### 编译下载
35+
36+
双击 project.uvprojx 文件,打开 MDK5 工程,编译并下载程序到开发板。
37+
38+
> 工程默认配置使用 CMSIS-DAP 仿真器下载程序,在通过 CMSIS-DAP 连接开发板的基础上,点击下载按钮即可下载程序到开发板
39+
40+
#### 运行结果
41+
42+
下载程序成功之后,系统会自动运行,LED 闪烁。
43+
44+
连接开发板对应串口到 PC , 在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息:
45+
46+
```bash
47+
\ | /
48+
- RT - Thread Operating System
49+
/ | \ 5.0.0 build Mar 3 2023 00:43:44
50+
2006 - 2022 Copyright by RT-Thread team
51+
msh />
52+
```
53+
54+
### 进阶使用
55+
56+
此 BSP 默认只开启了 GPIO 和 串口1的功能,如果需使用高级功能,需要利用 ENV 工具对BSP 进行配置,步骤如下:
57+
58+
1. 在 bsp 下打开 env 工具。
59+
60+
2. 输入`menuconfig`命令配置工程,配置好之后保存退出。
61+
62+
3. 输入`pkgs --update`命令更新软件包。
63+
64+
4. 输入`scons --target=mdk4/mdk5/iar` 命令重新生成工程。
65+
66+
## 注意事项
67+
68+
暂无
69+
70+
## 联系人信息
71+
72+
维护人:
73+
74+
- [yuanzihao](https://github.com/zihao-yuan/), 邮箱:<[email protected]>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
/*
3+
* Auto generated Run-Time-Environment Configuration File
4+
* *** Do not modify ! ***
5+
*
6+
* Project: 'project'
7+
* Target: 'rt-thread'
8+
*/
9+
10+
#ifndef RTE_COMPONENTS_H
11+
#define RTE_COMPONENTS_H
12+
13+
14+
15+
#endif /* RTE_COMPONENTS_H */

bsp/gd32/arm/gd32527I-eval/SConscript

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# for module compiling
2+
import os
3+
Import('RTT_ROOT')
4+
from building import *
5+
6+
cwd = GetCurrentDir()
7+
objs = []
8+
list = os.listdir(cwd)
9+
10+
for d in list:
11+
path = os.path.join(cwd, d)
12+
if os.path.isfile(os.path.join(path, 'SConscript')):
13+
objs = objs + SConscript(os.path.join(d, 'SConscript'))
14+
15+
Return('objs')

bsp/gd32/arm/gd32527I-eval/SConstruct

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import os
2+
import sys
3+
import rtconfig
4+
5+
if os.getenv('RTT_ROOT'):
6+
RTT_ROOT = os.getenv('RTT_ROOT')
7+
else:
8+
RTT_ROOT = os.path.normpath(os.getcwd() + '/../../../..')
9+
10+
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
11+
try:
12+
from building import *
13+
except:
14+
print('Cannot found RT-Thread root directory, please check RTT_ROOT')
15+
print(RTT_ROOT)
16+
exit(-1)
17+
18+
TARGET = 'rtthread.' + rtconfig.TARGET_EXT
19+
20+
DefaultEnvironment(tools=[])
21+
env = Environment(tools = ['mingw'],
22+
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
23+
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
24+
AR = rtconfig.AR, ARFLAGS = '-rc',
25+
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
26+
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
27+
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
28+
29+
if rtconfig.PLATFORM in ['iccarm']:
30+
env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
31+
env.Replace(ARFLAGS = [''])
32+
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map')
33+
34+
Export('RTT_ROOT')
35+
Export('rtconfig')
36+
37+
SDK_ROOT = os.path.abspath('./')
38+
39+
if os.path.exists(SDK_ROOT + '/libraries'):
40+
libraries_path_prefix = SDK_ROOT + '/libraries'
41+
else:
42+
libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries'
43+
44+
SDK_LIB = libraries_path_prefix
45+
Export('SDK_LIB')
46+
47+
# prepare building environment
48+
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
49+
50+
gd32_library = 'GD32F5xx_Firmware_Library'
51+
rtconfig.BSP_LIBRARY_TYPE = gd32_library
52+
53+
# include libraries
54+
objs.extend(SConscript(os.path.join(libraries_path_prefix, gd32_library, 'SConscript')))
55+
56+
# include drivers
57+
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'gd32_drivers', 'SConscript')))
58+
59+
# make a building
60+
DoBuilding(TARGET, objs)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from building import *
2+
import os
3+
4+
cwd = GetCurrentDir()
5+
src = Glob('*.c')
6+
CPPPATH = [cwd]
7+
8+
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
9+
10+
list = os.listdir(cwd)
11+
for item in list:
12+
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
13+
group = group + SConscript(os.path.join(item, 'SConscript'))
14+
15+
Return('group')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2006-2023, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2021-08-20 BruceOu first implementation
9+
* 2023-03-05 yuanzihao change the LED pins
10+
*/
11+
12+
#include <stdio.h>
13+
#include <rtthread.h>
14+
#include <rtdevice.h>
15+
#include <board.h>
16+
17+
/* defined the LED1 pin: PE3 */
18+
#define LED1_PIN GET_PIN(E, 3)
19+
20+
int main(void)
21+
{
22+
int count = 1;
23+
24+
/* set LED1 pin mode to output */
25+
rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
26+
27+
while (count++)
28+
{
29+
rt_pin_write(LED1_PIN, PIN_HIGH);
30+
rt_thread_mdelay(500);
31+
rt_pin_write(LED1_PIN, PIN_LOW);
32+
rt_thread_mdelay(500);
33+
}
34+
35+
return RT_EOK;
36+
}

0 commit comments

Comments
 (0)