Use when debugging STM32 applications with J-Link or ST-Link, including breakpoints, watchpoints, register or memory inspection, HardFault analysis, and automated fault-context capture.
When this skill encounters a build, flash, debug, script-usage, or other workflow problem, do not stop at the local workaround after the issue is solved.
Record the resolved issue and lesson in BFD-Kit/.learnings/ERRORS.md and/or BFD-Kit/.learnings/LEARNINGS.md; unresolved capability gaps go to BFD-Kit/.learnings/FEATURE_REQUESTS.md.
Promote reusable fixes into the affected BFD-Kit asset in the same task when feasible: update the relevant SKILL.md, script, wrapper, or resource so the next run benefits by default.
When a learning is promoted into a skill or script, append a short entry to BFD-Kit/.learnings/CHANGELOG.md and mention the improvement in the task close-out.
Overview
Use this skill to run standardized STM32 debug sessions with repeatable CLI and GDB commands.
(gdb) continue
(gdb) backtrace
(gdb) info registers
Full Command Reference
1) Connect and Load
target remote localhost:2331 connect to J-Link
target remote localhost:61234 connect to ST-Link
file ${STM32_ELF} load symbols
load load program to target
2) Execution Control
run start execution (with load)
continue continue execution
continue <count> continue, ignore count-1 breaks
step step into (source line)
stepi step into (instruction)
next step over (source line)
nexti step over (instruction)
finish run until function returns
until run until line/address
jump *0x08001000 jump to address
3) Breakpoint Management
Set Breakpoints
break main break at function
break file.c:123 break at line
break *0x08001234 break at address
break func if var > 10 conditional breakpoint
tbreak main temporary breakpoint
hbreak HardFault_Handler hardware breakpoint
thbreak func temporary hardware breakpoint
Manage Breakpoints
info breakpoints list all breakpoints
delete <num> delete breakpoint
disable <num> disable breakpoint
enable <num> enable breakpoint
clear main clear by function
clear file.c:123 clear by line
ignore <num> <count> ignore breakpoint N times
condition <num> <expr> set condition
commands <num> on-hit command list
> print var
> continue
> end
Hardware vs Software Breakpoints
Type
Limit
Use Case
Hardware
6 (Cortex-M)
Flash memory
Software
Unlimited
RAM only
4) Watchpoints and Variable Display
watch variable_name break on write
rwatch variable_name break on read
awatch variable_name break on read/write
info watchpoints list watchpoints
delete <num> delete watchpoint