本文へ移動
cccskills
無料GitHub で公開

zephyr-foundations

Foundational skills for Zephyr RTOS development. Covers essential Embedded C patterns (BIT, CONTAINER_OF), real-time concurrency primitives (mutexes, semaphores, spinlocks), hardware literacy (datasheet-to-DTS mapping), and defensive programming. Trigger when writing core application logic, drivers, or troubleshooting foundational behavior.

インストール方法を見る

含まれるファイル(8)

  • SKILL.md2.8 KB
  • assets/foundation_examples/template_driver.c2.2 KB
  • references/concurrency.md1.4 KB
  • references/devicetree_basics.md1.2 KB
  • references/error_handling.md1.2 KB
  • references/zephyr_macros.md1.4 KB
  • scripts/errno_return_check.py1.7 KB
  • skill-meta.yaml517 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Zephyr Foundations

Mastering the bedrock of Zephyr is essential for writing efficient, robust, and idiomatic code.

Core Workflows

1. Idiomatic C Patterns

Zephyr uses specific macros to manage memory and hardware-software mapping.

  • Reference: zephyr_macros.md
  • Key Tools: CONTAINER_OF, BIT(), GENMASK(), ARRAY_SIZE.

2. Real-Time Concurrency

Safe multi-threading and interrupt handling are critical for stability.

  • Reference: concurrency.md
  • Key Tools: k_mutex, k_sem, k_spinlock, atomic_t, ISR safety rules.

3. Hardware Literacy (Devicetree)

Understanding how code interacts with the hardware description.

  • Reference: devicetree_basics.md
  • Key Tools: Nodes, properties, phandles, overlays, and advanced deletion.

4. Robust Error Handling

Preventing crashes through defensive programming.

  • Reference: error_handling.md
  • Key Tools: errno.h, BUILD_ASSERT, validation patterns, return code checking.

Quick Start (Defensive Pattern)

int sensor_read_checked(const struct device *dev)
{
  if (dev == NULL || !device_is_ready(dev)) {
    return -ENODEV;
  }

  return 0;
}

Validation Checklist

  • Shared bit-field logic uses Zephyr macros (BIT, GENMASK) instead of raw literals.
  • Thread-shared state is protected with mutex/spinlock/atomic primitives.
  • Error paths return standard negative errno codes.
  • Defensive guards exist for null pointers, bounds, and device readiness checks.

Automation Tools

Examples & Templates

  • template_driver.c: A complete skeleton showing how to combine DT macros, mutexes, and config-data separation.

Resources

  • References:
    • zephyr_macros.md: Essential macros (BIT, CONTAINER_OF, etc.).
    • concurrency.md: Mutexes, Semaphores, Spinlocks, and ISR safety.
    • devicetree_basics.md: Devicetree syntax and overlay patterns.
    • error_handling.md: Error codes and defensive programming.
  • Scripts:
    • errno_return_check.py: Return-code sign checker.
  • Assets:
    • foundation_examples/: Working code templates for drivers and logic.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

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.

日本語の概要は準備中です。原文の説明を表示しています。

beriberikix/zephyr-agent-skills692026年5月19日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

beriberikix/zephyr-agent-skills692026年5月19日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

beriberikix/zephyr-agent-skills692026年5月19日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

beriberikix/zephyr-agent-skills692026年5月19日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

beriberikix/zephyr-agent-skills692026年5月19日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

beriberikix/zephyr-agent-skills692026年5月19日 更新

beriberikix のスキルをすべて見る

このスキルの問題を報告する