Loading...
Loading...
J-Link download and online debugging tool, used for device detection, firmware flashing, memory read/write, register viewing, target reset, RTT/SWO log reading, and online debugging (pause/resume/step execution/breakpoint running/call stack/variable inspection). This skill is automatically triggered when users mention J-Link, JLink, RTT, firmware flashing, memory writing, memory reading, register viewing, target reset, probe connectivity check, online debugging, step execution, breakpoint, or call stack. It also supports explicit invocation via /jlink. Even if users only say "flash the firmware", "check RTT output", or "debug", this skill should be triggered as long as the context involves a J-Link probe.
npx skill4agent add zhinkgit/embeddedskills jlinkconfig.jsonexe{
"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
}exegdbserver_exertt_exegdb_exeserial_nortt_telnet_portswo_commandjlink_swo.pyoperation_mode123.embeddedskills/config.json{
"jlink": {
"device": "STM32F407VG",
"interface": "SWD",
"speed": "4000"
}
}deviceinterfacespeed.embeddedskills/config.jsonskill/config.json.embeddedskills/state.json| Subcommand | Purpose | Risk |
|---|---|---|
| Detect probe and target connectivity | Low |
| Flash firmware (.hex / .bin / .elf) | High |
| Read memory area | Low |
| Write to memory | High |
| View CPU registers | Low |
| Reset target chip | High |
| Read RTT log output | Low |
| Wrap external SWO viewer into a unified event stream | Low |
| Subcommand | Purpose | Risk |
|---|---|---|
| Pause CPU, return register status | Low |
| Resume CPU operation | Low |
| Step execution (supports specifying step count), return executed instructions and registers | Low |
| Set breakpoint and run, return status after hitting | Low |
| Subcommand | Purpose | Dependencies |
|---|---|---|
| View call stack and local variables | arm-none-eabi-gdb |
| One-shot execution flow control | arm-none-eabi-gdb |
| One-shot source-level diagnosis | arm-none-eabi-gdb |
skill/config.jsonexe.embeddedskills/config.json.embeddedskills/state.json.embeddedskills/config.jsonskill/config.json.embeddedskills/state.jsondeviceserial_nooperation_mode.jlink-NoGui 1 -ExitOnError 1 -AutoConnect 1.embeddedskills/config.json# Detect connectivity
python <skill-dir>/scripts/jlink_exec.py info --device GD32F470ZG --json
# Flash firmware
python <skill-dir>/scripts/jlink_exec.py flash --file build/app.hex --device GD32F470ZG --json
# Flash .bin (address must be provided)
python <skill-dir>/scripts/jlink_exec.py flash --file build/app.bin --device GD32F470ZG --address 0x08000000 --json
# Read memory
python <skill-dir>/scripts/jlink_exec.py read-mem --address 0x08000000 --length 256 --device GD32F470ZG --json
# Write to memory
python <skill-dir>/scripts/jlink_exec.py write-mem --address 0x20000000 --value 0x12345678 --device GD32F470ZG --json
# View registers
python <skill-dir>/scripts/jlink_exec.py regs --device GD32F470ZG --json
# Reset target
python <skill-dir>/scripts/jlink_exec.py reset --device GD32F470ZG --json
# Pause CPU
python <skill-dir>/scripts/jlink_exec.py halt --device GD32F470ZG --json
# Resume operation
python <skill-dir>/scripts/jlink_exec.py go --device GD32F470ZG --json
# Step execution (3 steps)
python <skill-dir>/scripts/jlink_exec.py step --device GD32F470ZG --count 3 --json
# Run to breakpoint address
python <skill-dir>/scripts/jlink_exec.py run-to --device GD32F470ZG --address 0x08001234 --timeout-ms 3000 --json--interface SWD|JTAG--speed 4000--serial-no <serial number>--exe <path to JLink.exe>python <skill-dir>/scripts/jlink_rtt.py --device GD32F470ZG --json--serial-no--channel--encoding--rtt-port--gdbserver-exe <path>--rtt-exe <path>--json# Use swo_command in config.json
python <skill-dir>/scripts/jlink_swo.py --json
# Or explicitly pass viewer command
python <skill-dir>/scripts/jlink_swo.py \
--viewer-cmd JLinkSWOViewerCL.exe -device GD32F470ZG -itf SWD -speed 4000 \
--jsonjlink_swo.py# Execute custom GDB command sequence
python <skill-dir>/scripts/jlink_gdb.py run \
--gdbserver-exe <path> --gdb-exe <path to arm-none-eabi-gdb> \
--device GD32F470ZG --elf build/app.elf \
--commands "break main" "continue" "backtrace" "info locals" --json
# Shortcut: Get call stack
python <skill-dir>/scripts/jlink_gdb.py backtrace \
--gdbserver-exe <path> --gdb-exe <path> \
--device GD32F470ZG --elf build/app.elf --json
# Shortcut: View local variables
python <skill-dir>/scripts/jlink_gdb.py locals \
--gdbserver-exe <path> --gdb-exe <path> \
--device GD32F470ZG --elf build/app.elf --jsonstatusactionsummarydetailscontextartifactsmetricsstatenext_actionstimingsourcechannel_typestream_type{
"status": "ok",
"action": "halt",
"summary": "Paused, PC=0x08049ABC",
"details": {
"device": "GD32F470ZG",
"registers": { "PC": "0x08049ABC", "R0": "0x00000004", "..." : "..." }
}
}{
"status": "ok",
"action": "step",
"summary": "3 steps executed, PC=0x08049AB4",
"details": {
"steps": [
{ "address": "0x08049AB8", "opcode": "80 1B", "instruction": "SUBS R0, R0, R6" },
{ "address": "0x08049ABA", "opcode": "A8 42", "instruction": "CMP R0, R5" },
{ "address": "0x08049ABC", "opcode": "FA D3", "instruction": "BCC #-0x0C" }
],
"registers": { "PC": "0x08049AB4", "..." : "..." }
}
}{
"status": "ok",
"action": "run-to",
"summary": "Breakpoint hit @ 0x08049AB4, PC=0x08049AB4",
"details": {
"bp_address": "0x08049AB4",
"bp_hit": true,
"registers": { "PC": "0x08049AB4", "..." : "..." }
}
}device.embeddedskills/config.jsonskill/config.json.embeddedskills/state.json.binrun-tostate.jsonlast_flashlast_debugstate.jsonhalt → regs → read-mem → step → gorun-to(address) → regs → read-mem → gogdb run --elf app.elf --commands "break main" "continue" "backtrace" "info locals"references/common_devices.md