What's inside
55 sections- —Preface: How to Use This Handbook
- Foundations of Zephyr RTOS
- 01Introduction to Zephyr RTOS & the RTOS Landscape
- Why an RTOS at all?
- Zephyr versus other RTOS choices
- Anatomy of a Zephyr Application
- DO
- AVOID
- 02MCU vs MPU Architectures in Zephyr
- MPU-only targets: region-based protection
- MMU targets: memory domains as real address spaces
- Choosing a target class for your product
- 03Kernel Architecture: Scheduler, Threads & Memory
- Threads and the scheduler
- Core synchronization & communication primitives
- Memory: stacks, heaps, and static allocation discipline
- DO
- AVOID
- Boot Flow, Secure Boot & the Chain of Trust
- 04Normal (Non-Secure) Boot Flow — Function by Function
- The high-level boot chain
- Step-by-step, with the actual function names
- Init levels in detail — the mechanism behind "dynamic driver loading"
- DO
- AVOID
- 05Secure Boot with MCUboot & Chain of Trust
- What "secure boot" actually guarantees
- MCUboot execution flow, function by function
- Signature schemes and where keys live
- Anti-rollback: the security counter
- Building a secure-boot-enabled Zephyr application
- DO
- AVOID
- 06Secure Boot on MPU Targets: TF-A / TF-M & TrustZone
- ARMv8-A secure world boot chain
- TrustZone-M: MCU-class secure/non-secure split
- 07Firmware Update, Rollback & Anti-Rollback
- The A/B (primary/secondary) slot model
- Application-level responsibilities
- Transport-agnostic update sources
- DO
- AVOID
- Devicetree & the Driver Model
- 08Devicetree Fundamentals
- Structure of a devicetree
- Bindings: the contract between devicetree and driver
- DO
- AVOID
- 09Static & Dynamic Device Driver Loading
- The static model: DEVICE_DT_INST_DEFINE
- What "dynamic" really means in Zephyr
- Runtime Power Management flow
- DO
- AVOID
- 10Writing a Zephyr Device Driver
- Anatomy of a driver source file
- Driver review checklist
- DO
- AVOID
- Serial, Bus & Network Peripherals
- 11Serial Communication: UART, RS-232 & RS-485
- The Zephyr UART driver API — two operating modes
- RS-232 vs RS-485: electrical and protocol differences
- Framing & error handling
- DO
- AVOID
- 12I2C Subsystem
- Bus fundamentals recap
- Core API surface
- DO
- AVOID
- 13SPI Subsystem
- Configuration model
- DO
- AVOID
- 14Ethernet & the Zephyr Networking Stack
- Layered networking architecture
- Packet RX path, function by function
- Do's and don'ts for embedded networking
- DO
- AVOID
- 15Wi-Fi Connectivity
- Offloaded vs native Wi-Fi drivers
- Connection flow
- DO
- AVOID
- File Systems & Secure Storage
- 16File Systems: LittleFS, FATFS & Robust Storage for Embedded
- Filesystem options in Zephyr
- Mounting a LittleFS partition
- Robustness engineering patterns
- DO
- AVOID
- 17Secure Storage of Certificates & Secrets
- Storage options ranked by assurance
- Certificate provisioning flow
- Wiring certificates into Zephyr's TLS credential subsystem
- DO
- AVOID
- MQTT, AWS IoT & Azure IoT
- 18MQTT & TLS Fundamentals in Zephyr
- MQTT session lifecycle
- QoS levels and delivery guarantees
- Minimal client skeleton
- DO
- AVOID
- 19AWS IoT Core Integration
- Connection topology
- DO
- AVOID
- 20Azure IoT Hub Integration
- Authentication options
- Device Provisioning Service (DPS) flow
- DO
- AVOID
- Testing, Debugging & Power Management
- 21Testing, Debugging & Fault Handling
- Twister: Zephyr's native test framework
- Fault handling & the fatal error path
- DO
- AVOID
- 22Power Management Deep Dive
- System power states
- Policy: how the idle thread chooses a state
- DO
- AVOID
- Functional Safety, Certification & Career
- 23Functional Safety & Certification Alignment
- Standards landscape at a glance
- Practice-to-evidence map
- Freedom-from-interference on a shared core
- Practical certification checklist
- DO
- AVOID
- 24Advanced Interview Question Bank
- Kernel & Scheduling
- Boot & Secure Boot
- Device Driver Model & Devicetree
- Serial, I2C & SPI
- Networking, MQTT & Cloud
- File Systems & Storage
- Power, Debugging & Reliability
- Architecture & System Design
- RTOS Internals & Timing
- Security & Attack Surface
- Cross-Cutting System Design
- End-to-End Case Study: A Secure, Connected Sensor Node
- 25Case Study: Secure Connected Sensor Node
- Product requirements
- System architecture
- Boot-to-telemetry sequence
- What this case study deliberately does NOT cover
- Lessons generalized from this architecture
- DO
- AVOID
- Coding Standards, Build System & Additional Protocols
- 26Coding Standards & MISRA-C for Certifiable Firmware
- Why coding standards matter more on embedded targets
- High-value MISRA rules for Zephyr driver/application code
- Applying static analysis in a Zephyr project
- DO
- AVOID
- 27Build System Deep Dive: CMake, west & sysbuild
- The tool chain
- Practical invocations
- DO
- AVOID
- 28Bluetooth Low Energy Connectivity
- Stack layering
- Minimal peripheral GATT service
- BLE as a provisioning channel
- DO
- AVOID
- 29Industrial Protocols: Modbus RTU over RS-485 & CAN
- Modbus RTU over RS-485
- CAN bus fundamentals
- DO
- AVOID
- 30Interview Question Bank — Extended Topics
- Coding Standards & Static Analysis
- Build System & Reproducibility
- Bluetooth LE
- Industrial Protocols
- 31USB Device & Host Stack
- USB device stack (new USB stack, Zephyr 3.x+)
- Enumeration flow
- DO
- AVOID
- 32Troubleshooting Field Guide
- 33Multi-Core & Asymmetric Multiprocessing (AMP)
- SMP vs AMP
- Inter-processor communication: OpenAMP & RPMsg
- DO
- AVOID
- 34Logging & Shell Subsystem Deep Dive
- Logging architecture
- The Shell subsystem for field diagnostics
- DO
- AVOID
- 35Sensor Fusion & Signal Processing Patterns on Constrained MCUs
- Where filtering belongs in the driver stack
- Fixed-point vs floating-point on MCU targets
- DO
- AVOID
- 36Real-World Deployment Checklist
- 37Interview Question Bank — Final Round
- Multi-Core & AMP
- USB & Peripheral Diagnostics
- Sensor Fusion & Applied Judgment
- Holistic System Design & Career-Level Judgment
- 38Architecture Portability: ARM, RISC-V & Xtensa
- What the architecture abstraction layer owns
- Practical portability implications
- DO
- AVOID
- 39Real-Time Determinism & Worst-Case Execution Time Analysis
- What "real-time" actually commits you to
- Sources of latency and jitter to account for
- Practical WCET measurement approach
- Static analysis as a complement to measurement
- DO
- AVOID
- 40Vendor HAL Integration & Board Support Packages
- Where vendor HALs sit in the stack
- Anatomy of a complete board port
- Custom board bring-up checklist
- DO
- AVOID
- AAppendix — Glossary & Reference Architecture Map
- A.1 Glossary
- A.2 Full-stack reference architecture
- A.3 Recommended reading & primary sources
- BAppendix — Kconfig & API Quick Reference
- B.1 Kernel & Boot
- B.2 Peripherals
- B.3 Storage & Security
- B.4 Cloud & Protocols
- B.5 Testing & Power
- B.6 Common negative errno return values
- CAppendix — Annotated Sample prj.conf & Devicetree Overlay
- C.1 prj.conf
- C.2 Devicetree overlay excerpt
- —About the Author
Code & supporting files
No supporting links for this eBook yet.More in Firmware
FirmwareSafety Standards in Firmware DevelopmentFirmwareSafety Standards in Firmware DevelopmentFirmwareEmbedded Debugging Complete Guide from ScratchFirmwareEmbedded Debugging Complete Guide from ScratchFirmwareSTM32H7 Graphics TutorialsFirmware › Microcontrollers › STM32STM32H7 Graphics TutorialsFirmwareSTM32H7 and FreeRTOSFirmware › Microcontrollers › STM32STM32H7 and FreeRTOS