Skip to content
Agentmart
Submit a tool

STM32 GDB Debugger

Debug STM32 firmware on real hardware via GDB + OpenOCD/ST-Link/J-Link with decoded results.

Connector by Zeraissh · GitHub account verified by the MCP Registry

IndexedMITLocal (stdio)★ 2
Write a review

Install

Works with Claude Code, Codex, VS Code, Cursor, Windsurf, Claude Desktop. Read the repository before you give any tool access to your data.

npx agentmarket install connector/zeraissh-stm32-gdb-mcp

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Debug STM32 firmware on real hardware via GDB + OpenOCD/ST-Link/J-Link with decoded results.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this server can do and what it asks for, from its tool list, install config and code. Checked Oct 25, 2026.

Tools
52 read · 37 write · 6 delete · 24 not yet classified
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Tools by what they do 119

Read from the source code; the running server may list different tools.

Read 52 · Look things up without changing anything.

  • acceptance_loop_status
  • address_of
  • analyze_stack
  • assert_expressions
  • capture_debug_snapshot
  • capture_expressions
  • capture_rtos_snapshot
  • capture_state
  • check_session_health
  • compare_expressions_after_action
  • describe_acceptance
  • describe_board
Show 40 more tools
  • describe_framework
  • describe_hub
  • detect_probe
  • detect_rtos
  • diagnose_fault
  • discover_hub_map
  • get_debug_profile
  • get_gdb_events
  • get_gdb_server_logs
  • get_logs
  • get_session
  • get_timeouts
  • get_write_audit_log
  • inspect_project
  • list_breakpoints
  • list_functions
  • list_sessions
  • list_source
  • list_variables
  • lookup_type
  • mcp_info
  • measure_hub_channel
  • read_call_stack
  • read_core_registers
  • read_fault_registers
  • read_frame_variables
  • read_freertos
  • read_memory
  • read_peripheral_register
  • read_typed_memory
  • read_variable
  • resolve_address
  • sample_pc
  • self_check
  • sizeof
  • suggest_server_args
  • tool_help
  • validate_board
  • validate_debug_config
  • verify_flash

Write 37 · Create, change, send or run things.

  • batch
  • build_firmware
  • call
  • call_read
  • close_session
  • decode_peripheral_register
  • export_debug_report
  • flash_and_run
  • hub_dashboard
  • import_netlist
  • import_spec
  • load_device_pack
Show 25 more tools
  • run_acceptance
  • run_acceptance_iteration
  • run_and_wait
  • run_for_duration
  • run_pipeline
  • run_scenario
  • run_to_line
  • save_debug_config
  • select_frame
  • set_adapter_speed
  • set_breakpoint
  • set_debug_profile
  • set_hub_data
  • set_hub_power
  • set_timeouts
  • set_watchpoint
  • set_write_policy
  • start_acceptance_loop
  • start_debug_session
  • start_logging
  • stop_debug_session
  • stop_logging
  • wait_for_stop
  • write_memory
  • write_typed_memory

Delete 6 · Delete, drop, revoke or wipe things.

  • clear_logs
  • clear_session_journal
  • delete_breakpoint
  • flash_erase
  • power_cycle_target
  • reset_target

Not yet classified 24 · We could not tell from the name and description.

  • capture_coredump
  • configure_debug_freeze
  • continue_execution
  • debug_until
  • design_framework
  • disassemble
  • flash_firmware
  • halt_execution
  • load_acceptance
  • load_coredump
  • load_debug_config
  • load_svd
Show 12 more tools
  • load_symbols
  • read_cycle_counter
  • reconstruct_fault_context
  • recover_session
  • render_framework
  • report_issue
  • setup_swo
  • solve_clock_tree
  • solve_timer
  • step
  • synthesize_acceptance
  • track_variable

Secrets and settings it asks for

Other settings (environment variables or headers).

  • STM32_GDB_MCP_COMPACT

Network hosts it talks to 4

  • developer.arm.com · found in code
  • dummy.com · found in code
  • github.com · found in code
  • segger.com · found in code

Files it touches

  • /sys/bus/usb/devices
  • Your home directory (~)
  • ~/.codeium/windsurf/mcp_config.json
  • ~/.cursor/mcp.json
  • Any path the agent passes to its tools

Tools (119)

Read from the source code; the running server may differ. Descriptions are the server’s own words; hidden characters are shown as [U+…].

  • acceptance_loop_status

    Read the acceptance loop's trajectory (per-iteration pass/fail counts, status) and the current decision without running an iteration.

  • address_of

    Resolves the address of a symbol (&symbol).

  • analyze_stack

    Reports stack used/free bytes and a clear overflow verdict for the halted core. stack_top defaults to the initial MSP (first word of the vector table at vector_table_addr). Give stack_size or stack_limit for the overflow check (else only usage is reported). The key tool for diagnosing stack overflows.

  • assert_expressions

    Reads GDB expressions and evaluates assertions with operators ==, !=, >, >=, <, <=.

  • batch

    Runs several tool calls in ONE round trip and returns ALL their full results — the fastest way to do a sequence of operations (e.g. read registers + backtrace + several variables) without per-call latency. ok is false if ANY step failed; data.succeeded/data.failed count the outcomes (count/total only count steps run vs requested). Pass session to run every step against a named debug session.

  • build_firmware

    Builds firmware with Keil uVision (UV4), CMake, make, or a custom command, so the AI can rebuild after a fix. Keil emits a .axf (ELF/DWARF) that the debug tools load like any .elf. Returns the exit code, success flag, and build log tail.

  • call

    Invoke ANY stm32-gdb-mcp tool by name — including one that is NOT in your current tool list (clients with tool-count limits may hide some). Use this to reach e.g. start_debug_session when it isn't directly listed: call(tool='start_debug_session', args={...}). Returns that tool's result.

  • call_read

    Like call, but restricted to tools that only READ state — so it needs no approval prompt where call, which can reach anything, does. Prefer it for hidden read-only tools: call_read(tool='read_core_registers', args={}). The gate is per-ACTION, not per-tool: a family's reading action goes through even though the family also writes, so call_read(tool='debug_profile', args={'action':'get'}) works while action='set' does not. A refusal names the actions it would accept. Refuses anything that writes; use call for those.

  • capture_coredump

    Writes a core dump (RAM + registers) of the halted target to a file for offline postmortem analysis.

  • capture_debug_snapshot

    Captures a structured debug snapshot: core registers, fault registers, call stack, PC disassembly, GDB events, server logs, and optional project/RTOS context.

  • capture_expressions

    Reads GDB expressions and returns parsed values. Optionally builds an indexed table from array-like expression prefixes while preserving the raw per-expression values.

  • capture_rtos_snapshot

    Captures FreeRTOS detection, current task, ready tasks, and task-list snapshot.

  • capture_state

    One-call 'where am I': decoded core registers + a PC/LR/SP summary, the decoded backtrace, and the innermost-frame locals. The fastest way to get full halted context.

  • check_session_health

    Reports whether the GDB client, GDB server process, and target are still alive and responsive. With reconnect=true, attempts to restart the GDB client and reconnect to the running server. Use this on long autonomous runs to detect a dropped session before it derails debugging.

  • clear_logs

    Clears the buffered log lines for a channel (rtt/swo/uart) without stopping capture.

Show 104 more tools
  • clear_session_journal

    Clears the session journal (keeps the run-id).

  • close_session

    Closes a named debug session, tearing down its GDB client and server.

  • compare_expressions_after_action

    Captures expressions, performs one debug action, captures them again, and reports changes.

  • configure_debug_freeze

    Freezes peripherals (IWDG, WWDG, RTC, timers) while the core is halted via the DBGMCU freeze registers, so the watchdog cannot reset the target out from under the debugger. Family is taken from the debug profile MCU if omitted.

  • continue_execution

    Resumes execution of the target device until the next breakpoint. Safe to call when the target is already running (reports already_running instead of erroring), so 'make sure it is running' is expressible.

  • debug_until

    One-call repro step: set an optional conditional/temporary breakpoint at a location, run, and return the stop event PLUS the decoded backtrace and innermost-frame locals. Collapses set_breakpoint + run + read frame/vars into a single round-trip.

  • decode_peripheral_register

    Reads and decodes a peripheral register with SVD bitfield names and enumerated values.

  • delete_breakpoint

    Deletes a breakpoint by its ID.

  • describe_acceptance

    Read the loaded AcceptanceSpec or the last verdict. what=summary (name + check counts), checks (full check list), or last_result (the most recent run_acceptance report).

  • describe_board

    Read the BoardDescription imported by import_netlist. what=summary (MCU + peripherals + counts), pins (full MCU pin map), nets, power (power/ground nets), or peripherals (distinct peripherals in use).

  • describe_framework

    Read the synthesized FrameworkPlan. what=summary (mcu + clocks + peripherals), clocks, gpio (per-pin config), peripherals (init blocks), init_order, or unresolved (the TODO holes that need target data or a design decision). Run design_framework first.

  • describe_hub

    Reports the attached programmable USB hub: identity, channel list, per-port power and USB2 data-line state, and per-port voltage/current on models with an ADC. Read-only. Returns hub_unavailable when the [hub] extra is not installed or no hub is attached.

  • design_framework

    Synthesize a deterministic FrameworkPlan (Pillar D) from the session's imported board: which clocks to enable, how each pin must be muxed, and which peripheral init blocks to emit, in dependency order. Supply per-peripheral HAL .Init parameters via design={'USART1': {'baud': 115200, ...}} and optional AF numbers via af_map. Mandatory .Init members are auto-filled with HAL-standard defaults (a complete, valid init struct, not a half-initialized one) and a few are derived from the netlist (UART flow control from RTS/CTS pins, SPI NSS from an NSS pin); each field is tagged explicit/derived/defaul…

  • detect_probe

    Lists physical ST-Link, J-Link, and CMSIS-DAP probes currently connected over USB. Preserves serial numbers so multiple identical probes are never silently collapsed.

  • detect_rtos

    Detects whether FreeRTOS symbols are available in the current GDB session.

  • diagnose_fault

    Reads and decodes Cortex-M fault registers into likely fault causes.

  • disassemble

    Disassembles N instructions at a location (default $pc).

  • discover_hub_map

    Works out which hub channel each debug probe is plugged into, by disconnecting one channel's USB data lines at a time and seeing which probe disappears from detect_probe. Data lines, not power, so a neighbouring board mid-experiment is not rebooted. SLOW and opt-in: it runs detect_probe once per channel plus a baseline, and on Windows each of those walks the whole USB device tree (~8.5 s). Refuses while any GDB server is alive unless force=true. With apply=true the result is written into the active debug profile.

  • export_debug_report

    Writes a single self-contained JSON report (journal + metrics + profile, optionally a state snapshot and a coredump) tied to the run-id, so a bug session is fully reproducible and shareable from one artifact.

  • flash_and_run

    One-call bring-up: flash an ELF (loads symbols), reset-halt, set a temporary breakpoint at an entry point (default 'main'), run to it, and return the decoded stop context. With hub_channel (or usb_location) and no session running, it starts one pinned to that probe first -- so 'flash the firmware on channel 4' is this single call, on a bench with several probes, without disconnecting any of the others.

  • flash_erase

    Erases a flash range on the target (OpenOCD 'flash erase_address pad'), rounding out to the driver's erase-sector boundaries. The recovery tool for a board that will not boot: clearing a corrupt OTA journal, a stale boot descriptor, or a half-written image. Requires an explicit address AND length — there is deliberately no mass-erase default.

  • flash_firmware

    Flashes a compiled firmware binary to the target. Accepts GCC .elf or Keil .axf. By default it then resets and RUNS the firmware (Keil-style 'Load + Run'). Pass reset_run=false to flash only (e.g. to set breakpoints before the firmware starts). Refuses (elf_layout_unsupported) an image GDB would flash incompletely, such as a Keil ARMCC5 AXF whose RW initializer lies outside its segment; flash its fromelf BIN instead.

  • get_debug_profile

    Returns the stored board/session defaults.

  • get_gdb_events

    Polls GDB for any asynchronous events (like hitting a breakpoint) or stdout messages.

  • get_gdb_server_logs

    Returns recent logs captured from the active GDB server process.

  • get_logs

    Returns captured log lines for a channel (rtt/swo/uart).

  • get_session

    Returns this session's record by view: 'journal' (every tool call with args/ok/summary/duration; supports limit), 'timeline' (compact human-readable replay), or 'metrics' (per-tool call counts, success/failure, durations).

  • get_timeouts

    Returns the current named GDB operation timeouts (connect, reset, memory, registers, source, run, download).

  • get_write_audit_log

    Returns the append-only audit log of every memory-write decision (written, blocked, or simulated).

  • halt_execution

    Interrupts/halts the target device execution.

  • hub_dashboard

    Starts (or stops) a local, read-only web dashboard for the hub: every port's power and data-line state, live voltage/current with a few minutes of history, which debug session sits on which channel (and whether its GDB server is live), and a timeline of hub actions. Serves on 127.0.0.1 only and returns the URL. When the shared hub daemon owns the hub (the default with several MCP servers on a rack) this returns the daemon's always-on page, which also lists every connected server. In local mode the page runs inside this server and, while it runs, no OTHER process can open the hub; state=off sto…

  • import_netlist

    Parse a schematic netlist (KiCad .net today) into a machine-readable BoardDescription: the MCU part/family/line, a per-pin map (package pin -> port pin -> net -> inferred peripheral function), and the power/ground nets. This is the input contract for automated framework design. Pass 'path' or 'text'. The result is stored on the session; read views with describe_board.

  • import_spec

    Translate a controlled-vocabulary product spec (human/product terms) into the per-peripheral design params design_framework consumes, and cross-check it against the imported netlist. This is the upstream guard the pipeline lacked: instead of hand-writing HAL macros, supply intent -- UART framing '8N1', direction 'txrx', flow_control 'rtscts'; SPI role 'master', spi_mode 0..3, data_size, bit_order; I2C speed 'fast', addressing '7bit'; ADC resolution 12, conversion 'continuous'; a timer update_hz; plus dma / interrupt / priority opt-ins -- and the machine expands it deterministically (8E1 -> UAR…

  • inspect_project

    Discovers firmware project artifacts such as ELF, map, linker script, SVD, and STM32CubeMX .ioc metadata.

  • list_breakpoints

    Lists breakpoints with their HIT COUNTS. A hit_count of 0 means the code path was never reached — so a run_and_wait timeout means the precondition (a flag/state) to get there was not satisfied. Use this instead of retrying.

  • list_functions

    Lists functions in the loaded symbols, optionally filtered by a regex.

  • list_sessions

    Lists all debug target sessions (the 'default' one plus any named) with their liveness and port. To debug MULTIPLE boards at once, pass a 'session' argument (any string) to any tool — e.g. start_debug_session(session='rackA', ...) — and each gets fully isolated state.

  • list_source

    Lists source lines around a location (function, 'file.c:42', or '*0xADDR').

  • list_variables

    Lists global/static variables in the loaded symbols, optionally filtered by a regex.

  • load_acceptance

    Load a machine-checked AcceptanceSpec (product-spec → deterministic checks) from an inline 'spec' object or a JSON 'path'. Checks: memory_u32 (any memory-mapped register), variable (C global), core_register, no_fault, stopped_at (PC in a symbol). Stored on the session; evaluate with run_acceptance.

  • load_coredump

    Loads a previously captured core file for offline analysis.

  • load_debug_config

    Loads a YAML debug config and applies compatible fields to the active debug profile. Fields the file defines REPLACE the stored ones, so re-loading a rack config after re-cabling never accumulates the previous rig's hub.map channels; fields it omits are left alone.

  • load_device_pack

    Register a verified device-fact pack (Pillar F) so the deterministic solvers cover a new STM32 family: its DMA request routing, irregular NVIC vectors, clock PLL profile, and timer bus/width. Facts are DATA, never guessed -- STM32F4/L4 ship built-in; add a family by supplying a validated pack (schema 'stm32-device-pack/v1') via path= (a JSON file) or inline pack=. Call with no arguments to report current coverage. Honest by design: a malformed pack is rejected with the list of problems and never half-loaded; shadowing a built-in family needs allow_override=true.

  • load_svd

    Loads an SVD file for peripheral parsing.

  • load_symbols

    Loads symbols from an ELF/AXF into the current GDB session WITHOUT flashing. Symbols are per-session, so after a fresh connect or recover_session you need this (or flash_firmware) before symbol breakpoints resolve. Falls back to the debug profile's elf_path if elf_path is omitted.

  • lookup_type

    Shows the type/layout of an expression or type name (GDB ptype).

  • mcp_info

    Identifies THIS running stm32-gdb-mcp server: release version, git commit, the package directory the code was imported from (plus the install root the git probe used), whether compact mode is hiding tools, and how many tools this build advertises versus how many exist. Needs NO debug session, NO probe and NO target — call it the moment a tool you expect is missing or behaves like an older build, instead of guessing which checkout the client actually launched.

  • measure_hub_channel

    Samples a hub port's voltage and current over a window and returns the series plus min/max/mean per channel. Read-only, and costs no target traffic -- so it works while the core is running, which is the point: it is the only instrument here that sees actual power draw, and an MCU that entered Stop and one that only thinks it did look identical over SWD. Requires a model with an ADC.

  • power_cycle_target

    Removes power from a hub port and restores it: a true cold boot of whatever is on that port, and the only in-band way to clear a wedged probe USB endpoint. On models with an ADC the voltage during the off window is measured and reported, so a rail that never actually collapsed (bulk capacitance, a second supply, a coin cell) is flagged instead of being reported as a cold boot that did not happen. Requires confirm=true while the guard is in confirm mode or a session has a live GDB server on the port.

  • read_call_stack

    Reads the call stack as a decoded list of frames {level, func, file, line, addr} plus a one-line summary. Set include_raw=true to also get the raw GDB output.

  • read_core_registers

    Reads CPU core registers as a decoded {name: hex} map plus a one-line summary of PC/LR/SP. Set include_raw=true to also get the raw GDB output.

  • read_cycle_counter

    Enables (if needed) and reads the DWT cycle counter (DWT_CYCCNT) for on-chip timing measurements.

  • read_fault_registers

    Reads Cortex-M SCB fault status registers (CFSR, HFSR, DFSR, MMFAR, BFAR, AFSR).

  • read_frame_variables

    Returns a decoded {name: value} map of locals and arguments for a stack frame, plus a count summary. Set include_raw=true for the raw GDB output.

  • read_freertos

    Reads FreeRTOS state by 'what': 'current_task' (pxCurrentTCB), 'tasks' (ready list: names/priorities/TCB/stack), 'task_lists' (ready/delayed/suspended/deleted), 'queue' or 'mutex' (needs handle = a Queue_t expression), or 'heap' (heap_4/5 usage).

  • read_memory

    Reads a block of memory from the target. Returns the raw bytes in memory order, plus value_le -- the same bytes as one little-endian value -- for a 1/2/4/8-byte read. Use value_le for a peripheral register: the raw string arrives least-significant-byte first, so reversing it by hand is where bit positions get misread.

  • read_peripheral_register

    Reads a peripheral register using its name from the loaded SVD.

  • read_typed_memory

    Reads memory with an explicit element width and count.

  • read_variable

    Reads the value of a C variable currently in scope.

  • reconstruct_fault_context

    Reconstructs the full crash site after a HardFault: decodes fault registers, unwinds the auto-stacked exception frame from MSP/PSP via EXC_RETURN to recover the true faulting PC, and resolves it to source file:line. Run this when halted in a fault handler.

  • recover_session

    Recovers a dropped or wedged session: cleanly tears down the GDB client and server, then restarts the server (with retry/backoff for a busy probe) using the last start_debug_session arguments and reconnects. Use after a probe_unavailable or connection_lost error. When a programmable USB hub is configured (debug_profile hub.channel), a retry that cannot fix the probe escalates to toggling its USB data lines and then power-cycling the port -- the only in-band cure for a wedged endpoint. Any hub action taken is reported in recovery_steps.

  • render_framework

    Render the synthesized FrameworkPlan to a HAL C init skeleton (bsp_init.c + bsp_init.h). Every derived fact (clock enables, GPIO modes, mapped .Init fields) is concrete; every unresolved value is a clearly marked TODO — nothing is fabricated. Returns the files, their content, and a todo_count. Run design_framework first.

  • report_issue

    Files a GitHub issue about an MCP problem from THIS session — auto-bundling the session journal, metrics, and MCP version into a structured report (via the gh CLI). Call this when a tool misbehaves or confuses you. Deduplicated per session so retries don't spam. Defaults to the stm32-gdb-mcp repo.

  • reset_target

    Resets the target device. Can optionally halt immediately after reset. strategy="cold" removes target power through a configured programmable USB hub before resetting, which is the only strategy that produces a true power-on reset (RCC_CSR POR flag, cleared .noinit, drained RAM); it fails rather than silently doing a warm reset when no hub channel is mapped. It needs no confirm argument -- asking for a cold reset by name IS the confirmation the hub guard wants -- and it stops the GDB session before the cut, then re-establishes it.

  • resolve_address

    Maps an address or expression (e.g. '$pc', '0x08001234') to its source file:line and nearest symbol, returning {resolved, symbol, offset, section, file, line}. resolved=false means GDB found no symbol there.

  • run_acceptance

    Evaluate the loaded AcceptanceSpec against live silicon state and return a deterministic pass/fail/error verdict per check (the closed-loop judge). An unreadable target is reported as 'error', never a silent pass. A failing/errored check derived by synthesize_acceptance carries provenance.source — the init function + line that should satisfy it — so fixes are precision-guided. Run load_acceptance first; halt the target at the state you want to assert.

  • run_acceptance_iteration

    Run one bounded loop iteration: (optional build) → (optional flash+run-to) → evaluate the AcceptanceSpec against live silicon, then record the verdict and return a decision (converged / should_continue / exhausted / stalled) plus the checks to fix. A build or run-to failure is recorded as a phase_error, not a crash. Refuses to run a terminal loop unless force=true. start_acceptance_loop first.

  • run_and_wait

    Resumes the target and waits, returning a structured stop event (reason, symbolized frame, breakpoint id, signal) or a timeout. Use this instead of continue_execution + polling to close the debug loop.

  • run_for_duration

    Runs the target freely for a wall-clock duration, halts it, and returns one structured report with final frame/context and optional expression captures. Useful for counters, telemetry buffers, polling loops, and timing-sensitive bus diagnostics without breakpoint perturbation.

  • run_pipeline

    Spec-to-silicon capstone (Pillar G): run the whole deterministic DESIGN half in one call. Chains the existing, individually verified tools in dependency order -- import_netlist? -> import_spec? -> design_framework -> solve_clock_tree? -> solve_timer? -> render_framework -> synthesize_acceptance -- turning a netlist plus a product spec into a flashable HAL skeleton and a machine-checked acceptance spec, then hands off to the build/verify loop. Optional stages (marked ?) run only when their input is present. Honest by construction: it GUESSES NOTHING -- it sequences verified tools and aggregates…

  • run_scenario

    Replays a declarative scenario — a list of {tool, args} steps — deterministically and returns a per-step pass/fail report. Provide inline 'steps' or a 'path' to a JSON scenario file. The minimal-step way to re-run a complex bug repro.

  • run_to_line

    Runs until a given location is reached (function, 'file.c:42', or '*0xADDR').

  • sample_pc

    Statistical PC profiler: enables DWT and samples the program counter while the core RUNS (non-intrusive, over SWD — no SWO pin or firmware change). Returns a symbolized hot-spot histogram (top functions by %), not raw hex — the fast way to find where firmware spends time or what loop it is stuck in. A high 'unsampleable' count means the core is halted/asleep; a high 'zero_samples' count means nothing was profiled at all. Leave enable=true: GDB cannot write the enable bit while the core runs, so this halts briefly to set it and resumes, and only when it is not already set. Note some links canno…

  • save_debug_config

    Saves a YAML debug config file.

  • select_frame

    Selects a stack frame by level (0 = innermost) for subsequent variable reads.

  • self_check

    Validates the link right after connecting: reads CPUID and DBGMCU IDCODE and checks byte order, that a real Cortex-M is present, and that the device matches the expected family (from the profile MCU or the 'expected_family' arg). Run this first to catch endianness/config faults before debugging. Halts the core first (identity reads are unreliable while running); pass halt=false to skip.

  • set_adapter_speed

    Sets the SWD/JTAG adapter clock (kHz) at runtime. The default ST-Link speed is only ~480 kHz; raising it (e.g. 4000) speeds up flashing and memory reads ~8x. Lower it if reads/flash become unreliable.

  • set_breakpoint

    Sets a breakpoint at a function, line, or address. Supports an optional condition (break only when true), temporary (auto-delete on first hit), and ignore_count (skip N hits) so the AI can set a hypothesis trap and resume.

  • set_debug_profile

    Stores board/session defaults such as MCU, probe, GDB server args, ELF path, and SVD path. Top-level fields you omit keep their value, but a nested block you pass (hub, rtt, uart, swo, reset, hil) REPLACES the stored one whole -- pass merge=true to deep-merge into it instead.

  • set_hub_data

    Connects or disconnects a hub port's USB2 data lines, leaving power untouched. This un-enumerates a probe without rebooting the board it is attached to. With exclusive=true every other port's data line is disconnected, so exactly one probe stays visible -- which keeps start_debug_session's single-probe auto-select valid on a multi-board rack.

  • set_hub_power

    Switches a hub port's power on or off. Powering off removes VBUS from whatever is on that port, so it cold-boots the board and un-enumerates its probe. Requires confirm=true while the guard is in confirm mode (the default) or a session has a live GDB server on the port.

  • set_timeouts

    Overrides one or more named timeouts (positive seconds). Useful for a slow or flaky probe. Recorded in the journal so replays are deterministic.

  • set_watchpoint

    Sets a hardware watchpoint on a memory address or variable.

  • set_write_policy

    Configures memory-write guardrails: mode ('enforce' or 'dry_run'), and optional allow/protected regions. Protected regions (option bytes, IWDG, WWDG) block writes by default; dry_run simulates every write.

  • setup_swo

    One-call SWO/ITM printf setup. Configures the target's TPIU+ITM from the debugger (no firmware ITM-init needed) for the given core clock (hclk_hz) and SWO baud, and returns the OpenOCD capture commands + the firmware printf retarget snippet. Then capture with logging(action=start, channel='swo', file=<output>). Requires the SWO pin (e.g. PB3) wired to the probe.

  • sizeof

    Evaluates sizeof(expr) against the loaded symbols.

  • solve_clock_tree

    Synthesize a concrete SystemClock_Config() for the session's FrameworkPlan (Pillar D Tier 3) - the last hand-written gap in generated init code. Given a clock source (HSE + crystal Hz, or HSI) and a target SYSCLK, it computes the exact PLL dividers (M/N/P or R, Q for 48 MHz USB), AHB/APB bus prescalers, and flash wait-states via pure datasheet math, then stores the result so the next render_framework emits real clock code instead of a TODO stub. Deterministic and honest: an unmodelled device or an infeasible target is surfaced, never guessed. Built-in profiles: STM32F401/F407/F411 and mainstre…

  • solve_timer

    Solve a timer's Prescaler/Period (PSC/ARR) for a target update frequency (Pillar D Tier 3). Turns intent ('TIM3 at 1 kHz') into concrete register values using the timer input clock (TIMxCLK) derived from the solved clock tree. Record a target via design_framework(design={'TIM3': {'update_hz': 1000}}) then run solve_clock_tree first, or pass timer_clock_hz directly for a what-if. Deterministic and honest: an exact target yields zero-error PSC/ARR, an inexact one yields the closest pair plus the achieved frequency and ppm error, and an unrepresentable target or an unknown timer bus is surfaced, …

  • start_acceptance_loop

    Start a bounded spec-to-silicon acceptance loop (Pillar C) for the loaded AcceptanceSpec. Each run_acceptance_iteration does one build → flash → run-to-state → run_acceptance pass; the loop stops on convergence, on max_iterations, or on a stall (same checks failing repeatedly). Omit build/flash to run evaluate-only iterations (you flash manually). Load a spec first.

  • start_debug_session

    Starts the specified GDB Server (openocd, stlink, jlink) and connects the GDB Client to it. openocd REQUIRES server_args naming the probe and target, e.g. ['-f','interface/stlink.cfg','-f','target/stm32l4x.cfg'] — without them OpenOCD cannot find a config or adapter. Omitted values come from the active debug profile.

  • start_logging

    Starts background log capture on a channel: 'rtt' (SEGGER RTT, default cmd JLinkRTTClient), 'swo' (ITM printf — run setup_swo then pass file=<output>; or command=<external decoder>), or 'uart' (serial, port required). One tool for all three channels.

  • step

    Single-steps the target: kind='over' (over the line), 'into' (into calls), 'out' (run until the function returns), or 'instruction' (one machine instruction; set over=true to step over a call).

  • stop_debug_session

    Stops the GDB client/server, variable tracking, and all active RTT/SWO/UART readers.

  • stop_logging

    Stops background log capture on a channel (rtt/swo/uart).

  • suggest_server_args

    Returns the correct OpenOCD server_args for an MCU family + probe (e.g. STM32L431 + stlink -> ['-f','interface/stlink.cfg','-f','target/stm32l4x.cfg']) and validates the config files exist in OpenOCD's bundled scripts dir. Call this to get start_debug_session args — do NOT search the disk for .cfg files.

  • synthesize_acceptance

    Auto-derive a machine-checked AcceptanceSpec from the synthesized FrameworkPlan (Pillar D Tier 3) and load it as the session's acceptance judge — welding design synthesis to the acceptance loop. Always emits a no_fault check (init must not HardFault); adds a memory_u32 bits_set check per clock the plan enables (RCC enable bit), a memory_u32 bits_set check per interrupt the plan enables (arch-standard NVIC ISER bit, from the resolved IRQ number), and a masked memory_u32 eq check per configured pin (GPIO MODER = AF/analog; F1's CRL/CRH is skipped). Register/IRQ/port placements come from the sess…

  • tool_help

    Returns descriptions and complete schemas for full-surface tools, including tools hidden in compact mode.

  • track_variable

    Background variable tracking: action='start' (needs variable + interval_ms), 'stop', or 'get' (returns the sampled data for trend/leak analysis).

  • validate_board

    Validate the imported BoardDescription: detect a package pin wired to multiple nets (short), a peripheral signal routed to multiple pins, a port pin driven by multiple nets, and missing power/ground/debug/reset nets. With a pin-capability DB (db_path or the STM32_GDB_MCP_PIN_DB env) it also checks alternate-function legality; unknown pins degrade to 'unverified', never a false conflict. Run import_netlist first.

  • validate_debug_config

    Validates a YAML debug config object without saving it.

  • verify_flash

    Verifies that target flash matches an ELF (GDB compare-sections). Compares read-only sections, which is what lives in flash; writable sections hold the ELF's initial RAM values and always differ once the firmware has run, so including them would fail every healthy target. Pass include_writable=true only right after a load, before the target has executed.

  • wait_for_stop

    Waits for the next stop event WITHOUT resuming the target, returning a structured stop event or a timeout.

  • write_memory

    Writes a value to a specific memory address.

  • write_typed_memory

    Writes memory with an explicit C integer width.

Signals

Stars
2
Forks
0
Open issues
1
Weekly downloads
158
Last commit
Oct 24, 2026 (4 days ago)
Last release
Oct 19, 2026 (9 days ago)
Last package publish
Oct 17, 2026 (11 days ago)

From GitHub (fetched Oct 24, 2026) and the package registry.

Details

Registry name
io.github.Zeraissh/stm32-gdb-mcp
Version
0.15.1
Auth
No auth
Packages
pypi stm32-gdb-mcp
License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026
Cite this page

STM32 GDB Debugger MCP server. Agent Mart. https://agentmart.dev/connectors/zeraissh-stm32-gdb-mcp (last updated 2026-10-24)