Skip to content

Build RedAster outside STM32CubeIDE

Follow the next steps to build the project with CMake on any platform.

Requirements:

  • CMake Version: The project requires the 3.28 minimum version for CMake, so make sure to have the right version installed. To check the version:
    cmake --version
    
  • Arm GNU Toolchain: To build an embedded project base on Amr Cortex is required to have the right compiler toolchain. Download it from Arm's official website for your OS. Or get it with a package manager.

macOS:

brew install arm-none-eabi-gcc
Linux:
sudo apt install gcc-arm-none-eabi
Windows:
choco install gcc-arm-embedded

Build the project:

At this point you have the needed tools. Run the following bash commands to create a folder called build to store all the files generated by CMake, including the .bin and .elf files. The -S flag is needed to provide the directory that contains the source files (" . " means the directory you are located right now), and -B flag specifies the build directory (if it does not exist CMake will create it for you). Then you run the command that actually builds the program.

cmake -S . -B build # use the current directory as source dir and create build 
cmake --build build # compiles the project in the build folder