‹ 首页

multicore

@beriberikix · 收录于 昨天 · 上游提交 2 个月前

Developing for multicore systems in Zephyr RTOS. Covers Symmetric Multiprocessing (SMP), Asymmetric Multiprocessing (AMP) with OpenAMP/RPMsg, inter-processor communication (IPC) patterns, and Linkable Extensions (LLEXT). Trigger when designing for SoCs with multiple homogeneous or heterogeneous cores.

适合你,如果正在使用Zephyr RTOS开发多核嵌入式设备

/ 通过 npx 安装 校验哈希
npx oh-my-skill add beriberikix/zephyr-agent-skills/multicore
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- beriberikix/zephyr-agent-skills/multicore
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify beriberikix/zephyr-agent-skills/multicore
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
58GitHub stars
~707最小装载
~3.4K含声明引用
~3.5K文本包总量
索引托管

怎么用

商店整理自技能原文 · 版本 ed63cdf · 表述以原文为准
它做什么

安装后,Claude 能帮助你配置 Zephyr RTOS 的多核系统,包括对称多处理(SMP)、非对称多处理(AMP)、核间通信(IPC)和动态加载模块(LLEXT),并验证配置正确性。

什么时候触发

当你设计包含多个同质或异构 CPU 核心的 SoC 的 Zephyr 项目时触发。

装好后可以这样说
Claude 会生成相关 Kconfig 和代码示例。
Claude 会提供配置和代码框架。
Claude 会指导模块创建和加载过程。
技能原文 SKILL.md作者撰写 · Apache-2.0 · ed63cdf

Zephyr Multicore Development

Leverage multiple CPU cores to increase performance, isolate critical tasks, and integrate heterogeneous systems.

Core Workflows
1. SMP Configuration

Run the Zephyr kernel and your threads across multiple identical cores.

  • Reference: [smp_configuration.md](references/smp_configuration.md)
  • Key Tools: CONFIG_SMP, k_spinlock, Thread Affinity.
2. OpenAMP & RPMsg

Communicate between heterogeneous cores (e.g., A-series and M-series) using standard protocols.

  • Reference: [openamp_rpmsg.md](references/openamp_rpmsg.md)
  • Key Tools: CONFIG_OPENAMP, message vrings, Resource Tables.
3. IPC Patterns

Implement efficient data exchange between cores using high-level services or low-level mailboxes.

  • Reference: [ipc_patterns.md](references/ipc_patterns.md)
  • Key Tools: IPC Service, IPM drivers, Shared Memory.
4. LLEXT (Linkable Extensions)

Dynamically load and run binary modules at runtime without a full firmware update.

  • Reference: [llext_basics.md](references/llext_basics.md)
  • Key Tools: CONFIG_LLEXT, dynamic ELF loading, Symbol Export.
5. Multi-domain SoCs (nRF5340)

Build separate application-core and network-core images in one Sysbuild invocation.

  • Reference: [multidomain_sysbuild.md](references/multidomain_sysbuild.md)
  • Key Tools: west build --sysbuild, CONFIG_NRF53_BOOT_NETWORK_CORE_ON_STARTUP, domains.
Quick Start (SMP prj.conf)
# Enable SMP for dual-core SoCs
CONFIG_SMP=y
CONFIG_MP_NUM_CPUS=2
// Using spinlocks for cross-core sync
struct k_spinlock lock;
k_spinlock_key_t key = k_spin_lock(&lock);
// ... critical section ...
k_spin_unlock(&lock, key);
Professional Patterns (Architecture Design)
  • Linux Bridging: Use OpenAMP/RPMsg to bridge Zephyr real-time logic with a Linux application controller.
  • Core Isolation: Pin high-frequency interrupts (e.g., motor control) to Core 1 and keep the main application on Core 0 to prevent jitter.
  • Zero-Copy Transfers: Use shared memory regions for large data (video/audio) and only pass meta-data via IPC channels to minimize overhead.
Automation Tools
  • [smp_config_check.py](scripts/smp_config_check.py): Validate SMP-related Kconfig consistency in prj.conf.
Examples & Templates
  • [rpmsg_channel_contract.md](assets/rpmsg_channel_contract.md): Starter channel contract for RPMsg endpoint design.
Validation Checklist
  • [ ] SMP builds run with expected CPU count and no cross-core race regressions.
  • [ ] OpenAMP/RPMsg endpoint exchange passes bidirectional message tests.
  • [ ] IPC latency and throughput remain within target budget under load.
  • [ ] LLEXT module load/unload path resolves symbols and handles failure cases safely.
  • [ ] Multi-domain Sysbuild builds both core images and west flash programs each domain.
Resources
  • [References](references/):
  • smp_configuration.md: Configuration and spinlocks.
  • openamp_rpmsg.md: AMP and Linux interoperability.
  • ipc_patterns.md: Mailboxes and high-level IPC services.
  • llext_basics.md: Dynamic code loading.
  • [Scripts](scripts/):
  • smp_config_check.py: SMP config consistency checker.
  • [Assets](assets/):
  • rpmsg_channel_contract.md: RPMsg interface contract template.
按 Apache-2.0 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。