AgentSkillsCN

zephyr-module

创建并集成树外 Zephyr 模块。涵盖 module.yml 配置、模块内的 Kconfig 与 CMake 集成,以及 West 清单的引入。在开发可复用的库、驱动程序包,或为 Zephyr 构建外部软件组件时,可触发此流程。

SKILL.md
--- frontmatter
name: zephyr-module
description: Creating and integrating out-of-tree Zephyr modules. Covers module.yml configuration, Kconfig and CMake integration within a module, and West manifest inclusion. Trigger when developing reusable libraries, driver packages, or external software components for Zephyr.

Zephyr Modules

Extend the Zephyr RTOS with reusable, out-of-tree modules that integrate seamlessly with the build system.

Core Workflows

1. Defining a Module

Create the directory structure and metadata required for auto-discovery.

  • Reference: module_definition.md
  • Key Tools: zephyr/module.yml, zephyr/Kconfig, zephyr/CMakeLists.txt.

2. West Manifest Integration

Adding your module to a workspace for distribution and versioning.

  • Reference: west_integration.md
  • Key Tools: west.yml, west update, west build -t list_modules.

3. Library Wrapping (Glue Code)

Wrapping external C/C++ libraries as Zephyr modules.

Quick Start (module.yml)

yaml
build:
  cmake: .
  kconfig: zephyr/Kconfig

Resources

  • References:
    • module_definition.md: Structure and module.yml specification.
    • west_integration.md: Manifest configuration and discovery tools.