Course 07 Free course 11 volumes · 49 sub-modules All 11 volumes are live ~24 hours

Embedded C++: Classes, RAII and Templates for Microcontrollers

C++ can make firmware safer and clearer without making it bigger or slower - if you know which parts to use. This course starts from the C you already know and adds C++ one idea at a time: classes, cleanup that cannot be forgotten, templates the compiler works out for you. Every example is compiled and run, and every cost is measured, not guessed.

Start here

Start with Volume 00. It explains why C++ is used on microcontrollers, which parts of the language fit on a small chip and which do not, and the two compiler flags every embedded C++ build uses. Then take the volumes in order - each one uses only what came before it.

This course assumes you can read C: variables, functions, pointers and structs. If you cannot yet, take Embedded C from Zero first - it assumes nothing, and this course carries on where it stops.

Every example here was compiled with warnings treated as errors and run before it was published, so the output you see is the output you get. Where a lesson says a feature costs a number of bytes, that number was measured. Each new word is underlined with dots - point at it (or tap it) to see what it means, and every sub-module ends with a quick check.

Full syllabus

Part I - From C to C++

Part II - Objects that manage themselves

Part III - Work done by the compiler

Part IV - Real firmware

Part V - Revision and interviews

What you need before starting

What Why Free option
Some C Pointers, structs and functions are used from the first page Embedded C from Zero, Volumes 00 to 08
A web browser To compile and run C++ without installing anything Compiler Explorer (it can also show the ARM instructions for a microcontroller)
Optional: g++ on your computer To work offline, with the same flags as the course GCC is free on Linux and macOS; on Windows, use WSL or MinGW
Optional: a microcontroller board To run the drivers on real hardware Any board with a C++ toolchain works; the course never needs one