From bare metal C to an industry grade Open Source Real-Time Operating System.
A “know-how upgrade” for a bare-metal microcontroller C programmer to an industry-grade Open Source real-time operating system.
- What are the advantages?
- What is the trade-off?
Hands-on exercises provide you with the necessary practical experience to go ahead and use a real-time operating system with your own embedded system after successfully completing this training.
This 3-day class illustrates the concepts of a real-time operating system. FreeRTOS will be used as an example. It is designed to bring you quickly up to speed. The concepts and commands necessary to make effective use of FreeRTOS are described through a combination of theory and practical examples. Don’t reinvent the wheel, but learn from an experienced trainer and take home a working knowledge of FreeRTOS and the ability to use it effectively in your own embedded development project.
- depending on host
- basic familiarity with using a GNU/Linux system as an end-user
- (Trainer will use Ubuntu as a host system)
- basic C programming knowledge
Who should attend?
People with interest in or tasked with the development of a resource-constrained real-time system like software engineers, field engineers, (project) managers,. . .
|Real-Time Intro (Time/
|What is real-time?
|What is hard real-time?)
|RTOS vs. Linux
- Intro (What is a
Example01– crude loop
Example06– “continuous processing” and
Example08– play with priorities
Scheduling(What’s an OS?
- Intro (What is a queue?
|Queue as a data type)
|Queue Management (Data storage
|Accessed by multiple
|blocking on read/write
|Example Queue Access)
Example10– queue send/receive (Client/Server pattern)
- Working with Large Data
|Message Passing Generic (Indirect/Direct Synchronous/Asynchronous)
- Intro (
|How does an
|What if two
interruptsarrive at the same time?
|What is reentrant code?
|What is an
|What kind of “events” do you know?)
- Concurrency Intro
- Semaphores Intro (Mutual exclusion
|Mutex vs. Synchronization
|Sempahore Types (Signal/
|FreeRTOS Binary Semaphore
- Semaphores Intro (Mutual exclusion
Taskwith an “Interrupt”
Example12– deferred ISR + Binary Semaphore (Binary Semaphore API)
Example13– deferred ISR + Counting Semaphore (Binary Semaphore vs. Counting Semaphore – Events latched
|Counting Semaphore API)
Example14– deferred ISR + Queues (Queues and ISRs – API
|Inefficient Queue Usage
|More efficient Queue usage)
Interrupt nesting(NVIC Cortex M3
- Intro (concurrency
|the single variable
|Kinds/Causes of Concurrency
|What does need/not need protection?
- Resource Management (Potential conflict – accessing things concurrently
|shared resource protection)
- Protecting critical regions/sections (Dis-/enabling interrupts
|suspending/locking the scheduler
Example15– Mutex (Mutex API)
- Priority inversion (Unbounded/
|Sources of unbounded priority inversion
|Priority Inversion and FreeRTOS)
|Deadlock (Conditions for Deadlock
vApplicationIdleHook()vs. priority 0)
- Mutex vs. Semaphore (Ownership/Recursive Mutex)
- Memory types
|Memory allocation patterns (Fixed/Static
|Stack Allocation, Scratch-pad
|FreeRTOS Static Allocation
|FreeRTOS Dynamic Allocation – FreeRTOS Heap
|Memory Management Porting
- Intro (What’s a bug/debugging
|Preventing Bugs (Coding Wars
|Productive Working Environment
|Requirements/Architecture/Design (Design for Test
|Debugging (GNU toolchain)
- Debugging by Stopping (Simulator
|RTOS aware debugger)
- Debugging Running System (Hardware Exceptions
Example19– FreeRTOS Heap
Example21– FreeRTOS run-time statictics
- Profiling (
gprof | gcov)
|Other methods (Hardware Trace
|Software controlled LEDs
Trace hook macros
Example22– FreeRTOS trace hook macros 1
Example23– FreeRTOS trace hook macros 2
- FreeRTOS: Common sources of error
- Intro (Memory Management
|FreeRTOS MPU (LPC17xx MPU
|from Privileged to User mode
|Practical Usage Tips
Example24– FreeRTOS MPU (Where was the crash?)
Traffic Light controller
- Traffic light controller – use what we learned so far
Example40– Traffic light controller (Compile and execute
- ”Embedded Linux – From System Architecture to Real-Time (5 days)”
- ”Refresher to Embedded Linux & Intro to the Yocto Project (5 days)”
- ”Embedded Linux Kernel Internals and Device Drivers (5 days)”
- “The Yocto Project – A thorough Overview (4 days)”
- ”Introduction to Embedded Linux & Real-Time, bird’s eye view of the Yocto Project (4 days)”
- ”Introduction to Embedded Linux in Theory and Practice – a Crash Course (3 days)”
- ”(Embedded) Linux debugging (3 days)”