BKPT LabsDOCS/BKPT DEBUG/GETTING STARTED BKPT DEBUG · VS CODE
BKPT DEBUG · USER GUIDE

Getting started

From a programmed board to your code halted at main.

1. Program the board

Connect the board through its ST-LINK or a J-Link and program it with the tool you already use (STM32CubeProgrammer, J-Flash, your IDE). BKPT Debug is debug-only on purpose: it never writes flash, so a session can never leave the board with something other than what you built. When a session starts, the first halt compares the target's flash with your ELF and says so when they differ.

Check: the board runs your firmware, and nothing else holds the probe (close the IDE's debug session, stop ST-LINK server).

2. Open the Debug Layout

VS Code with the Debug Layout open and no session: the strip with Start, Attach, the Views, Target, Probe, ELF and Recording menus, and the empty tiles waiting for a session.
VS CODE WITH THE DEBUG LAYOUT OPEN AND NO SESSION: THE STRIP WITH START, ATTACH, THE VIEWS, TARGET, PROBE, ELF AND RECORDING MENUS, AND THE EMPTY TILES WAITING FOR A SESSION

Click BKPT Debug in the activity bar and choose Open Debug Layout. The strip along the top is the whole control surface:

CONTROL WHAT IT DOES
Start / AttachReset and run to main, or join the running firmware (see below)
Run controlsContinue, pause, step over, step into, step out, step one instruction, reset, stop, while a session runs
ViewsShow or hide tiles; the ViewAlyzer views are listed under their own heading
TargetThe core clock, and the target scan (what the core offers: PC sampling, data watch, ETM, trace sink)
ProbeWhich probe, by serial, when several are attached
ELFThe firmware image, shared by the session, the Symbols tile and PC sampling
RecordingOpen a recording in the ViewAlyzer tiles

Pick your ELF in the strip (or set bkptDebug.elf). It is remembered per workspace.

Check: the strip reads no session and the ELF name shows in the strip.

3. Press F5

The target resets, runs to main and halts with your code centre stage: the halted line in the Code tile, the frames and their locals in the Call Stack, the registers on the right.

Halted at main after Start: the Code tile on the halt line, Call Stack with locals, Registers.
HALTED AT MAIN AFTER START: THE CODE TILE ON THE HALT LINE, CALL STACK WITH LOCALS, REGISTERS

From here it is the debugger you know: F5 continues, F6 pauses, F10 and F11 step, click a line number to set a breakpoint. Debugging goes through each tile.

Keys

KEY ACTION
F5Start (when no session runs), else Continue
F6Pause
F10Step over
F11Step into
Shift+F11Step out
Ctrl+F11Step one instruction
Shift+F5Stop
Ctrl+Shift+F5Restart

The keys are BKPT Debug's only while its session is active (and F5 to start only where an ELF is configured), so they do not fight with VS Code's own debugger. Every action is also a command in the Command Palette under BKPT Debug.

Attach instead of reset

Attach to Running Target joins the firmware without a reset: the target keeps running and you pause it when you want to look. Attach and Halt stops it at once. Both are in the strip's Attach menu and in the Command Palette.

Settings

All under bkptDebug. in Settings, with the workspace scope for anything board-specific.

SETTING MEANING
elfThe firmware ELF (absolute, or relative to the workspace). Empty: debug.elf in .va/settings.json, then a prompt when a session starts.
probestlink (default) or jlink. Both are driven directly.
probeSerialThe probe's serial, for benches with more than one attached. Empty: the first probe of that kind. The strip's Probe menu writes it.
speedKhzSWD clock; 0 = the probe's default.
deviceThe SEGGER device name (STM32F767ZI), J-Link only, effectively required there.
runToThe symbol Start runs to after reset (main). Empty: halt at the reset vector.
maskIsrInterrupt masking while stepping: auto (single-step only), on, off.
faultCatchThe fault classes caught at the exception: all, off, or a list of hard bus mem usage int sf. The Fault Analyzer tile edits it live.
pcSampling, pcSamplingUpdateMsPC sampling on, and how often the counts reach the views (sampling itself always runs at the probe's speed).
cpuClockHzThe core clock in Hz; the Core clock field in the Target menu writes it.
profilingSource, hardwareTraceThe Hardware Trace tile's switch and its on-chip configuration (see Hardware trace).
swoFreqHzThe SWO clock in Hz; the SWO clock field in the Target menu writes it. 0 (the default) is automatic: the fastest exact rate the probe's receiver takes, up to 10 MHz.
tcpPortThe GDB port the bundled server listens on (2331); the live watch, PC sampling and trace side channels use the next three.
gdbserverPathYour own bkpt_gdbserver; empty uses the bundled one.
viewalyzer.binaryPathYour own ViewAlyzer engine for tracing; empty uses the bundled one.

Troubleshooting

Start fails at once. Read the Output channel (BKPT Debug: Show Debug Output): the probe is in use, no probe was found, or arm-none-eabi-gdb is missing. Check Setup Health lists what the extension found.

**Start warns after a few seconds that main was never reached.** The firmware on the board is not this ELF (reflash with your vendor tool), or the image needs a different runTo.

Two boards on the bench and the wrong one answers. Pin the probe: the strip's Probe menu, or bkptDebug.probeSerial. An unpinned session takes the first probe it finds.

Breakpoints never hit. Same cause as above nine times out of ten: the flash does not match the ELF, so the addresses point at other code. The first halt's mismatch warning says so.