Real-Time Embedded Systems

By: , Posted on: August 28, 2015

An embedded system is an electronic system that are designed to perform a dedicated function within a larger system. Real-time systems are those that can provide guaranteed worst-case response times to critical events, as well as acceptable average-case response times to noncritical events. When a real-time system is designed as an embedded component, it is called a real-time embedded system.

real time embedded systems

Real-time embedded systems are widespread in consumer, industrial, medical, and military applications. As more and more of our daily life depends on embedded technologies, the demand for engineers with the skill set on the development of real-time embedded software has soared in recent years. Developing software for real-time embedded systems involves many activities, including requirements specification, timing analysis, architecture design, multi-tasking design, and cross-platform testing and debugging. This book takes a synergetic approach to introducing fundamental concepts and topics related to the development of real-time embedded systems. In particular, readers may find with ease that this book has two intertwining themes: design principles and engineering practices.

The first theme is about the design principles of real-time embedded systems, which is exemplified in the treatment of system architecture, design patterns, and real-time task analysis.

For instance, shortening task response time and improving hardware concurrency are the key design principles of real-time systems. These principles are used to guide the selection of real-time software architectures in chapter 12. It starts from the basic round-robin architecture. Such a turn-taking approach works best for low-end systems but worst for high-demanding real-time systems because system components can suffer from low hardware concurrency. Introduced next is named round-robin architecture with interrupts, which offers improved hardware concurrency—the use of interrupt service routines allows external service requests to be honored almost immediately.

However, many real-time systems cannot afford the delay incurred by lengthy interrupt service routines. Hence, the processing logic for an external request is typically split into two portions: the portion that is necessary to acknowledge the hardware request is handled in the interrupt service routine, whereas most of the processing logic is separated into a so-called deferred task code. This exposes a limitation of the round-robin architecture with interrupts: the processing order of those deferred task codes is still fixed at design time due to the round-robin nature.

In a high-performing real-time system, it may be necessary to process tasks in an order that is dynamically determined—say, according to how important or urgent they are. Two dynamic queue-based architectures are then introduced: one is based on an FIFO queue and the other employs a priority queue. However, regardless of the type of the task queue being used, once it is adopted by a system, the queuing policy is fixed, and the whole system has to stick with it at run time. The understanding of such a limitation helps us to further examine RTOS in Chapter 13–a more advanced and powerful architecture.

Reusability is another important design principle emphasized in the book. It features a rich collection of design patterns that can be reused in a wide range of real-time embedded systems. For example, at the low level, a few design patterns pertinent to the design of interrupt service routines are introduced in Chapter 4, while at the high level, design patterns demonstrating the best practices of using OS kernel objects such as semaphores, Mutex, condition variables, and message queues, are scattered around in Part IV of the book. In both camps of design patterns, readers can see the utilization of Separation of Concerns (SoC)—the most important principle in Software Engineering.

Yet another design principle in real-time systems is predictability of the system behavior. Predictability depends on the timing constraints of the real-time tasks identified or derived from the domain problem at hand. The book not only covers multi-task design in general, but also introduces principle approaches to addressing priority inversion and resource deadlocks. In addition, the book examines a variety of real-time task scheduling policies, including the clock-driven approach, the rate-monotonic principle, and sporadic servers. Given that the multi-task design of a system is ready and the task scheduling policies are chosen, predictability of the system can be determined at design time. This is critical to many real-time applications because problematic system design can be corrected at the earliest stage of system development.


The second theme of the book is about engineering practices in the development of real-time embedded systems. This is twofold: standards for system modeling, and implementation portability. First, each engineering discipline follows its own design methodology and has its own set of design tools. An important design tool in the software industry is UML (Unified Modeling Language)—a collection of standard notations for specifying, constructing, and documenting software systems.

This book features the latest UML standard, with Part II dedicated to basic notations for several UML diagrams (say, class diagram, sequence diagram, use case diagram, etc). In particular, the Real-time UML—a profile for specifying real-time constraints in system models, is covered in Chapter 10 and Chapter 11. Moreover, UML diagrams are consistently used throughout the book to illustrate key real-time concepts and design patterns. The diagrams also serve as examples, from which readers can learn how to document their own system designs in a professional way.

As far as implementation portability is concerned, this book sticks with the latest POSIX (Portable Operating System Interface) standard when it comes to the Operating System services and concepts. POSIX is an open standard for OS interface that has been developed to promote interoperability and portability of applications across variants of Unix operating systems. Software systems built upon one real-time operating system can be easily ported to other POSIX compliant operating systems. Part IV of the book is dedicated to techniques in system implementation, where the focus is on those mechanisms that are available on all POSIX-compliant operating systems. The example codes have been tested in QNX—a real-time operating system widely adopted in industry. Since QNX is POSIX compliant, the programs may also be compiled, without changing the source code, for execution on another POSIX-compliant operating system.

Lastly, this book may benefit practicing embedded system engineers, but it is written especially for advanced undergraduates or master-level students who are pursuing a major in Computer Engineering, Software Engineering, or a related discipline. As a textbook, a collection of problems are given at the end of each chapter. Instructors may extend some problems to design lab exercises. For example, Problem 12.5 is a good candidate for a lab assignment; it can be modified to increase the level of difficulty (say, whether to use interrupts or not, whether to use an OS or not). It is also a good idea to design a series of lab activities scattered through a semester so that each student or team of students may end up with a running system with real-time features. In so doing, the instructor has to plan ahead to select an OS and the evaluation boards to be used. It is worth mentioning that the book is not tied with QNX, although the example C code in the book has been tested in QNX. Instead, instructors are free to choose any OSes for their classes. As an example, Dr. Kwei-Jay Lin at UC Irvine has adopted this text but used Linus and Intel boards (Galileo and Edison) in his class. If QNX is chosen, there are a big collection of evaluation boards available on the market, including Atmel AT91SAM9G45 (which is used in my class). Another note is that sometimes the chosen evaluation board may not have all the functionality required for a system. In such a case, students may need extra materials on integrated circuit design.

About the Author

Dr. Xiaocong (Simon) Fan is an Associate Professor of Computer Science and Software Engineering at Pennsylvania State University. He received his Ph.D. in Software Engineering from Nanjing University, China. He has been an active researcher in the fields of Multi-Agent Systems, Formal Methods in Software Engineering, and Advanced Decision-Support Systems. He is a key architect of several intelligent agent systems, including RCAST and SMMall. Dr. Fan is a Senior Member of IEEE.

His book Real-Time Embedded Systems is available for purchase on the Elsevier Store. Use discount code “STC215” at checkout and save up to 30% on your very own copy!

Connect with us on social media and stay up to date on new articles

Electronics & Electrical Engineering

Electronics and electrical engineering have practically limitless applications. From power engineering, telecommunications, and consumer electronics to circuit design, computer engineering, and embedded systems, these disciplines form the backbone of our increasingly tech-dependent world. Elsevier’s collection of electronics and electrical engineering content — particularly our Newnes and Academic Press Imprints — encompasses these areas and more. Our books and journals provide fundamental knowledge and practical, up-to-date toolkits for professional engineers and technicians, undergraduate and postgraduate students, and electronics enthusiasts.