Hom-Wang / stm32_cmake

CMake template for STM32 projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

CMake template for STM32 projects

License:MIT License


Languages

Language:C++ 70.7%Language:C 25.5%Language:Assembly 3.8%Language:CMake 0.0%Language:Makefile 0.0%Language:GDB 0.0%