Samples and Demos

Zephyr offers a comprehensive collection of samples and demos that highlight the features of the kernel and its subsystems.

These samples are crafted to be simple and easy to understand, serving as a starting point for your own projects.

We welcome contributions of new samples to the project and you are encouraged to read more about the Sample Definition and Criteria if you are interested in submitting your own sample.

Application Development

Architecture-dependent Samples

MMU/MPU

Symmetric Multiprocessing (SMP)

  • SMP PiCalculate the first 240 digits of Pi on multiple execution units.
  • SMP pktqueueUse SMP to process multiple packet headers in parallel.

Basic

Bluetooth

Bluetooth Classic

Boards

96Boards

96Boards ArgonKey

  • MicrophoneAcquire audio through the ArgonKey's on-board MP34DT05 microphone.
  • SensorsRead sensor data from the ArgonKey board's onboard sensors.

BBC

BBC micro:bit

  • LED matrix displayUse the 5x5 LED matrix display on the BBC micro:bit board.
  • Line following robotImplement a line following robot using a BBC micro:bit board and robot chassis.
  • Pong gamePlay pong as single player or over Bluetooth between two micro:bit devices.
  • SoundUse the piezo buzzer on the BBC micro:bit board.

EnjoyDigital

Espressif ESP32 boards

  • Deep SleepUse deep sleep with wake on timer, GPIO, and EXT1 sources on ESP32.
  • Flash EncryptionEncrypt/decrypt data stored in flash memory using ESP32 flash encryption feature.
  • Flash IPM on ESP32Sample of flash API sharing between CPU cores using inter-processor mailbox (IPM).
  • Light SleepUse light sleep mode on ESP32 to save power while preserving the state of the memory, CPU, and peripherals.
  • Memory-Mapped FlashWrite data into scratch area and read it using flash API and memory-mapped pointer.
  • SPIRAMAllocate memory from SPIRAM.
  • XTAL32K Watchdog Timer (WDT)Trigger watchdog interrupt on external 32K crystal failure.

Ultra Low Power coprocessor (ULP)

Low-Power CPU (LP CORE)
  • Debug ULPDebug the LP Core in ESP32C6.
  • Echo ULPLeverage Zephyr's UART API to use the LP UART on the ESP32-C6's LP core.
  • Interrupt ULPHP Core interrupt LP Core.

Google

  • Power Delivery AnalyzerImplement a basic Power Delivery Analyzer to determine if a USB device is currently charging.

Intel

Microchip

MEC15xxEVB Reference Board

Nordic Semiconductor

NXP

PHYTEC

reel board

QuickLogic

Renesas

STMicroelectronics

Bluetooth

Power Management

SensorTile.box Pro

STWIN.box

  • STWIN.box sensorsRead sensor data from the various STWIN SensorTile wireless industrial node sensors.

UART

  • Single-wire UARTUse single-wire/half-duplex UART functionality of STM32 devices.
  • UART circular modeRead data from the console and echo it back using a circular DMA configuration.

Texas Instruments

C++

Data Structures

Drivers

ADC

Audio

Biometrics

  • Fingerprint sensorDemonstrate fingerprint sensor enrollment, verification, identification, and template management using the biometric driver API.

Controller Area Network (CAN)

Counter

  • Counter AlarmImplement an alarm application using the counter API.
  • DS3231 TCXO RTCInteract with a DS3231 real-time clock using the counter API and dedicated driver API.

Ethernet

FPGA

  • FPGA ControllerLoad a bitstream into an FPGA and perform basic operations on it.

General Purpose I/O (GPIO)

Haptics

Inter-Integrated Circuit (I2C) Bus

I2S

Inter-Processor Mailbox (IPM)

  • IPM on ESP32Implement inter-processor mailbox (IPM) between ESP32 APP and PRO CPUs.
  • IPM on NXP i.MXImplement inter-processor mailbox (IPM) on i.MX SoCs containing a Messaging Unit peripheral.
  • IPM on NXP LPCImplement inter-processor mailbox (IPM) on NXP LPC family.
  • IPM over IVSHMEMImplement inter-processor mailbox (IPM) over IVSHMEM (Inter-VM shared memory)
  • IPM with ARM MHUImplement inter-processor mailbox (IPM) using an MHU (Message Handling Unit)

Light-Emitting Diode (LED)

LoRa

  • LoRa receiveReceive packets in both synchronous and asynchronous mode using the LoRa radio.
  • LoRa sendTransmit a preconfigured payload every second using the LoRa radio.

Miscellaneous

  • FT800Display various shapes and text using FT800 Embedded Video Engine.
  • Grove LCDDisplay an incrementing counter and change the backlight color.
  • Time-aware GPIOSynchronize clocks.

Modem

  • AT Command ClientCreate a bidirectional UART bridge between console and modem for AT command communication.
  • Hello hl78xx modem driverget & set basic hl78xx modem information & functionality with HL78XX modem APIs

Multi-bit SPI Bus (MSPI)

OPAMP

PWM

Stepper

  • StepperRotate a stepper motor in 4 different modes.
  • TMC50XX stepperRotate a TMC50XX stepper motor and change velocity at runtime.

Universal Asynchronous Receiver-Transmitter (UART)

  • Native TTY UARTUse native TTY driver to send and receive data between two UART-to-USB bridge dongles.
  • UART ASYNC APIDemonstrate the use of the asynchronous API
  • UART echoRead data from the console and echo it back.
  • UART PassthroughPass data directly between the console and another UART interface.

Video

Virtualization

  • IVSHMEM doorbellUse Inter-VM Shared Memory to exchange messages between two processes running on different operating systems.

1-Wire

  • 1-Wire scannerScan for 1-Wire devices and print their family ID and serial number.

Kernel and Scheduler

  • BootargsPrint received bootargs to the console.
  • Condition VariablesManipulate condition variables in a multithreaded application.
  • Message QueueImplements a basic message queue producer/consumer thread pair.

External modules

CMSIS-DSP

LVGL

TensorFlow Lite for Microcontrollers

Apache Thrift

Networking

IoT Cloud

Network Ethernet

OpenThread

Quality of Service

Sockets API

Wi-Fi

  • Wi-Fi AP-STA modeConfigure a Wi-Fi board to operate as both an Access Point (AP) and a Station (STA).
  • Wi-Fi shellTest Wi-Fi functionality using the Wi-Fi shell module.

POSIX API

PSA

Sensors

Shields

X-NUCLEO-IKS01A2 shield

X-NUCLEO-IKS01A3 shield

X-NUCLEO-IKS02A1 shield

X-NUCLEO-IKS4A1 shield

Subsystems

Binary Descriptor

Controller Area Network (CAN) Bus

  • ISO-TP libraryUse ISO-TP library to exchange messages between two boards.

Console

  • Console echoEcho an input character back to the output using the Console API.
  • console_getchar()Use console_getchar() to read an input character from the console.
  • console_getline()Use console_getline() to read an input line from the console.

CPU Freq

Debug

  • Debug MonitorConfigure the Debug Monitor feature on a Cortex-M processor.
  • FuzzingIntegrate fuzz testing with Zephyr apps.

Display

File Systems

Input

Inter-Processor Communication (IPC)

Linkable Loadable Extensions (LLEXT)

Logging

LoRaWAN

Management

Modbus

PMCI

MCTP

Portability

Profiling

  • Perf toolSend perf samples to the host with console support

Real Time I/O (RTIO)

Sensing

Shell

State Machine Framework

Test suites

USB

Legacy USB device support

USB-C device support

  • Basic USB-C SinkImplement a USB-C Power Delivery application in the form of a USB-C Sink.
  • Basic USB-C SourceImplement a USB-C Power Delivery application in the form of a USB-C Source.

zbus

Sysbuild

TF-M Integration

Userspace