
Jlink
Flash firmware and debug ARM embedded targets over SEGGER J-Link with RTT, SWO, and GDB from your agent.
Overview
jlink is an agent skill most often used in Build (also Ship testing, Operate monitoring) that automates SEGGER J-Link flash, RTT/SWO logs, and GDB debug on embedded ARM targets.
Install
npx skills add https://github.com/zhinkgit/embeddedskills --skill jlinkWhat is this skill?
- Firmware programming for .hex, .bin, and .elf images
- Probe connectivity checks, memory read/write, registers, and target reset
- RTT log streaming and SWO event wrapping via external viewer
- Online debug: halt, resume, single-step, breakpoints
- GDB source-level debug with stack and locals via arm-none-eabi-gdb
Adoption & trust: 1 installs on skills.sh; 340 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
You have firmware artifacts and a J-Link probe but need repeatable agent-driven flash, reset, and debug steps without memorizing SEGGER CLI paths.
Who is it for?
Indie hardware/firmware builders on ARM MCUs who already use SEGGER probes and want agent-executable debug workflows.
Skip if: Pure mobile App Store apps, cloud-only SaaS without hardware, or teams without J-Link software and probe hardware installed.
When should I use this skill?
User needs J-Link probe connectivity, firmware burn, memory/register access, RTT/SWO logs, or GDB debugging on embedded ARM hardware.
What do I get? / Deliverables
Configured J-Link tooling runs connectivity checks, programming, logging, and GDB sessions from documented JSON config and Python helpers.
- Flashed firmware image on target
- RTT or SWO log capture
- GDB debug session artifacts (breakpoints, stack, locals)
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Build/integrations because the skill wires hardware probe tooling into the firmware delivery loop before production operate routines. Integrations subphase captures probe executables, GDB server, and device I/O—not generic frontend or docs work.
Where it fits
Program a fresh .elf to a dev board after the agent compiles a firmware target.
Set breakpoints and inspect locals over GDB before signing off a hardware regression.
Stream RTT logs from a field prototype while reproducing an intermittent fault.
How it compares
Hardware probe integration skill—not a substitute for on-device XCTest or cloud CI runners.
Common Questions / FAQ
Who is jlink for?
Embedded solo developers using Claude Code or similar agents with SEGGER J-Link and optional GNU Arm GDB installed locally.
When should I use jlink?
During Build/integrations for flash and bring-up; during Ship/testing for breakpoint debug; during Operate/monitoring for RTT log streams.
Is jlink safe to install?
It executes local SEGGER binaries with device access; review the Security Audits panel on this page and treat config paths and probe access as high-trust.
SKILL.md
READMESKILL.md - Jlink
{ "exe": "C:\\Program Files\\SEGGER\\JLink\\JLink.exe", "gdbserver_exe": "C:\\Program Files\\SEGGER\\JLink\\JLinkGDBServerCL.exe", "rtt_exe": "C:\\Program Files\\SEGGER\\JLink\\JLinkRTTClient.exe", "gdb_exe": "C:\\Program Files\\Arm\\GNU Toolchain mingw-w64-x86_64-arm-none-eabi\\bin\\arm-none-eabi-gdb.exe", "serial_no": "", "rtt_telnet_port": 0, "swo_command": [], "operation_mode": 1 } # jlink Claude Code skill,通过 J-Link 探针进行嵌入式设备的固件烧录、内存读写、寄存器查看、RTT/SWO 日志读取和在线调试。 ## 功能 - 探针与目标连通性探测 - 固件烧录(.hex / .bin / .elf) - 内存读写、寄存器查看、目标复位 - RTT 日志实时读取 - SWO 事件流包装(通过外部 viewer) - 在线调试:暂停/恢复/单步/断点运行 - GDB 源码级调试:调用栈、局部变量查看 ## 环境要求 - [SEGGER J-Link Software](https://www.segger.com/downloads/jlink/) — 提供 JLink.exe、JLinkGDBServerCL.exe、JLinkRTTClient.exe - Python 3.x(仅标准库,无额外依赖) - GDB 调试需要 `arm-none-eabi-gdb`(随 [Arm GNU Toolchain](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) 安装) ## 配置 ### 环境级配置(skill/config.json) 复制 `config.example.json` 为 `config.json`,根据实际安装路径修改: ```json { "exe": "C:\\Program Files\\SEGGER\\JLink\\JLink.exe", "gdbserver_exe": "C:\\Program Files\\SEGGER\\JLink\\JLinkGDBServerCL.exe", "rtt_exe": "C:\\Program Files\\SEGGER\\JLink\\JLinkRTTClient.exe", "gdb_exe": "C:\\Program Files\\Arm\\GNU Toolchain mingw-w64-x86_64-arm-none-eabi\\bin\\arm-none-eabi-gdb.exe", "serial_no": "", "rtt_telnet_port": 0, "swo_command": [], "operation_mode": 1 } ``` | 字段 | 必填 | 说明 | |------|------|------| | `exe` | 是 | JLink.exe 完整路径 | | `gdbserver_exe` | 否 | JLinkGDBServerCL.exe 路径,RTT 和 GDB 调试需要 | | `rtt_exe` | 否 | JLinkRTTClient.exe 路径,RTT 需要 | | `gdb_exe` | 否 | arm-none-eabi-gdb 路径,GDB 源码级调试需要 | | `serial_no` | 否 | 探针序列号,多探针场景使用 | | `rtt_telnet_port` | 否 | RTT 端口,`0` 使用工具默认值 | | `swo_command` | 否 | 外部 SWO viewer 的完整命令数组,供 `jlink_swo.py` 包装 | | `operation_mode` | 否 | `1` 直接执行 / `2` 输出风险摘要 / `3` 执行前确认 | ### 工程级配置(.embeddedskills/config.json) 设备参数(device/interface/speed)统一在工作区的 `.embeddedskills/config.json` 中管理: ```json { "jlink": { "device": "STM32F407VG", "interface": "SWD", "speed": "4000" } } ``` 参数解析优先级:**CLI 参数 > 工程配置 > state.json > 默认值** 成功执行后,确认过的 device/interface/speed 会自动写回工程配置。 # 常见芯片 Device 名称速查表 在 J-Link Commander 中使用的芯片型号名称(区分大小写)。 ## STMicroelectronics | 系列 | Device 名称示例 | |------|----------------| | STM32F0 | STM32F030R8, STM32F072RB | | STM32F1 | STM32F103C8, STM32F103RB, STM32F103ZE | | STM32F2 | STM32F207VG, STM32F207ZG | | STM32F3 | STM32F303CC, STM32F303VC | | STM32F4 | STM32F401RE, STM32F407VG, STM32F429ZI | | STM32F7 | STM32F746ZG, STM32F767ZI | | STM32G0 | STM32G030K8, STM32G071RB | | STM32G4 | STM32G431KB, STM32G474RE | | STM32H7 | STM32H743ZI, STM32H750VB | | STM32L0 | STM32L053R8, STM32L073RZ | | STM32L1 | STM32L151RB, STM32L152RE | | STM32L4 | STM32L431RC, STM32L476RG | | STM32U5 | STM32U575ZI, STM32U585AI | | STM32WB | STM32WB55RG | | STM32WL | STM32WLE5JC | ## GigaDevice | 系列 | Device 名称示例 | |------|----------------| | GD32F1 | GD32F103C8, GD32F130G8 | | GD32F3 | GD32F303CC, GD32F350RB | | GD32F4 | GD32F407VG, GD32F450ZI | | GD32E1 | GD32E103C8, GD32E230C8 | | GD32E5 | GD32E507ZE | ## Nordic Semiconductor | 系列 | Device 名称示例 | |------|----------------| | nRF51 | nRF51822_xxAA | | nRF52 | nRF52832_xxAA, nRF52840_xxAA | | nRF53 | nRF5340_xxAA_APP, nRF5340_xxAA_NET | | nRF91 | nRF9160_xxAA | ## NXP | 系列 | Device 名称示例 | |------|----------------| | LPC | LPC1768, LPC54608J512 | | i.MX RT | MIMXRT1052xxx5B, MIMXRT1062xxx5A | | Kinetis | MK64FN1M0xxx12 | ## Microchip (Atmel) | 系列 | Device 名称示例 | |------|----------------| | SAM | ATSAMD21G18, ATSAME70Q21 | ## 查找完整列表 如果上表未包含目标芯片,可通过以下方式查找: 1. 打开 J-Link Commander,输入 `ExpDevList` 查看完整列表 2. 在 SEGGER Wiki 搜索: https://wiki.segger.com/Supported_devices 3. 使用 JLink.exe 的 `-device ?` 参数列出所有支持设备 """J-Link 设备探测、烧录、内存读写、寄存器查看、复位、在线调试""" import argparse import json import os import re import subprocess import sys import tempfile import time from pathlib import Path # 添加 runtime 模块路径 SCRIPT