Awesome Open Source
Awesome Open Source


This toolchain is part of the Kvasir project. Kvasir is a collection of zero cost statically checked libraries for resource constrained systems including microcontrollers. More information at


Kvasir toolchain is a cmake based toolchain with support for different microcontrollers. It supports flashing for most supported chips.

How to setup

To use the Kvasir toolchain, copy the example CMakeLists to your project directory, or add the contents to your existing CMakeLists.txt.

The CMakeLists file contains several parameters that need to be adjusted to your environment:

# Where the toolchain is located on your pc.
set(toolchain ~/kvasir_toolchain) # Your path to kvasir-toolchain (this repository).

# The compiler that is used:

# The target chip that is compiled for:

# The flashscript used to flash the binary (optional):

For the compiler, target chip and flash script, you can use any of the cmake files available in this repository (see Directory Structure), or you can add your own.

How to use

After setting up the CMakeLists.txt file, create a build directory within your project directory and generate a Makefile using the following comands:

mkdir build
cd build
cmake ..

In your build directory, run make to compile the source into an ELF file.

If you've included a flash script, running make flash will create a binary and flash your microcontroller.

Directory structure

On the toplevel, the toolchain contains the following two directories:


This contains cmake files for setting the compiler toolchain to be used.


The targets directory contains target cmake files and dependencies for specific microcontrollers.

This directory hierarchy is ordered by architecture (e.g. arm32/cm3), vendor (atmel), and then microcontroller model (sam3x/sam3x8e).

Microcontroller-specific headers, startup code and linker scripts are stored in the deps folders in the deepest levels of /targets. More generic dependencies live in deps folders on higher levels.


If you want to contribute by adding a chip or flash script, please copy one of the existing chip cmake files and edit it for the new chip. Try to keep to the current structure and create a pull request to get feedback. Thanks in advance.


We'd like to thank the following contributors, in alphabetical order:


This library is maintained by Carlos van Rooijen (@CvRXX). Requests for push rights could be addressed to him via kvasir (at) The maintainer is also the only one who could approve pull requests to master.

Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
C (186,614
Cmake (15,757
Microcontroller (2,648