fec7404506
#### 为什么提交这份PR (why to submit this PR) - 修复ch32v307v-r1 board.h 中变量_stack_size未声明BUG - 提供ch32v307v-r1动态堆内存分配(宏开关)代码 - ch32v307v-r1 MD文档新增烧录方式,作为烧录后无运行结果的替代方案 #### 你的解决方案是什么 (what is your solution) - 去掉_stack_size未声明变量 - 动态分配内存堆,将堆起始地址放在.bss段结尾,堆结束地址放在.stack段开头[详情](https://club.rt-thread.org/ask/article/001065082e9ae611.html) - 将烧录工具替换为WCH-LinkUtility #### 在什么测试环境下测试通过 (what is the test environment) - 开发工具: RT-Thread Studio - 测试板卡:ch32v307v-r1评估板 - 烧录工具:WCH-LinkUtility |
||
---|---|---|
.. | ||
applications | ||
board | ||
figures | ||
.config | ||
Kconfig | ||
README.md | ||
README_zh.md | ||
SConscript | ||
SConstruct | ||
rtconfig.h | ||
rtconfig.py |
README.md
CH32V307V-R1 BSP Introduction
English | 中文
1 Introduction
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.
This document records the execution instruction of the BSP (board support package) provided by the RT-Thread community for the CH32V307V-R1 development board.
The document is covered in three parts:
- Board Resources Introduction
- Compiling
- Quickly Get Started
By reading the Quickly Get Started section developers can quickly get their hands on this BSP and run RT-Thread on the board.
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.
For more details about this board, please refer to: CH32V307 and CH32V307 official document
2 Compiling
The BSP supports the RISC-V GCC development environment, here's the specific version information:
IDE/Compiler | Version Tested |
---|---|
GCC | WCH RISC-V GCC 8.2.0 |
3 Quickly Get Started
3.1 Using Env to compile BSP
This section is about to introduce how to use Env to compile the BSP.
3.1.1 Compile BSP
- Download WCH Compile Toolchain
- Download the Env tool latest version
- Download the RT-Thread latest code
- Open the Env tool in the current BSP root directory and execute the
scons -j12 --exec-path=D:\sdk-toolchain-RISC-V-GCC-WCH-1.0.0\bin
command, compile it directly while specifying the toolchain location. - After compilation, the rtthread.bin file will be generated
3.1.2 Hardware Connection
Use a data cable to connect the onboard wch-link to the PC, and turn on the power switch.
3.1.3 Download
Open the WCH RISC-V MCU ProgrammerTool, select the rtthread.bin file that we just generated, and download it.
Note that Chip Mem here is set to 224K ROM + 96K RAM.
3.1.4 Running Result
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.1.5 If no running result
Replace download tool with WCH-LinkUtility. Details
3.2 Use VSCode to edit and compile the project
In the Env terminal, type command scons --target=vsc
to generate the VSCode project. Then, type command code .
in the Env terminal to open the VSCode.
Use VSCode terminal to type command scons -j12 --exec-path=D:\sdk-toolchain-RISC-V-GCC-WCH-1.0.0\bin
to compile the project in VSCode.