Skip to content

Repository files navigation

Build Instructions

Prerequisites

  • arm-none-eabi-gcc toolchain in your PATH
  • CMake 3.19 or newer
  • MSYS2 (Windows) or Make (Linux)

Building

Configure first (run directly from your terminal, not via make):

cmake --preset debug-msys   # Windows
cmake --preset debug         # Linux

Then build:

make

The default build type is Debug and the output binary is written to Debug/<project-name>.bin.

To build a release, configure with the release preset and then make:

cmake --preset release-msys  # Windows
cmake --preset release        # Linux
make BUILD_TYPE=Release

Uploading

make upload COM=COM3
make upload COM=COM3 BUILD_TYPE=Release

On Linux, use the device path instead:

make upload COM=/dev/ttyACM0

qbossac is detected automatically from the qNimble Arduino board package if installed. Otherwise it must be on your PATH, or set via QBOSSAC in CMakeUserPresets.json (see CMSIS Setup for the preset format).

CMSIS Setup

The CMSIS math libraries are required at link time. If the qNimble Arduino board package is installed, they are detected and used automatically.

If you see a linker error like:

cannot find -larm_cortexM7lfdp_math

CMSIS was not found automatically. Use one of the following options:

Option 1 — LIBRARY_PATH environment variable

Set LIBRARY_PATH in your shell profile to include the CMSIS Lib/GCC directory.

Linux / MSYS (~/.bashrc or ~/.bash_profile):

export LIBRARY_PATH=/path/to/CMSIS/Lib/GCC:$LIBRARY_PATH

Windows (System Environment Variables): Add the path to LIBRARY_PATH (create it if it does not exist).

Option 2 — CMakeUserPresets.json (per-machine, gitignored)

Create a CMakeUserPresets.json in the repo root and set CMSIS_DIR to the Lib/GCC directory for your installation. The preset must inherit one of the platform presets (debug-msys / release-msys on Windows, debug / release on Linux) so that it uses the correct build directory:

Windows:

{
  "version": 3,
  "configurePresets": [
    {
      "name": "my-machine",
      "inherits": "debug-msys",
      "cacheVariables": {
        "CMSIS_DIR": "C:/path/to/CMSIS/Lib/GCC",
        "QBOSSAC": "C:/path/to/qbossac.exe"
      }
    }
  ]
}

Linux:

{
  "version": 3,
  "configurePresets": [
    {
      "name": "my-machine",
      "inherits": "debug",
      "cacheVariables": {
        "CMSIS_DIR": "/path/to/CMSIS/Lib/GCC",
        "QBOSSAC": "/path/to/qbossac"
      }
    }
  ]
}

Then configure and build:

cmake --preset my-machine
make

Note: If you change CMSIS_DIR after an initial configure, delete the cache first or the old value will be reused:

rm build/debug-msys/CMakeCache.txt   # Windows
rm build/debug/CMakeCache.txt        # Linux
cmake --preset my-machine

Where to get CMSIS

CMSIS ships with the qNimble Arduino board package. After installing the Quarto board in the Arduino IDE, the libraries are in:

  • Windows: %LOCALAPPDATA%\Arduino15\packages\qnimble\tools\CMSIS\<version>\CMSIS\Lib\GCC
  • Linux: ~/.arduino15/packages/qnimble/tools/CMSIS/<version>/CMSIS/Lib/GCC

CMSIS can also be downloaded directly from the ARM CMSIS repository.

About

Basic Template for Make / CMake build

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages