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

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.
  • 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.
  • Wi-Fi AP-STA modeSetup ESP32 to function as both an Access Point (AP) and a Station (STA) simultaneously.
  • XTAL32K Watchdog Timer (WDT)Trigger watchdog interrupt on external 32K crystal failure.

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

STMicroelectronics

Bluetooth

Power Management

Texas Instruments

C++

Drivers

ADC

Audio

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.

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.

Multi-bit SPI Bus (MSPI)

Universal Asynchronous Receiver-Transmitter (UART)

  • Native TTY UARTUse native TTY driver to send and receive data between two UART-to-USB bridge dongles.
  • 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.

Fuel Gauge

Kernel and Scheduler

External modules

CMSIS-DSP

Compression

  • LZ4Compress and decompress data using the LZ4 module.

LVGL

TensorFlow Lite for Microcontrollers

Apache Thrift

Networking

IoT Cloud

Sockets API

POSIX API

PSA

Sensors

Shields

  • nPM1300 EKInteract with the nPM1300 PMIC using the shell interface.
  • nPM6001 EKInteract with the nPM6001 PMIC using the shell interface.
  • X-NUCLEO-53L0A1 shieldInteract with the 7-segment display and VL53L0X ranging sensor of an X-NUCLEO-53L0A1 shield.
  • X-NUCLEO-IKS01A1 shieldInteract with all the sensors of an X-NUCLEO-IKS01A1 shield.

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.

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

Portability

Profiling

  • Perf toolSend perf samples to the host with console support

Sensing

Shell

State Machine Framework

Test suites

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