CMake + CubeMX/CubeCLT Toolchain
- Install CubeMX. This is the
.ioc
file editor. - Install CubeCLT. This is the command-line toolset that contains all the software necessary to build and deploy the codebase.
- In order to use the scripts to build and flash, add all
*/bin
directories from CubeCLT to$PATH
. - Install CubeMCUFinder.
- Install the corresponding extension for your editor. In each case, the extension will need to be provided the location to CubeMX and CubeCLT.
./scripts/build.sh --src <PROJECT>
will build the project./scripts/flash.sh --src <PROJECT>
will flash the project to the MCU connected to the STLINK
Adding CMake Dependencies to Projects
To add lib/
dependencies to a CubeMX project, add the following to CMakeLists.txt
.
# Add fwlib dependency
add_subdirectory(../../lib fwlib)
# Add linked libraries
target_link_libraries(${CMAKE_PROJECT_NAME}
stm32cubemx
# Add user defined libraries
stm32
units
util
)