示例与演示
Zephyr 提供了丰富的示例与演示,展示内核及各个子系统的功能。
这些示例力求简单易懂,可作为开发自己的项目的起点。
欢迎向项目贡献新示例。有意提交示例时,请先阅读 Sample Definition and Criteria。
备注
下方列表按示例源码中的元数据自动汇总。尚未翻译的示例名称和简介保留英文, 点击后打开上游英文文档。已翻译的示例会打开本站中文页面。
- Basic SynchronizationManipulate basic kernel synchronization primitives.
- Dining PhilosophersImplement a solution to the Dining Philosophers problem using Zephyr kernel services.
- Hello World向控制台输出 "Hello World"。
应用开发
- 外部静态库将外部静态库接入 Zephyr 构建系统。
- 无需复制的代码重定位使用自定义链接脚本重定位代码段、数据段或 BSS 段。
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 button inputs using the input subsystem.
- 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
- 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.
- 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.
- Elapsed Time Service (ETS) PeripheralExpose an Elapsed Time Service (ETS) 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.
- HCI 3-wire (H:5)Expose a Bluetooth controller to another device or CPU over H5:HCI transport.
- 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.
- 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.
- L2CAP Connection Oriented Channels (Acceptor)Accept incoming L2CAP Connection Oriented Channel connections.
- L2CAP Connection Oriented Channels (Initiator)Initiate L2CAP Connection Oriented Channel connections and send data.
- MeshUse basic Bluetooth 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 ANSSend notification using Alert Notification Service (ANS).
- Peripheral GAP service custom implementationImplement a peripheral with GAP service that limits the accepted names
- 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.
- Scan & AdvertiseCombine Bluetooth LE Broadcaster & Observer roles to advertise and scan for devices simultaneously.
- Synchronized ReceiverUse Bluetooth LE Synchronized Receiver functionality.
Bluetooth Audio
- 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.
- Call Control Profile (CCP) Call Control ServerCCP Call Control Server sample that registers one or more TBS bearers and advertises the TBS UUID(s).
- Call Control Profile (CCP) Call Control ServerCCP Call Control Server sample that registers one or more TBS bearers and advertises the TBS UUID(s).
- Common Audio Profile (CAP) AcceptorAdvertise audio availability to CAP Initiators using the CAP Acceptor role.
- Common Audio Profile (CAP) HandoverConnect to a CAP acceptor and perform CAP handover procedures
- Common Audio Profile (CAP) InitiatorConnect to CAP Acceptors and setup unicast audio streaming or broadcast audio streams.
- Hearing Access Profile (HAP) Hearing Aid (HA)Advertise and await connection from a Hearing Aid Unicast Client or Remote Controller.
- Public Broadcast Profile (PBP) Public Broadcast SinkUse PBP Public Broadcast Sink functionality.
- Public Broadcast Profile (PBP) Public Broadcast SourceUse PBP Public Broadcast Source 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.
Bluetooth Classic
- A2DP SinkUse A2DP (Advanced Audio Distribution Profile) sink functionality.
- A2DP SourceUse A2DP (Advanced Audio Distribution Profile) source functionality.
- Hands-freeUse the Hands-Free Profile (HFP) APIs.
- Hands-free Audio Gateway (AG)Use the Hands-Free Profile Audio Gateway (AG) APIs.
Boards
96Boards
96Boards ArgonKey
- MicrophoneAcquire audio through the ArgonKey's on-board MP34DT05 microphone.
- SensorsRead sensor data from the ArgonKey board's onboard sensors.
ADI
- ADI MAX32 GPIO WakeupUse GPIO to wake the system from low-power states
- ADI Power ModesExercise power modes for a given SoC
AMD
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.
- ESP-NOWSend and receive ESP-NOW broadcast heartbeat beacons between two ESP32 boards.
- ESP32 qdec per-unit threshold triggerInstall per-unit threshold callbacks on the ESP32 PCNT driver.
- 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 the storage partition and read it using flash API and memory-mapped pointer.
- Pixel processing acceleratorScale, rotate and mirror an image with the pixel processing accelerator.
- SPIRAMAllocate memory from SPIRAM.
- Wi-Fi MeshBuild a self-organizing multi-hop Wi-Fi mesh network.
- Wi-Fi Mesh IPCarry IP over a self-organizing Wi-Fi mesh with a root NAT relay.
- 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.
- LP GPIO WakeupLP Core wakes HP Core from deep sleep on LP GPIO level change.
- LP Timer WakeupLP Core periodically wakes HP Core from deep sleep using LP timer.
- Power Delivery AnalyzerImplement a basic Power Delivery Analyzer to determine if a USB device is currently charging.
Infineon
- AutAnalog ADC FIR+FIFORead AutAnalog ADC channels with FIR filtering and FIFO bulk collection.
Intel
- Code relocationRelocate code using custom linker script.
Microchip
MEC15xxEVB Reference Board
Nordic Semiconductor
- Battery Voltage MeasurementMeasure the voltage of the device power supply.
- Coresight STM benchmark
- Coresight STM with remote shell
- 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.
- Nordic flash write during Bluetooth LE activityWrite to flash while the Bluetooth LE radio is active.
- Nordic IronSide SE firmware updateUpdate the Nordic IronSide SE firmware.
- nRF clock controlRequest minimum clock requirements at runtime.
- nRF System EventsManage global constant latency mode on Nordic SoCs using the nRF System Events API.
- 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.
- SPIS wake upReduce current consumption by handling the wake line while using an SPIS.
- Synchronized RTCSynchronize system and network core RTC clocks.
- System OffUse deep sleep on Nordic platforms.
NXP
- Audio output AMP sample.AMP system example for NXP i.MX RTxxx platforms - audio loopback.
- Audio output AMP sample.AMP system example for NXP i.MX RTxxx platforms - audio output.
- Blinky AMP sampleAMP system example for NXP i.MX RTxxx platforms - blinking LED.
- FLEXRAM magic addressConfigure an interrupt that triggers on arbitrary RAM/TCM address access.
- FRDM-MCXA156 lpdac opamp lpadc exampleAmplify the input of the OPAMP and sample it using the ADC.
- mbox API AMP sampleAMP system example for NXP i.MX RTxxx platforms - IPC using the mbox API.
- Number crunching using optimized librarySet up and use different backends for complex math operations.
- NXP MCX suspend-to-RAMSuspend an NXP MCXA/MCXN SoC to RAM and resume on an LPTMR timer (or button) wakeup delivered through the WUU wakeup controller.
- NXP MCX system offUse system off (Deep Power Down) on NXP MCXA/MCXN SoCs and wake through the WUU wakeup controller.
- NXP SmartDMA memory-to-memoryUse the NXP SmartDMA coprocessor to perform a memory-to-memory transfer through the Zephyr DMA API.
- OpenAMP DSP AMP SampleSend messages between multiple cores using OpenAMP with concurrent communication channels.
- RT1060 System OffUse soft-off on MIMXRT1060-EVK.
- RT595 System OffUse soft-off on MIMXRT595-EVK.
- RT700 EVK dual-core power managementExercise active, sleep, deep-sleep and deep-sleep-retention combinations on both RT700 EVK Cortex-M33 cores.
- RT700 System OffUse system off on MIMXRT700-EVK.
- RW612 PM flash checkCheck external NOR flash health across RW612 low-power modes.
- S32 Network Controller (NETC)Configure NXP S32 Network Controller (NETC)
- System Off (MCXE31B standby)Use standby (the only low-power mode) on FRDM-MCXE31B and wake via an RTC alarm.
- TensorFlow Lite for Microcontrollers on NXP NeutronRun an inference using a MobileNet model on the NXP Neutron NPU.
PHYTEC
reel board
- Bluetooth Mesh badgeImplement a smart badge using the reel board and Bluetooth Mesh.
QuickLogic
Raspberry Pi
- Pico W WiFi + LEDBlink the onboard LED while scanning for WiFi networks.
- Raspberry Pi Board InfoRetrieve and display Raspberry Pi board information using VideoCore firmware interface.
Renesas
- OpenAMP Linux Zephyr RPMsgEnable message exchange between two cores, with the application core running Linux and the real-time core running Zephyr, using the OpenAMP library.
- Renesas comparatorMonitor the output of comparator.
- Renesas ELC SampleIntegrating the Renesas ELC with PWM Functionality
- Renesas Low-voltage Detection Sample using ComparatorDemonstrates monitoring and reacting to voltage levels.
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.
Bluetooth
- Bluetooth: ST Interactive GUIExpose ST BlueNRG Bluetooth network coprocessor over UART.
- ST Bluetooth LE Sensor DemoExport vendor-specific GATT services over Bluetooth.
Board-specific STM32 samples
SensorTile.box
- SensorTile.box sensorsRead sensor data from the various SensorTile.box sensors.
SensorTile.box Pro
- SensorTile.box Pro sensorsRead sensor data from the various SensorTile.box Pro sensors.
STWIN.box
- STWIN.box sensorsRead sensor data from the various STWIN SensorTile wireless industrial node sensors.
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.
- STOP3 modeUse STOP3 low power mode on STM32U5.
- Suspend to RAMUse suspend to RAM low power mode on STM32.
PWM
- STM32 pwm mastermodeDevicetree configuration for utilizing master/slave capabilities to synchronize timer instances.
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
- 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++.
Data Structures
- Min-Heap Data StructureDemonstrate usage of a min-heap implementation in a Zephyr application.
- Red-Black Tree Data StructureUse a red-black tree data structure in a Zephyr application.
Drivers
- AT45 DataFlash driverUse the AT45 family DataFlash driver to interact with the flash memory over SPI.
- Auxiliary digits displayOutput increasing numbers to an auxiliary display.
- 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.
- Cyclic Redundancy Check Drivers (CRC)Compute and verify a CRC checksum using the CRC driver API.
- Digital Addressable Lighting Interface (DALI)Blink LED controllers connected to a DALI bus.
- 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.
- Fuel GaugeUse fuel gauge API to access fuel gauge properties and get charge information.
- GNSSConnect to a GNSS device to obtain time, navigation data, and satellite information.
- Hash HW benchmarkMeasure throughput and CPU load of the crypto hash API implementation.
- 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.
- HWSPINLOCKDemonstrate cross-core synchronization using the HWSPINLOCK API together with the MBOX API.
- 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.
- 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) driverRead and write external memory
- Multi-Function Device (MFD) with Charger, Fuel Gauge, and RegulatorsDemonstrate a multi-function device using charger, fuel gauge, and regulator subsystems.
- 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.
- PSI5 interfaceUse the PSI5 (Peripheral Sensor Interface) driver.
- Real-Time Clock (RTC)Set and read the date/time from a Real-Time Clock.
- SENT interfaceUse the SENT (Single Edge Nibble Transmission) driver.
- SMBus shellInteract with SMBus peripherals using shell commands.
- SPI bitbangUse the bitbang SPI driver for communicating with a peripheral.
- Time-aware GPIOSynchronize clocks.
- 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.
- Generic ADC streamGet data from a ADC using stream.
Audio
- audio codecmic to speaker loopback.
- Digital Microphone (DMIC)Perform PDM transfers using different configurations.
Biometrics
- Fingerprint sensorDemonstrate fingerprint sensor enrollment, verification, identification, and template management using the biometric driver API.
Buzzer
- Buzzer TonePlay a short beep and a few tones through the buzzer device aliased as buzzer0.
Controller Area Network (CAN)
- Controller Area Network (CAN) babbling nodeSimulate a babbling CAN node.
- Controller Area Network (CAN) counterSend and receive CAN messages.
Clock Monitor
- Clock Monitor Frequency CheckContinuously check a clock against programmable frequency thresholds.
- Clock Monitor Frequency MeterMeasure the frequency of a clock once and print the result.
Counter
- Counter AlarmImplement an alarm application using the counter API.
Ethernet
- Inter-VM Shared Memory (ivshmem) EthernetCommunicate with another "cell" in the Jailhouse hypervisor using IVSHMEM Ethernet.
Firmware Samples
- SCMI Platform InteractionInteract with the SCMI platform using various protocols.
FPGA
- FPGA ControllerLoad a bitstream into an FPGA and perform basic operations on it.
General Purpose I/O (GPIO)
- Bouffalolab GPIO FIFO / Wire Out UARTOutput UART using Wire Out
- Button interruptHandle GPIO inputs with interrupts.
Haptics
- CS40L26 Haptic DriverDrive an LRA using the CS40L26/27 haptic driver chip.
- CS40L5x Haptic DriverDrive an LRA using the CS40L5x haptic driver chip.
- DRV2605 Haptic DriverDrive an LRA using the DRV2605 haptic driver chip.
- TM6605 Haptic DriverDrive an LRA using the Titan Micro Electronics TM6605 haptic driver chip.
Inter-Integrated Circuit (I2C) Bus
- I2C Custom TargetSetup a custom I2C target on the I2C interface.
- I2C RTIO loopbackPerform I2C transfers between I2C controller and custom I2C target using RTIO.
- 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
Interrupt controller
- RISC-V AIA SMP UART echoEcho UART input using RISC-V AIA interrupt delivery on an SMP system.
- RISC-V AIA UART echoEcho UART input using RISC-V AIA interrupt delivery through APLIC and IMSIC.
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.
- IS31FL319x RGB LEDCycle colors on an RGB LED connected to the IS31FL3193, IS31FL3194 or IS31FL3197 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.
- LP586x LED matrixControl LED dots on an LP586x LED matrix controller.
- PCA9633 LEDControl 4 LEDs connected to a PCA9633 driver chip.
- SCT2024 LED ControllerControl up to 16 LEDs connected to an SCT2024 chip.
- SX1509B RGB LEDControl an RGB LED connected to an SX1509B driver chip.
Local Interconnect Network (LIN)
- NCV7430 LED Controller over LINSample application for using the NCV7430 LED Controller with Zephyr's LIN API.
- NCV7430 mock LIN responderSample application that mocks the NCV7430 LED Controller as a LIN responder node.
LoRa
- LoRa duty cycleReceive LoRa packets using hardware RX duty cycling (wake-on-radio).
- 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.
- TMC6460 Voltage ModeDrive a BLDC motor in open-loop voltage mode with a Trinamic TMC6460.
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)
- Ambiq MSPI timing scanFind the appropriate timing for a given device on a given board.
- JEDEC MSPI-NOR flashUse the flash API to interact with an MSPI NOR serial flash memory device.
- MSPI asynchronous transferUse the MSPI API to interact with MSPI memory device asynchronously.
- MSPI throughput performance testMeasure MSPI throughput performance with different buffer sizes and packet counts.
OPAMP
- Operational Amplifier (OPAMP) output measure sampleAmplify the input of the OPAMP and sample it using the ADC.
Pulse IO
- pulse_io byte transferTransfer bytes over a pulse_io controller using the codec helpers.
PWM
- PWM CaptureCapture a PWM signal.
- PWM EventEvents on a PWM signal.
SPI
- SPI RTIO loopbackPerform SPI transfers between SPI controller and SPI target using RTIO.
Stepper
- StepperRotate a stepper motor in 4 different modes.
- TMC50XX stepperRotate a TMC50XX stepper motor and change velocity at runtime.
- TMCM-3216 stepperControl a stepper motor using the ADI TMCM-3216 standalone stepper motor controller and driver board over RS485.
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.
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 QueueImplement a basic message queue producer/consumer thread pair.
- Meta-IRQ Thread PriorityImplement a thread running at a Meta-IRQ priority level.
External modules
- 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.
LVGL
- LVGL demosRun LVGL built-in demos.
- LVGL line chart with accelerometer dataDisplay acceleration data on a real-time chart using LVGL.
- LVGL Multi-displayRun different LVGL demos on multiple displays.
- 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(R) Ethos(TM)-U55, U65, and U85 NPUsRun an inference using an optimized TFLite model on Arm Ethos-U NPU.
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.
- DHCPv6 prefix delegationObtain and delegate an IPv6 prefix using DHCPv6 (RFC 8415).
- DNS resolveResolve an IP address for a given hostname.
- FTP client shell sampleFTP client sample interacting with FTP server over Zephyr shell.
- IPv4 autoconf clientPerform IPv4 autoconfiguration and self-assign a random IPv4 address
- Latmon ClientMeasures delta time between GPIO events and reports the latency metrics via latmon to the latmus service executing on the SUT.
- LwM2M clientImplement a LwM2M client that connects to a LwM2M server.
- mDNS responderListen and respond to mDNS queries.
- MIDI2 network transportExchange Universal MIDI Packets over the Network MIDI 2.0 protocol
- 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 packet filterInstall network packet filter hooks.
- Network statisticsQuery and display network statistics from a user application.
- OCPP charge pointImplement an OCPP charge point that connects to a Central System server and simulates the meter readings.
- 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
- RTPSend or receive an RTP audio stream over a UDP multicast.
- Secure MQTT Sensor/ActuatorImplement an MQTT-based IoT sensor/actuator device
- SSH server and clientImplements SSH server and client shell support.
- Telnet consoleAccess Zephyr shell over telnet.
- TFTP clientUse the TFTP client library to get/put files from/to a TFTP server.
- Virtual network interfaceCreate a sample virtual network interface.
- Wireguard VPNImplement a echo-server application that sends received packets back to the sender over Wireguard VPN connection.
- 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.
Network Ethernet
- 10BASE-T1S tests (OA_TC6)Setup tests to examine long term stability of 10BASE-T1S communication
- bridgeTest and debug Ethernet bridge
- DSA (Distributed Switch Architecture)Test and debug Distributed Switch Architecture
- gPTPEnable gPTP support and monitor functionality using net-shell.
- Link Layer Discovery Protocol (LLDP)Enable LLDP support and setup VLANs.
- TSN SwitchTest and debug TSN switch
- Virtual LANSetup two virtual LAN networks and use net-shell to view the networks' settings.
MCP (Model Context Protocol)
- MCP Server Hello WorldThis code sample shows two very basic tool definitions to introduce users to the Zephyr MCP Server library.
OpenThread
- OpenThread BorderRouterTest Wi-Fi and IEEE 802.15.4 using the OpenThread Border Router.
- OpenThread co-processorBuild a Thread border-router using OpenThread's co-processor designs.
- OpenThread CoAP client and server applicationBuild a Full Thread Device (FTD) CoAP server and client.
- OpenThread shellTest Thread and IEEE 802.15.4 using the OpenThread shell.
Quality of Service
- Quality of ServiceImplements a demo of quality of service on the ethernet layer.
QUIC API
- Echo client (QUIC)Implements a simple IPv4/IPv6 echo client using QUIC API and socket service API.
- Echo server (QUIC)Implements a simple IPv4/IPv6 echo server using QUIC API and socket service API.
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.
- CoAP TCP ClientUse the CoAP over TCP client to communicate with a CoAP server.
- CoAP uploadUse the CoAP client API to upload data via a PUT request
- 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.
- SNTP serverServe the current time to SNTP clients on the network.
- SocketCANSend and receive raw CAN frames using BSD sockets API.
- SocketpairImplement communication between threads using socket pairs.
- 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 provisioning over BLEReceive Wi-Fi credentials over a BLE GATT service and connect to the access point.
- Wi-Fi shellTest Wi-Fi functionality using the Wi-Fi shell module.
PSA
- PSA Crypto persistent keyManage and use persistent keys via the PSA Crypto API.
- PSA Internal Trusted Storage APIUse the PSA ITS API.
Regulator
- Regulator Shell SampleInteract with regulators using the shell module.
Sensors
- 6dof device FIFO streamingGet accelerometer/gyroscope/temperature FIFO data frames from a sensor using SENSOR_TRIG_FIFO_WATERMARK as a trigger.
- 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.
- Barometric pressure and temperature sensor interrupt exampleManage interrupts from a barometric pressure and temperature sensor.
- Barometric pressure and temperature sensor polling exampleGet barometric pressure and temperature data from a sensor.
- BME280 humidity and pressure sensorGet temperature, pressure, and humidity data from a BME280 sensor.
- BMG160 3-axis gyroscopeGet temperature, and angular velocity data from a BMG160 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).
- Flow MeterRead flow rate and volume from a Hall-effect pulse-output flow meter.
- FXAS21002 Gyroscope SensorGet gyroscope data synchronously from an FXAS21002 sensor.
- Generic 3-Axis accelerometer pollingGet 3-Axis accelerometer data from a sensor (polling mode).
- Generic 3-Axis accelerometer streamingGet 3-Axis accelerometer data from a sensor (stream mode).
- Generic 6DOF Motion DatareadyGet 6-Axis accelerometer and gyroscope data from a sensor (data ready interrupt mode).
- Generic CO2 polling sampleGet CO2 data from a sensor (polling mode).
- Generic device sample streaming using Data Ready triggerGet accelerometer data frames from a sensor using SENSOR_TRIG_DATA_READY.
- Generic digital humidity temperature sensor pollingGet temperature and humidity data from a DHT sensor (polling mode).
- Generic distance measurementMeasure distance to an object using a distance sensor
- Generic Light Sensor PollingGet illuminance data from a 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.
- Heart Rate SensorGet heart rate data from a sensor (polling/interrupt mode).
- 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.
- Iclegend S3KM1110 mmWave sensorRead standard and custom channels from an Iclegend S3KM1110 mmWave radar 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).
- LPS22HH Temperature and Pressure SensorGet pressure and temperature data from an LPS22HH sensor (polling & trigger mode).
- LPS22HH 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).
- MAX32664C + MAX86141 Sensor Hub
- MAX6675 K-thermocouple to digital converterGet temperature from a MAX6675 K-thermocouple to digital converter (polling mode).
- 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).
- MTCH9010 Liquid Leak Detector TestbenchConfigure an MTCH9010 and receive data from it periodically.
- Multi-unit quadrature decoderRead several quadrature encoders from a single sensor device using the Read-and-Decode API.
- 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).
- PAJ7620 Gesture SensorGet hand gesture data from PAJ7620 sensor.
- Proximity sensorGet proximity data from up to 10 proximity sensors (polling mode).
- Quadrature Decoder SensorGet rotation data from a quadrature decoder sensor.
- Sensor ClockTest and debug Sensor Clock functionality.
- 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).
- SX9500 SAR proximity sensorGet proximity data from an SX9500 SAR proximity sensor.
- TDK Advanced Pedometer and Event Detection (APEX)Get TDK APEX event detection (trigger mode).
- TDK integrated angle sensor with TMR (Tunnel Magneto Resistance)Get angle and temperature data from a TDK TAD2144 sensor using SPI, I2C and Encoder(angle data only).
- 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.
- VEML6031 High Accuracy Ambient Light SensorGet ambient light data from a VEML4040 sensor (polling mode).
- VEML6046 RGBIR Color SensorGet red, green, blue and IR light data from a VEML6046 sensor (polling mode).
- VL53L0X Time Of Flight sensorGet distance data from a VL53L0X sensor (polling mode).
Shields
- nPM13xx EKInteract with an nPM1300 or nPM1304 PMIC using the shell interface and buttons.
- nPM2100 EKInteract with the nPM2100 PMIC using the EK buttons and the shell interface.
- nPM6001 EKInteract with the nPM6001 PMIC using the shell interface.
- RTK0EG0019B01002BJ Capacitive Touch Application ShieldInteract with the Capacitive Touch Sensor and LED matrix on the RTK0EG0019B01002BJ shield
- 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
- X-NUCLEO-IKS4A1 shield - SensorHub (Mode 2)Interact with all the sensors of an X-NUCLEO-IKS4A1 shield using SHUB2 (mode 2).
- X-NUCLEO-IKS4A1 shield - SensorHub (Mode 3)Interact with all the sensors of an X-NUCLEO-IKS4A1 shield using SHUB1 (mode 3).
- X-NUCLEO-IKS4A1 shield - Standard (Mode 1)Interact with all the sensors of an X-NUCLEO-IKS4A1 shield using Standard mode.
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.
- Cyclic Redundancy Check Subsystem (CRC Subsys)Compute and verify a CRC computation using the CRC subsys API.
- Demand pagingLeverage demand paging to deal with code bigger than available RAM.
- EDAC shellTest error detection and correction (EDAC) using shell commands.
- InstrumentationDemonstrate the instrumentation subsystem tracing and profiling features.
- Settings APILoad and save configuration values using the settings API.
- Task watchdogMonitor a thread using a task watchdog.
- UUIDManipulate UUID v4 and v5 compliant with IETF RFC 9562.
Authentication
- FIDO2 AuthenticatorImplement a FIDO2/CTAP2 hardware security key.
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.
CPU Freq
- CPU frequency scaling timing noise sampleShow how randomized P-state selection can disrupt a simple cycle-count password guessing experiment.
- CPU frequency thermal capConstrain CPU frequency from die temperature.
- On-demand CPU frequency scalingDynamically scale CPU frequency using the on-demand policy.
- Pressure based CPU frequency scalingDynamically scale CPU frequency using the pressure policy.
Debug
- Debug MonitorConfigure the Debug Monitor feature on a Cortex-M processor.
- FuzzingIntegrate fuzz testing with Zephyr apps.
- UDP coredump via shellFault from the Zephyr shell; the coredump is mirrored as UART #CD: hex and framed UDP.
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.
- Color Palette DisplayDisplay vertical color bands using indexed color palette.
- Custom fontsGenerate and use a custom font.
- LVGL basic sampleDisplay a "Hello World" and react to user input using LVGL.
File Systems
- EXT2 filesystem fstabDefine ext2 filesystems in the devicetree.
- Fatfs filesystem fstabDefine fatfs filesystems in the devicetree.
- 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.
- virtiofs filesystemUse file system API over virtiofs.
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: RPMSG-Lite backendSend messages between two cores using the IPC service and RPMSG-Lite backend.
- 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.
Key-Value Storage Systems
- Non-Volatile Storage (NVS)Store and retrieve data from flash using the NVS API.
- Zephyr Memory Storage (ZMS)Store and retrieve data from storage using the ZMS API.
- ZMS Cycle Count VerificationVerify that ZMS sector cycle counters are tracked correctly across garbage collection cycles, including past the uint8_t wraparound boundary.
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
- Bluetooth logging backendSend log messages over Bluetooth using the Bluetooth logging backend.
- Dictionary-based loggingOutput binary log data using the dictionary-based logging API.
- LoggingOutput log messages to the console using the logging subsystem.
- Logging in multi-domain environmentUse the multidomain logging feature to aggregate log messages from multiple cores into a single console output via the IPC service.
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.
Power Management
- Device Idle Power ManagementUse device runtime power management with a parent-child device hierarchy.
- PM policy latencyConstrain allowed power states using maximum tolerable exit latency
PMCI
MCTP
- MCTP Endpoint SampleCreate an MCTP endpoint over UART.
- MCTP Host SampleCreate an MCTP host over UART.
- MCTP I2C GPIO Endpoint Node SampleCreate an MCTP endpoint node controlling I2C with GPIO signaling.
- MCTP I2C GPIO Top Node SampleCreate an MCTP top node controlling I2C with GPIO signaling.
- MCTP I3C Endpoint Node SampleCreate an MCTP endpoint node over I3C.
- MCTP I3C Top Node SampleCreate an MCTP top node controlling I3C.
- MCTP USB Endpoint Node SampleCreate an MCTP endpoint node using the USB device interface.
Portability
CMSIS RTOS v1
- Dining Philosophers (CMSIS RTOS V1 APIs)Implement a solution to the Dining Philosophers problem using CMSIS RTOS V1.
- Synchronization using CMSIS RTOS V1 APIsUse timers and message queues from CMSIS RTOS v1 API to synchronize threads.
CMSIS RTOS v2
- Dining Philosophers (CMSIS RTOS V2 APIs)Implement a solution to the Dining Philosophers problem using CMSIS RTOS V2.
- Synchronization using CMSIS RTOS V2 APIsUse timers and message queues from CMSIS RTOS v2 API to synchronize threads.
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.
Profiling
- Perf toolSend perf samples to the host with console support
Real Time I/O (RTIO)
- Producer ConsumerImplement a producer->consumer pipe using RTIO.
- Sensor batch processingImplement a sensor device using RTIO for asynchronous data processing.
Sensing
- Sensing subsystemGet high-level sensor data in defined intervals.
Shell
- Custom Shell moduleRegister shell commands using the Shell API
- devmem load shellLoad data to device memory using devmem shell cmd.
- 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.
- zephyr benchmark sampleShowcases how to use Zephyr Benchmarking subsystem to measure performance of code sections.
Tracing
- TracingGenerate kernel and application trace events and stream them to a host with any of the supported tracing formats and backends.
- Tracing a sensor pipelineTrace a realistic multi-threaded sensor pipeline and use the trace to understand how the RTOS schedules it - and to spot a priority inversion.
USB
- Console over USB CDC ACMOutput "Hello World!" to the console over USB CDC ACM.
- I2C-Tiny-USB bridgeExpose a Zephyr I2C controller to a host as a USB to I2C adapter.
- 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 CDC ACM UART sampleUse USB CDC ACM UART driver to implement a serial port echo.
- USB CDC-ACM bridgeUse USB CDC-ACM driver to implement a serial port bridge.
- USB device testing applicationTest USB device drivers using a loopback function.
- USB DFUImplement a basic USB DFU device
- USB HID keyboardImplement a basic HID keyboard device.
- USB HID mouseImplement a basic HID mouse device.
- USB Host UVC CameraCapture video from a USB camera.
- USB Mass StorageExpose board's RAM or FLASH as a USB disk using USB Mass Storage driver.
- USB MIDI2 deviceImplements a simple USB MIDI loopback and keyboard device.
- USB shellUse shell commands to interact with USB device stack.
- USB Video webcamSend video frames over USB.
- WebUSBReceive and echo data from a web page using WebUSB API.
Legacy USB device support
- Legacy console over USB CDC ACMOutput "Hello World!" to the console over USB CDC ACM.
- Legacy HCI USBTurn a Zephyr board into a USB Bluetooth dongle (compatible with all operating systems).
- Legacy USB Audio headsetImplement a USB Audio headset device with audio IN/OUT loopback.
- Legacy USB Audio microphone & headphonesImplement a USB Audio microphone + headphones device with audio IN/OUT loopback.
- Legacy USB CDC ACM UART sampleUse USB CDC ACM UART driver to implement a serial port echo.
- Legacy USB device netusb sampleUse USB CDC EEM/ECM or RNDIS implementation
- Legacy USB DFU (Device Firmware Upgrade)Implement device firmware upgrade using the USB DFU class driver.
- Legacy USB HID mouseImplement a basic HID mouse device.
- Legacy USB Mass StorageExpose board's RAM as a USB disk using USB Mass Storage driver.
- Legacy WebUSBReceive and echo data from a web page using WebUSB API.
USB-C device support
- Basic USB-C DRPImplement a USB-C Power Delivery application in the form of a USB-C DRP (Dual Role Power).
- 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.
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.
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 Async ListenersDemonstrate the usage of zbus async listeners.
- zbus Hello WorldMake three threads talk to each other using zbus.
- zbus Priority BoostIllustrates zbus priority boost feature with a priority inversion scenario.
- zbus Proxy agent - IPCForward zbus messages between different domains using IPC proxy agents.
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 Firmware UpdatePerform a firmware update using the PSA Firmware Update API.
- 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.