FirmwareZEPHYR RTOS Complete Tutorial GuideIndeep Sidhu
ZEPHYR RTOS Complete Tutorial Guide
FirmwareRTOS
By Indeep Sidhu
Updated Oct 3, 2026
PDF · 385.9 KB
What's inside
17 sections
- Table of Contents
- Environment Setup: VSCode + Zephyr on Windows
- Install Prerequisites
- Install West & Initialize Workspace
- Install Zephyr SDK (Toolchain)
- VS Code Extensions
- First Build – Blinky on NUCLEO-F401RE
- VS Code launch.json for Debugging
- Zephyr Architecture Overview
- Layered Architecture
- Key Design Principles
- Boot Sequence on STM32
- Kconfig – Configuring the Kernel
- Devicetree for STM32
- Kernel Fundamentals: Threads & Scheduling
- Thread Lifecycle
- Creating Threads
- Compile-Time Thread Definition (Macro)
- Scheduling Policies
- Synchronization: Semaphores, Mutexes, Message Queues
- Semaphores
- Mutexes
- Message Queues (FIFO)
- Memory Management: Heaps, Slabs, Pools
- Memory Slab (Fixed-Size Blocks)
- Kernel Heap (Dynamic Allocation)
- MPU / Memory Protection (CONFIG_USERSPACE)
- Device Driver Model & Devicetree
- Getting a Device Handle
- Writing a Minimal Custom Driver
- GPIO, UART, SPI, I2C on STM32
- GPIO – Blinky + Button with Interrupt
- UART – Interrupt-Driven RX
- I2C – Reading a Temperature Sensor (e.g. TMP117)
- SPI – MAX31855 Thermocouple Reader
- Interrupt Handling & IRQ
- Registering a Hardware ISR
- ISR-Safe Kernel Objects
- Work Queues – Deferred Processing Pattern
- Power Management & Low-Power Modes
- System Power States (STM32)
- Enabling Power Management
- Device Runtime PM Example
- Networking Stack: TCP/IP, BLE, LoRaWAN
- TCP/IP Client on STM32 + W5500 (SPI Ethernet)
- Bluetooth LE – Peripheral (GATT Server)
- LoRaWAN – Class A End Device (OTAA)
- File System & Storage
- LittleFS on Internal Flash
- NVS – Non-Volatile Settings Store
- Zephyr Shell & Logging
- Logging Subsystem
- Interactive Shell
- Testing: Ztest, Twister & CI
- Unit Test with Ztest
- Running Twister (Test Runner)
- GitHub Actions CI Pipeline
- Advanced: SMP, TrustZone & Secure Boot
- Multi-Core Systems – AMP on STM32H745/H755 and SMP
- TrustZone – Secure/Non-Secure World (STM32L5/U5/H5)
- Secure Boot with MCUboot
- Secure OTA Updates
- Certifications: Cybersecurity, Functional Safety & Medical
- Cybersecurity – IEC 62443 / ETSI EN 303 645 / PSA Certified
- Functional Safety – IEC 61508 / ISO 26262 / IEC 62061
- Medical Devices – IEC 62304 / FDA 21 CFR Part 11
- Certification Roadmap Summary
- Appendix – Quick Reference
- A.1 Useful West Commands
- A.2 Commonly Used Kconfig Symbols
- A.3 Supported STM32 Boards in Zephyr
- A.4 Resources & Further Reading
Code & supporting files
No supporting links for this eBook yet.