Modern C++ for Embedded Systems: From Fundamentals to Real-Time Solutions
While C has long been the dominant language in embedded systems development, modern C++ offers a rich set of features that can significantly improve code quality, robustness, and efficiency — all without sacrificing performance on resource-constrained devices.
This session introduces practical, real-world techniques for applying modern C++ to embedded systems. It is divided into three focused parts:
-
Part 1: Getting Started with Embedded C++
This section lays the foundation for writing efficient, safe embedded code in C++. It covers key language features, design semantics, and optimization strategies suitable for microcontrollers, helping developers transition from C to C++ with confidence. -
Part 2: C++ Components for Embedded Systems
This section explores powerful C++ constructs — including class types, templates, and selected STL components — and demonstrates how to use them to implement low-level drivers, register interfaces, custom memory allocators, embedded containers, and multitasking utilities. -
Part 3: Reusable Mathematical and Generic Utilities
The final section introduces reusable patterns and mathematical utilities designed for solving common real-time problems, enabling developers to write more expressive, maintainable embedded C++ code.
Whether you're new to C++ in embedded contexts or looking to deepen your expertise, this session will provide concrete tools and insights to level up your embedded development with modern C++.
What this presentation is about and why it matters
How do you bring modern C++ features into embedded code without losing sight of memory limits, startup behavior, and real-time constraints? Rutvij Karkhanis walks through that tension with a hands-on tour that moves from language fundamentals into optimization and reusable numeric utilities, all grounded in embedded patterns like hardware abstraction layers, register access, linker behavior, and RTOS integration. The talk leans on concrete code-level examples, assembly and map-file inspection, and a pragmatic look at what compile-time techniques buy you on small systems. It is a good fit for engineers who want to use more of C++ intentionally, not just because it is available.
Who will benefit the most from this presentation
- Embedded software engineers who already use C or C++ and want a more modern style.
- Firmware developers who need to reason about object layout, startup code, or memory placement.
- Engineers working with hardware abstraction layers, drivers, or register-level peripherals.
- Teams using an RTOS and considering C++ wrappers around native APIs.
- Developers tuning code size or performance on resource-constrained targets.
What you need to know
Useful background for getting the most from this session:
- Comfort reading basic C++ syntax, classes, templates, and references.
- Familiarity with embedded concepts like interrupts, registers, flash, RAM, and startup code.
- Some exposure to compile-time checking, linker sections, or assembly listings will help.
- Knowing the difference between dynamic allocation and stack or static storage is helpful.
Glossary (terms used in this talk)
- RTOS (Real-Time Operating System): An operating system designed to provide predictable timing behavior for real-time applications.
- Fixed-point: A binary numeric representation with a fixed radix point; the available precision and range are determined by the number of integer and fractional bits.
- Anonymous namespace: A namespace with internal linkage, making names visible only within a translation unit. It is a common way to keep helper symbols file-local without using C-style static variables.
- Variable templates: Templates that define values instead of types or functions. They are useful for reusable compile-time constants that can vary by type.
- Placement new: A form of object construction that builds an object at a specific pre-allocated memory address. It is used when memory allocation and object construction must be controlled separately.
- Name mangling: A compiler encoding scheme that turns source-level names into unique linker symbols by incorporating information such as namespaces, classes, and parameter types. It allows overloading and separate compilation to coexist, but can make binary symbols harder to read.
- Class Template Argument Deduction (CTAD): A mechanism that lets the compiler infer template arguments from constructor arguments when creating an object. It reduces boilerplate for template class instantiation while preserving compile-time type safety.
- SFINAE (Substitution Failure Is Not An Error): A template resolution rule where an invalid substitution removes a candidate overload instead of producing a hard compile error. It is commonly used to constrain templates and control overload selection at compile time.
Toolbox (mentioned in this talk)
- GCC: A widely used compiler toolchain for C and C++ and other languages. In embedded development, it is commonly used to build firmware for many microcontrollers.
- FreeRTOS: A widely used real-time operating system for embedded systems. It is commonly integrated as a library that the application initializes and then starts scheduling tasks.
- Zephyr RTOS: A scalable real-time operating system for connected and resource-constrained devices. It often owns much of the system startup flow, including hardware initialization and thread setup.
- objdump: A binary inspection tool that can disassemble object files and help relate source code to generated assembly.
- c++filt: A demangling utility (part of GNU binutils) that translates mangled C++ symbol names into readable forms, useful when inspecting linker/map files or disassembly output.
Final thoughts
Practical and example-driven, this session gives you a useful lens on how modern C++ changes the shape of embedded code, from object lifetime to compile-time work and memory-aware design. You will come away with a richer vocabulary for reading low-level C++ systems code and a better sense of where the language helps, where it costs, and why the tradeoffs matter. It will be especially helpful for firmware engineers, driver developers, and teams trying to modernize without losing control of the target. The through-line is clear: use the language with intention.
This overview is AI-generated from the session transcript. Spot an issue? Let us know.
I went hunting and found a public GitHub slide deck by the same speaker on the same Modern C++ for Embedded Systems topic. It appears to overlap with this talk. https://github.com/CppCon/CppCon2025/blob/main/Presentations/Modern_Cpp_for_Embedded_Systems.pdf
Great recap of C++ features, very useful.
Please do kindly provide the slides as PDF for download, thanks!
Can you make your slides available? Thanks.








Yes, sorry for the delay. I have uploaded the slides. Also, here's the github link for the code snippets to follow the examples: https://github.com/rtvj/CppCon-2025.git