/stm32_cmake

CMake template for STM32 projects

Primary LanguageC++MIT LicenseMIT

STM32 CMake Project Template

This template has been tested in Linux. Additional adjustments may be required for use in Windows.

How to compile code

Prerequisite:

This cmake setup assumes the gcc-arm-none-eabi toolchain has been set up correctly in your system.

Generally there are two ways to set up the toolchain:

  1. Install using the package manager

    $ sudo apt install gcc-arm-none-eabi
    
  2. Download the toolchain binaries and add its directory to system path

Now you can try to compile the sample project using the cmake template.

$ cd <root-folder-of-this-repo>
$ mkdir build
$ cmake ../src
$ make

If the "cmake ../src" step runs successfully, you should see something similar to the below screenshot:

cmake step

Then you can continue to actually compile the code and you can expect a similar result:

cmake step