Description
Description
This course provides a comprehensive introduction to real-time operating systems (RTOS) with a focus on Cortex-M4 architecture and FreeRTOS. Participants will gain a deep understanding of real-time multitasking, including key constraints such as determinism, preemption, and interrupts. The course covers the architecture of FreeRTOS, its core services, and how to efficiently develop and debug FreeRTOS-based applications.
The training combines theoretical learning with hands-on practical activities, making up 40%–50% of the course. Participants will work with code examples, exercises, and solutions using a Linux or Windows PC, with target boards provided for onsite sessions. A preconfigured virtual machine is also available for post-course practice.
To ensure a strong foundation, attendees should have prior experience with embedded C programming and a basic understanding of embedded processors. The course is designed for embedded systems engineers and technicians seeking to enhance their skills in real-time systems development.
Evaluation includes practical exercises and quizzes, with participants receiving a certificate of completion upon successfully demonstrating their skills. If any prerequisite gaps are identified, additional training recommendations will be provided in coordination with the trainee’s company.
The course is structured over three days, covering:
Day 1: Cortex-M4 architecture, real-time system fundamentals, and task management in FreeRTOS.
Day 2: FreeRTOS memory and resource management, synchronization mechanisms, and handling parallelism issues.
Day 3: Interrupt management, software timers, and memory protection with FreeRTOS-MPU.
Can be further customised with additional days to cover advanced topics such as data structures, memory management strategies, and real-time system optimisation, ensuring participants gain both theoretical knowledge and practical expertise for real-world embedded systems development.
Training Objectives
- Gain an overview of the Cortex-M4 architecture.
- Understand the fundamentals of real-time multitasking.
- Learn about real-time constraints
- including:
- Determinism
- Preemption
- Interrupts
- Explore the FreeRTOS architecture and its services.
- Learn how to develop and debug FreeRTOS applications.
Course Outline
- Day 1: Cortex-M4 Architecture & Real-Time Concepts<br />
- Cortex-M Resources for RTOS<br />
- Overview of Cortex-M architecture.<
- Stack pointers, running modes, and privilege levels.<
- Memory Protection Unit (MPU) overview.<
- SysTick timer and interrupt mechanisms.<
- SVC, PendSV, and SysTick interrupts.<
- Developing with an IDE.<
- Exercise: Managing interrupts on Cortex-M4.<
- Real-Time System Fundamentals<br />
- Core real-time concepts and constraints.<
- Multitasking and task management in RTOS.<
- Task scheduling:<
- Context switching<
- Tick-based vs. tickless scheduling<
- Fixed-priority scheduling (RMA, EDF)<
- FreeRTOS scheduling<
- Deterministic preemptive scheduling<
- Exercise: Analyzing a context switch.<
- Task Management in FreeRTOS<br />
- Creating, prioritizing, and deleting tasks.<
- Understanding task states, idle tasks, and delays.<
- Thread Local Storage and Kernel Interrupts on Cortex-M4.<
- Visual trace diagnostics using Tracealyzer.<
- Exercises: Task management, periodic tasks, task statistics.<
- Day 2: Memory & Resource Management in FreeRTOS<br />
- FreeRTOS Memory Management<br />
- Overview of FreeRTOS memory managers.<
- Handling out-of-memory conditions and stack overflows.<
- Exercise: Analyzing stack usage in programs.<
- Resource Management in FreeRTOS<br />
- Mutual exclusion with critical sections and mutexes.<
- Priority inversion and solutions:<
- Priority inheritance<
- Priority ceiling<
- Gatekeeper tasks<
- Exercise: Implementing mutual exclusion.<
- Task Synchronization<br />
- Binary semaphores, event groups, mailboxes, and queues.<
- Stream Buffers and Message Buffers for efficient data transfer.<
- Exercises: Task synchronization, queue management, task notifications, proper use of buffers.<
- Handling Parallelism Issues<br />
- Understanding deadlocks, livelocks, and starvation.<
- Exercises:<
- Producer-consumer problem.<
- Philosophers’ dinner problem (deadlock prevention).<
- Day 3: Interrupts, Timers, and FreeRTOS-MPU<br />
- Interrupt Management in FreeRTOS<br />
- Interrupts in real-time systems:<
- Software, time, and device interrupts.<
- Interrupt vectoring and nesting.<
- Deferred interrupt processing using FreeRTOS.<
- Using semaphores and queues within ISRs.<
- Exercise: Synchronizing interrupts with tasks.<
- Software Timers in FreeRTOS<br />
- Configuring and using timers.<
- One-shot vs. auto-reload timers.<
- Exercise: Implementing software timers.<
- Memory Protection with FreeRTOS-MPU<br />
- MPU overview:<
- Privileged vs. user mode.<
- Defining MPU regions and configuring permissions.<
- Exercise: Implementing protected memory regions.<
- Optional Advanced Topics<
- Data Structures for Real-Time Systems<br />
- Linked lists, FIFOs, stacks, and circular lists.<
- Ensuring data integrity and thread safety.<
- Exercise: Implementing a general-purpose linked list.<
- Memory Management Techniques<br />
- Memory allocation strategies (Buddy System, Best Fit, First Fit, Pools).<
- FreeRTOS memory allocation schemes.<
- Memory monitoring and error detection.<
- Exercises:<
- Writing a thread-safe memory manager.<
- Implementing a multi-level memory manager.<
- Enhancing memory management for error detection.



