triwahyuu / stm32_cmake_example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

Example STM32 Project with CMake

This repository uses NUCLEO-STM32L452RE-P board.
The CMake toolchain file is obtained from vpetrigo/arm-cmake-toolchains.
This repository is generated with STM32CubeMX, so you can regenerate the project if you want with cmake_test.ioc file.

BUILD

To build the project don't forget to specify the toolchain in the cmake:

mkdir -p build/ && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/arm-gcc-toolchain.cmake

The ARM math library (libarm_cortexM4lf_math.a) file is obtained from ARM CMSIS repository.
The STM32L4x2.svd file is used for debugging, and is obtained from KEIL device pack inside CMSIS/SVD directory. Or get it from posborne/cmsis-svd.

NOTES

This repository doesn't mean to be modular, if you want to use it for another board or project you need to customize the CMakeLists.txt file.

If you want to customize this repository for another project, there are several things that needs to be changed:

Also there are several config that is infered from MCU device definition, but not yet tested thoroughly:

About


Languages

Language:C 98.6%Language:C++ 0.9%Language:Assembly 0.2%Language:CMake 0.2%Language:Shell 0.0%