Added README.md and .gitignore.

This commit is contained in:
imi415 2022-03-29 00:21:16 +08:00
parent 5e8df9c17f
commit a25b896bb0
Signed by untrusted user: imi415
GPG Key ID: 885EC2B5A8A6F8A7
2 changed files with 30 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/cmake-build-*
/build
/.vscode

27
README.md Normal file
View File

@ -0,0 +1,27 @@
# 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
** Change the startup file to the correct version for the hardware in use. **