Compare commits
No commits in common. "be9832c403438269da2a2218ac8eb1c67e4ba2f5" and "a7682c802ae4c4ff29d38dcd4d1d4333c9fd588b" have entirely different histories.
be9832c403
...
a7682c802a
3 changed files with 10 additions and 9 deletions
|
@ -60,6 +60,8 @@ instructions.
|
|||
|
||||
## TODO
|
||||
|
||||
- [ ] Add NewLib finding/functionality
|
||||
- [ ] Add NewLib-nano finding/functionality
|
||||
- [X] Add ch32v003fun sources.
|
||||
- [X] Add example blinky default main.
|
||||
- [ ] Add useful test examples.
|
||||
|
|
3
otto.sh
3
otto.sh
|
@ -8,7 +8,6 @@ CMAKE_VERBOSE="ON"
|
|||
CROSS_COMPILE=1
|
||||
TEMPLATE_FILES=".template_files"
|
||||
MODULE_DIR="${TEMPLATE_FILES}/modules"
|
||||
CHIP="ch32v003"
|
||||
|
||||
|
||||
format_source_code () {
|
||||
|
@ -266,7 +265,7 @@ build_hex_optimized () {
|
|||
|
||||
flash_microcontroller () {
|
||||
build_hex_optimized
|
||||
wlink --chip=${CHIP} flash ./src/main.elf
|
||||
make upload
|
||||
}
|
||||
|
||||
run_c_tests () {
|
||||
|
|
|
@ -8,14 +8,9 @@ target_include_directories(${PROJECT_NAME} PUBLIC
|
|||
${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
gcc
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
)
|
||||
|
||||
|
||||
# The `-ffunction-sections` and `-fdata-sections` need to be used
|
||||
# in the compile and linker options otherwise it doesnt't
|
||||
# correctly remove the unused functions.
|
||||
target_compile_options(${PROJECT_NAME} PUBLIC
|
||||
-g
|
||||
-Os
|
||||
|
@ -27,9 +22,14 @@ target_compile_options(${PROJECT_NAME} PUBLIC
|
|||
-march=rv32ec
|
||||
-mabi=ilp32e
|
||||
-DCH32V003=1
|
||||
-static-libgcc
|
||||
-nostdlib
|
||||
-lgcc
|
||||
)
|
||||
|
||||
target_link_options(${PROJECT_NAME} PUBLIC
|
||||
-g
|
||||
-Os
|
||||
-flto
|
||||
-ffunction-sections
|
||||
-fdata-sections
|
||||
|
@ -37,9 +37,9 @@ target_link_options(${PROJECT_NAME} PUBLIC
|
|||
-msmall-data-limit=8
|
||||
-march=rv32ec
|
||||
-mabi=ilp32e
|
||||
-DCH32V003=1
|
||||
-static-libgcc
|
||||
-nostdlib
|
||||
-L${CMAKE_SOURCE_DIR}/src
|
||||
-Wl,--print-memory-usage
|
||||
-Wl,-Map=${PROJECT_NAME}.map
|
||||
-Wl,--gc-sections
|
||||
|
|
Loading…
Add table
Reference in a new issue