Skip to content
0:00 / 0:00

#modernc++#bare-metal#cppcon

CppCon 2018: Michael Caisse “Modern C++ in Embedded Systems - The Saga Continues”

CppCon

189K subscribers • 136 videos on Hallway • Conference channel

YouTube
  • Recommended by 4 people: 4 in engineering communities.
  • A classic. People kept recommending it from 2019 to 2023.
  • Presented by Michael Caisse
  • Linked in the descriptionCppCon/CppCon2018

Intermediate. Assumes working knowledge.

22K views8 years ago4 recommendations

Systems programmingProgramming languagesC++Embedded systems

Michael Caisse discusses the challenges and benefits of using modern C++ in bare-metal embedded systems development.

CppCon.org — Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/CppCon/CppCon2018 — For nearly 35 years I have been working with small processors and there has always been deep divides between practitioners of languages. When writing assembly we ridiculed those using C and when I spent years microcoding we scoffed at everyone. However, nearly all groups continue to wag their heads at the shameful C++ programmers attempting to twist their tools toward the small. Recent language developments have made C++ the obvious choice for many embedded projects; nevertheless, the toxic environment extends past reddit roasts into poor vendor support of tools and nearly obstructionist chip manufacturers. At C++Now I introduced a bare-metal project started in 2018 for a Ciere client as a case study. The goal was to extract useful lessons ranging from tooling acrobatics to idioms, language features, and libraries for producing high quality embedded results. Like an Athenian youth navigating Minos’ labyrinth we were thwarted at every bend and could merely report on the first half of the quest. In this session we will complete the saga with a discussion of the recent language features that enable goals of size, speed, and expressiveness, the libraries employed, and debugging techniques to stave off the minotaur. While the examples will be based on a concrete project, the extracted lessons-learned should be applicable to many embedded projects (bare-metal and small-OS). Attendees will walk away with motivations to use C++ in embedded projects, hints and tips to making tools work, and a sampling of language features and idioms that improve the quality of a final product. — Michael Caisse Ciere Consulting Michael Caisse has been crafting code in C++ for 28-years. He is a regular speaker at various conferences and is passionate about teaching and training. Michael is the owner of Ciere Consulting which provides software consulting and contracting services, C++ training, and Project Recovery for failing multidisciplinary engineering projects. When he isn't fighting with compilers or robots, he enjoys fencing with a sabre. :: ciere.com — Videos Filmed & Edited by Bash Films: BashFilms.com Work at Hudson River Trading (HRT): tinyurl.com/safxfctf --- Videos Filmed & Edited by Bash Films: BashFilms.com

Why it's here

4 people recommend this

What people say. Recommended as a great resource for understanding how to apply modern C++ practices to embedded environments.

u/dstdudein r/embedded • Recommends

On “C++ under the hood”

I also like the idea of using C++ on embedded systems. But this still seems to be a rebellious idea. I'd love to see us combing our researched sources here. I've found useful stuff from Dan Saks, Michael Caisse and Wouter van Ooijen. [video [video [video [video [video [video If you google "Dan Saks embedded c++ filetype:pdf" you will find the same ideas presented in the video in form of texts. Great mind, great guy, great presenter - his talk "Talking to C Programmers about C++" really chanced some of my mindset! I also found some stuff, where the authors were talking about themself using C++ in an embedded environment, but all their material I found online explained C++…

u/d1722825in r/embedded • Recommends

On “Recommendations for learning embedded C++”

>However, I have never written a line of code in C++. Do you know "normal" C++? If not you could start at learncpp, and then go into what you can and can not (eg. RTTI, exceptions) use in an embedded environment. >YT channels There a few good talks on CppCon, eg. from Michael Wong and Michael Caisse. If you want to get into how high level C++ abstractions are turned into assembly code, Matt Godbolt and Jason Turner have a few good talks, too. You should specify how "embedded" is the system you want to target. Both a 8 bit MCU and multi-GHz ARM with FPGA are considered embedded, and you can program them very differently. Random links: [video [video [video [video

u/AudioRevelationsC++ Advocatein r/embedded • Recommends

On “Embedded c++”

As far as I know there aren't any embedded-specific c++ resources out there at the moment. If you find any I'd love to hear about them! There are a few speakers that tend to focus more on embedded like Dan Saks and Michael Caisse, but IMO most of their talks are either too general or not beginner friendly. Worth checking out, though! In general the things you have to keep in mind are: - you generally shouldn't use exceptions - you generally shouldn't use the heap/dynamic allocation (this can make using the STL a bit tricky, ETL is a good option) - usage of zero-cost abstractions (i.e. classes, structs, basic inheritance, etc.) are all fair game - folks are still out on if `virtual` ma…

u/AudioRevelationsC++ Advocatein r/embedded • Recommends

On “Learning C++ in an Embedded Environment”

Got a lot of thoughts on this, but it's hard to just jump into C++. It's a huge language, and it can be ridiculously hard to know what is useful to a particular context and what doesn't. What I'd recommend is going through some of the cppcon talks of the past few years with an eye toward embedded. After you start getting a feel for what c++ code can look like and what are considered best practices, you can start applying it to your codebase. Talks by Ben orDan Saks, Michael Caisse, or following the "Back to Basics" track would be good places to start. As /u/geo38 has mentioned, the Arduino libraries are written mostly in halfway decent C++, so if you're looking for a good place to…

u/hak8orin r/embedded • Recommends

On “An I a good candidate for embedded dev.”

This is very true, modern compilers are able to do absolute wonders with getting a monstrous AST from C++ into a small number of instructions. For example, there is this talk about general C++ usage for embedded, and my favorite, from 2016, showing Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17. Hey /u/Neu_Ron, don't let people tell you that you have to be stuck with C forever in embedded. My main reasoning for C++ for embedded, aside from all the QOL improvements, is being able to have a discussion with the compiler such that you are shifting more checking to the compiler during every compile, instead of either at runtime or hoping a human does it. For example, mon…

u/d1722825in r/embedded • Recommends

On “how to use C++ in embedded projects”

There are a lot of good talks on CppCon, mostly from Michael Caisse, Jason Turner, and Michael Wong. In embedded devices OOP probably will differ a lot from how OOP is used in Java. (Eg. less inheritance and virtual functions and more templates and maybe CRTP). Also the term "embedded projects" could mean a lot of things, from a 8 bit MCU with hundreds of bytes of RAM, to special DSPs or FPGAs with multi core multi-GHz CPUs / GPUs and tens of GBs of RAM. You can write very different C++ on those. Using just a static vector, or span, or optional could be a huge improvement, and they can be used anywhere.