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 RISC-V microcontrollers, bare-metal firmware, RTOS bring-up, OpenOCD or GDB sessions, traps, CSRs, startup code, or flashing failures
$ npx -y skills add easyzoom/aix-skills --skill riscv-mcu-debug --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/riscv-mcu-debugContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when debugging RISC-V microcontrollers, bare-metal firmware, RTOS bring-up, OpenOCD or GDB sessions, traps, CSRs, startup code, or flashing failures
name: riscv-mcu-debug description: Use when debugging RISC-V microcontrollers, bare-metal firmware, RTOS bring-up, OpenOCD or GDB sessions, traps, CSRs, startup code, or flashing failures
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:
Do not use this skill for Cortex-M, 8051, embedded Linux application debugging, or general C code review without target evidence.
Ask for:
1. Confirm the target profile. RISC-V MCU behavior depends on XLEN, extensions, privilege mode, vendor CSRs, debug module, and memory map.
1. Classify the failure phase. Use connect, flash, reset/startup, trap, runtime hang, peripheral bring-up, or RTOS scheduling.
1. Establish a non-destructive debug session. Prefer halt/reset-halt and symbol loading before flash erase or startup rewrites.
1. Collect trap and reset evidence. Record `pc`, `sp`, `mstatus`, `mcause`, `mepc`, `mtval`, `mtvec`, and key memory addresses.
1. Check linker and startup alignment. Confirm reset address, vector/trap base, RAM origin, stack top, `.data` copy, `.bss` zeroing, and `main` call path.
1. 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:
When a trap occurs:
1. Preserve state before reset. 1. Read `mcause`, `mepc`, `mtval`, `mstatus`, and `mtvec`. 1. Decode whether the cause is interrupt or exception. 1. Map `mepc` to a symbol and instruction. 1. Check whether `mtval` contains a bad address or instruction.
Common causes:
If firmware fails before `main()`:
If flashing fails:
Before claiming progress:
User:
RISC-V 小板下载后进 trap,串口没有日志。
Agent:
1. Asks for chip, core/ISA, probe, OpenOCD config, ELF, and trap register dump. 1. Connects halt-first and reads `pc`, `sp`, `mcause`, `mepc`, `mtval`, and `mtvec`. 1. Maps `mepc` to source or disassembly. 1. Checks ISA flags, stack range, trap vector, and linker origins before editing code.
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…