Advanced FreeRTOS with C++
Integrate FreeRTOS into bare-metal C++ firmware and build typed abstractions for tasks, queues, and board support.
About this course
C++ can give an RTOS application a clearer boundary between operating-system primitives and application code. This course uses STM32 to show how to integrate FreeRTOS into a bare-metal project and wrap its task and queue interfaces in C++.
You’ll build those wrappers, write GPIO and UART classes, route standard I/O to the UART, and debug a working application with concrete task classes. You’ll also implement queue operations for use from both tasks and interrupt handlers.
What you’ll be able to do
Explain the C++ and FreeRTOS boundary
- Describe where the FreeRTOS middleware and its configuration fit in a bare-metal C++ project.
- Explain how blocking, task states, and the idle task affect execution.
- Compare static and dynamic task allocation and identify the memory each requires.
- Explain how a trampoline connects a FreeRTOS task entry point to a C++ object.
- Describe how a board-support layer and syscall bindings route application I/O to hardware.
- Explain what a typed queue wrapper checks and why interrupt handlers use different queue operations.
Build and verify the C++ wrappers
- Integrate FreeRTOS and verify that tasks run in a bare-metal STM32 C++ project.
- Implement a C++ task class with a trampoline and static and dynamic creation paths.
- Build GPIO and UART classes and use them to initialise and access peripherals.
- Implement the UART manager and connect C library read and write calls to the UART.
- Build and debug concrete task classes with stack-overflow and allocation-failure hooks.
- Implement a typed queue with send and receive operations for tasks and interrupts.
Course curriculum
- Architect Scalable & Maintainable RTOS Systems: Design modular, reusable components using C++ classes and interfaces.
- Master Advanced C++ RTOS Integration: Implement type-safe task management, IPC (Queues, Semaphores), and synchronization primitives (Mutexes, LockGuards) that prevent common C API pitfalls.
- Implement Robust Memory Management: Go beyond the basic FreeRTOS heap. Create custom Memory Pools for deterministic allocation and overload new/delete for instrumented, thread-safe dynamic memory control.
- Design Advanced Event-Driven Systems: Build a type-safe, publish-subscribe event framework, integrate ISRs and timer events seamlessly, and manage asynchronous operations effectively.
- Control Hardware Directly & Efficiently with C++: Create reusable, type-safe C++ abstractions for peripherals like DMA, Hardware Timers, and ADC using Direct Register Access (DRA) – no opaque libraries needed.
- Write Safer, More Optimized Code: Understand C++ performance implications in RTOS, leverage RAII for resource safety, implement robust error handling, and apply best practices for real-time constraints.
- Boost Your Career: Gain highly sought-after skills in modern embedded C++ development, setting you apart in the competitive field of embedded systems engineering.
- C++ Foundations for RTOS: Leveraging classes, RAII, templates, namespaces, const-correctness, lambdas, and C++17 features effectively under resource constraints.
- Object-Oriented RTOS Primitives: Building robust, type-safe C++ wrappers for Tasks, Queues, Semaphores, Mutexes, and Software Timers using static allocation. Implementing RAII LockGuard.
- Advanced Memory Management: Deep dive into stack vs. heap vs. static vs. pool allocation trade-offs. Implementing custom MemoryPool classes. Overloading global new/delete to interface with FreeRTOS heap and add instrumentation via a MemoryManager singleton.
- Task Design Patterns & Event Systems: Implementing Command, Observer, and State Machine patterns in C++. Building a type-safe, Pub/Sub EventDispatcher for decoupled communication between tasks, ISRs, and timers.
- Advanced Peripheral Abstraction (DRA): Creating professional C++ interfaces for Hardware Timers (Basic, PWM), DMA Controllers, and ADC (triggered by timers, using DMA). Managing interrupts and callbacks cleanly.
- Performance, Debugging & Error Handling: Analyzing C++ overhead, applying optimization techniques, robust error handling without exceptions.
This is not just theory
You'll apply everything you learn through intensive, practical labs on STM32.
All code is written using Direct Register Access (DRA) , giving you complete control and deep understanding of the hardware interaction, just like in demanding professional environments.
Stop wrestling with the limitations of C for complex RTOS projects.
Frequently Asked Questions
Course Curriculum
-
StartImportant information about this section
-
StartProgramming : Enabling the Floating Point Unit (FPU) (18:00)
-
StartProgramming : Developing a UART Driver - Analyzing the Documentation (11:35)
-
StartProgramming : Developing a UART Driver - Listing out the steps (4:00)
-
StartProgramming : Developing a UART Driver - Implementing the Init. function (22:13)
-
StartProgramming : Developing a UART Driver - Implementing the Write function (5:39)
-
StartProgramming : Developing a UART Driver - Testing the Driver (6:39)
-
StartProgramming : Developing the System Timebase - Analyzing the Documentation (8:28)
-
StartProgramming : Developing the System Timebase - Implementing the Init. function (9:52)
-
StartProgramming : Developing the System Timebase - The rest of the functions (12:15)
-
StartProgramming : Developing the System Timebase - Testing the Timebase (5:34)
-
StartProgramming : BSP : Listing the out the Required Functions (7:55)
-
StartProgramming : Writing the LED Driver (5:01)
-
StartProgramming : Writing the PushButton Driver (4:00)
-
StartProgramming : Testing the Board Support Package (3:35)
-
StartProgramming : Analyzing the Documentation (5:21)
-
StartProgramming : Listing out the steps for developing the ADC Driver (5:27)
-
StartProgramming : Writing the ADC Initialization function (13:21)
-
StartProgramming : Writing the ADC Read function (14:05)
Your Instructor
EmbeddedExpertIO represents a vibrant collective dedicated to the mastery of sophisticated embedded systems software development for professionals.
Our core objective is to equip individuals and organizations with the indispensable skills to thrive in the swiftly evolving embedded systems sector. We achieve this by providing immersive, hands-on education under the guidance of seasoned industry specialists. Our ambition is to emerge as the favored learning platform for embedded systems development professionals across the globe.