CH32V307_Template/README.md

36 lines
1.0 KiB
Markdown
Raw Permalink Normal View History

<!-- SPDX-License-Identifier: MIT -->
2022-03-28 16:21:16 +00:00
# Template for WCH CH32V30x series MCU
## How to use
* Write your own CMake toolchain file (see `riscv64-elf.cmake` for example)
* Configure project and build as usual. (see below for a simple test)
## Sample usage
```bash
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=riscv64-elf.cmake ..
make -j${nprocs}
```
## 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
2022-03-29 08:19:12 +00:00
*** Change the startup file to the correct version for the hardware in use. ***
2022-03-28 17:04:49 +00:00
### Compilers
2022-03-29 08:19:12 +00:00
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 is `WCH-Interrupt-fast`