Embedded C++ Advanced Training and the MISRA C++ 2023 Guidelines

Embedded C++ Kurs

Embedded C++ Advanced Training

This hands-on in-house course is aimed at developers in companies planning to migrate from C or older C++ standards to C++17 and learn about the latest tools and best practices.

Together with the Embedded C++ basic course, this advanced course covers all topics that are important for programming embedded applications with C++.

Embedded programs are often characterized by special requirements. They often have a special program structure (setup, loop), no heap may be used to avoid memory fragmentation, they are interrupt driven, have to comply with requirements such as the MISRA guidelines, etc.

Traditionally, embedded programs are often written in C. With the advancement of compilers, most C++ features today no longer have any disadvantage over C in terms of code size and speed.

  • The new C++ standards (C++11C++14C++17) have introduced new features that lead to faster and more compact code than the C alternatives.
  • One of the most important arguments in favor of C++, however, is that embedded programs are becoming more and more complex and larger. This complexity is often difficult to manage with C tools. Here, C++ offers enormous advantages that save development costs and contribute to the reliability of the applications
  • Most development environments for embedded programs (STM32CubeIDE, Espressif IDE, etc.) now support C++17.
  • The MISRA guidelines, which used to be primarily C-oriented, also point out the advantages of C++: „… now C++ is in the position once held by „C“;“
  • In addition, an outlook is given on the most important enhancements in C++20 and C++23, which will soon be available in the next gcc toolchains.

Course Objectives

This Embedded C++ basic training presents advanced C++ features (e.g. templates, exception handling, the standard library, multithreading) . The focus is on the new language features of C++17 (including C++11 and C++14) and their use in embedded systems. These C++ topics are supplemented by

  • Numerous examples for common microcontrollers that demonstrate their usability for common microcontroller boards (STM32ESP32Raspberry Pi etc.).
  • Best practices: The MISRA C++ 2023 Guidelines for safety-critical systems and the C++ Core Guidelines are presented together with the language elements. Adherence to these best practices is often recommended or required to obtain safe, maintainable and efficient C++ code.
  • An introduction to AI support for programming with Microsoft Copilot.

Target audience

This course is aimed at

  • experienced developers who want to write embedded applications using state-of-the-art C++17. It is also aimed at
  • decision-makers and technology managers, project leaders, etc., who want to evaluate how C++17 can optimize their teams‘ development processes.

It is often delivered as an in-house seminar so that companies can bring their teams up to date together.

Typical application fields:

  • Automotive and aerospace: developers who have to meet high safety and reliability requirements.
  • Industrial automation: programmers of complex control and monitoring systems.
  • IoT and smart devices: developers working on modern IoT devices where memory and performance optimizations are crucial.
  • Medical technology: engineers developing safety-critical and resource-efficient software for medical devices.

Prerequisites: C++ knowledge at the extent of the Embedded C++ basic training.

Contents

The contents can be adapted to the particular needs of the students.

1. Namespaces

  • Defining and using namespaces

2. Exception handling

  • try, catch, throw
  • Exceptions in the Standard Library
  • Releasing Resources (RAII)
  • noexcept

3. Standard library containers

  • Sequential containers, iterators
  • Ordered and unordered associative containers
  • vector, list and deque

4. Functors and lambda expressions

  • The call operator
  • Predicates and comparison functions
  • Lambda expressions

5. Templates

  • Function templates and specializations
  • Non-Type Parameters
  • Recursive Function Templates and Variadic Templates
  • Class templates
  • Type traits
  • Concepts
  • Type inference

6. STL algorithms and lambda expressions

  • Ranges
  • Iterators: reverse generators, insert functions and insert generators, stream iterators
  • Linear search and counting
  • Searching for subsequences
  • Minimum and maximum
  • Swapping elements
  • Copying ranges
  • Transform, replace and remove elements
  • Partitioning and Sorting
  • Binary search in sorted areas
  • Mixing of sorted areas
  • Set operations on sorted areas

7. Times and calendars with chrono

  • Time and duration
  • clocks

8. Multithreading

  • Starting Functions with async and thread
  • Multithreading with Lambda expressions
  • Exceptions in Threads
  • future and promise
  • Lock critical sections with lock_guard etc.
  • condition variables

9. smart pointer

  • unique_ptr, shared_ptr, weak_ptr

About „Embedded C++ Advanced Programming Training“

Teaching style of the C++ course

Lecture with many examples. A balanced combination of theory and practice.

  • At the beginning of a new topic, an overview of applications, basic ideas and syntax is given.
  • The concepts and the syntax are illustrated by using carefully selected and proven examples. Often, best practices“ are presented.
  • The manuscript contains numerous practical exercises.
  • If desired, tasks from the work of the students can also be dealt with. This should be arranged before the start of the training.

Training Materials

Extensive and detailed training materials (approx. 200 pages) – Full text, no PowerPoint slides containing only keywords. Therefore, the course materials can also be used as a reference at work.

Place and time of this C++ training

This seminar is offered as an inhouse seminar (at your site). The implementation as a face-to-face seminar is preferred, but is also possible as an online seminar. Dates by arrangement.

Duration: 4 – 5 days

Lecturer

Prof. Richard Kaiser has been conducting seminars for companies for many years, mainly on software development and the programming languages C#, C++ and C. He knows the requirements of practice and addresses them in detail, both in the basic concepts and in the details. His clients include renowned global corporations and small and medium-sized enterprises. He is the author of several books on C++, most recently „C++ mit Visual Studio 2019“. He was a member of the DIN standardization committee Information Technology NI-22 for many years.

Contact Prof. Richard Kaiser