Logo vun Openocd Jlink Stlink Debug

Openocd Jlink Stlink Debug

Communautéit
easyzoom
openocd-jlink-stlink-debug

Use when debugging OpenOCD, J-Link, ST-Link, CMSIS-DAP, probe connection, reset scripts, flash algorithms, GDB attach, semihosting, RTT, or SWD/JTAG failures

Iwwersiicht

Editeureasyzoom
Repositoryaix-skills
Skill-Nummopenocd-jlink-stlink-debug
Stären
39
Forks
5
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum easyzoom op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Openocd Jlink Stlink Debug an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/easyzoom/aix-skills/tree/main/skills/openocd-jlink-stlink-debug
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/easyzoom/aix-skills.git /tmp/aix-skills
mkdir -p .claude/skills
cp -r /tmp/aix-skills/skills/openocd-jlink-stlink-debug .claude/skills/openocd-jlink-stlink-debug
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Openocd Jlink Stlink Debug an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Openocd Jlink Stlink Debug automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Openocd Jlink Stlink Debug net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

OpenOCD J-Link ST-Link Debug

Overview

Use this skill to debug probe sessions by separating physical wiring, probe firmware, target voltage, reset strategy, transport, target script, flash algorithm, and GDB behavior. Probe failures are often reset or adapter issues.

When To Use

Use this skill when:

  • The user cannot connect, halt, reset, flash, erase, verify, or attach with OpenOCD, J-Link, ST-Link, CMSIS-DAP, pyOCD, or GDB.
  • The issue involves SWD/JTAG wiring, adapter speed, reset config, target scripts, flash loaders, protected devices, semihosting, RTT, or multicore.
  • The same firmware behaves differently under debugger and standalone boot.

Do not use this skill for application fault analysis after a stable debug session exists. Use the architecture-specific debug skill then. For flash download failures focused on erase/program/verify, use mcu-flashing-debug.

First Questions

Ask for:

  • Probe model, firmware version, debugger tool, target MCU/SoC, board, and OS.
  • Wiring: VTref, GND, SWDIO/TMS, SWCLK/TCK, nRST/SRST, SWO, and power ownership.
  • Exact command, the -f interface/*.cfg and -f target/*.cfg scripts, adapter speed, transport select, and full log.
  • Reset mode, boot pins, readout protection (STM32 RDP), low-power state, and external flash.
  • Whether connect-under-reset, halt-after-reset, or attach-to-running is needed.

Launch Reference

  • ST-Link: openocd -f interface/stlink.cfg -f target/stm32f4x.cfg (stlink.cfg is the hla driver; use target/stm32f1x.cfg, stm32h7x.cfg, nrf52.cfg etc. for other parts).
  • J-Link: openocd -f interface/jlink.cfg -c "transport select swd" -f target/stm32f4x.cfg.
  • CMSIS-DAP/DAPLink: openocd -f interface/cmsis-dap.cfg -c "transport select swd" -f target/stm32f1x.cfg.
  • Force JTAG instead of SWD: -c "transport select jtag" (note stlink.cfg hla only supports hla_swd/hla_jtag).
  • Set speed before target script: -c "adapter speed 1000" (kHz; deprecated alias adapter_khz). Pick a probe by serial with -c "adapter serial <SN>" (older: hla_serial).
  • Default TCP ports: GDB 3333, Telnet monitor 4444, Tcl 6666.

Debug Workflow

  1. Prove physical connection. Check VTref, ground, cable length, pinout, SRST line, and whether the probe powers or only senses the target. In the log confirm a valid SWD DPIDR 0x2ba01477 (Cortex-M3/M4) or JTAG IDCODE, not a zero/failed read (SWD DPIDR 0x00000000 / Error connecting DP: cannot read IDR).

  2. Lower the adapter speed. Start with adapter speed 480 or lower, then raise only after IDCODE, halt, reset, and mdw reads are stable.

  3. Pick the right reset strategy. In the target/board cfg set reset_config, e.g. srst_only srst_nogate for connect-under-reset, or none separate. Then use reset halt / reset init / reset run. Add -c "reset_config connect_assert_srst" for locked or fast-sleeping parts.

  4. Validate target scripts. Confirm transport select, chip family cfg, TAP/DAP IDs (-expected-id on jtag newtap/swj_newdap, -dp-id for SWD multidrop), flash bank, and _TARGETNAME/work-area RAM. List cores with targets.

  5. Separate attach from flash. Enter the monitor with telnet localhost 4444, then init and reset halt. Read state with targets, reg, mdw 0x08000000 4, mdh, mdb; write with mww 0x40021000 0x01. Only then flash: program firmware.elf verify reset or flash write_image erase firmware.bin 0x08000000 / flash erase_sector 0 0 last / flash info 0. resume to run, dump_image out.bin 0x08000000 0x10000 to read back.

  6. Add extras last. Enable arm semihosting enable, SWO/tpiu, or RTT only after the base debug path is reliable (see RTT And Semihosting).

GDB Attach

text
arm-none-eabi-gdb firmware.elf
(gdb) target extended-remote localhost:3333
(gdb) monitor reset halt
(gdb) load
(gdb) monitor reg
(gdb) continue

Use target remote for a single-session attach, target extended-remote to allow reconnect. monitor <cmd> forwards any OpenOCD command (e.g. monitor reset init, monitor flash write_image erase firmware.bin).

RTT And Semihosting

  • Semihosting: after halt run arm semihosting enable (optionally arm semihosting_fileio enable); printf/puts output appears on the OpenOCD console once the firmware links libnosys/semihosting stubs.
  • RTT: rtt setup 0x20000000 2048 "SEGGER RTT" then rtt start; expose a channel with rtt server start 9090 0 and read it via telnet localhost 9090. Use rtt channels to confirm the control block was found. The ID string defaults to "SEGGER RTT".

Common Failures

  • VTref is missing, so Error: target voltage may be too low or the probe cannot sense target voltage.
  • Adapter speed too high for early boot/low-power/long wires, giving a failed DPIDR read (Error connecting DP: cannot read IDR), Error: init mode failed (unable to connect to the target), or SWD ack not OK.
  • SRST not wired but the script uses reset_config srst_only; switch to none/connect_assert_srst.
  • Device is readout-protected or locked (Error: … cannot be programmed); for STM32 clear RDP with stm32f4x unlock 0 / stm32f1x unlock 0 (mass-erases).
  • Wrong target cfg selects the wrong flash bank or work-area RAM, so flash write_image/program fails or verify mismatches.
  • External QSPI/SPI flash needs a board-specific flash bank driver (stmqspi, cfi), not the internal loader.
  • hla (stlink.cfg) cannot do raw swd/jtag low-level commands or SWD multidrop; use interface/stlink-dap.cfg or a J-Link/CMSIS-DAP v2 probe.

Verification

Before claiming the debug path works:

  • State probe, tool, exact command, transport, adapter speed, and reset mode.
  • Confirm SWD DPIDR/IDCODE, reset halt, targets shows halted, a reg read, and an mdw memory read.
  • Confirm program … verify reset or flash write_image plus verify when flashing is required.
  • Confirm standalone boot still works after reset run and power-cycle, i.e. after debugger-specific settings.

Example

User:

text
OpenOCD 连 STM32 一直 timeout。

Agent:

  1. Checks VTref, ground, SWD pins, SRST, and lowers adapter speed 480.
  2. Retries with reset_config connect_assert_srst and the correct target/stm32f4x.cfg, watching for SWD DPIDR.
  3. Separates connection evidence (init, targets, mdw) from program/flash write_image errors.

Heefeg gestallte Froen

Wat mécht de KI-Skill Openocd Jlink Stlink Debug?

Use when debugging OpenOCD, J-Link, ST-Link, CMSIS-DAP, probe connection, reset scripts, flash algorithms, GDB attach, semihosting, RTT, or SWD/JTAG failures

Firwat Openocd Jlink Stlink Debug op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Openocd Jlink Stlink Debug besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Openocd Jlink Stlink Debug an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/easyzoom/aix-skills/tree/main/skills/openocd-jlink-stlink-debug an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Openocd Jlink Stlink Debug benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Openocd Jlink Stlink Debug benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Openocd Jlink Stlink Debug domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Openocd Jlink Stlink Debug gratis?

Jo. De Skill gëtt vum easyzoom ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇