Looking for well written, modern C++ (17/20) example projects for microcontrollers

This page summarizes the projects mentioned and recommended in the original post on /r/embedded

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • compile-time-init-build

    C++ library for composing modular firmware at compile-time.

  • init/build is supposed to be the new thing, but i never touched and no embedded example are available. video

  • etl

    Embedded Template Library

  • ETL: a drop-in replacement for the STL, but embedded focused.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • tinyusb

    An open source cross-platform USB stack for embedded system

  • Second: Distrust, misunderstanding, and out of date opinions of C++ in embedded spaces. I often see "compatibilty" thrown around as a goal for using C and not C++, but for most modern embedded systems, C++ compilers exist and are (usually) well tuned. Arm is a shining example here*. C++ is more optimizable than C as the intent can be clearer to the compiler. C++ constexpr and templates are a godsend for embedded systems, and I used both heavily in my recent arduino and pico testing. I combined both of them for a really cool experimental USB interface descriptor builder that runs at compile time and avoids the need to count byte sizes, but I gave up on it when the maintainer said C only, despite the fact that C can't do that. I was similarly disappointed when the pico "C++" was C only, as there was no backwards compatibility necessary.

  • embedded-resources

    Embedded Artistry Templates, Documents, and Source Code

  • From embedded artistry: https://github.com/embeddedartistry/embedded-resources/tree/master/examples/cpp

  • InfiniTime

    Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS

  • Infinitime (Fast open-source firmware for the PineTime smartwatch with many features, written in modern C++): https://github.com/InfiniTimeOrg/InfiniTime

  • amp-embedded-infra-lib

    amp-embedded-infra-lib is a set of C++ libraries and headers that provide heap-less, STL like, infrastructure for embedded software development

  • I can recommend having a look at: - https://github.com/philips-software/amp-embedded-infra-lib (stl-like replacement and utility library including a HAL definition - https://github.com/philips-software/amp-hal-st (HAL implementation for STs based on EMiL HAL) - https://github.com/philips-software/amp-preview (a GUI library for STs based on above mentioned repo's)

  • amp-hal-st

    HAL implementation of the Embedded Infrastructure Library for ST microcontrollers

  • I can recommend having a look at: - https://github.com/philips-software/amp-embedded-infra-lib (stl-like replacement and utility library including a HAL definition - https://github.com/philips-software/amp-hal-st (HAL implementation for STs based on EMiL HAL) - https://github.com/philips-software/amp-preview (a GUI library for STs based on above mentioned repo's)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • amp-preview

    amp-preview is a user-interface framework tailed towards embedded devices

  • I can recommend having a look at: - https://github.com/philips-software/amp-embedded-infra-lib (stl-like replacement and utility library including a HAL definition - https://github.com/philips-software/amp-hal-st (HAL implementation for STs based on EMiL HAL) - https://github.com/philips-software/amp-preview (a GUI library for STs based on above mentioned repo's)

  • amp-devcontainer

    amp-devcontainer is a fully loaded devcontainer useable for (embedded) C++ development

  • We have also published a devcontainer https://github.com/philips-software/amp-devcontainer to easily get started developing for Macy's that use the arm-none-eabi-gcc compiler

  • cpp_stm32

    Pure c++17 implementation of stm32 driver

  • (No to self advertise as I think what I’ve written is shit from my pov now) I have a project for learning/discovering the possibilities and advantages using modern c++ (at that time, c++17), and yes, it’s been a while, cause I’m playing with other micro controllers(esp32c3) a while ago, and I’m also a bit busy irl. But definitely wanted to continue this in the future, despite looking terrifying, haha

  • Marlin

    Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.

  • I really like the Marlin 3D printer firmware: https://github.com/MarlinFirmware/Marlin

  • modm

    modm: a C++23 library generator for AVR and ARM Cortex-M devices

  • Have a look in the modm.

  • low-power-speech-recognition

    For the 2019 Oticon Audio Explorers Contest

  • ardupilot

    ArduPlane, ArduCopter, ArduRover, ArduSub source

  • Check out Ardupilot. I think they use C++ 11/14

  • cppreference-doc

    C++ standard library reference (by p12tic)

  • Rather than looking at good examples (which you should by all means do), add cppreference.com to you bookmarks and use it as your reference. By far the best C++ reference on the net. (from a C programmer who was thrown into C++ a decade ago -- slowly digesting C++20 now) Both StackOverflow.com and electronic.stackexchange.com are two additional QA sites that can help.

  • sml

    C++14 State Machine library

  • boost-ext/sml: quite modern way of doing state machines using a DSL

  • cortex-m3-rtos

    ARM Cortex-M3 Real-Time Operating System for educational purpose.

  • I will add my own project here https://github.com/t4th/cortex-m3-rtos

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts