This is a standalone CMake library version of the RISCV firmware provided by Gigadevice.
This is a kind of minimal version to get the gd32v up and running without using the complete standard peripheral library.
For this library to work you need to provide some code in your project.
You need to:
- Set the
SystemCoreClockto the used system clock - Provide a
SystemInit()function- This function should at least set the
SystemCoreClock
- This function should at least set the
To use this library in your project, clone this repository somewhere into your project. Then add the library as a subdirectory and link target in your projects CMakeLists.txt.
add_subdirectory(path/to/this/lib) CMake Doc
target_link_libraries(<your target> gd32vf103) CMake Doc
You also have to define your target board type which is done by defining one of those variables:
GD32VF103C_STARTGD32VF103R_STARTGD32VF103T_STARTGD32VF103V_EVAL
To define it you can add target_compile_definitions to your project.
target_compile_definitions(gd32vf103 PUBLIC GD32VF103V_EVAL) CMake Doc