Debug RISC-V MCU firmware systematically: traps, CSRs, startup code, OpenOCD/GDB sessions, and flashing failures.
Ships in aix-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill to debug RISC-V MCU firmware systematically. Identify the exact core, SoC, debug module, toolchain, memory map, and trap state before changing startup code, linker scripts, flash settings, or machine-mode configuration.
Use this skill when:
mstatus, mcause, mepc, mtvec, trap handlers, startup code, or linker scripts.main, traps, hangs, or has no UART/log output.Do not use this skill for Cortex-M, 8051, embedded Linux application debugging, or general C code review without target evidence.
Ask for:
Confirm the target profile. RISC-V MCU behavior depends on XLEN, extensions, privilege mode, vendor CSRs, debug module, and memory map.
Classify the failure phase. Use connect, flash, reset/startup, trap, runtime hang, peripheral bring-up, or RTOS scheduling.
Establish a non-destructive debug session. Prefer halt/reset-halt and symbol loading before flash erase or startup rewrites.
Collect trap and reset evidence.
Record pc, sp, mstatus, mcause, mepc, mtval, mtvec, and key memory addresses.
Check linker and startup alignment.
Confirm reset address, vector/trap base, RAM origin, stack top, .data copy, .bss zeroing, and main call path.
Ask before risky operations. Mass erase, option bytes, boot mode, security locks, and vendor flash config changes require explicit approval.
Useful patterns:
openocd -f interface/<probe>.cfg -f target/<target>.cfg
riscv64-unknown-elf-gdb build/firmware.elf
riscv-none-elf-gdb build/firmware.elf
GDB baseline:
target extended-remote :3333
monitor reset halt
info registers
p/x $pc
p/x $sp
p/x $mcause
p/x $mepc
p/x $mtval
p/x $mtvec
bt
Check:
pc points to a valid executable region.sp points inside RAM and is aligned.mtvec points to the intended trap handler.mepc maps to source or disassembly.When a trap occurs:
mcause, mepc, mtval, mstatus, and mtvec.mepc to a symbol and instruction.mtval contains a bad address or instruction.Common causes:
rv32imac but running on a core without compressed instructions.If firmware fails before main():
gp and small data sections are initialized if used..data and .bss initialization.If flashing fails:
Before claiming progress:
pc, sp, mcause, mepc, mtval, and mtvec when trap-related.-march or -mabi for the actual core.User:
RISC-V 小板下载后进 trap,串口没有日志。
Agent:
pc, sp, mcause, mepc, mtval, and mtvec.mepc to source or disassembly.What SKILL.md sets; muted values are Claude Code's defaults
76 skills in this plugin
/8051-mcu-debugUse when debugging 8051-compatible microcontrollers, 51 MCU firmware, STC download issues, Keil C51 projects, interrupts, timers, UART, or startup failures/avem-integrationUse when integrating, evaluating, configuring, or debugging Avem embedded C framework modules, event-driven components, drivers, middleware, or application architecture/battery-charger-fuel-gauge-integrationUse when integrating or debugging Li-ion charger/fuel gauge ICs (BQ24295, BQ27441, MAX17048) over I2C, covering charge start, watchdog host mode, NTC/JEITA faults, and SOC jumps/ble-gatt-integrationUse when integrating, designing, or debugging BLE GATT services, characteristics, descriptors, MTU, notifications, indications, pairing, connection parameters, or throughput/bootloader-debugUse when debugging embedded bootloaders, application jumps, vector table offsets, firmware upgrade flow, OTA state, image validation, rollback, or boot selection failures/canbus-integrationUse when integrating, porting, configuring, or debugging CAN bus libraries, CANBus-Triple, MCP2515, CAN frames, bit timing, filters, or embedded automotive communication/aix-skills:riscv-mcu-debugfrom aix-skills
npx claudepluginhub easyzoom/aix-skills --plugin aix-skillsOther plugins' skills for the same job