Real Time Embedded Linux C Programming - RT-PREEMPT and Xenomai
Duration: 5 Days
Course Background
This course is aimed at engineers who will be developing embedded Linux application that are subject to a number of performance and real-time constraints such as robotics applications, industrial control systems applications and certain automotive applications. As Linux has evolved so have its potential real time capabilities. For applications that need to satisfy hard real time constraints various approaches such as inclusion of an open-source co-kernel as in Xenomai Cobalt, or hypervisor approaches such as Sysgo's proprietary PikeOS Hypervisor have been developed. This course will concentrate on usuing RT-PREEMPT and Xenomai in real time embedded Linux application development
Intended Audience
This course is intended for experienced C and Linux programmers. It is an advanced course requiring considerable knowledge of embedded Linux, C, multi-tasking and inter-process communications patterns and protocols. Necessary concepts and example code will be introduced so that completion of the various labs (exercises) can be done in a reasonable amount of time, and even where it might be assumed that certain concepts and techniques are already known these will be reviewed where necessary, based on the background and experience of the attendees.
The course can make use of a variety of embedded boards both ARM and Intel based. Mainly the boards used will be Beaglebone Black, Armadeus and the RaspberryPi.
Course Contents
- Linux and Real Time
- Hard real time vs. soft real time
- Why hard real time requires a pre-emptible kernel
- Real time Linux and kernel pre-emption strategies
- Voluntary kernel pre-emption
- Increasing opportunities for pre-emption in the Linux Kernel (pre-emptable kernel)
- PREEMPT-RT
- Micro kernel approaches
- An overview of the Xenomai + Linux approach to Real Time Linux
- Multi-tasking and Inter-process Communication
- Multi Tasking - tasks vs. threads
- Semaphores
- Periodic Scheduling
- Intertask Communication Patterns
- Priority Scheduling
- Round Robin Scheduling
- Priority Inversion
- Interrupts
- Hardware Abstraction Layer
- What is a Hardware Abstraction Layer (HAL)
- HAL and support for multiple operating systems
- HAL functionality provided by Adeos-Xenomai
- Understanding the Adeos-Xenomai interrupt pipeline
- How Xenomai and Linux can work together
- Xenomai
- Installing and Configuring Xenomai
- Setting up Linux to work with Xenomai
- Understanding how Linux and Xenomai work together
- Instrumenting Xenomai and Linux to collect timing information
- Xenomai multi-tasking
- Xenomai semaphores
- Xenomai periodic scheduling
- Xenomai intertask communication
- Linux as a Xenomai task
- Hardware controlled by Linux vs. hardware controlled by Xenomai
- Xenomai priority scheduling
- Xenomai round robin scheduling
- Xenomai and priority inversion
- Xenomai interrupts and interaction with the Linux interrupt handling framework
- Measuring Jitter and Latency
- Real Time - GPIO, CAN and RS485
- Real Time aspects of GPIO
- Multiplexed GPIO
- Overview of the CAN protocol
- Real time aspects of CAN
- Setting up CAN bus drivers on top of Xenomai
- Overview of the CANSocket API
- CAN bus protocol analysers for testing CAN bus implementations
- Overview of RS485
- Real time aspects of RS485
- Setting up RS485 device drivers on top of Xenomai
- Pure Linux RS485 device drivers
- RS485 protocol analysiers for testing RS485 implementations