flash

A command for writing firmware to a microcontroller using OpenOCD, a tool that programs chips through a connected debugging probe.

In plain words
What is it for?
Use it to detect the connected probe, write an AXF or ELF build file to the chip, choose the probe and chip configuration, and diagnose connection or configuration errors.
Why use it?
It first checks whether OpenOCD and the probe are available, then reports whether writing and verification succeeded and groups common failures for troubleshooting.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/jzl-maker/ea-skill/flash
Clone the repo
git clone --depth 1 https://github.com/jzl-maker/EA-SKILL
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 560 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00560
Opus 5 $0.00000 $0.00280
Sonnet 5 $0.00000 $0.00112
Haiku 4.5 $0.00000 $0.00056

Measured 2d ago against content hash e248784be630, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

flash scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/flash.md · 63 lines

What it actually says

命令: /ea flash (烧录)

功能

调用 OpenOCD 烧录固件到 MCU

先探测环境

python ~/.claude/skills/ea-skill/tools/flash-openocd/scripts/openocd_flasher.py --detect

确认 OpenOCD 可用且调试探针已连接。

调用方式

python ~/.claude/skills/ea-skill/tools/flash-openocd/scripts/openocd_flasher.py \
  --artifact <产物路径> \
  --interface stlink \
  --target target/stm32f4x.cfg

参数来源

参数 来源
--artifact 从 build-keil 的产物路径获取(AXF/ELF)
--interface --detect 探测结果获得(stlink/jlink/cmsis-dap)
--target 根据芯片型号选择(GD32F407 → target/stm32f4x.cfg

结果处理

字段 检查要点
烧录状态 success / failure
校验状态 verified / skipped
失败分类 connection-failure / target-response-abnormal / project-config-error

自动决策

  • 烧录成功 → 提示下一步(串口观察启动日志)
  • 烧录失败 → 根据失败分类引导排查

常见错误

错误类型 原因 解决方案
connection-failure 调试器未连接或驱动问题 检查调试器连接、USB驱动
target-response-abnormal 芯片未进入调试模式 检查芯片供电、复位电路
project-config-error target 配置文件与芯片不匹配 检查 --target 参数
Unsupported transport --interface 参数错误 使用正确的接口类型 (stlink/jlink/cmsis-dap)

注意事项

⚠️ --interface 必须与烧录时使用的接口一致

⚠️ --target 必须匹配实际芯片型号

相关文件

  • ~/.claude/skills/ea-skill/tools/flash-openocd/scripts/openocd_flasher.py - 烧录脚本
  • commands/build.md - 编译说明
  • commands/serial.md - 串口监控说明
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 63 lines · 0 tokens per session scan A e248784be630

Subscribe to this mod's changes

flash is a command published in the GitHub repository jzl-maker/EA-SKILL (6 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 560 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.