8051-mcu-debug
Use when debugging 8051-compatible microcontrollers, 51 MCU firmware, STC download issues, Keil C51 projects, interrupts, timers, UART, or startup failures
Use when debugging OpenOCD, J-Link, ST-Link, CMSIS-DAP, probe connection, reset scripts, flash algorithms, GDB attach, semihosting, RTT, or SWD/JTAG failures
$ npx -y skills add easyzoom/aix-skills --skill openocd-jlink-stlink-debug --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/openocd-jlink-stlink-debugContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when debugging OpenOCD, J-Link, ST-Link, CMSIS-DAP, probe connection, reset scripts, flash algorithms, GDB attach, semihosting, RTT, or SWD/JTAG failures
name: openocd-jlink-stlink-debug description: Use when debugging OpenOCD, J-Link, ST-Link, CMSIS-DAP, probe connection, reset scripts, flash algorithms, GDB attach, semihosting, RTT, or SWD/JTAG failures
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.
Use this skill when:
OpenOCD, J-Link, ST-Link, CMSIS-DAP, pyOCD, or GDB.
scripts, flash loaders, protected devices, semihosting, RTT, or multicore.
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`.
Ask for:
power ownership.
`adapter speed`, `transport select`, and full log.
external flash.
(`stlink.cfg` is the `hla` driver; use `target/stm32f1x.cfg`, `stm32h7x.cfg`, `nrf52.cfg` etc. for other parts).
`hla` only supports `hla_swd`/`hla_jtag`).
alias `adapter_khz`). Pick a probe by serial with `-c "adapter serial <SN>"` (older: `hla_serial`).
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`).
1. Lower the adapter speed. Start with `adapter speed 480` or lower, then raise only after IDCODE, halt, reset, and `mdw` reads are stable.
1. 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.
1. 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`.
1. 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.
1. Add extras last. Enable `arm semihosting enable`, SWO/`tpiu`, or RTT only after the base debug path is reliable (see RTT And Semihosting).
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`).
`arm semihosting_fileio enable`); `printf`/`puts` output appears on the OpenOCD console once the firmware links `libnosys`/semihosting stubs.
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"`.
cannot sense target voltage.
DPIDR read (`Error connecting DP: cannot read IDR`), `Error: init mode failed (unable to connect to the target)`, or `SWD ack not OK`.
`none`/`connect_assert_srst`.
STM32 clear `RDP` with `stm32f4x unlock 0` / `stm32f1x unlock 0` (mass-erases).
`flash write_image`/`program` fails or verify mismatches.
(`stmqspi`, `cfi`), not the internal loader.
multidrop; use `interface/stlink-dap.cfg` or a J-Link/CMSIS-DAP v2 probe.
Before claiming the debug path
AIX Skills is a public collection of Agent Skills, templates, and references for building repeatable AI workflows.
Use when debugging 8051-compatible microcontrollers, 51 MCU firmware, STC download issues, Keil C51 projects, interrupts, timers, UART, or startup failures
Use when integrating, evaluating, configuring, or debugging Avem embedded C framework modules, event-driven components, drivers, middleware, or application…
Use when integrating or debugging Li-ion charger/fuel gauge ICs (BQ24295, BQ27441, MAX17048) over I2C, covering charge start, watchdog host mode, NTC/JEITA…
Use when integrating, designing, or debugging BLE GATT services, characteristics, descriptors, MTU, notifications, indications, pairing, connection parameters,…
Use when debugging embedded bootloaders, application jumps, vector table offsets, firmware upgrade flow, OTA state, image validation, rollback, or boot…
Use when integrating, porting, configuring, or debugging CAN bus libraries, CANBus-Triple, MCP2515, CAN frames, bit timing, filters, or embedded automotive…