O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Embedded Systems Architecture

Book Description

A comprehensive guide to reaping the benefits of architectural modeling in embedded design

About This Book
  • Identify and overcome challenges in embedded environments
  • Understand the steps required to increase the security of IoT solutions
  • Build safety-critical and memory-safe parallel and distributed embedded systems
Who This Book Is For

If you're a software developer or designer wanting to learn about embedded programming, this is the book for you. You'll also find this book useful if you're a less experienced embedded programmer willing to expand your knowledge.

What You Will Learn
  • Participate in the design and definition phase of an embedded product
  • Learn about architectural design patterns and engineering tradeoffs
  • Build an embedded development lab and optimize the workflow
  • Write memory-safe code
  • Understand the architecture behind the most communication interfaces
  • Understand the design and development patterns for connected and distributed devices in the IoT
  • Master multitask parallel execution patterns and real-time operating systems
In Detail

Embedded systems are self-contained units that have a dedicated purpose within a device. We come across a variety of applications of embedded systems in navigation tools, telecom applications, and networking equipment, to name just a few.

Embedded Systems Architecture begins with a bird's eye view of embedded development and how it differs from the other systems that you may be familiar with. You'll first be guided to setting up a development environment and then move on to the core system architectural concepts, exploring pragmatic designs, boot-up mechanisms, and memory management. Next, you'll look at the programming interface and device drivers to establish communication via TCP/IP and take measures to increase the security of IoT solutions. Lastly, you'll be introduced to parallel multithreaded applications through the development of a scheduler.

By the end of the book, you will have explored various aspects of embedded architecture such as memory management, focusing on a memory-safe approach, multithreading, and the RTOS approach.

Style and approach

Software developers and designers with experience in different fields, and who want to learn about embedded programming, will benefit from this book. Junior and less experienced embedded programmers willing to expand their knowledge in the field will also find it useful.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Embedded Systems Architecture
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Embedded Systems – A Pragmatic Approach
    1. Domain definition
      1. Embedded Linux systems
      2. Low-end 8-bit microcontrollers
      3. Hardware architecture
      4. Understanding the challenge
      5. Multithreading
    2. RAM
    3. Flash memory
    4. Interfaces and peripherals
      1. Asynchronous UART-based serial communication
      2. SPI
      3. I2C
      4. USB
    5. Connected systems
    6. The reference platform
      1. ARM reference design
      2. The Cortex-M microprocessor
    7. Summary
  7. Work Environment and Workflow Optimization
    1. Workflow overview
      1. C compiler
      2. Linker
      3. Build automation
      4. Debugger
      5. Embedded workflow
    2. The GCC toolchain
      1. The cross-compiler
      2. Compiling the compiler
      3. Linking the executable
      4. Binary format conversion
    3. Interacting with the target
      1. The GDB session
    4. Validation
      1. Functional tests
      2. Hardware tools
      3. Testing off-target
      4. Emulators
    5. Summary
  8. Architectural Patterns
    1. Configuration management
      1. Revision control
      2. Tracking activities
      3. Code reviews
      4. Continuous integration
    2. Source code organization
      1. Hardware abstraction
      2. Middleware
      3. Application code
    3. The life cycle of an embedded project
      1. Defining project steps
      2. Prototyping
      3. Refactoring
      4. API and documentation
    4. Summary
  9. The Boot-Up Procedure
    1. The interrupt vector table
      1. Startup code
      2. Reset handler
      3. Allocating the stack
      4. Fault handlers
    2. Memory layout
    3. Building and running the boot code
      1. The makefile
      2. Running the application
    4. Multiple boot stages
      1. Bootloader
      2. Building the image
      3. Debugging a multi-stage system
      4. Shared libraries
    5. Summary
  10. Memory Management
    1. Memory mapping
      1. Memory model and address space
      2. The code region
      3. The RAM regions
      4. Peripheral-access regions
      5. The system region
      6. Order of memory transactions
    2. The execution stack
      1. Stack placement
      2. Stack overflows
      3. Stack painting
    3. Heap management
      1. Custom implementation
      2. Using newlib
      3. Limiting the heap
      4. Multiple memory pools
      5. Common heap usage errors
    4. The memory protection unit
      1. MPU configuration registers
      2. Programming the MPU
    5. Summary
  11. General-Purpose Peripherals
    1. The interrupt controller
      1. Peripherals interrupt configuration
    2. System time
      1. Adjusting the flash wait states
      2. Clock configuration
      3. Clock distribution
      4. Enabling the SysTick
    3. Generic timers
    4. General-purpose I/O
      1. Pin configuration
      2. Digital output
      3. PWM
      4. Digital input
      5. Interrupt-based input
      6. Analog input
    5. The watchdog
    6. Summary
  12. Local Bus Interfaces
    1. Introducing serial communication
      1. Clock and symbol synchronization
      2. Bus wiring
      3. Programming the peripherals
    2. UART-based asynchronous serial bus
      1. Protocol description
      2. Programming the controller
      3. Hello world!
      4. Newlib printf
      5. Receiving data
      6. Interrupt-based input/output
    3. SPI bus
      1. Protocol description
      2. Programming the transceiver
      3. SPI transactions
      4. Interrupt-based SPI transfers
    4. I2C bus
      1. Protocol description
      2. Clock stretching
      3. Multi-master
      4. Programming the controller
      5. Interrupt handling
    5. Summary
  13. Low-Power Optimizations
    1. System configuration
      1. Hardware design
      2. Clock management
      3. Voltage control
      4. Low-power operating modes
      5. Deep-sleep configuration
      6. Stop mode
      7. Standby mode
      8. Wake-up intervals
    2. Measuring power
      1. Development boards
    3. Designing low-power embedded applications
      1. Replacing busy loops with sleep mode
      2. Deep sleep during longer inactivity periods
      3. Choosing the clock speed
      4. Power state transitions
    4. Summary
  14. Distributed Systems and IoT Architecture
    1. Network interfaces
      1. Media Access Control
      2. Ethernet
      3. Wi-Fi
      4. Low-Rate Wireless Personal Area Networks (LR-WPAN)
      5. LR-WPAN industrial link-layer extensions
      6. 6LoWPAN
      7. Bluetooth
      8. Mobile networks
      9. Low-power Wide Area Networks (LPWANs)
      10. Selecting the appropriate network interfaces
    2. The Internet Protocols
      1. TCP/IP implementations
      2. Network device drivers
      3. Running the TCP/IP stack
      4. Socket communication
      5. Mesh networks and dynamic routing
    3. Transport Layer Security
      1. Securing socket communication
    4. Application protocols
      1. Message protocols
      2. REST architectural pattern
      3. Distributed systems – single points of failure
    5. Summary
  15. Parallel Tasks and Scheduling
    1. Task management
      1. The task block
      2. Context switch
      3. Creating tasks
    2. Scheduler implementation
      1. Supervisor calls
      2. Cooperative scheduler
      3. Concurrency and timeslices
      4. Blocking tasks
      5. Waiting for resources
      6. Real-time scheduling
    3. Synchronization
      1. Semaphore
      2. Mutex
      3. Priority inversion
    4. System resource separation
      1. Privilege levels
      2. Memory segmentation
      3. System calls
    5. Summary
  16. Embedded Operating Systems
    1. Real-time application platforms
      1. FreeRTOS
      2. ChibiOS
    2. Low-power IoT systems
      1. Contiki OS
      2. Riot OS
    3. POSIX-compliant systems
      1. NuttX
      2. Frosted
    4. The future of safe embedded systems
      1. Process isolation – Tock
    5. Summary
  17. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think