
rtos-debug
当需要进行 FreeRTOS/RT-Thread/Zephyr 的线程感知调试,查看任务列表、栈水位或死锁检测时使用。
- Installs
- 558
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/leokemp223/embed-ai-tool --skill rtos-debug- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads rtos-debug automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
RTOS 调试
适用场景
- 固件运行了 RTOS(FreeRTOS、RT-Thread 或 Zephyr),需要查看任务状态。
- 怀疑任务栈溢出导致 HardFault 或异常行为。
- 需要检测死锁(所有任务都处于等待状态)。
- 需要查看队列、信号量等内核对象状态。
- 需要自动识别固件使用的 RTOS 类型。
必要输入
- 带符号的
ELF文件路径。 - 已运行的 GDB Server(OpenOCD 或 JLinkGDBServer),通过
--port指定 GDB 端口。 - 可选显式指定 RTOS 类型(
--rtos freertos|rt-thread|zephyr)。
自动探测
- 通过 ELF 符号表自动判断 RTOS 类型:
vTaskStartScheduler→ FreeRTOS,rt_thread_init→ RT-Thread,k_thread_create→ Zephyr。 - 不依赖 OpenOCD 的 RTOS awareness 功能,改用 GDB 直接读取 RTOS 内核数据结构。
- FreeRTOS 提供完整支持(任务列表、栈水位、队列),RT-Thread/Zephyr 提供基本任务列表支持。
执行步骤
- 先阅读 references/usage.md 和 references/rtos-patterns.md,了解常见 RTOS 问题模式。
- 确保 GDB Server(OpenOCD 或 JLinkGDBServer)已在运行。
- 若不确定 RTOS 类型,先运行 scripts/rtos_debugger.py 的
--detect模式。 - 使用
--tasks查看任务列表和状态。 - 使用
--stack-check检查各任务栈水位。 - 使用
--deadlock检查死锁特征。 - 使用
--queues查看队列和信号量状态。
失败分流
- 当缺少 GDB 时,返回
environment-missing。 - 当没有可用的
ELF时,返回artifact-missing。 - 当 GDB 无法连接到 GDB Server 时,返回
connection-failure。 - 当 ELF 中未检测到 RTOS 符号时,返回
project-config-error。 - 当 GDB 可以连接但无法读取 RTOS 数据结构时,返回
target-response-abnormal。 - 当无法确定 RTOS 类型时,返回
ambiguous-context。
平台说明
- 自带脚本使用 Python 标准库和 subprocess 调用 GDB,跨平台兼容。
- GDB Server 需要由用户或上游 skill(
debug-gdb-openocd或debug-jlink)预先启动。 - RTOS 数据结构读取依赖 ELF 符号信息,Release 优化可能导致部分符号被优化掉。
输出约定
- 输出检测到的 RTOS 类型和版本(如果可获取)。
- 输出任务列表,包含任务名、状态、优先级和栈使用信息。
- 栈水位低于安全阈值时输出告警。
- 死锁检测结果以明确的是/否形式输出。
- 在
Project Profile中更新rtos字段。
交接关系
- 当确认栈溢出时,建议使用
memory-analysis分析固件内存布局。 - 当需要更深入的单步调试时,交给
debug-gdb-openocd或debug-jlink。
FAQ
What does the rtos-debug skill do?
当需要进行 FreeRTOS/RT-Thread/Zephyr 的线程感知调试,查看任务列表、栈水位或死锁检测时使用。
How do I install rtos-debug?
Run npx skills add https://github.com/leokemp223/embed-ai-tool --skill rtos-debug in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/rtos-debug/ (personal) or .claude/skills/rtos-debug/ (project).
Which AI agents can use rtos-debug?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is rtos-debug safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains rtos-debug?
It is published by leokemp223 in leokemp223/embed-ai-tool. It has 558 recorded installs.
More from leokemp223/embed-ai-tool
build-keil
leokemp223/embed-ai-tool
当需要通过 Keil MDK 命令行编译嵌入式工程,调用自带脚本解析工程文件、执行构建并定位固件产物时使用。
build-platformio
leokemp223/embed-ai-tool
当需要通过 PlatformIO 命令行编译嵌入式工程,调用自带脚本解析环境配置、执行构建并定位固件产物时使用。
workflow
leokemp223/embed-ai-tool
当需要串联多个 skill 完成编译+烧录+监控或编译+烧录+调试等流水线任务时使用。
flash-keil
leokemp223/embed-ai-tool
当需要通过 Keil MDK 内置调试器烧录固件到目标板时使用,利用工程中已配置的调试器和 Flash 算法执行下载。
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.