The Firmware Handbook

Book description

The Firmware Handbook provides a comprehensive reference for firmware developers looking to increase their skills and productivity. It addresses each critical step of the development process in detail, including how to optimize hardware design for better firmware. Topics covered include real-time issues, interrupts and ISRs, memory management (including Flash memory), handling both digital and analog peripherals, communications interfacing, math subroutines, error handling, design tools, and troubleshooting and debugging.

This book is not for the beginner, but rather is an in-depth, comprehensive one-volume reference that addresses all the major issues in firmware design and development, including the pertinent hardware issues.

Included CD-Rom contains all the source code used in the design examples, so engineers can easily use it in their own designs

Table of contents

  1. Cover
  2. Acknowledgements
  3. Contents (1/2)
  4. Contents (2/2)
  5. Preface
  6. I. Basic Hardware
    1. I. Introduction
    2. Chapter 1. Basic Electronics
      1. DC Circuits
      2. AC Circuits (1/2)
      3. AC Circuits (2/2)
      4. Active Devices
      5. Putting it Together—a Power Supply
      6. The Scope (1/2)
      7. The Scope (2/2)
    3. Chapter 2. Logic Circuits
      1. Coding
      2. Combinatorial Logic (1/2)
      3. Combinatorial Logic (2/2)
      4. Sequential Logic
      5. Logic Wrap-up
    4. Chapter 3. Hardware Design Tips
      1. Diagnostics
      2. Connecting Tools
      3. Other Thoughts
      4. Summary
  7. II. Designs
    1. II. Introduction
    2. Chapter 4. Tools and Methods for Improving Code Quality
      1. Introduction
      2. The Traditional Serial Development Cycle of an Embedded Design
      3. Typical Challenges in Today’s Embedded Market
      4. Generic Methods to Improve Code Quality and Reduce the Time-to-Market
      5. Major Time Factors for the Engineering Cycle
      6. Where is Most Time Needed?
      7. How to Improve Software Development Time and Code Quality
      8. How to Reduce Hardware Development Time
      9. Outlook and Summary
    3. Chapter 5. Tips to Improve Functions
      1. Minimize Functionality
      2. Encapsulate
      3. Remove Redundancies
      4. Reduce Real-Time Code
      5. Flow With Grace
      6. Refactor Relentlessly
      7. Employ Standards and Inspections
      8. Comment Carefully
      9. Summary
    4. Chapter 6. Evolutionary Development
      1. Introduction
      2. 1. History
      3. 2. Issues Addressed by Evo (1/2)
      4. 2. Issues Addressed by Evo (2/2)
      5. 3. How Do We Use Evo in Projects
      6. 4. Check Lists
      7. 5. Introducing Evo in New Projects
      8. 6. Testing With Evo
      9. 7. Change Requests and Problem Reports
      10. 8. Tools
      11. 9. Conclusion
      12. Acknowledgment
      13. References
    5. Chapter 7. Embedded State Machine Implementation
      1. State Machines
      2. An Example
      3. Implementation
      4. Testing
      5. Crank It
      6. References
    6. Chapter 8. Hierarchical State Machines
      1. Conventional State Machine Example
      2. Hierarchical State Machine Example (1/2)
      3. Hierarchical State Machine Example (2/2)
    7. Chapter 9. Developing Safety Critical Applications
      1. Introduction
      2. Reliability and safety
      3. Along came DO-178B
      4. Overview of DO-178B
      5. Failure Condition Categorization
      6. System Architectural Considerations
      7. System Architectural Documentation
      8. DO-178B Software life cycle
      9. Object Oriented Technology and Safety Critical Software Challenges
      10. Iterative Process
      11. Issues Facing OO Certification
      12. Summary
      13. References
    8. Chapter 10. Installing and Using a Version Control System
      1. Introduction
      2. The Power and Elegance of Simplicity
      3. Version Control
      4. Typical Symptoms of Not (Fully) Utilizing a Version Control System
      5. Simple Version Control Systems
      6. Advanced Version Control Systems
      7. What Files to Put Under Version Control
      8. Sharing of Files and the Version Control Client
      9. Integrated Development Environment Issues
      10. Graphical User Interface (GUI) Issues
      11. Common Source Code Control Specification
      12. World Wide Web Browser Interface or Java Version Control Client
      13. Bug Tracking
      14. Non-Configuration Management Tools
      15. Closing Comments
      16. Suggested Reading, References, and Resources
  8. III. Math
    1. III. Introduction
    2. Chapter 11. An Introduction To Machine Calculations
      1. Introduction
      2. Integer Arithmetic
      3. Floating-Point Math (1/3)
      4. Floating-Point Math (2/3)
      5. Floating-Point Math (3/3)
      6. Fixed-Point Arithmetic
      7. Conclusion
      8. Bibliography
    3. Chapter 12. Floating Point Approximations
      1. General Trig Notes
      2. Cosine and Sine
      3. Higher Precision Cosines
      4. Tangent
      5. Higher Precision Tangents
      6. Arctangent, Arcsine and Arccosine
    4. Chapter 13. Math Functions
      1. Gray Code
      2. Integer Multiplication by a Constant
      3. Computing an Exclusive Or
      4. Integer Square Roots
      5. Important Basic Math Operations
    5. Chapter 14. IEEE 754 Floating Point Numbers
      1. Special values
  9. IV. Real-Time
    1. IV. Introduction
    2. Chapter 15. Real-Time Kernels
      1. Introduction
      2. What is a Real-Time Kernel?
      3. What is a task?
      4. The Clock Tick
      5. Scheduling
      6. Context Switching
      7. Kernel Services
      8. Kernel Services, Semaphores
      9. Kernel Services, Message Queues
      10. Kernel Services, Memory Management
      11. Do You Need a Kernel?
      12. Can You Use a Kernel?
      13. Selecting a Kernel?
      14. Conclusion
    3. Chapter 16. Reentrancy
      1. Atomic Variables
      2. Two More Rules
      3. Keeping Code Reentrant
      4. Recursion
      5. Asynchronous Hardware/Firmware
      6. Race Conditions
      7. Options
      8. Other RTOSes
      9. Metastable States
      10. Firmware, not Hardware
    4. Chapter 17. Interrupt Latency
      1. Taking Data
    5. Chapter 18. Understanding Your C Compiler: How to Minimize Code Size
      1. Modern C Compilers (1/2)
      2. Modern C Compilers (2/2)
      3. Tips on Programming (1/2)
      4. Tips on Programming (2/2)
      5. Final Notes
      6. Acknowledgements
    6. Chapter 19. Optimizing C and C++ Code
      1. Adjust Structure Sizes to Power of Two
      2. Place Case Labels in Narrow Range
      3. Place Frequent Case Labels First
      4. Break Big Switch Statements into Nested Switches
      5. Minimize Local Variables
      6. Declare Local Variables in the Innermost Scope
      7. Reduce the Number of Parameters
      8. Use References for Parameter Passing and Return Value for Types Bigger than 4 Bytes
      9. Don’t Define a Return Value if Not Used
      10. Consider Locality of Reference for Code and Data
      11. Prefer int over char and short
      12. Define Lightweight Constructors
      13. Prefer Initialization Over Assignment
      14. Use Constructor Initialization Lists
      15. Do Not Declare “Just in Case” Virtual Functions
      16. Inline 1 to 3 Line Functions
    7. Chapter 20. Real-Time Asserts
      1. Embedded Issues
      2. Real-Time Asserts
  10. V. Errors and Changes
    1. V. Introduction
    2. Chapter 21. Implementing Downloadable Firmware With Flash Memory
      1. Introduction
      2. The Microprogrammer
      3. Advantages of Microprogrammers
      4. Disadvantages of Microprogrammers
      5. Receiving a Microprogrammer
      6. A Basic Microprogrammer
      7. Common Problems and Their Solutions (1/2)
      8. Common Problems and Their Solutions (2/2)
      9. Hardware Alternatives
      10. Separating Code and Data
    3. Chapter 22. Memory Diagnostics
      1. ROM Tests
      2. RAM Tests (1/2)
      3. RAM Tests (2/2)
    4. Chapter 23. Nonvolatile Memory
      1. Supervisory Circuits
      2. Multi-byte Writes
      3. Testing
      4. Conclusion
    5. Chapter 24. Proactive Debugging
      1. Stacks and Heaps
      2. Seeding Memory
      3. Wandering Code
      4. Special Decoders
      5. MMUs
      6. Conclusion
    6. Chapter 25. Exception Handling in C++
      1. The Mountains (Landmarks of Exception Safety)
      2. A History of this Territory
      3. The Tar Pit
      4. Tar!
      5. The Royal Road
      6. The Assignment Operator—A Special Case
      7. In Bad Weather
      8. Looking back
      9. References
    7. Chapter 26. Building a Great Watchdog
      1. Internal WDTs
      2. External WDTs
      3. Characteristics of Great WDTs
      4. Using an Internal WDT
      5. An External WDT
      6. WDTs for Multitasking
      7. Summary and Other Thoughts
  11. Appendix A: ASCII Table
  12. Appendix B: Byte Alignment and Ordering
    1. Byte Alignment Restrictions
    2. Byte Ordering
  13. Index (1/2)
  14. Index (2/2)

Product information

  • Title: The Firmware Handbook
  • Author(s): Jack Ganssle
  • Release date: April 2004
  • Publisher(s): Newnes
  • ISBN: 9780080470177