diff options
| author | Man, Jianting (Meco) <[email protected]> | 2022-10-17 23:02:39 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-10-17 23:02:39 -0400 |
| commit | afd1666918abbef5323de4bfa7d47234dd8ee737 (patch) | |
| tree | 6de0cd4a5317e4c8fb5ce53aa7dd66d9d56465b4 /bsp | |
| parent | 3a9152c5fee95776ff29454b42bbf79d002edee7 (diff) | |
[ch32v307] update readme (#6529)
* [ch32v307] update Chinese readme
* add English readme
Diffstat (limited to 'bsp')
| -rw-r--r-- | bsp/wch/risc-v/ch32v307v-r1/README.md | 128 | ||||
| -rw-r--r-- | bsp/wch/risc-v/ch32v307v-r1/README_zh.md | 105 | ||||
| -rw-r--r-- | bsp/wch/risc-v/ch32v307v-r1/figures/method1.png | bin | 66844 -> 0 bytes | |||
| -rw-r--r-- | bsp/wch/risc-v/ch32v307v-r1/figures/method2.png | bin | 74651 -> 0 bytes | |||
| -rw-r--r-- | bsp/wch/risc-v/ch32v307v-r1/figures/sconscompile.jpg | bin | 0 -> 70352 bytes | |||
| -rw-r--r-- | bsp/wch/risc-v/ch32v307v-r1/figures/tool.png | bin | 247667 -> 276341 bytes |
6 files changed, 164 insertions, 69 deletions
diff --git a/bsp/wch/risc-v/ch32v307v-r1/README.md b/bsp/wch/risc-v/ch32v307v-r1/README.md index 067b1952df..4343717b83 100644 --- a/bsp/wch/risc-v/ch32v307v-r1/README.md +++ b/bsp/wch/risc-v/ch32v307v-r1/README.md @@ -1,131 +1,121 @@ -# ch32v307v-r1 BSP 说明 +# CH32V307V-R1 BSP Introduction -## 1 开发板简介 +**English** | [中文](README_zh.md) -CH32V307V-R1 是 WCH 推出的一款基于 RISC-V 内核的开发板,最高主频为 144Mhz。比较适合入门学习 RISC-V 架构。 +## Introduction - - -**基本特性:** - -- MCU:CH32V307VCT6,主频 144MHz,FLASH和RAM可配置 -- LED:2个,用户 LEDs, LED1(blue),LED2(blue)。 -- 按键:2个,Reset, User 。 -- USB:2个,Tpye-C。 -- 网口:1个,内置 10M PHY。 -- 板载 WCH-Link 下载调试工具。 - -更多信息和资源请访问[互联型RISC-V单片机 CH32V307](https://www.wch.cn/products/CH32V307.html) - -## 2 编译说明 - -板级包支持 RISC-V GCC 开发环境,以下是具体版本信息: - -| IDE/编译器 | 已测试版本 | -| ---------- | -------------------- | -| GCC | WCH RISC-V GCC 8.2.0 | - -## 3 使用说明 +CH32V307V-R1 is a RISC-V core-based development board with a maximum main frequency of 144Mhz. It delivers the best value for developers to try and get started with RISC-V architecture. ->本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。 +This document records the execution instruction of the BSP (board support package) provided by the RT-Thread community for the CH32V307V-R1 development board. -### 3.1 快速上手 +The document is covered in three parts: -本 BSP 为开发者提供 Scons 编译配置。下面介绍如何将系统运行起来。 +- Board Resources Introduction +- Compiling +- Quickly Get Started -#### 3.1.1 指定RISC-V GCC编译器 +By reading the Quickly Get Started section developers can quickly get their hands on this BSP and run RT-Thread on the board. -推荐使用 RT-Thread Studio 软件里面的编译器。 - -##### 方法一:直接指定编译器路径。 - - + -##### 方法二:通过env设置编译器路径 +**Features** - +- MCU: CH32V307VCT6, main frequency 144MHz,FLASH and RAM are available for configuration. +- LED: 2, user LEDs, LED1(blue), LED2(blue). +- Button: 2, Reset, User. +- USB: 2, Tpye-C. +- Network Port: 1, 10M PHY inside. +- WCH-Link download debugging tools onboard. -```shell -set RTT_EXEC_PATH=D:\RT-ThreadStudio\repo\Extract\ToolChain_Support_Packages\WCH\RISC-V-GCC-WCH\8.2.0\bin -``` +For more details about this board, please refer to: [CH32V307](https://www.wch.cn/products/CH32V307.html) -或者通过 `scons --exec-path="GCC工具链路径"` 命令,在指定工具链位置的同时直接编译。 +## Compiling -> 注意:如果使用第二种方法,第一种方法设置的路劲将会失效。 +The BSP supports the RISC-V GCC development environment, here's the specific version information: -#### 3.1.2 生成dist文件夹 +| IDE/Compiler | Version Tested | +| ------------ | -------------------- | +| GCC | WCH RISC-V GCC 8.2.0 | -```shell -scons --dist -``` +## Quickly Get Started - +#### 3.1 Using [Env](https://www.rt-thread.io/download.html?download=Env) to compile BSP -#### 3.1.3 进入dist文件夹scons编译 +This section is about to introduce how to use Env to compile the BSP. -```shell -scons -``` +#### 3.1.1 Compile BSP - +1. [Download WCH Compile Toolchain](https://github.com/NanjingQinheng/sdk-toolchain-RISC-V-GCC-WCH/archive/refs/tags/V1.0.0.zip) +2. [Download the Env tool latest version](https://github.com/RT-Thread/env-windows/releases) +3. [Download the RT-Thread latest code](https://github.com/RT-Thread/rt-thread/archive/refs/heads/master.zip) +4. Open the Env tool in the current BSP root directory and execute the `scons --exec-path=D:sdk-toolchain-RISC-V-GCC-WCH-1.0.0bin` command, compile it directly while specifying the toolchain location. +5. After compilation, the **rtthread.bin** file will be generated -最终会生成 **rtthread.bin** 文件。 + -#### 3.1.4 硬件连接 +#### 3.1.2 Hardware Connection -使用数据线连接板载 wch-link 到 PC,打开电源开关。 +Use a data cable to connect the onboard wch-link to the PC, and turn on the power switch. -#### 3.1.5 下载 +#### 3.1.3 Download -打开 WCH RISC-V MCU ProgrammerTool 下载软件,选择刚刚生成的 **rtthread.bin** 文件,进行下载。 +Open the WCH RISC-V MCU ProgrammerTool, select the **rtthread.bin** file that we just generated, and download it.  -> 注意:这里Chip Mem 设置为224K ROM + 96K RAM。不要以参考手册为准。 +> Note that Chip Mem here is set to 224K ROM + 96K RAM. -#### 3.1.6 运行结果 +#### 3.1.4 Running Result -在终端工具里打开板载 wch-link 串口(WCHDapLink SERIAL,默认115200-8-1-N),复位设备后,在串口上可以看到 RT-Thread 的输出信息: +In the terminal tool, open the onboard wch-link serial port (WCHDapLink SERIAL, default 115200-8-1-N), and after resetting the device, you can see the output information of RT-Thread on the serial port:  -### 3.2 导入 RT-Thread Studio 工程 -#### 3.2.1 导入 +<!-- ### 3.2 Import RT-Thread Studio Project + +**CH32V307V-R1 is pending upgrade in Studio. It's not encouraged now to use Studio to compile this BSP.** -打开 RT-Thread Studio 后点击:文件->导入: +#### 3.2.1 Import + +Open RT-Thread Studio and click: File-> Import:  -选择“RT-Thread Bsp 到工作空间中”: +Select "RT-Thread BSP Project into Workspace":  填写项目信息,Bsp 根目录为 \rt-thread\bsp\wch\risc-v\ch32v307v-r1 目录: +Fill in the project info, the BSP root directory is \rt-thread\bsp\wch\risc-v\ch32v307v-r1: +  -#### 3.2.2 配置环境 +#### 3.2.2 Compilation Environment 工程导入后进行编译环境的设置,首先点击“打开构建设置”进入设置界面: +After the project is imported, set the compilation environment, click "Open Build Settings" to enter the setting interface: +  将编译链路径复制到 Toolchain path 中: +Copy the compilation chain path into the Toolchain path:  -如图更改 Prefix : +Change Prefix:  -进行工具设置: +Set the tool:  -#### 3.2.3 编译 +#### 3.2.3 Compiling -编译结果如下: +The result is shown as below: - + | **中文** + +## 1 开发板简介 + +CH32V307V-R1 是 WCH 推出的一款基于 RISC-V 内核的开发板,最高主频为 144Mhz。比较适合入门学习 RISC-V 架构。 + + + +**基本特性:** + +- MCU:CH32V307VCT6,主频 144MHz,FLASH和RAM可配置 +- LED:2个,用户 LEDs, LED1(blue),LED2(blue)。 +- 按键:2个,Reset, User 。 +- USB:2个,Tpye-C。 +- 网口:1个,内置 10M PHY。 +- 板载 WCH-Link 下载调试工具。 + +更多信息和资源请访问[互联型RISC-V单片机 CH32V307](https://www.wch.cn/products/CH32V307.html) + +## 2 编译说明 + +板级包支持 RISC-V GCC 开发环境,以下是具体版本信息: + +| IDE/编译器 | 已测试版本 | +| ---------- | -------------------- | +| GCC | WCH RISC-V GCC 8.2.0 | + +## 3 使用说明 + +>本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。 + +### 3.1 使用Env编译BSP + +本节讲解如何使用Env工具来编译BSP工程。 + +#### 3.1.1 编译BSP + +1. [下载WCH编译工具链](https://github.com/NanjingQinheng/sdk-toolchain-RISC-V-GCC-WCH/archive/refs/tags/V1.0.0.zip) +2. 下载Env工具[最新版本](https://github.com/RT-Thread/env-windows/releases) +3. 下载RT-Thread[最新源码](https://github.com/RT-Thread/rt-thread/archive/refs/heads/master.zip) +4. 并在当前BSP根目录下打开Env工具并执行 `scons --exec-path=D:\sdk-toolchain-RISC-V-GCC-WCH-1.0.0\bin` 命令,在指定工具链位置的同时直接编译。 +5. 编译完成之后会生成 **rtthread.bin** 文件。 + + + +#### 3.1.2 硬件连接 + +使用数据线连接板载 wch-link 到 PC,打开电源开关。 + +#### 3.1.3 下载 + +打开 WCH RISC-V MCU ProgrammerTool 下载软件,选择刚刚生成的 **rtthread.bin** 文件,进行下载。 + + + +> 注意:这里Chip Mem 设置为224K ROM + 96K RAM。不要以参考手册为准。 + +#### 3.1.4 运行结果 + +在终端工具里打开板载 wch-link 串口(WCHDapLink SERIAL,默认115200-8-1-N),复位设备后,在串口上可以看到 RT-Thread 的输出信息: + + + +### 3.2 导入 RT-Thread Studio 工程 + +#### 3.2.1 导入 + +打开 RT-Thread Studio 后点击:文件->导入: + + + +选择“RT-Thread Bsp 到工作空间中”: + + + +填写项目信息,Bsp 根目录为 `\rt-thread\bsp\wch\risc-v\ch32v307v-r1` 目录: + + + + +#### 3.2.2 配置环境 + +工程导入后进行编译环境的设置,首先点击“打开构建设置”进入设置界面: + + + +将编译链路径复制到 Toolchain path 中: + + + +如图更改 Prefix : + + + +进行工具设置: + + + +#### 3.2.3 编译 + +编译结果如下: + + diff --git a/bsp/wch/risc-v/ch32v307v-r1/figures/method1.png b/bsp/wch/risc-v/ch32v307v-r1/figures/method1.png Binary files differdeleted file mode 100644 index b595a0c3a5..0000000000 --- a/bsp/wch/risc-v/ch32v307v-r1/figures/method1.png +++ /dev/null diff --git a/bsp/wch/risc-v/ch32v307v-r1/figures/method2.png b/bsp/wch/risc-v/ch32v307v-r1/figures/method2.png Binary files differdeleted file mode 100644 index 733d090f3f..0000000000 --- a/bsp/wch/risc-v/ch32v307v-r1/figures/method2.png +++ /dev/null diff --git a/bsp/wch/risc-v/ch32v307v-r1/figures/sconscompile.jpg b/bsp/wch/risc-v/ch32v307v-r1/figures/sconscompile.jpg Binary files differnew file mode 100644 index 0000000000..2460567f48 --- /dev/null +++ b/bsp/wch/risc-v/ch32v307v-r1/figures/sconscompile.jpg diff --git a/bsp/wch/risc-v/ch32v307v-r1/figures/tool.png b/bsp/wch/risc-v/ch32v307v-r1/figures/tool.png Binary files differindex 00df7925b8..f1a6335c9e 100644 --- a/bsp/wch/risc-v/ch32v307v-r1/figures/tool.png +++ b/bsp/wch/risc-v/ch32v307v-r1/figures/tool.png |
