XFlashGate MCU DebugEnglish / 中文 illustrated guides are included in the extension. Run XFlashGate: User Guide to open the guide offline in your VS Code display language. 中文说明 · English guide · 中文图文指南 New in 0.5.24Memory, RTT, Peripherals, RTOS and Live Watch now have shorter window titles. To open them from the Command Palette, search for XFlashGate. Direct GDB attach retries a connection reset during the handshake. J-Link attach asks the server to confirm hardware breakpoints when you set them. Ordinary managed attach checks code bytes against the selected ELF when the stopped PC maps to one fixed-address, read-only executable image. A mismatch shows the ELF path, address and differing bytes. F10 displays the stopped frame first. If the PC has no source line, the editor shows the instruction at that address. For eligible straight-line calls on Cortex-M, Step Over uses GDB to run to the next location in the current frame. Both attach modes were verified on STM32C5 in system VS Code at 5000 kHz SWD, including source breakpoints, stepping and resuming on disconnect. New in 0.5.23The WCH interface defaults to Auto, prefer two-wire. On an eligible target such as CH32V467, the extension uses the downloader's declared capabilities and signed target identification to qualify two-wire SDI at the nominal 5 MHz GPIO setting. The advanced interface setting can pin SWIO or two-wire. Automatic mode can keep a verified fallback link. Offline Flash jobs follow the transport in their signed algorithm. Live Watch groups adjacent fields into memory reads and can batch noncontiguous ranges with downloaders advertising Bench coverage includes native GDB attach to CH32V467, switching from SWIO and reattaching to an existing two-wire 5 MHz session. In system VS Code on STM32C5 at 5000 kHz SWD, a mixed list with 19 expanded fields reached 11.42 complete rounds/s at a 20 rounds/s setting with downloader firmware New in 0.5.22Live Watch keeps updating the list during high-rate sampling. It shows the latest available values up to four times per second, including values already read while longer reads are still running. Polling plain integer globals in the default display format uses a single GDB evaluation. The configured sampling rate is an upper limit on complete read rounds. In system VS Code on Apple silicon, direct GDB running attach to STM32C5 with downloader firmware New in 0.5.21J-Link compatible Attach and halt now supports watchdog freeze through the explicit AP in the project profile. The downloader must advertise Saving a project configuration consolidates duplicate extension settings, including the SVD/SFD path. Peripheral Registers reloads the currently configured file. System VS Code on Apple silicon loaded all 53 STM32C551 peripherals after saving and after a window reload. J-Link requests 5000 kHz by default. Direct GDB uses the downloader's SWD speed, which defaults to 5000 kHz on current firmware. System VS Code on Apple silicon verified attach, pause, continue and cleanup on STM32C5 with downloader firmware New in 0.5.20Watchdog freeze moved to a project profile with the target identity, AP, register addresses and masks. The extension verifies the connected target before writing and restores the changed bits after resuming. Running attach requires the full initial-state protocol. Configure the actual RAM range for snapshots and bounded memory access. After a downloader restart, the plugin restores missing GDB core/AP topology with read-only discovery before preparing the watchdog. Manually restarting RTT after a stop lets the stream reconnect on the first pause of a running attach. CMake synchronization now reports success in a separate notification. Hardware acceptance used system VS Code on Apple silicon and downloader firmware New in 0.5.19The CH32V467 fixture F5 accepts downloader target CRC with optional strict readback, and legacy full-sector readback. It reports unsupported capabilities separately from pending recovery. New in 0.5.18The CH32V467 fixture F5 notification shows the programming phase, elapsed time, and completion reported by the downloader. For a single sector, the percentage may stay flat until physical readback. New in 0.5.17CH32V467 fixture F5 lets the downloader identify the chip and match an installed signed flash algorithm. Programming uses single-wire, and Auto can switch to GPIO two-wire at 5 MHz for debugging. New in 0.5.16The 467 workflow reports whether it reused an identical TF firmware package or uploaded and verified a new one. The configuration page labels the downloader's GDB algorithm selection separately from the project's offline programming algorithm. New in 0.5.15The 467 build, program and debug entry automatically selects its generated TF package. It accepts an unknown image size in the downloader catalog after verifying package contents, selection and the exact firmware variant. A known mismatch stops programming. On a compatible downloader, the extension verifies or switches to single-wire before programming, then uses the selected debug interface. New in 0.5.14When Auto attaches over SWIO and identifies a halted CH32V467, the extension can use the downloader's declared wire switch and GPIO speed commands to select two-wire SDI at the nominal 5 MHz setting. A failed upgrade allows debugging to continue only after the single-wire link is verified. The fixture provides bare-metal and FreeRTOS RTT presets for testing through a halted debugger. New in 0.5.13WCH startup shows progress while reading downloader capabilities. If the capability GET is interrupted by a socket disconnect, the extension reads it once more. The sidebar distinguishes preparation from an existing debug session and opens that session in Run and Debug. New in 0.5.12WCH RV32 projects show Attach and halt and, for the CH32V467 bare fixture, Build, Program and Debug. Regenerating F5 entries removes incompatible managed entries and preserves the names of the two supported entries. The configuration panel and command menus apply the same WCH launch limits. Existing incompatible values can be corrected in the configuration panel. New in 0.5.11The CH32V467 fixture can start programming after the downloader has parsed the selected package while its programming state is idle. A repeated run waits for the new job instead of using the previous completion status. New in 0.5.10The CH32V467 bare fixture introduced a separate Build, Program and Debug entry. The downloader verifies Flash before GDB parks at the fixture entry using the same build’s ELF. Standard Attach halts the firmware already on the board without programming or resetting. New in 0.5.9The TF library accepts native RISC-V Flash algorithms and the current A/B format identifiers. Select the exact signed package version for offline programming. For CH32V467, program the firmware package on the downloader and use F5 Attach with the matching ELF; GDB does not program this target. New in 0.5.8Check device status without reading the TF algorithm library. Algorithm browsing is under Flash programming settings. If a directory is entered as the ELF path, select the actual ELF/AXF file. CMake sync can reuse absolute GCC and Ninja paths from the selected preset; a separately installed GDB still needs its own path. New in 0.5.7WCH attach with firmware declaring New in 0.5.6CH32V467 attaches with automatic WCH interface detection by default. Select a matching RISC-V ELF and GDB, then press F5 with the Attach configuration. An advanced setting can pin SWIO or two-wire SDI for a specific fixture. On firmware declaring New in 0.5.5This release includes the completed English and Chinese READMEs and user guides, with matching descriptions of cooperative RTT requirements, firmware dependencies and verified limits. The CHANGELOG now includes both languages. Each future package requires current-version summaries in all five documents; packaging and CI reject missing or stale summaries, and the VSIX audit checks the packaged documents against the source. The MCU debugging implementation is unchanged from 0.5.4. This release reuses its completed hardware and real AI acceptance evidence; verification covers the documentation checks, universal package and official installation. Experimental CH569 running RTT still requires explicitly cooperating target code and compatible downloader firmware. TCP firmware changes retain their separate production gates; ISP remains deferred. New in 0.5.4Cooperative RTT now completes its data and stop confirmation before a direct VS Code disconnect ends GDB. New input is blocked during disconnect. Compatible downloader firmware can also prove that the original private session has closed; failed or missing proof remains visible. MCP identifies stopped RTT caches by their original source/session and keeps them historical when a new debug session starts. The experimental CH569 running RTT path requires explicitly cooperating target code, a matching ELF and initialization breakpoint, and the downloader's declared protocol. It does not provide arbitrary background SRAM access for ordinary firmware. System VS Code checks cover preemptive FreeRTOS, bidirectional input, direct disconnect and the next session; real AI checks cover task/stack sources, empty and nonempty RTT increments, and the closed-session cache. See the test scope and remaining limits. TCP keepalive tolerance and GDB trace redaction are companion firmware changes. They are not installed by a VSIX update. Their development branch retains separate production resource gates; the temporary test downloader was restored to its original firmware. ISP remains deferred. Run XFlashGate: Offline Download Status from the sidebar or Command Palette to inspect the downloader's current directory, saved variant, execution errors and recovery state. Traditional When the downloader declares the independent algorithm compatibility policy, a firmware release increment does not require replacing or re-signing an existing algorithm package. The extension checks declared container, manifest and algorithm ABI support; device API, preparation, signature, target and parameter checks remain mandatory when loading. Exact package identities stay pinned. Missing or unknown policy declarations do not enable this behavior. Selection and verified loading do not establish successful physical programming. TF algorithm selection displays transfer progress and supports cancellation. Its total limit is 60 seconds plus the declared file size at 8 KiB/s, capped at 15 minutes; 30 seconds without data also stops the read. A canceled or timed-out read preserves the previous selection and does not load an algorithm or operate the target. Check Wi-Fi and TF read speed before trying again. Use XFlashGate: Target / Cores to select a project debug configuration, configure device-declared cores, or attach through an external Xtensa GDB server. CMake owns compilation and ELF outputs; each debug configuration selects its ELF, GDB and core. Chip-specific register models and shared-resource checks belong to registered target adapters. No chip-specific entries are permanently added to the sidebar. See the English/中文 configuration guide and validation limits. The buildable RT685 M33 + HiFi4 RAM example supplies two matching ELFs, independent heartbeat loops and explicit backup/restoration instructions. Independent concurrent sessions require the downloader's explicit shared-core contract; otherwise use supported single-core sessions. Loading this sample is a deliberate test operation, not part of Attach. The target-picker refactor does not establish new hardware acceptance results. Debug MCU source code through an ESP-DAP device in Visual Studio Code. Version 0.4.5 adds RTT down-channel preparation while the MCU keeps running in eligible direct-GDB running-attach sessions. Running attach, compact RTT controls, host receive timestamps, color rules, incremental RTT access through AI/MCP, verified Flash programming, backed-up RAM launch and built-in analysis views remain available. The interface follows VS Code's display language: Chinese for Chinese locales, English otherwise. Commands, settings, panels and analysis reports use the same language. MCU logs, variable values, source code and user input retain their original content. New in 0.5.0macOS Intel and Apple silicon packages join Windows x64. Tool discovery supports Homebrew and CMake.app, and connection/tool failures include the failing step and recovery instructions. Attach Running (No Reset) has its own command and F5 entry. RTT can start and prepare input automatically with debugging; routine connection details are folded away. Live Watch now negotiates running attach correctly and rebuilds its observer after the first manual pause. System VS Code checks on Apple silicon cover PowerUnit Boot/App and FreeRTOS RAM samples on MIMXRT685 and STM32N657. Both RTOS samples expose nine tasks, source stacks/locals, up0/down1 RTT acknowledgements and offline RAM inspection. RT685 automatic reset/recovery remains limited by the tested board's ineffective nRESET path; the N6 controlled-fault run required a power cycle before recovery. See the 0.5.0 acceptance record for exact evidence and limits. Fixed in 0.4.9After the first manual Pause or adoption of a halted session, Continue now waits for owned RTT restoration. This avoids GDB's “Cannot execute this command while the target is running” error. Direct-GDB sessions with device live-memory support can prepare RTT input while running even after Pause/Step/Continue. The main RTT channel still follows its separate setup rules below. PowerUnit normal-window checks cover automatic recovery, F5/Attach, source and frame variables, disconnect/reconnect, and Configure and Build both during running attach and with no debug session. New Fixed in 0.4.8Ordinary attach and F5 attach automatically reconcile an unfinished direct-GDB session. When the target is already halted, attach adopts the existing state while preserving watchdog freeze and the original recovery values; it does not require a manual recovery step or resume/reset the MCU. Identity, firmware, resource-ownership and readback failures remain visible. Download and RAM launch keep their explicit safeguards. See session lifecycle. Host builds have their own task state: an attached debugger no longer blocks CMake configuration or builds, repeated clicks join the current build, and a failed build can be retried from the same entry. The running-attach/build combination deferred at 0.4.8 release was subsequently verified in the 0.4.9 hardware record above. For Boot/App source debugging, load matching ELFs that contain line and variable debug information, including in Release builds. The companion PowerUnit CMake fix retains Fixed in 0.4.7Selecting Attach and keep running (pause manually) no longer blocks CMake preview, synchronization, configuration or builds. Generating an alternate J-Link launch entry does not validate that entry as an active debug session. Build actions preserve your selected connection and startup mode; backend compatibility is checked when you actually start debugging. This closes the running-attach configuration case missed in 0.4.6. New in 0.4.6CMake preview, synchronization, configuration and build require only the compiler tools, CMake and Ninja; GDB, a connected device and an ELF are not prerequisites. Tool diagnostics check available build tools even when GDB or J-Link is missing. Actual debugging still validates its required debugger. Synchronization also handles localized Git diagnostics for projects outside a repository while retaining protection for tracked local presets. New in 0.4.5Select Prepare input beside the RTT input line, enter a command and press Enter. Select a separate down channel under Channel and display settings → Down-channel input (advanced). The configuration page's RTT section offers automatic RTT startup and automatic input preparation independently. Session termination cleans up RTT; reconnection prepares input again without sending commands. A visible hint explains disabled input. If stopped at For attachment without reset, use XFlashGate: Attach running (no reset) or its generated F5 (gdb) entry. It keeps running even when the workspace saves Boot-to-entry as its startup policy. Start configured debugger follows the saved policy. Pause manually once to enable full source-breakpoint debugging. The officially installed 0.4.5 passed normal F5 running attach and RTT input preparation on PowerUnit Up0/Down0. New Fixed in 0.4.4RTT input preparation accepts the defined Failed RTT startup also reconciles monitor status when the welcome marker times out. It recognizes an already-closed monitor and only cleans a running empty monitor when no other ports exist and the range matches this attempt, allowing recovery without closing another receiver. Hardware verification covers Up0/Down0 command replies, recovery from invalid input, out-of-range channel rejection/recovery and incremental/repeated MCP peek reads matching newly received terminal bytes. MCP reads do not consume the received cache. Positive concurrent operation on nonzero channels is not covered by this verification. Fixed in 0.4.3Automatic RTT setup in a normal all-stop session now waits for a real stop and rechecks session readiness before running. Boot-to-entry waits for the primary App entry, so a Boot breakpoint does not bind the wrong image's same-named RTT control block. Initial non-stop running attach retains its automatic RTT setup; the first manual Pause ends that initial permission. See the Boot/App workflow for primary App and additional Boot symbols, source/frame association and reset versus programming. Pre-halt watchdog preparation also initializes an empty target profile through a read-only CPUID access within its own Web lease, so the first attach after the downloader restarts does not wait on an uninitialized cache. Core/AP validation and cleanup remain required; the probe does not halt or reset the MCU. New in 0.4.2The following describes 0.4.2 behavior and its required device capabilities. The English guide provides the steps and identifies historical screenshots. See the real Windows running-attach RTT capture and compact RTT settings, both captured in a Chinese-language host with UTC receive timestamps. Hardware verification and external MCP-client analysis remain separately scoped. The rule-switch example uses synthetic local cached logs in the native display layer to demonstrate case, whole-word and RE2 matching; it does not involve an MCU or model response.
Run XFlashGate: AI/MCP Diagnostics, enable read-only diagnostics, then start and trust the server in MCP: List Servers. In your MCP client, record
In running attach, configured HardFault catch is activated and read back after the first manual Pause. The initial observation phase does not provide automatic fault-stop notifications; choose the existing attach-and-halt mode when full fault debugging is required immediately. Quick start
Project settings save a stable Use the ELF from the firmware running on the MCU. On an ordinary managed attach, the adapter checks instruction bytes when the stopped PC belongs to a single fixed-address, read-only executable image. A mismatch reports its address and the selected ELF. If the top frame has no source line, the editor shows its PC and instruction. Two distinct PCs can map to the same source line when stepping through a loop. Boot and App imagesSelect the App ELF/AXF as the primary symbol file and add the matching Boot ELF under Additional symbols (up to eight workspace-relative paths). Both symbol sets stay in one debug session: source navigation and frame variables follow the current PC or selected stack frame and its DWARF information, without manually switching ELFs. Matching source files must remain accessible; moved source trees require a source-path mapping. The session freezes and hashes the complete set for debugging, Live Watch, RTOS readers and saved crash/RAM analysis. Additional symbols supply no implicit download action. Startup mode defaults to Attach and halt (preserve current context). With the Start configured debugger entry, Boot to primary ELF entry ( Runtime addresses must match the ELFs' fixed linked addresses (VMAs); dynamic relocation, overlays and overlapping code regions are not switched automatically. Duplicate non-static globals in Watch or Global scope still follow GDB lookup rules and are not separated into Boot/App namespaces. The two symbol sets are not memory snapshots: when Boot and App reuse RAM, current RAM values do not preserve earlier Boot variables. With Program and debug, an empty Download images (advanced) list downloads only the primary ELF. A nonempty list explicitly replaces that default and can include matching Boot, App and tail-data ELFs. Keep this list separate from additional symbols, and check the complete firmware layout before downloading. Saved additional ELF digests prove which files were retained; target-machine-code comparison still reports its verified scope separately. Included views
AI / MCP permissions and toolsEnable XFlashGate: AI/MCP Diagnostics for a trusted local project and connect through MCP: List Servers or the copied connection configuration. The provider is named XFlashGate AI/MCP; each connection identifies whether target power write permission is enabled. Diagnostics remain read-only.
Power Off/Cycle loses target RAM and execution state; On can start the target and its peripherals. External power can prevent a reset. Off keeps power off; Cycle restores it on a fixed schedule. Active debugging, RTT and locally saved recovery sessions are rejected, never automatically stopped. If firmware explicitly permits the current download recovery session, only explicit On/Off is available and the recovery warning remains. Check each rail's Requirements and boundariesWindows x64 or macOS (Intel and Apple silicon) desktop, VS Code 1.101.2 or newer, a trusted project, an ESP-DAP device with the required capabilities, and local GNU/CMake/Ninja tools. The extension includes its own GDB/MI debug adapter, Live Watch, Memory, RTOS and peripheral views; no other debugger extension is required. J-Link mode uses an optional local J-Link GDB Server. Tools and vendor algorithms are not bundled. Apple silicon macOS has been checked in the system VS Code with PowerUnit Boot/App builds and source debugging, App and tail programming, running attach, repeated pause/resume, bidirectional RTT, Memory, peripheral reads, read-only MCP and RAM capture, with independent physical readback. J-Link on Apple silicon was verified within the 0.5.21 scope above. Intel Mac runtime remains unverified. For a local VSIX, use Node.js 22 or newer and run On macOS, GNU discovery also checks Direct GDB uses the device RSP port; J-Link uses the native probe endpoint through the local server. These ports are different protocols. Default Reset method ( Hardware samples include CH32F208/Cortex-M3, STM32C551/Cortex-M33 and NUCLEO-N657X0-Q/Cortex-M55. FreeRTOS stacks cover the verified GCC ARM_CM3 non-MPU basic frame, CM33_NTZ and CM55_NTZ basic contexts. The CH32F208 regression record describes its task stacks, variables and bidirectional RTT while running. ThreadX 6.2.1, CMSIS-RTX5 5.9.0 and Zephyr 4.3.0 use their verified basic M55 contexts in fixed N657 demos. Target identity, firmware capabilities and port layout govern support; these samples do not establish support for every MCU. Binary SFR, arbitrary RTOS ports, floating-point/cross-security context reconstruction, Remote/Web hosts and post-reset state restoration remain outside the verified scope. Local tool paths are stored per project and OS in VS Code's local storage, outside shareable project settings. Tokens use SecretStorage. Generated tasks and launch entries resolve local tools at execution time. The extension ID For errors, run XFlashGate: Show Diagnostics. Remove credentials and sensitive target data before sharing logs. |