BMP DebugA VS Code extension for debugging ARM microcontrollers using the Black Magic Probe with Zephyr RTOS thread awareness support. This extension is a fork of Cortex-Debug by Marus (marus25), stripped down and focused specifically on Black Magic Probe (BMP) workflows. Full credit and attribution to the original Cortex-Debug project and its contributors. Features
Requirements
Quick StartAdd the following to your
USB Auto-DetectionThe extension automatically detects a connected Black Magic Probe by scanning USB devices for VID
The GDB port (Interface 0) is identified by its USB interface descriptor ( If multiple probes are connected you will be prompted to choose one.
You can still override the port manually by adding RTT over BMP SerialWhen
The UART port is detected using these strategies (in order):
The RTT terminal is bidirectional — you can both view output and send input. It is automatically closed when the debug session ends. Example configuration with RTT
Specifying the GDB Executable and Python RuntimeThe extension needs a GDB binary with Python support to communicate with the Black Magic Probe and enable RTOS thread awareness. You typically need to configure both the GDB path and the Python runtime together. Selecting the GDB binaryThe GDB binary is resolved in this order of precedence:
Configuring the Python runtimeGDB builds with Python support ( Set
Set Example: GDB-py with a venv Python (Windows)
Example: Using
|
| Property | Description |
|---|---|
gdbPath |
Full path or name of the GDB executable. Overrides armToolchainPath. |
armToolchainPath |
Directory containing the ARM toolchain binaries. |
pythonPath |
Path to the Python interpreter GDB should use. Accepts a venv interpreter; the base install is found automatically via pyvenv.cfg (important on Windows). |
pythonHome |
Explicitly sets PYTHONHOME for GDB. Rarely needed — omit unless pythonPath alone does not work. |
All properties support per-platform VS Code setting variants: .linux, .osx, .windows.
Getting a Compatible GDB for python based RTOS thread awareness
The Zephyr SDK ships a build of arm-zephyr-eabi-gdb that includes Python support and is the easiest way to get a compatible GDB.
Download the Zephyr SDK from the releases page. You can install the full SDK or just the ARM toolchain:
# Full SDK (includes all toolchains) wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.0/zephyr-sdk-0.17.0_linux-x86_64.tar.xz tar xf zephyr-sdk-0.17.0_linux-x86_64.tar.xz # Or minimal — ARM toolchain only wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.0/toolchain_linux-x86_64_arm-zephyr-eabi.tar.xz tar xf toolchain_linux-x86_64_arm-zephyr-eabi.tar.xzOn Windows, download the
.7zor installer variant and extract/install to a directory such asC:\zephyr-sdk-0.17.0.Locate the GDB binary inside the extracted SDK:
OS Path Linux <sdk>/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdbmacOS <sdk>/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdbWindows <sdk>\arm-zephyr-eabi\bin\arm-zephyr-eabi-gdb.exeConfigure the extension using one of the methods above. Since the Zephyr SDK uses the prefix
arm-zephyr-eabiinstead of the defaultarm-none-eabi, the simplest approach is to setgdbPathdirectly:{ "bmp-debug.gdbPath": "<sdk>/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb" }Alternatively, set both
armToolchainPathandarmToolchainPrefix:{ "bmp-debug.armToolchainPath": "<sdk>/arm-zephyr-eabi/bin", "bmp-debug.armToolchainPrefix": "arm-zephyr-eabi" }
Note: The Zephyr SDK GDB requires the Python version it was compiled against to be installed on your system. If you get errors about missing Python libraries, install the matching Python version (check with
arm-zephyr-eabi-gdb --configurationand look for the Python path).
Key launch.json Properties
| Property | Description |
|---|---|
servertype |
GDB server type: "bmp" (default), "qemu", or "external" |
port |
Serial port for BMP GDB server. Auto-detected if omitted |
interface |
Debug interface: "swd" (default) or "jtag" |
targetId |
Target ID for BMP scan (default: 1) |
powerOverBMP |
Power target via BMP: "enable", "disable", or "lastState" (default) |
rtos |
RTOS type for thread awareness. Currently only "zephyr" is supported |
rttEnabled |
Enable RTT over BMP serial. Opens the UART port in a terminal panel and sends monitor rtt enable |
runToEntryPoint |
Function name to run to on launch (e.g., "main") |
gdbPath |
Full path or name of the GDB executable to use (overrides armToolchainPath) |
armToolchainPath |
Path to the directory containing the ARM toolchain binaries |
For a full list of properties, see debug_attributes.md.
Acknowledgments
This extension is based on Cortex-Debug by Marus (marus25). The original project is licensed under the MIT License.
Parts of the original Cortex-Debug extension are based upon Jan Jurzitza's (WebFreak) code-debug extension, which provided an excellent base for GDB MI parsing and interaction.
The mcu-debug extensions (Memory Viewer, RTOS Views, Peripheral Viewer) are used for frontend debug views.