Skip to content
cccskills
FreePublished on GitHub

kernel-services

Advanced Zephyr RTOS kernel services. Covers inter-thread communication using Zbus (pub/sub), behavioral management with the State Machine Framework (SMF), background processing via work queues, and persistent configuration with the Settings subsystem. Trigger when building modular application architectures, complex state-driven logic, or requiring persistent data storage.

The English summary is being prepared. Showing the original description.

See how to install

Files included (7)

  • SKILL.md3.4 KB
  • assets/smf_state_table_template.c1.4 KB
  • references/settings_workqueue.md2.0 KB
  • references/smf.md2.2 KB
  • references/zbus.md2.6 KB
  • scripts/zbus_channel_lint.py2.1 KB
  • skill-meta.yaml522 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

Zephyr Kernel Services

Move beyond basic threading and logging to build modular, event-driven, and robust Zephyr applications.

Core Workflows

1. Event-Driven Communication (Zbus)

Decouple your modules using a lightweight publish-and-subscribe bus.

  • Reference: zbus.md
  • Key Tools: ZBUS_CHAN_DEFINE, ZBUS_SUBSCRIBER_DEFINE, zbus_chan_pub.

2. Behavioral Logic (SMF)

Manage complex system states and transitions using the State Machine Framework.

  • Reference: smf.md
  • Key Tools: smf_set_state, SMF_CREATE_STATE, Hierarchical states.

3. Background Processing (Work Queues)

Defer long-running or non-critical tasks to prevent blocking interrupts or high-priority threads.

4. Persistence (Settings)

Save and restore configuration data and state across reboots.

Quick Start (Zbus)

// Define a channel for sensor data
ZBUS_CHAN_DEFINE(sensor_data_chan, struct sensor_msg, NULL, NULL, ZBUS_OBSERVERS_EMPTY, ZBUS_CHAN_DEFAULTS);

// Publish from a thread
zbus_chan_pub(&sensor_data_chan, &msg, K_NO_WAIT);

Professional Patterns (Asset Tracker Style)

  • Modularity: Use Zbus as the backbone for inter-module communication.
  • Predictability: Use SMF to define clear lifecycle states for each module (e.g., Uninitialized -> Ready -> Active -> Error).
  • Responsiveness: Use custom work queues for sensor data ingestion to keep the main thread responsive for cloud communication.
  • Sensor Integration: For sensor data ingestion patterns, see the hardware-io skill.

Automation Tools

Examples & Templates

Validation Checklist

  • Zbus publishers and subscribers exchange messages without deadlock or missed updates.
  • SMF transitions follow expected state graph under normal and error conditions.
  • Deferred work executes on intended queue context with bounded execution time.
  • Settings values persist across reboot and reload successfully at startup.

Resources

  • References:
    • zbus.md: Publish/Subscribe patterns and subscriber types.
    • smf.md: Finite and Hierarchical state machine implementation.
    • settings_workqueue.md: Background work and persistent storage.
  • Scripts:
    • zbus_channel_lint.py: Zbus channel name collision checker.
  • Assets:
    • smf_state_table_template.c: State-machine template.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Custom board bringup for Zephyr RTOS using Hardware Model v2 (HWMv2). Covers directory structure, board.yml metadata, core configuration files (Kconfig, defconfig, CMake), and revision management. Trigger when creating new board definitions or porting Zephyr to custom hardware.

The English summary is being prepared. Showing the original description.

beriberikix/zephyr-agent-skills70Updated May 19, 2026

Build system management for Zephyr RTOS. Covers West workspace initialization, manifest management, Sysbuild multi-image builds, Kconfig symbols, and CMake integration. Trigger when setting up workspaces, configuring builds, or troubleshooting build-time errors.

The English summary is being prepared. Showing the original description.

beriberikix/zephyr-agent-skills70Updated May 19, 2026

Bluetooth Low Energy (BLE) integration for Zephyr RTOS. Covers GATT Services/Characteristics, GAP advertising, connection parameters, power optimization strategies, and the professional Send-When-Idle design pattern. Trigger when adding BLE connectivity, optimizing battery life for wireless devices, or implementing custom GATT profiles.

The English summary is being prepared. Showing the original description.

beriberikix/zephyr-agent-skills70Updated May 19, 2026

IP networking fundamentals for Zephyr RTOS. Covers IoT protocol selection (LwM2M, CoAP, MQTT), IP stack configuration and trimming (IPv4/IPv6, UDP/TCP), and professional SDK integration as Zephyr modules using West manifests. Trigger when building cloud-connected applications, optimizing network memory usage, or integrating external cloud SDKs.

The English summary is being prepared. Showing the original description.

beriberikix/zephyr-agent-skills70Updated May 19, 2026

USB and CAN connectivity for Zephyr RTOS. Covers USB device stack configuration (CDC ACM, HID, MSC), CAN controller integration, and professional USB-to-CAN adapter patterns including buffering and protocol packetization. Trigger when adding USB interfaces, implementing CAN bus communication, or building hardware diagnostic tools.

The English summary is being prepared. Showing the original description.

beriberikix/zephyr-agent-skills70Updated May 19, 2026

Devicetree management for Zephyr RTOS. Covers syntax, bindings, overlays, Hardware Model v2 (HWMv2), and advanced node/property deletion patterns. Trigger when defining hardware topology, creating overlays, or mapping pins and peripherals.

The English summary is being prepared. Showing the original description.

beriberikix/zephyr-agent-skills70Updated May 19, 2026

See all skills by beriberikix

Report a problem with this skill