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.
- Basic SynchronizationManipulate basic kernel synchronization primitives.
- Dining PhilosophersImplement a solution to the Dining Philosophers problem using Zephyr kernel services.
- Hello WorldPrint "Hello World" to the console.
Application Development
- Code relocation nocopyRelocate code, data, or bss sections using a custom linker script.
- External LibraryInclude an external static library into the Zephyr build system.
Architecture-dependent Samples
MMU/MPU
- Memory Protection Unit (MPU)Use memory protection to prevent common security issues.
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
- Basic thread manipulationSpawn multiple threads that blink LEDs and print information to the console.
- BlinkyBlink an LED forever using the GPIO API.
- ButtonHandle GPIO inputs with interrupts.
- Fade LEDFade an LED using the PWM API.
- GPIO with custom Devicetree bindingUse custom Devicetree binding to control a GPIO.
- Minimal footprintMeasure Zephyr's minimal ROM footprint in different configurations.
- PWM BlinkyBlink an LED using the PWM API.
- PWM RGB LEDDrive an RGB LED using the PWM API.
- ServomotorDrive a servomotor using the PWM API.
- System hashmapInsert, replace, and remove entries in a hashmap.
- System heapPrint system heap usage to the console.
Bluetooth
- Basic Audio Profile (BAP) Broadcast Audio AssistantUse BAP Broadcast Assistant functionality.
- Basic Audio Profile (BAP) Broadcast Audio SinkUse BAP Broadcast Sink functionality.
- Basic Audio Profile (BAP) Broadcast Audio SourceUse BAP Broadcast Source functionality.
- Basic Audio Profile (BAP) Unicast Audio ClientUse BAP Unicast Client functionality.
- Basic Audio Profile (BAP) Unicast Audio ServerUse BAP Unicast Server functionality.
- BeaconAdvertise an Eddystone URL using GAP Broadcaster role.
- BroadcasterPeriodically send out advertising packets with a manufacturer data element.
- BTHome sensor templateImplement a BTHome sensor.
- CentralImplement basic Bluetooth LE Central role functionality (scanning and connecting).
- Central / GATT WriteScan for a Bluetooth LE device, connect to it and write a value to a characteristic.
- Central MultilinkScan, connect and establish connection to up to 62 peripherals.
- Central OTCConnect to a Bluetooth LE peripheral that supports the Object Transfer Service (OTS)
- Central Periodic Advertising Sync Transfer (PAST)Use the Periodic Advertising Sync Transfer (PAST) feature as the sender.
- Channel SoundingUse Channel Sounding functionality.
- Common Audio Profile (CAP) AcceptorAdvertise audio availability to CAP Initiators using the CAP Acceptor role.
- Common Audio Profile (CAP) InitiatorConnect to CAP Acceptors and setup unicast audio streaming or broadcast audio streams.
- Cycling Speed and Cadence (CSC) PeripheralExpose a Cycling Speed and Cadence (CSC) GATT Service.
- Direct AdvertisingAdvertise directly to a bonded central device.
- Direction Finding CentralConnect to a Bluetooth LE Direction Finding peripheral and request Constant Tone Extension.
- Direction Finding Periodic Advertising BeaconImplement Bluetooth LE Direction Finding CTE Broadcaster functionality.
- Direction Finding Periodic Advertising LocatorImplement Bluetooth LE Direction Finding CTE Locator functionality.
- Direction Finding PeripheralImplement Bluetooth LE Direction Finding peripheral transmitting CTE in connected mode.
- DIS PeripheralExpose device information using the Device Information Service (DIS).
- EddystoneExport an Eddystone Configuration Service as a Bluetooth LE GATT service.
- Encrypted AdvertisingUse the Bluetooth LE encrypted advertising feature.
- ESP PeripheralExpose environmental information using the Environmental Sensing Profile (ESP).
- Extended AdvertisingUse the Bluetooth LE extended advertising feature.
- Hands-freeUse the Hands-Free Profile (HFP) APIs.
- Hands-free Audio Gateway (AG)Use the Hands-Free Profile Audio Gateway (AG) APIs.
- HCI 3-wire (H:5)Expose a Bluetooth controller to another device or CPU over H5:HCI transport.
- HCI H4 over USBTurn a Zephyr board into a USB H4 Bluetooth dongle (Linux/BlueZ only).
- HCI IPCExpose a Bluetooth controller to another device or CPU using the IPC subsystem.
- HCI Power ControlDynamically control the Tx power of a Bluetooth LE Controller using HCI vendor-specific commands.
- HCI SPIExpose a Bluetooth controller to another device or CPU over SPI.
- HCI UARTExpose a Bluetooth controller to another device or CPU over UART.
- HCI UART asyncExpose a Bluetooth controller to another device or CPU over asynchronous UART.
- HCI USBTurn a Zephyr board into a USB Bluetooth dongle (compatible with all operating systems).
- HCI Vendor-Specific Scan RequestUse vendor-specific HCI commands to enable Scan Request events when using legacy advertising.
- Health Thermometer (Central)Connect to a Bluetooth LE health thermometer sensor and read temperature measurements.
- Health Thermometer (Peripheral)Expose a Health Thermometer (HT) GATT Service generating dummy temperature values.
- Hearing Access Profile (HAP) Hearing Aid (HA)Advertise and await connection from a Hearing Aid Unicast Client or Remote Controller.
- Heart-rate Monitor (Central)Connect to a Bluetooth LE heart-rate monitor and read heart-rate measurements.
- Heart-rate Monitor (Peripheral)Expose a Heart Rate (HR) GATT Service generating dummy heart-rate values.
- HID PeripheralImplement a Bluetooth HID peripheral (generic mouse)
- iBeaconAdvertise an Apple iBeacon using GAP Broadcaster role.
- ISO (Central)Transfer isochronous data to a peer device using an isochronous channel as a central.
- ISO (Peripheral)Implement a Bluetooth LE Peripheral that uses isochronous channels.
- Isochronous BroadcasterUse the Bluetooth Low Energy Isochronous Broadcaster functionality.
- Isochronous Broadcaster BenchmarkMeasure packet loss and sync loss of an ISO broadcaster against one or more receivers.
- Isochronous Connected Channels BenchmarkMeasure packet loss and sync loss in connected ISO channels.
- MeshUse basic Bluetooth LE Mesh functionality.
- Mesh DemoImplement a Bluetooth Mesh demo application.
- Mesh ProvisionerProvision a node and configure it using the Bluetooth Mesh APIs.
- MTU UpdateConfigure and exchange MTU between two devices.
- Multiple BroadcasterAdvertise multiple advertising sets.
- ObserverScan for Bluetooth devices nearby and print their information.
- Periodic AdvertisingUse Bluetooth LE Periodic Advertising functionality.
- Periodic Advertising Connection Procedure (Initiator)Initiate a connection to a device using the Periodic Advertising Connection Procedure.
- Periodic Advertising Connection Procedure (Responder)Respond to periodic advertising and establish a connection.
- Periodic Advertising SynchronizationUse Bluetooth LE Periodic Advertising Synchronization functionality.
- Periodic Advertising Synchronization Transfer PeripheralUse the Periodic Advertising Sync Transfer (PAST) feature as the receiver.
- Periodic Advertising with Responses (PAwR) AdvertiserUse Bluetooth LE Periodic Advertising with Responses (PAwR) Advertiser functionality.
- Periodic Advertising with Responses (PAwR) SynchronizationImplement Bluetooth LE Periodic Advertising with Responses Synchronization.
- PeripheralImplement basic Bluetooth LE Peripheral role functionality (advertising and exposing GATT services).
- Peripheral Accept ListAdvertise and accept connections only from devices on an accept list.
- Peripheral GATT WriteWrite a value to a characteristic using GATT Write Without Response.
- Peripheral IdentityUse multiple identities to allow connections from multiple central devices.
- Peripheral NUSImplement a simple echo server using the Nordic UART Service (NUS).
- Peripheral Object Transfer Service (OTS)Expose an Object Transfer Service (OTS) GATT Service.
- Peripheral SC-onlyEnable "Secure Connections Only" mode for a Bluetooth LE peripheral.
- Public Broadcast Profile (PBP) Public Broadcast SinkUse PBP Public Broadcast Sink functionality.
- Public Broadcast Profile (PBP) Public Broadcast SourceUse PBP Public Broadcast Source functionality.
- Scan & AdvertiseCombine Bluetooth LE Broadcaster & Observer roles to advertise and scan for devices simultaneously.
- ST Bluetooth LE Sensor DemoExport vendor-specific GATT services over BLE.
- Synchronized ReceiverUse Bluetooth LE Synchronized Receiver functionality.
- Telephone and Media Audio Profile (TMAP) Broadcast Media Receiver (BMR)Implement the TMAP Broadcast Media Receiver (BMR) role.
- Telephone and Media Audio Profile (TMAP) Broadcast Media Sender (BMS)Implement the LE Audio TMAP Broadcast Media Sender (BMS) role.
- Telephone and Media Audio Profile (TMAP) CentralImplement the TMAP Call Gateway (CG) and Unicast Media Sender (UMS) roles.
- Telephone and Media Audio Profile (TMAP) PeripheralImplement the TMAP Call Terminal (CT) and Unicast Media Receiver (UMR) roles.
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.
- 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
- Code relocationRelocate code using custom linker script.
Microchip
MEC15xxEVB Reference Board
Nordic Semiconductor
- Battery Voltage MeasurementMeasure the voltage of the device power supply.
- Dynamic Pin ControlDynamically change pin configuration at boot time.
- IEEE 802.15.4 over RPMsgExpose nRF IEEE 802.15.4 radio driver to another device or CPU using RPMsg transport.
- LED matrixUse the nRF LED matrix display driver to drive an LED matrix.
- Mesh ModelsSetup a Bluetooth Mesh node with various models (generic OnOff, generic Level, ...).
- Mesh OnOff ModelControl LEDs on a mesh network using the Bluetooth Mesh OnOff model.
- nRF5x Clock SkewMeasure the skew between the high-frequency and low-frequency clocks.
- nrfxUse nrfx library to interact with nRF peripherals.
- nrfx peripheral resource sharingUse nRF peripherals that share the same ID and base address.
- Synchronized RTCSynchronize system and network core RTC clocks.
- System OffUse deep sleep on Nordic platforms.
NXP
- FLEXRAM magic addressConfigure an interrupt that triggers on arbitrary RAM/TCM address access.
- Number crunching using optimized librarySet up and use different backends for complex math operations.
- RT1060 System OffUse soft-off on MIMXRT1060-EVK.
- RT595 System OffUse soft-off on MIMXRT595-EVK.
- S32 Network Controller (NETC)Configure NXP S32 Network Controller (NETC)
PHYTEC
reel board
- Bluetooth Mesh badgeImplement a smart badge using the reel board and Bluetooth Mesh.
QuickLogic
STMicroelectronics
- Backup SRAMUse Backup SRAM to store a variable that persists across power cycles.
- Core Coupled Memory (CCM)Place and use variables in the Core Coupled Memory (CCM).
- Hardware Semaphore (HSEM) Inter-Processor Communication on STM32 H7Use the Hardware Semaphore (HSEM) to trigger LED blinking from one core to another.
- I2C V2 timingsRetrieve I2C V2 timings at runtime.
- Master Clock Output (MCO)Output an internal clock for external use by the application.
- SensorTile.box Pro sensorsRead sensor data from the various SensorTile.box Pro sensors.
- SensorTile.box sensorsRead sensor data from the various SensorTile.box sensors.
- Single-wire UARTUse single-wire/half-duplex UART functionality of STM32 devices.
- STWIN.box sensorsRead sensor data from the various STWIN SensorTile wireless industrial node sensors.
Bluetooth
- Bluetooth: ST Interactive GUIExpose ST BlueNRG Bluetooth network coprocessor over UART.
Power Management
- ADC power managementUse ADC in a low-power context on STM32.
- Blinky with power managementBlink an LED using the GPIO API in a low-power context on STM32
- Bluetooth Low Energy Power Management on STM32WBPerform Bluetooth LE operations with Zephyr power management enabled on STM32WB.
- GPIO as a wake-up pin sourceUse a GPIO as a wake-up pin source.
- Serial wakeupWake up on serial activity on STM32.
- Standby/Shutdown modeEnter and exit Standby/Shutdown mode on STM32.
- STOP3 modeUse STOP3 low power mode on STM32U5.
- Suspend to RAMUse suspend to RAM low power mode on STM32.
Texas Instruments
- CC13x2/CC26x2 System OffExercise the various sleep modes on TI CC13x2/CC26x2 platforms.
C++
- C++ synchronizationUse Zephyr synchronization primitives from C++ code.
- Hello C++ worldPrint "Hello World" to the console in C++.
Drivers
- AT45 DataFlash driverUse the AT45 family DataFlash driver to interact with the flash memory over SPI.
- Auxiliary displayOutput "Hello World" to an auxiliary display.
- ChargerCharge a battery using the charger driver API.
- CryptoUse the crypto APIs to perform various encryption/decryption operations.
- Digital-to-Analog Converter (DAC)Generate an analog sawtooth signal using the DAC driver API.
- DisplayDraw basic rectangles on a display device.
- EEPROMStore a boot count value in EEPROM.
- Enhanced Serial Peripheral Interface (eSPI)Use eSPI to connect to a slave device and exchange virtual wire packets.
- Flash shellExplore a flash device using shell commands.
- GNSSConnect to a GNSS device to obtain time, navigation data, and satellite information.
- HD44780 LCD controllerControl an HD44780-based LCD display using GPIO pins.
- HT16K33 LED driver with keyscanControl up to 128 LEDs connected to an HT16K33 LED driver and log keyscan events.
- JEDEC SPI-NOR flashUse the flash API to interact with an SPI NOR serial flash memory device.
- JESD216 flashUse the JESD216 flash API to extract information from a compatible serial memory device.
- KSCANUse the KSCAN API to read key presses and releases on a keyboard matrix.
- LiteX clock control driverUse LiteX clock control driver to generate multiple clock signals.
- MBOXPerform inter-processor mailbox communication using the MBOX API.
- MBOX DataPerform inter-processor mailbox communication using the MBOX API with data.
- Memory controller (MEMC) driverAccess memory-mapped external RAM
- nRF SoC Internal StorageUse the flash API to interact with the SoC flash.
- PECI interfaceMonitor CPU temperature using PECI.
- PS/2 interfaceCommunicate with a PS/2 mouse.
- SMBus shellInteract with SMBus peripherals using shell commands.
- SPI bitbangUse the bitbang SPI driver for communicating with a slave.
- WatchdogUse the watchdog driver API to reset the board when it gets stuck in an infinite loop.
ADC
- Analog-to-Digital Converter (ADC) sequence sampleRead analog inputs from ADC channels, using a sequence.
- Analog-to-Digital Converter (ADC) with devicetreeRead analog inputs from ADC channels.
Audio
- Digital Microphone (DMIC)Perform PDM transfers using different configurations.
Controller Area Network (CAN)
- Controller Area Network (CAN) babbling nodeSimulate a babbling CAN node.
- Controller Area Network (CAN) counterSend and receive CAN messages.
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
- Inter-VM Shared Memory (ivshmem) EthernetCommunicate with another "cell" in the Jailhouse hypervisor using IVSHMEM Ethernet.
FPGA
- FPGA ControllerLoad a bitstream into an FPGA and perform basic operations on it.
Haptics
- DRV2605 Haptic DriverDrive an LRA using the DRV2605 haptic driver chip.
Inter-Integrated Circuit (I2C) Bus
- I2C Custom TargetSetup a custom I2C target on the I2C interface.
- I2C TargetSetup an I2C target on the I2C interface.
I2S
- I2S codecProcess an audio stream to codec.
- I2S echoProcess an audio stream to add an echo effect.
- I2S outputSend I2S output stream
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)
- Breathing-blinking LED (BBLED)Control a BBLED (Breathing-Blinking LED) using Microchip XEC driver.
- IS31FL3194 RGB LEDCycle colors on an RGB LED connected to the IS31FL3194 using the LED API.
- IS31FL3216A LEDControl up to 16 PWM LEDs connected to an IS31FL3216A driver chip.
- IS31FL3733 LED MatrixControl a matrix of up to 192 LEDs connected to an IS31FL3733 driver chip.
- LED PWMControl PWM LEDs using the LED API.
- LED stripControl an LED strip.
- LP3943 RGBW LEDControl up to 16 RGBW LEDs connected to an LP3943 driver chip.
- LP50XX RGB LEDControl up to 12 RGB LEDs connected to an LP50xx driver chip.
- LP5562 RGB LEDControl 4 RGB LEDs connected to an LP5562 driver chip.
- LP5569 9-channel LED controllerControl 9 LEDs connected to an LP5569 driver chip.
- PCA9633 LEDControl 4 LEDs connected to a PCA9633 driver chip.
- SX1509B RGB LEDControl an RGB LED connected to an SX1509B driver chip.
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)
- JEDEC MSPI-NOR flashUse the flash API to interact with a MSPI NOR serial flash memory device.
- MSPI asynchronous transferUse the MSPI API to interact with MSPI memory device asynchronously.
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
- Video captureUse the video API to retrieve video frames from a capture device.
- Video capture to LVGLCapture video frames and display them on an LCD using LVGL.
- Video TCP server sinkCapture video frames and send them over the network to a TCP client.
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
- MAX17048 Li-Ion battery fuel gaugeRead battery percentage and power status using MAX17048 fuel gauge.
Kernel and Scheduler
- BootargsPrint received bootargs to the console.
- Condition VariablesManipulate condition variables in a multithreaded application.
External modules
- Android's Context Hub Runtime Environment (CHRE)Run nanoapps on Zephyr using the Context Hub Runtime Environment (CHRE).
- CANopenNodeUse the CANopenNode CANopen protocol stack in Zephyr.
- NanopbSerialize and deserialize structured data using the nanopb module.
CMSIS-DSP
- CMSIS-DSP moving averageUse the CMSIS-DSP library to calculate the moving average of a signal.
Compression
- LZ4Compress and decompress data using the LZ4 module.
LVGL
- LVGL demosRun LVGL built-in demos.
- LVGL line chart with accelerometer dataDisplay acceleration data on a real-time chart using LVGL.
- LVGL screen transparencyRendering to screens with transparency support using LVGL.
TensorFlow Lite for Microcontrollers
- Hello WorldReplicate a sine wave using TensorFlow Lite for Microcontrollers.
- Magic WandRecognize gestures from an accelerometer using TensorFlow Lite for Microcontrollers and a 20KB neural network.
- TensorFlow Lite for Microcontrollers on Arm Ethos-URun an inference using an optimized TFLite model on Arm Ethos-U NPU.
Apache Thrift
- Apache Thrift Hello WorldImplement a simple Apache Thrift client-server application.
Networking
- 802.15.4 "serial-radio"Implement a slip-radio device for Contiki-based border routers.
- Cellular modemUse a cellular modem to communicate with a UDP server.
- DHCPv4 clientStart a DHCPv4 client to obtain an IPv4 address from a DHCPv4 server.
- DNS resolveResolve an IP address for a given hostname.
- DSA (Distributed Switch Architecture)Test and debug Distributed Switch Architecture
- gPTPEnable gPTP support and monitor functionality using net-shell.
- IPv4 autoconf clientPerform IPv4 autoconfiguration and self-assign a random IPv4 address
- Link Layer Discovery Protocol (LLDP)Enable LLDP support and setup VLANs.
- LwM2M clientImplement a LwM2M client that connects to a LwM2M server.
- mDNS responderListen and respond to mDNS queries.
- MQTT publisherSend MQTT PUBLISH messages to an MQTT server.
- MQTT-SN publisherSend MQTT-SN PUBLISH messages to an MQTT-SN gateway.
- Network packet captureCapture network packets and send them to a remote host via IPIP tunnel.
- Network statisticsQuery and display network statistics from a user application.
- OpenThread co-processorBuild a Thread border-router using OpenThread's co-processor designs.
- Prometheus SampleImplement a Prometheus Metric Server demonstrating various metric types.
- Promiscuous modeEnable promiscuous mode on all interfaces and print information about incoming packets.
- PTPEnable PTP support and monitor messages and events via logging.
- Remote syslogEnable a remote syslog service that sends syslog messages to a remote server
- Secure MQTT Sensor/ActuatorImplement an MQTT-based IoT sensor/actuator device
- Telnet consoleAccess Zephyr shell over telnet.
- TFTP clientUse the TFTP client library to get/put files from/to a TFTP server.
- Virtual LANSetup two virtual LAN networks and use net-shell to view the networks' settings.
- Virtual network interfaceCreate a sample virtual network interface.
- zperf: Network Traffic GeneratorUse the zperf shell utility to evaluate network bandwidth.
IoT Cloud
- AWS IoT Core MQTTConnect to AWS IoT Core and publish messages using MQTT.
- Microsoft Azure IoT Hub MQTTConnect to Azure IoT Hub and publish messages using MQTT.
- TagoIO HTTP PostSend random temperature values to TagoIO IoT Cloud Platform using HTTP.
Sockets API
- Asynchronous echo server using poll()Implement an asynchronous IPv4/IPv6 TCP echo server using BSD sockets and poll()
- Asynchronous echo server using select()Implement an asynchronous IPv4/IPv6 TCP echo server using BSD sockets and select()
- CoAP clientUse the CoAP library to implement a client that fetches a resource.
- CoAP downloadUse the CoAP client API to download data via a GET request
- CoAP serviceUse the CoAP server subsystem to register CoAP resources.
- Dumb HTTP serverImplement a simple, portable, HTTP server using BSD sockets.
- Dumb HTTP server (multi-threaded)Implement a simple HTTP server supporting simultaneous connections using BSD sockets.
- Echo client (advanced)Implement a client that sends IP packets, waits for data to be sent back, and verifies it.
- Echo server (advanced)Implement a UDP/TCP server that sends received packets back to the sender.
- Echo server (service)Implements a simple IPv4/IPv6 TCP echo server using BSD sockets and socket service API.
- Echo server (simple)Implements a simple IPv4/IPv6 TCP echo server using BSD sockets.
- HTTP ClientImplement an HTTP(S) client that issues a variety of HTTP requests.
- HTTP GET using plain socketsImplement an HTTP(S) client using plain BSD sockets.
- HTTP ServerImplement an HTTP(s) Server demonstrating various resource types.
- Large HTTP downloadDownload a large file from a web server using BSD sockets.
- Network management socketListen to network management events using a network management socket.
- Packet socketUse raw packet sockets over Ethernet.
- SNTP clientUse SNTP to get the current time from the host.
- SocketCANSend and receive raw CAN frames using BSD sockets API.
- SocketpairImplement communication between threads using socket pairs.
- TCP sample for TTCN-3 based sanity checkUse TTCN-3 to validate the functionality of the TCP stack.
- UDP sender using SO_TXTIMEControl the transmission time of a packet using SO_TXTIME socket option.
- WebSocket ClientImplement a Websocket client that connects to a Websocket server.
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
- Environment VariablesManipulate environment variables from a Zephyr application.
- eventfd()Use eventfd() to create a file descriptor for event notification.
- gettimeofday() with clock initializationUse gettimeofday() with clock initialization over SNTP.
- POSIX PhilosophersImplement a solution to the Dining Philosophers problem using the POSIX API.
- uname()Use uname() to acquire system information and output it to the console.
PSA
- PSA Crypto persistent keyManage and use persistent keys via the PSA Crypto API.
- PSA Internal Trusted Storage APIUse the PSA ITS API.
Sensors
- Accelerometer triggerTest and debug accelerometer with interrupts.
- ADT7420 high-accuracy digital I2C temperature sensorGet temperature data from an ADT7420 sensor using polling and window mode.
- AMG88XX infrared array sensorGet temperature data from an AMG88XX 8x8 thermal camera sensor.
- ams iAQcore indoor air quality sensorGet CO2 equivalent and VOC data from an ams iAQcore sensor.
- APDS9960 RGB, ambient light, and gesture sensorGet ambient light, RGB, and proximity/gesture data from an APDS9960 sensor.
- BME280 humidity and pressure sensorGet temperature, pressure, and humidity data from a BME280 sensor.
- BMI270 6-axis IMU sensorConfigure and read accelerometer and gyroscope data from a BMI270 sensor.
- BQ274XX fuel gauge sensorGet various fuel gauge parameters from a BQ274XX sensor.
- CCS811 indoor air quality sensorGet CO2 equivalent and VOC data from a CCS811 sensor.
- CPU die temperature pollingGet CPU die temperature data from a sensor using polling.
- DS18B20 1-Wire Temperature SensorGet ambient temperature data from a DS18B20 sensor (polling mode).
- FDC2X1X Capacitance-to-Digital ConverterGet capacitance and frequency data from a FDC2X1X sensor (polling & trigger).
- FXAS21002 Gyroscope SensorGet gyroscope data synchronously from an FXAS21002 sensor.
- FXOS8700 Accelerometer/Magnetometer SensorGet accelerometer and magnetometer data from an FXOS8700 sensor (polling & trigger mode).
- Generic 3-Axis accelerometer pollingGet 3-Axis accelerometer data from a sensor (polling mode).
- Generic CO2 polling sampleGet CO2 data from a sensor (polling mode).
- Generic digital humidity temperature sensor pollingGet temperature and humidity data from a DHT sensor (polling mode).
- Grove Light SensorGet illuminance data from a Grove Light Sensor.
- Grove Temperature SensorGet temperature data from a Grove temperature sensor and display it on an LCD display.
- GROW R502-A Fingerprint SensorStore and match fingerprints using the GROW R502-A fingerprint sensor.
- HTS221 Temperature and Humidity MonitorGet temperature and humidity data from an HTS221 sensor (polling & trigger mode).
- I3G4250D 3-axis gyroscope sensorGet gyroscope data from an I3G4250D sensor.
- INA219 Bidirectional Power/Current MonitorGet shunt voltage, bus voltage, power and current from an INA219 sensor.
- ISL29035 Digital Light SensorGet light intensity data from an ISL29035 sensor (polling & trigger mode).
- JEDEC JC 42.4 compliant Temperature SensorGet ambient temperature from a JEDEC JC 42.4 compliant temperature sensor (polling & trigger mode).
- LIS2DH Motion SensorGet accelerometer data from an LIS2DH sensor (polling & trigger mode).
- LPS22HB Temperature and Pressure SensorGet pressure and temperature data from an LPS22HB sensor (polling mode).
- LPSS22HH Temperature and Pressure SensorGet pressure and temperature data from an LPS22HH sensor (polling & trigger mode).
- LPSS22HH Temperature and Pressure Sensor (I3C)Get pressure and temperature data from an LPS22HH sensor over I3C (polling & trigger mode).
- LSM303DLHC Magnetometer and Accelerometer sensorGet magnetometer and accelerometer data from an LSM303DLHC sensor (polling mode).
- LSM6DSL IMU sensorGet accelerometer and gyroscope data from an LSM6DSL sensor (polling & trigger mode).
- LSM6DSO IMU sensorGet accelerometer and gyroscope data from an LSM6DSO sensor (polling & trigger mode).
- LSM6DSO IMU sensor (I2C on I3C bus)Get accelerometer and gyroscope data from an LSM6DSO sensor using I2C on I3C bus (polling & trigger mode).
- Magnetometer SensorGet magnetometer data from a magnetometer sensor (polling mode).
- Magnetometer triggerTest and debug magnetometer with interrupts
- MAX17262 Fuel Gauge SensorGet voltage, current and temperature data from a MAX17262 sensor (polling mode).
- MAX30101 Heart Rate SensorGet heart rate data from a MAX30101 sensor (polling mode).
- MAX6675 K-thermocouple to digital converterGet temperature from a MAX6675 K-thermocouple to digital converter (polling mode).
- MPR Pressure SensorGet atmospheric pressure data from an MPR pressure sensor.
- MPU6050 Invensense Motion Tracking DeviceGet temperature, acceleration, and angular velocity from an ICM42605 sensor (polling & trigger mode).
- MPU6050 motion tracking deviceGet temperature, acceleration, and angular velocity from an MPU6050 sensor (polling & trigger mode).
- MS5837 Digital Pressure SensorGet pressure and temperature data from an MS5837 sensor (polling mode).
- NPCX ADC ComparatorDetect upper/lower voltage limits using NPCX ADC Comparator driver.
- NXP MCUX Analog Comparator (ACMP)Get analog comparator data from an NXP MCUX Analog Comparator (ACMP).
- NXP MCUX Low-power Analog Comparator (LPCMP)Get analog comparator data from an NXP MCUX Low-power Analog Comparator (LPCMP).
- Proximity sensorGet proximity data from up to 10 proximity sensors (polling mode).
- Quadrature Decoder SensorGet rotation data from a quadrature decoder sensor.
- Sensor shellInteract with sensors using the shell module.
- SGP40 and SHT4X digital humidity and multipixel gas sensorGet temperature, humidity and gas sensor data from SGP40 and SHT4X sensors (polling mode).
- SHT3XD humidity sensorGet temperature and humidity from a SHT3XD sensor (polling & trigger mode).
- SM351LT Magnetoresistive SensorDetect a magnet's presence using the SM351LT magnetoresistive sensor (polling & trigger mode).
- SoC Voltage SensorGet voltage data from an SoC's voltage sensor(s).
- TH02 Temperature and Humidity SensorGet temperature and humidity data from a TH02 sensor (polling mode).
- ThermometerGet ambient temperature data from a temperature sensor and get alerts when temperature drifts above a threshold. (polling & trigger mode).
- TMP108 Temperature SensorGet temperature data from a TMP108 sensor (polling & trigger mode).
- TMP112 Temperature SensorGet temperature data from a TMP112 sensor (polling & trigger mode).
- VCNL4040 Proximity and Ambient Light SensorGet proximity and ambient light data from a VCNL4040 sensor (polling & trigger mode).
- VEAA-X-3 proportional pressure control valveControl a VEAA-X-3 proportional pressure control valve.
- VL53L0X Time Of Flight sensorGet distance data from a VL53L0X sensor (polling mode).
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-IKS01A2 shield - SensorHub (Mode 2)Interact with all the sensors of an X-NUCLEO-IKS01A2 shield using Sensor Hub mode.
- X-NUCLEO-IKS01A2 shield - Standard (Mode 1)Interact with all the sensors of an X-NUCLEO-IKS01A2 shield using Standard Mode.
X-NUCLEO-IKS01A3 shield
- X-NUCLEO-IKS01A3 shield - SensorHub (Mode 2)Interact with all the sensors of an X-NUCLEO-IKS01A3 shield using Sensor Hub mode.
- X-NUCLEO-IKS01A3 shield - Standard (Mode 1)Interact with all the sensors of an X-NUCLEO-IKS01A3 shield using Standard mode.
X-NUCLEO-IKS02A1 shield
- X-NUCLEO-IKS02A1 shield - MEMS microphoneAcquire audio using the digital MEMS microphone on X-NUCLEO-IKS02A1 shield.
- X-NUCLEO-IKS02A1 shield - SensorHub (Mode 2)Interact with all the sensors of an X-NUCLEO-IKS02A1 shield using Sensor Hub mode.
- X-NUCLEO-IKS02A1 shield - Standard (Mode 1)Interact with all the sensors of an X-NUCLEO-IKS02A1 shield using Standard mode.
X-NUCLEO-IKS4A1 shield
Subsystems
- Arm SiP Services on Intel Agilex SoC FPGAUse the SiP SVC subsystem to interact with the Secure Device Manager on Intel Agilex SoC FPGA.
- CMSIS-DAPImplement a custom CMSIS-DAP controller using SWDP interface driver.
- Demand pagingLeverage demand paging to deal with code bigger than available RAM.
- EDAC shellTest error detection and correction (EDAC) using shell commands.
- Non-Volatile Storage (NVS)Store and retrieve data from flash using the NVS API.
- Settings APILoad and save configuration values using the settings API.
- Task watchdogMonitor a thread using a task watchdog.
- TracingSend tracing formatted packet to the host with supported backends.
Binary Descriptor
- Binary descriptors "Hello World"Set and access binary descriptors for a basic Zephyr application.
- Binary descriptors readDefine some binary descriptors and read them.
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
- Character frame bufferDisplay character strings using the Character Frame Buffer (CFB).
- Character Framebuffer shell moduleUse the CFB shell module to interact with a monochrome display.
- Custom fontsGenerate and use a custom font.
- LVGL basic sampleDisplay a "Hello World" and react to user input using LVGL.
File Systems
- File system manipulationUse file system API with various filesystems and storage devices.
- Format filesystemFormat different storage devices for different file systems.
- LittleFS filesystemUse file system API over LittleFS.
- Zephyr Memory Storage (ZMS)Store and retrieve data from storage using the ZMS API.
Input
- Draw touch eventsVisualize touch events on a display.
- Input dumpPrint all input events.
Inter-Processor Communication (IPC)
- IPC service: icmsg backendSend messages between two cores using the IPC service and icmsg backend.
- IPC service: Multi-endpointUse the IPC Service with multiple endpoints.
- IPC service: static vrings backendSend messages between two cores using the IPC service and static vrings backend.
- OpenAMPSend messages between two cores using OpenAMP.
- OpenAMP using resource tableSend messages between two cores using OpenAMP and a resource table.
- RPMsg serviceSend messages between cores using RPMsg service.
Linkable Loadable Extensions (LLEXT)
- Linkable loadable extensions "module" sampleCall a function in a loadable extension module, either built-in or loaded at runtime.
- Linkable loadable extensions EDKEnable linkable loadable extension development outside the Zephyr tree using LLEXT EDK (Extension Development Kit).
- Linkable loadable extensions shell moduleManage loadable extensions using shell commands.
Logging
- BLE logging backendSend log messages over BLE using the BLE logging backend.
- Dictionary-based loggingOutput binary log data using the dictionary-based logging API.
- LoggingOutput log messages to the console using the logging subsystem.
LoRaWAN
- LoRaWAN class A deviceJoin a LoRaWAN network and send a message periodically.
- LoRaWAN FUOTAPerform a LoRaWAN firmware-upgrade over the air (FUOTA) operation.
Management
- Eclipse hawkBit Direct Device Integration APIUpdate a device using Eclipse hawkBit DDI API.
- SMP serverImplement a Simple Management Protocol (SMP) server.
- UpdateHub embedded Firmware Over-The-Air (FOTA) updatePerform Firmware Over-The-Air (FOTA) updates using UpdateHub.
Modbus
- Modbus RTU clientCommunicate with a Modbus RTU server.
- Modbus RTU serverImplement a Modbus RTU server exposing Modbus commands to control LEDs.
- Modbus TCP serverImplement a Modbus TCP server exposing Modbus commands to control LEDs.
- Modbus TCP-to-serial gatewayImplement a gateway between an Ethernet TCP-IP network and a Modbus serial line.
Portability
- Dining Philosophers (CMSIS RTOS V1 APIs)Implement a solution to the Dining Philosophers problem using CMSIS RTOS V1.
- Dining Philosophers (CMSIS RTOS V2 APIs)Implement a solution to the Dining Philosophers problem using CMSIS RTOS V2.
- Synchronization using CMSIS RTOS V1 APIsUse timers and message queues from CMSIS RTOS v1 API to synchronize threads.
- Synchronization using CMSIS RTOS V2 APIsUse timers and message queues from CMSIS RTOS v2 API to synchronize threads.
Profiling
- Perf toolSend perf samples to the host with console support
Sensing
- Sensing subsystemGet high-level sensor data in defined intervals.
Shell
- Custom Shell moduleRegister shell commands using the Shell API
- File system shellAccess a LittleFS file system partition in flash using the file system shell.
State Machine Framework
- Hierarchical State Machine Demo based on example from PSiCC2Implement an event-driven hierarchical state machine using State Machine Framework (SMF).
- SMF CalculatorCreate a simple desk calculator using the State Machine Framework.
Test suites
- Pytest shell application testingExecute pytest tests against the Zephyr shell.
USB device support
- Console over USB CDC ACMOutput "Hello World!" to the console over USB CDC ACM.
- USB Audio asynchronous explicit feedback sampleUSB Audio 2 explicit feedback sample playing audio on I2S.
- USB Audio asynchronous implicit feedback sampleUSB Audio 2 implicit feedback sample playing stereo and recording mono audio on I2S interface.
- USB Audio headsetImplement a USB Audio headset device with audio IN/OUT loopback.
- USB Audio microphone & headphonesImplement a USB Audio microphone + headphones device with audio IN/OUT loopback.
- USB CDC-ACMUse USB CDC-ACM driver to implement a serial port echo.
- USB DFU (Device Firmware Upgrade)Implement device firmware upgrade using the USB DFU class driver.
- USB HID keyboardImplement a basic HID keyboard device.
- USB HID mouseImplement a basic HID mouse device.
- USB Mass StorageExpose board's RAM or FLASH as a USB disk using USB Mass Storage driver.
- USB shellUse shell commands to interact with USB device stack.
- USB testing applicationTest USB device drivers using a loopback function.
- WebUSBReceive and echo data from a web page using WebUSB API.
- WebUSB-nextReceive and echo data from a web page using WebUSB API.
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
- BenchmarkingMeasure the time for sending 256KB from a producer to N consumers.
- Confirmed channelUse confirmed zbus channels to ensure all subscribers consume a message.
- Dynamic channelUse zbus channels with dynamically allocated messages.
- Message subscriberUse zbus message subscribers to listen to messages published to channels.
- Remote mock samplePublish to a zbus instance using UART as a bridge.
- Runtime observer registrationUse zbus' runtime observer registration to filter data generated by a producer.
- UART bridgeRedirect channel events to the host over UART.
- Work queueUse a work queue to process zbus messages in various ways.
- zbus Hello WorldMake three threads talk to each other using zbus.
- zbus Priority BoostIllustrates zbus priority boost feature with a priority inversion scenario.
Sysbuild
- Hello World for multiple board targets using SysbuildRun a hello world sample on multiple board targets
- MCUboot with sysbuildBuild a Zephyr application + MCUboot using sysbuild.
TF-M Integration
- TF-M IPCImplement communication between the secure and non-secure images using IPC.
- TF-M PSA cryptoUse the PSA Crypto API for cryptography and device certificate signing requests.
- TF-M PSA Protected StorageUse the Protected Storage (PS) API to store encrypted data.
- TF-M Secure PartitionCreate a secure partition that exposes secure services.
Userspace
- Hello WorldPrint a simple "Hello World" from userspace.
- Producer/consumerManipulate basic user mode concepts.
- Syscall performanceMeasure performance overhead of a system calls compared to direct function calls.
- Userspace Protected MemoryUse memory partitioning to protect memory between threads.