Crafting Embedded Systems in C++ is a two-day training course with programming exercises taught by Ben Saks. It is offered onsite at the Gaylord Rockies from 09:00 to 17:00 on Saturday, October 23rd and and Sunday, October 24th, 2021 (immediately prior to the conference). Lunch is included.
This course explains how to use C++ to write safe, efficient, and maintainable embedded programs. Step by step, it shows how to leverage C++ language features to write abstractions for hardware devices in a bare metal environment. It also explains how to make these abstractions easy to use and hard to misuse by turning potential run-time errors into compile-time errors. Although the course focuses primarily on standard features of C++, it also covers a few non-standard features when needed.
Many of the constructs that C++ provides for controlling hardware devices are also features of C. These features include pointers, bitwise operators, enumeration types, and the
volatile qualifiers. This course demonstrates how C++ supports these features in ways that make them even more useful, especially for embedded developers.
In addition, C++ has a lot more to offer to embedded programmers. For example, classes can provide simpler and safer interfaces that hide the often-messy details of interacting with hardware. Templates and inheritance can promote code reuse by capturing commonality among related hardware and software components. Overloading and user-defined type conversions can support friendlier and safer user interfaces. The
constexpr keyword can increase execution speed and reduce code size by turning run-time computations into compile-time computations.
Participants should have basic knowledge of the C++ language and standard library.
This course includes programming exercises. The exercises run on a simulator provided by the instructor. Each exercise compiles and links with the simulator in C++ and executes as a command-line application. Please bring a computer with a C++11 or C++14 development environment that can build command-line applications.
- Memory-mapped object placement and initialization
- Hardware abstraction techniques
- Co-located devices
- Standard-layout types
- Alignment and padding concerns
- Static assertions to verify layout
- Placement and class-specific
- Function and operator overloading
- Constant expressions and
- Enumeration types
- Using implicit conversions to create simpler, more intuitive interfaces
Time permitting, attendees’ choice of either:
- Advanced techniques for turning run-time errors into compile-time errors, or
- Interrupt handling, critical sections, and atomic types