You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
surenyi
e73cbfe008
|
1 year ago | |
---|---|---|
ch32v307 | 1 year ago | |
docs | 1 year ago | |
include | 1 year ago | |
lib | 1 year ago | |
src | 1 year ago | |
.clangd | 1 year ago | |
.gitignore | 1 year ago | |
CMakeLists.txt | 1 year ago | |
README.md | 1 year ago | |
riscv-collab.cmake | 1 year ago | |
xpack-riscv.cmake | 1 year ago |
README.md
FreeRTOS demo for WCH CH32V30x series MCU
How to use
- Write your own CMake toolchain file (see
xpack-riscv.cmake
for example) - Configure project and build as usual. (see below for a simple test)
Sample usage
build project
cmake -S . -B build -G Ninja
cmake --build build
flash binary
Enter the isp mode:
press reset
and boot0
key at the same time. Release reset
key then boot0
key.
cmake --build build -t flash
Notes
Startup files
There are two versions of startup assembly files, located at
BSP/Startup/startup_ch32v30x_D8.S
BSP/Startup/startup_ch32v30x_D8C.S
The first file is used for CH32V303 devices, which lacks of the following peripherals:
- Ethernet
- CAN2
- USBHS
- DVP
*** Change the startup file to the correct version for the hardware in use. ***
Compilers
These MCUs uses something called "RISC-V4F" core with Chinese documentation provided:
- Implemented RV32IMAFC ABI
Here is the list of features proprietary or incompatible with upstream toolchain:
- Fast IRQ handlers: uses a special attribute of
interrupt
, which value isWCH-Interrupt-fast
References
- https://github.com/gregdavill/CH32V307-makefile-example
- https://git.minori.work/Embedded_Projects/CH32V307_FreeRTOS_Hello
- https://git.minori.work/Embedded_Projects/CH32V307_Template
- https://github.com/imi415/FreeRTOS-Kernel.git
- https://github.com/hathach/tinyusb
- https://github.com/riscv-collab/riscv-gnu-toolchain