This project is based on rv003usb.
| 硬件信息 | ||
|---|---|---|
| MCU | CH32V003 | 青稞32位RISC-V内核,RV32EC指令集 @48MHz |
| SRAM | 2 KB | 易失数据存储区 |
| Bootloader | 1920 Bytes | 系统引导程序存储区 |
| Flash | 16 KB | 程序存储区 |
| USB_DP(D+) | PD3 | |
| USB_DM(D-) | PD4 | |
| DPU | PD5 | 用于重新触发USB枚举 |
| BOOT Btn | PD6 | 用于在BootLoader阶段检测是否要烧录程序 |
The following content assumes you are using the CH32V003 USB Dev Board.
Install toolchain and libs
sudo apt install gcc-riscv64-unknown-elf libusb-1.0-0-dev bearBuild the flash the firmware
cd vendor
makeFlash firmware and listen log. This requires a wch-linke debugger
minichlink -w vendor.bin flash -b -Tgenerate compile_commands.json and use clangd to index code
bear -- makeGo to vscode, Press Ctrl + Shift + P , the search clangd: Restart language server and press Enter.