2019-07-24 19:25:39 +08:00
|
|
|
|
# GD32VF103 #
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
|
|
|
|
## 简介
|
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
gd32vf103v-eval 是由兆易创新公司推出的基于开源指令集 RISC-V 架构的开发板。
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
|
|
|
|
### 板载资源:
|
|
|
|
|
|
|
|
|
|
| 硬件 | 描述 |
|
|
|
|
|
| -- | -- |
|
2019-07-24 19:25:39 +08:00
|
|
|
|
| 内核 | Bumblebee |
|
2019-07-24 17:03:26 +08:00
|
|
|
|
| 架构 | 32-bit RV32IMAC |
|
2019-07-24 19:25:39 +08:00
|
|
|
|
| 主频 | 108 MHz |
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
|
|
|
|
## 编译说明
|
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
### 导入工程
|
|
|
|
|
打开 Eclipse 选择工作空间
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|

|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
打开 Eclipse 后需要导入 RT-Thread 工程
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|

|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
选择以存在的工程,并指定工程路径
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|

|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
指定工程路径
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|

|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 添加环境变量
|
2019-07-24 19:25:39 +08:00
|
|
|
|
设置 Build Tools Path
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|

|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
点击 MCU 列表中的 Build Tools Path 选项,为其选择 SDK 文件包中提供的对应工具
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
设置 OpenOCD Path
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|

|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
点击 MCU 列表中的 OpenOCD Path 选项,为其选择 SDK 文件包中提供的对应工具。
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
设置 RISC-V Toolchains Path
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|

|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
点击 MCU 列表中的 RISC-V Toolchains Paths 选项,为其选择 SDK 文件包中提供的对应工具。
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
按照以上步骤设置好路径点击编译即可编译工程
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|

|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
|
|
|
|
## 烧写及执行
|
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
### 替换驱动
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
1. 执行 JLink_Windows_V622c.exe (可以是任意版本)安装 JLink 驱动程序。
|
|
|
|
|
2. 执行 Zadig.exe,点击 Options->List All Devices。
|
|
|
|
|
3. 在下图 1 处选择 J-Link,2 处选择 WinUSB, 之后点击 3 处 Replace Driver 进行驱动替换。
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|

|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
安装完成之后会弹出如下窗口:
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|

|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
### 配置 GDB 调试
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
在菜单栏中,点击 Run->Debug Configurations,进入 Debug 配置界面,如下图所示:
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|

|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
这里使用 OpenOCD 作为 GDB Server,使用GCC工具链中的 GDB 工具作为 GDB Client。双击 GDB OpenOCD Debugging,新建一套 OpenOCD 的配置选项。
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
Main 选项卡
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
Main 选项卡配置界面
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|

|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
选择当前工程 GD32VF103,并且选择当前型号的可执行文件,例如:GD32VF103xB\GD32VF103xB.elf。
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
Debugger 选项卡
|
|
|
|
|
Debugger 选项卡配置界面
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|

|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
在 Debugger 选项卡中,确认红圈中的配置正确。
|
|
|
|
|
其中,“Config options” 是为 OpenOCD 选择配置文件,需要根据当前使用的下载器选择不同的 cfg 文件。
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
上述配置内容配置好后,点击应用调试。
|
2019-07-24 17:03:26 +08:00
|
|
|
|
### 运行结果
|
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
下载程序之后,连接串口(115200-N-8-1),可以看到 RT-Thread 的输出信息:
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
\ | /
|
|
|
|
|
- RT - Thread Operating System
|
2019-07-24 19:25:39 +08:00
|
|
|
|
/ | \ 4.0.2 build Jul 24 2019
|
|
|
|
|
2006 - 2019 Copyright by rt-thread team
|
2019-07-24 17:03:26 +08:00
|
|
|
|
msh >
|
|
|
|
|
```
|
|
|
|
|
|
2019-07-24 19:25:39 +08:00
|
|
|
|
## 驱动支持情况
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
|
|
|
|
| 驱动 | 支持情况 | 备注 |
|
|
|
|
|
| ------ | ---- | :------: |
|
2019-07-24 19:25:39 +08:00
|
|
|
|
| USART | 支持 | UART0_TX/RX:GPIO 9/10 |
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|
|
|
|
|
## 5. 联系人信息
|
|
|
|
|
|
|
|
|
|
维护人:
|
2019-07-24 19:25:39 +08:00
|
|
|
|
- [tyustli](https://github.com/tyustli)
|
2019-07-24 17:03:26 +08:00
|
|
|
|
|