Agent skill · Audited from source
openocd
skill · zhinkgit/embeddedskillsMIT licenceAudited 26 Oct 2026 · source 674ae8bca880
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit 674ae8bca880 and observed network access and no hard-coded secrets. What it does: OpenOCD 下载与调试工具,用于探针探测、固件烧录、Flash 擦除、GDB Server 启动、目标复位控制、 Telnet 在线调试(halt/resume/step/寄存器/内存/断点)、GDB 源码级调试,以及 Semihosting/ITM 输出捕获和底层查询。 当用户提到 OpenOCD、ST-Link、CMSIS-DAP、DAPLink、FTDI、烧录固件、擦除 Flash、GDB Server、…
Cite
Cite this page
ModelsAtlas. “openocd (zhinkgit/embeddedskills)”. Retrieved 26 Oct 2026. https://modelsatlas.com/skills/zhinkgit/openocd
Trust audit
Audit 0.4.1 · source read 26 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 13,985 of 14,816 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkDeclared1 observation
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | PASS | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (0)
No findings at any severity. We re-audit when the source changes.
Audit 0.4.1 · source sha 674ae8bca880 · 26 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherzhinkgit GitHub userOwner of the repository this skill is read from
- Source folderzhinkgit/embeddedskills/openocdThe exact folder we audited
- LicenceMITAs the repository states it
- Commit pinned for this verdict674ae8bca880A new audit runs when the source changes
- Repository statusNot archivedLast push 6 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: OpenOCD 下载与调试工具,用于探针探测、固件烧录、Flash 擦除、GDB Server 启动、目标复位控制、 Telnet 在线调试(halt/resume/step/寄存器/内存/断点)、GDB 源码级调试,以及 Semihosting/ITM 输出捕获和底层查询。 当用户提到 OpenOCD、ST-Link、CMSIS-DAP、DAPLink、FTDI、烧录固件、擦除 Flash、GDB Server、…
---
name: openocd
description: >-
OpenOCD 下载与调试工具,用于探针探测、固件烧录、Flash 擦除、GDB Server 启动、目标复位控制、
Telnet 在线调试(halt/resume/step/寄存器/内存/断点)、GDB 源码级调试,以及 Semihosting/ITM 输出捕获和底层查询。
当用户提到 OpenOCD、ST-Link、CMSIS-DAP、DAPLink、FTDI、烧录固件、擦除 Flash、GDB Server、
reset、interface/target/board 配置、openocd.cfg、在线调试、单步、断点、寄存器查看、
内存读写、semihosting 时自动触发,也兼容 /openocd 显式调用。
即使用户只是说"烧录一下"、"启动 GDB Server"、"擦除芯片"、"看看寄存器"、"单步调试"
或"抓一下 semihosting",只要上下文涉及 OpenOCD 支持的开源调试器就应触发此 skill。
argument-hint: "[probe|flash|erase|reset|reset-init|targets|flash-banks|adapter-info|raw|gdb-server|gdb|halt|resume|step|reg|read-mem|write-mem|bp|rbp|run-to|semihosting|itm] ..."
---
# OpenOCD 下载与调试
本 skill 提供 OpenOCD 的探针探测、固件烧录、Flash 擦除、GDB Server 启动、目标复位、
Telnet 在线调试、GDB 源码级调试和 Semihosting 输出捕获能力。
## 配置
### 环境级配置(skill/config.json)
skill 目录下的 `config.json` 包含环境级配置(工具路径、端口号等),首次使用前确认 `exe` 路径正确:
```json
{
"exe": "openocd",
"scripts_dir": "",
"gdb_port": 3333,
"telnet_port": 4444,
"gdb_exe": "",
"operation_mode": 1
}
```
- `exe`:openocd.exe 路径或命令名(必填)
- `scripts_dir`:OpenOCD 配置脚本目录,为空时使用 OpenOCD 内置路径
- `gdb_port`:GDB Server 端口,默认 3333
- `telnet_port`:Telnet 端口,默认 4444
- `gdb_exe`:arm-none-eabi-gdb 路径,GDB 调试子命令(run/backtrace/locals)需要
- `operation_mode`:`1` 直接执行 / `2` 输出风险摘要但不阻塞 / `3` 执行前确认
### 工程级配置(.embeddedskills/config.json)
board/interface/target 等工程参数统一在工作区的 `.embeddedskills/config.json` 中管理:
```json
{
"openocd": {
"board": "",
"interface": "interface/stlink.cfg",
"target": "target/stm32f4x.cfg",
"adapter_speed": "4000",
"transport": "swd",
"tpiu_name": "stm32f4x.tpiu",
"traceclk": "168000000",
"pin_freq": "2000000"
}
}
```
- `board`:board 配置(如 `board/stm32f4discovery.cfg`),优先级高于 interface+target
- `interface`:interface 配置(如 `interface/stlink.cfg`)
- `target`:target 配置(如 `target/stm32f4x.cfg`)
- `adapter_speed`:调试速率 kHz
- `transport`:传输协议(swd/jtag)
- `tpiu_name` / `traceclk` / `pin_freq`:ITM/SWO 观测所需的 TPIU 参数
参数解析优先级:**CLI 显式参数 > `.embeddedskills/config.json`(工程级)> `skill/config.json`(环境级)> `.embeddedskills/state.json` > 默认值/报错**
成功执行后,确认过的参数会自动写回工程配置。
## 子命令
### 基础操作
| 子命令 | 用途 | 风险 |
|--------|------|------|
| `probe` | 验证 board 或 interface+target 组合,探测目标连通性 | 低 |
| `flash` | 烧录固件(.elf / .hex / .bin) | 高 |
| `erase` | 擦除目标 Flash | 高 |
| `reset` / `reset-init` | 复位目标芯片 | 高 |
| `targets` / `flash-banks` / `adapter-info` | 查询底层 target / flash / adapter 信息 | 低 |
| `raw` | 执行受控 OpenOCD 原生命令 | 高 |
### GDB Server
| 子命令 | 用途 | 风险 |
|--------|------|------|
| `gdb-server` | 启动 GDB Server,保持运行等待 GDB 连接 | 低 |
| `gdb backtrace/locals` | 快捷获取调用栈和局部变量 | 低 |
| `gdb break/continue/next/step/finish/until` | one-shot 执行流控制 | 低 |
| `gdb frame/print/watch/disassemble/threads/crash-report` | one-shot 源码级诊断 | 低 |
### Telnet 在线调试
| 子命令 | 用途 | 风险 |
|--------|------|------|
| `halt` | 暂停 CPU,返回 PC/xPSR | 低 |
| `resume` | 恢复 CPU 运行 | 低 |
| `step` | 单步执行(支持 `--count N`) | 低 |
| `reg` | 查看所有 CPU 寄存器 | 低 |
| `read-mem` | 读内存(`--width 8/16/32`,`--length N`) | 低 |
| `write-mem` | 写内存(`--width 8/16/32`) | 高 |
| `bp` | 设置硬件断点 | 低 |
| `rbp` | 移除断点 | 低 |
| `run-to` | 运行到指定地址(设置断点 + resume + 等待命中) | 低 |
### Semihosting
| 子命令 | 用途 | 风险 |
|--------|------|------|
| `semihosting` | 启用 ARM Semihosting 并捕获目标 printf 输出 | 低 |
| `itm` | 基于 TPIU/ITM 读取 SWO/ITM 观测数据 | 低 |
## 执行流程
1. 读取 `skill/config.json`,确认 `exe` 路径有效
2. 读取 `.embeddedskills/config.json` 获取工程级配置(board/interface/target 等)
3. 读取 `.embeddedskills/state.json` 获取历史状态
4. 参数解析优先级:**CLI 显式参数 > `.embeddedskills/config.json`(工程级)> `skill/config.json`(环境级)> `.embeddedskills/state.json` > 默认值/报错**
5. 已知 `board` 时优先使用 `-f board/*.cfg`,否则组合 `-f interface/*.cfg -f target/*.cfg`
6. `board`、`interface`、`target` 同时缺失时,不自动拼接组合,直接要求用户补充
7. 按 `operation_mode` 决定是否需要确认后执行
8. 根据子命令调用对应脚本
9. 统一解析输出中的 `Info`、`Error` 和就绪日志,返回结构化结果
10. 成功执行后,将确认过的参数写回 `.embeddedskills/config.json`
## 脚本调用
skill 目录下有五个 Python 脚本,使用标准库实现,无额外依赖。
### openocd_run.py — 探测 / 烧录 / 擦除 / 复位
```bash
# 探测连通性(使用 board)
python <skill-dir>/scripts/openocd_run.py probe --board board/stm32f4discovery.cfg --json
# 探测连通性(使用 interface + target)
python <skill-dir>/scripts/openocd_run.py probe --interface interface/stlink.cfg --target target/stm32f4x.cfg --json
# 烧录 ELF 固件
python <skill-dir>/scripts/openocd_run.py flash --file build/app.elf --interface interface/stlink.cfg --target target/stm32f4x.cfg --json
# 烧录 BIN 固件(必须提供地址)
python <skill-dir>/scripts/openocd_run.py flash --file build/app.bin --address 0x08000000 --interface interface/stlink.cfg --target target/stm32f4x.cfg --json
# 擦除 Flash(自动选择 mass/sector)
python <skill-dir>/scripts/openocd_run.py erase --mode auto --interface interface/stlink.cfg --target target/stm32f4x.cfg --json
# 复位目标
python <skill-dir>/scripts/openocd_run.py reset --mode halt --interface interface/stlink.cfg --target target/stm32f4x.cfg --json
# 查询 target 列表
python <skill-dir>/scripts/openocd_run.py targets --interface interface/stlink.cfg --target target/stm32f4x.cfg --json
# 查询 flash bank
python <skill-dir>/scripts/openocd_run.py flash-banks --interface interface/stlink.cfg --target target/stm32f4x.cfg --json
# 执行受控 raw 命令
python <skill-dir>/scripts/openocd_run.py raw --interface interface/stlink.cfg --target target/stm32f4x.cfg --command "init" "targets" --json
```
通用可选参数:`--board <cfg>`、`--search <目录>`、`--adapter-speed <kHz>`、`--transport <swd|jtag>`、`--exe <openocd路径>`
### openocd_gdb.py — GDB Server 启动与调试
```bash
# 启动 GDB Server(保持运行)
python <skill-dir>/scripts/openocd_gdb.py server --interface interface/stlink.cfg --target target/stm32f4x.cfg --json
# 无子命令时默认 server(向后兼容)
python <skill-dir>/scripts/openocd_gdb.py --interface interface/stlink.cfg --target target/stm32f4x.cfg --json
# 执行自定义 GDB 命令序列
python <skill-dir>/scripts/openocd_gdb.py run --gdb-exe arm-none-eabi-gdb --elf build/app.elf --interface interface/stlink.cfg --target target/stm32f4x.cfg --commands "break main" "continue" "backtrace" "info locals" --json
# 快捷获取调用栈
python <skiExcerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 674ae8b
git clone https://github.com/zhinkgit/embeddedskills git -C embeddedskills checkout 674ae8bca880
The author documents no install command, so this uses the repository directly. Our verdict covers commit 674ae8bca880 only.
Works in which agents?
What its own text says, not a test
| Agent | Status | More |
|---|---|---|
| Claude Code | Mentioned in its text, not tested | Skills for Claude Code · About Claude Code |
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
674ae8bca880
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/zhinkgit/openocd/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All automation skills →zhinkgit/embeddedskills
embeddedskills 的薄编排层,用于在当前 workspace 中发现工程、选择 build/flash/debug/observe 后端、串联 .embeddedskills/state.json,并聚合底层 skill 的结果。 当用户明确输入以下命令之一:"一键构建烧录"、"自动诊断"、"串起 build -> flash -> debug -> observe" 或显式调用 /workflow 时触发。
zhinkgit/embeddedskills
嵌入式串口调试工具,用于扫描串口、实时监控、发送数据、记录日志和 Hex 查看。 当用户提到串口、COM 口、UART、AT 命令调试、波特率、Hex 串流、串口抓日志、 串口监控、查看 MCU 输出、二进制协议联调时自动触发,也兼容 /serial 显式调用。 即使用户只是说"看看串口输出"、"发个 AT 命令"或"抓一下日志",只要上下文涉及 串口通信就应触发此 skill。
zhinkgit/embeddedskills
SSH/服务器操作助手。用于远程服务器、user@host、SSH 配置、上传下载、部署、跳板机、隧道、端口转发、服务器命令执行等任务;以 ~/.ssh/config 的 Host 别名为唯一服务器清单,优先密钥认证,通过本 skill 的 Python 脚本封装 OpenSSH 操作。
zhinkgit/embeddedskills
双向交互终端会话工具,用于串口终端、SSH 交互 Shell、本地 Shell、设备控制台、AT/CLI 菜单、需要保持上下文的交互式调试;当用户提到交互终端、串口终端、SSH 终端、打开 shell、发送命令后继续读输出、保持会话、登录后操作、菜单式命令行时触发,也兼容 /terminal 显式调用。
zhinkgit/embeddedskills
probe-rs 下载与调试工具,用于探针发现、固件烧录、复位、内存读写、GDB Server 调试和 RTT 日志读取。 当用户提到 probe-rs、cargo-embed、DAP、RTT、CMSIS-DAP、ST-Link、J-Link、烧录、芯片信息、 连接 under reset、probe 选择器、probe-rs gdb、probe-rs attach 时自动触发,也兼容 /probe-rs 显式调用。…
zhinkgit/embeddedskills
嵌入式网络调试工具,用于发现接口、抓包、分析 pcap/pcapng、做连通性测试、端口扫描和流量统计。 当用户提到 Wireshark、tshark、Npcap、抓包、网络联调、端口扫描、连通性排查、pcap 分析、 网络接口、ping 测试、traceroute、流量统计、Modbus TCP、EtherNet/IP 等网络协议调试时自动触发, 也兼容 /net…
Add this badge to your README
[](https://modelsatlas.com/skills/zhinkgit/openocd/)
<a href="https://modelsatlas.com/skills/zhinkgit/openocd/"><img src="https://modelsatlas.com/skills/zhinkgit/openocd/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about openocd
What does the openocd skill do?
Is openocd safe to install?
What can openocd access on my machine?
Which assistants does openocd work with?
How current is this page?
Sources
- github.com/zhinkgit/embeddedskills/tree/main/openocd — the audited source at commit 674ae8bca880 and every finding aboveObserved · 26 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the openocd skill do?
- Is openocd safe to install?
- What can openocd access on my machine?