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. 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 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. Intel Mac runtime and macOS J-Link remain unverified; existing Windows acceptance records retain their original scope. 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. |