From a25b896bb064e9236df7d132934e2843dcf912cd Mon Sep 17 00:00:00 2001 From: imi415 Date: Tue, 29 Mar 2022 00:21:16 +0800 Subject: [PATCH] Added README.md and .gitignore. --- .gitignore | 3 +++ README.md | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .gitignore create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b90c7d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/cmake-build-* +/build +/.vscode \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..a1d2fbb --- /dev/null +++ b/README.md @@ -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. **