Real-Time Embedded Systems
Design Principles and Engineering Practices
First Edition
Xiaocong Fan
Copyright
Newnes is an imprint of Elsevier
The Boulevard, Langford Lane, Kidlington, Oxford OX5 1GB, UK
225 Wyman Street, Waltham, MA 02451, USA
Copyright 2015 Elsevier Inc. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or any information storage and retrieval system, without permission in writing from the publisher. Details on how to seek permission, further information about the Publishers permissions policies and our arrangements with organizations such as the Copyright Clearance Center and the Copyright Licensing Agency, can be found at our website: www.elsevier.com/permissions.
This book and the individual contributions contained in it are protected under copyright by the Publisher (other than as may be noted herein).
Notices
Knowledge and best practice in this field are constantly changing. As new research and experience broaden our understanding, changes in research methods, professional practices, or medical treatment may become necessary.
Practitioners and researchers must always rely on their own experience and knowledge in evaluating and using any information, methods, compounds, or experiments described herein. In using such information or methods they should be mindful of their own safety and the safety of others, including parties for whom they have a professional responsibility.
To the fullest extent of the law, neither the Publisher nor the authors, contributors, or editors, assume any liability for any injury and/or damage to persons or property as a matter of products liability, negligence or otherwise, or from any use or operation of any methods, products, instructions, or ideas contained in the material herein.
British Library Cataloguing in Publication Data
A catalogue record for this book is available from the British Library
Library of Congress Cataloging-in-Publication Data
A catalog record for this book is available from the Library of Congress
ISBN: 978-0-12-801507-0
For information on all Newnes publications visit our website at http://store.elsevier.com/
Typeset by SPi Global, India
Printed and bound in USA
15 16 17 18 10 9 8 7 6 5 4 3 2 1
Preface
Xiaocong Fan, Erie, PA
An embedded system is an electronic system that is 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 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 for the development of real-time embedded software has soared in recent years. As a consequence, preparing students for the design and implementation of embedded software is becoming increasingly important. This textbook is written especially for advanced undergraduates or master-level students who are pursuing a major in software engineering, computer engineering, or a related discipline. The textbook may also benefit practicing engineers with a concentration in embedded software development.
This book takes a synergetic approach to introducing ideas and topics from real-time systems, embedded systems, and software development principles. Readers will not only gain a thorough understanding of concepts related to microprocessors, interrupts, and the cross-platform development process, and appreciate the importance of real-time modeling and scheduling, they will also be trained in good software engineering practices such as model documentation, model analysis, design patterns, and system standard conformance.
This textbook features three aspects that are essential for the development of real-time embedded software.
First, developing software for real-time embedded systems involves many activities, including specification of requirements, timing analysis, architecture design, multitasking design, and cross-platform testing and debugging. This book covers the whole process of embedded software development, with some topics fully explained and others only briefly mentioned (e.g., debugging and testing). In particular, this book presents various embedded software architectures in a systematic way, with a focus on a real-time operating system, which is the most advanced architecture adopted in large real-time embedded systems. Moreover, we have chosen to place significant emphasis on reusable design solutions. As shown in , this book introduces many design patterns, which represent the best practices that can be reused in a wide range of real-time embedded systems.
Table 0.1
Summary of design patterns
Category | Pattern Name | Where in the Book |
ISR | ISR-Pattern-min |
ISR-Pattern-server |
Interrupt chaining |
Interrupt cascading |
Interrupt disabling |
Double buffering |
Honor first request |
Subclassing | Abstraction-occurrence |
General hierarchy |
Software architecture | Round-robin DAS |
Round robin with interrupts |
FIFO queuing |
Priority queuing |
Serial port design pattern |
Static task scheduler | Clock based |
Frame based |
Timing wheel |
Semaphore/mutex | Rendezvous synchronization pattern |
Multi-instance resource protection |
Condition variable | Barrier synchronization pattern |
Producer-consumer pattern |
Read-write lock pattern |
Message queue | Unidirectional queuing pattern |
Acked-unidirectional queuing pattern |
Bidirectional queuing pattern |
Client-server queuing pattern |
Pipe | Unidirectional piping pattern |
Bidirectional piping pattern |
Deadlock avoidance | Hierarchical messaging pattern |
DAS, detect-acknowledge-service; FIFO, first in first out; ISR, interrupt service routine.
Second, Unified Modeling Language (UML) is a graphical language for specifying, visualizing, constructing, and documenting software systems. UML is useful in a variety of engineering problems, from single-process, embedded systems and stand-alone user applications to concurrent, distributed systems. This text features UML 2.4, the latest UML standard as of this writing. Throughout the book, UML diagrams are used for both system designs and concept illustrations. In particular, the UML real-time profile is carefully presented so that students can learn how to document their designs of real-time systems in a professional way.