Build libopencm3

This commit is contained in:
Arti Zirk 2021-09-30 16:40:01 +03:00
parent 244fdbc35c
commit 07bae3f5f6
2 changed files with 9 additions and 5 deletions

View File

@ -26,9 +26,9 @@ add_executable(usbtest src/main.c src/util.c)
set_target_properties(usbtest PROPERTIES SUFFIX .elf)
#add_custom_target(libopencm3 make TARGETS=stm32/f1 -j8 WORKING_DIRECTORY ${LIBOPENCM3_DIR})
add_custom_target(libopencm3 make TARGETS=stm32/f1 -j8 WORKING_DIRECTORY ${LIBOPENCM3_DIR})
#link_directories(${LIBOPENCM3_DIR}/lib)
#target_link_libraries(usbtest PUBLIC ${LIBOPENCM3_DIR}/lib/libopencm3_stm32f1.a)
target_link_libraries(usbtest PUBLIC ${LIBOPENCM3_DIR}/lib/libopencm3_stm32f1.a)
add_subdirectory(RTT)
target_link_libraries(usbtest PUBLIC RTT)

View File

@ -8,13 +8,17 @@ First time:
or older cmake:
2. `cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=toolchain-STM32F1.cmake`
2. `cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=toolchain-STM32F1.cmake -G Ninja`
And then to build an `.elf`
### Build libopencm3
0. `cmake --build build --verbose`
cmake --build build --verbose -t libopencm3
### Build project elf
cmake --build build --verbose
## RTT debug console
run this while `openocd` is running