Embedded Systems
Table of Contents
• Overview
• Hardware Fundamentals
• Microcontrollers vs Microprocessors
• Embedded Software and Toolchains
• Real-Time Systems and Scheduling
• Interfacing: Sensors, Actuators, and Buses
• Power and Energy Management
• Embedded Linux and RTOS
• Debugging, Testing, and Deployment
• Security and Safety in Embedded Devices
• Case Studies and Design Patterns
• Exercises and Projects
• Further Reading
Overview
Embedded systems are computing devices designed for specific control functions
within larger systems. They often operate under constraints of real-time deadlines,
limited resources, and environmental conditions.
Hardware Fundamentals
• Digital logic basics: buses, registers, and memory-mapped IO.
• Peripherals: timers, ADC/DAC, UART, SPI, I2C, PWM.
• Memory types: ROM/Flash for firmware, RAM for runtime data, EEP-
ROM for small persistent storage.
Microcontrollers vs Microprocessors
• Microcontrollers (MCUs): integrate CPU, memory, and peripherals on a
single chip (e.g., ARM Cortex-M, AVR).
• Microprocessors (MPUs): higher performance, require external peripherals
and often run a full OS (e.g., ARM Cortex-A).
Embedded Software and Toolchains
• Cross-compilation: compile on host machine targeting the embedded ar-
chitecture.
• Toolchain components: compiler (gcc/clang), assembler, linker, debugger
(gdb), build systems (make, CMake).
• Bootloaders: initialize hardware and load firmware (e.g., U-Boot, custom
bootloaders).
1
Real-Time Systems and Scheduling
• Hard vs soft real-time: hard real-time requires strict deadlines.
• Scheduling algorithms: rate-monotonic scheduling (RMS), earliest-deadline-
first (EDF).
• Priority inversion and priority inheritance mechanisms.
Interfacing: Sensors, Actuators, and Buses
• Analog-to-digital conversion, sampling rates, anti-aliasing.
• Digital buses: characteristics of UART, I2C (multi-master/slave), SPI
(full-duplex master-driven), CAN for automotive.
• Debouncing, filtering, and signal conditioning for reliable sensing.
Power and Energy Management
• Low-power modes, dynamic frequency and voltage scaling (DVFS).
• Techniques for battery-powered devices: duty cycling, event-driven wake-
ups.
• Energy profiling and measurement.
Embedded Linux and RTOS
• When to use embedded Linux vs RTOS: complexity, resource demands,
networking stacks.
• Common RTOS features: task scheduling, inter-task communication, syn-
chronization primitives, timers.
• Examples: FreeRTOS, Zephyr, VxWorks.
Debugging, Testing, and Deployment
• Debugging via JTAG/SWD, serial consoles, and trace tools.
• Unit testing with hardware-in-the-loop (HIL) and mock peripherals.
• Firmware update mechanisms: OTA (over-the-air) updates with secure
verification.
Security and Safety in Embedded Devices
• Secure boot chains, signed firmware, and hardware-backed keys.
• Threats: physical access attacks, side channels, supply-chain risks.
• Safety standards: ISO 26262 (automotive), IEC 61508 (industrial) where
applicable.
Case Studies and Design Patterns
• Sensor gateway: low-power sampling and intermittent connectivity.
• Embedded controller for motor control: real-time loops and control stability.
2
• IoT device lifecycle: provisioning, secure onboarding, telemetry, and OTA
updates.
Exercises and Projects
1. Build a simple firmware for an MCU that reads an analog sensor and
reports values via UART.
2. Implement a priority-based scheduler simulation and analyze missed dead-
lines under load.
3. Create a secure OTA update flow with signed firmware images and rollback
support.
Further Reading
• Barr & Massa: Programming Embedded Systems.
• Embedded Linux resources and RTOS manuals (FreeRTOS, Zephyr docu-
mentation).
• ARM architecture and peripheral datasheets.