Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Black Magic Probe runs its own GDB server over USB, so you can connect an ARM-aware GDB directly to the probe, scan the target over JTAG or SWD, and debug the microcontroller. The project documents an Eclipse-based setup specifically for STM32CubeIDE; the same configuration should not be assumed to work in every Eclipse distribution.

How the Black Magic Probe, GDB and Eclipse fit together

Black Magic Debug is the project and firmware; Black Magic Probe is the probe hardware and its integrated GDB-server workflow. The project describes support for ARM Cortex-M and Cortex-A targets, and lists Black Magic Probe V2.3 as active official hardware. Black Magic Debug’s supported hardware page and project homepage describe the hardware and project.

The probe firmware implements the GDB server. When connected by USB, it exposes two CDC-ACM serial devices: one is the GDB interface, and the other is a USB-to-UART adapter. For Cortex-M targets, the project recommends the ARM GNU Toolchain, which includes a suitable GDB. The getting-started guide explains the interfaces and setup.

Connect from GDB on the command line

Open the GDB executable for your target toolchain and connect to the probe’s GDB serial interface. Substitute the actual device name or COM port shown by your operating system for the example below.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Segger Microcontroller 8.12.28 J-Link Pro PoE Hardware Debugger Probe, Ethernet and USB Interface, for ARM Cortex, RISC-V, 8051, PIC32, RX MCUs
  • REMOTE DEBUG PROBE: The J-Link Pro PoE by Segger Microcontroller is a professional-grade remote debug probe designed for embedded development.
  • BROAD MCU SUPPORT: Compatible with a wide range of cores including ARM Cortex, 8051, PIC32, RISC-V, and RX MCUs, making it versatile for various development projects.
  • DUAL INTERFACE CONNECTIVITY: Features both Ethernet and USB interface types, allowing flexible connectivity options for seamless integration into your development environment.
  • STATUS INDICATORS: Equipped with onboard Status, Target IN, and Target OUT LEDs for real-time monitoring of debug probe activity and target communication.
  • COMPACT DIMENSIONS: Measures approximately 8.25 x 6.0 x 1.75 inches, offering a portable and space-saving form factor suitable for professional development workstations.
target extended-remote /dev/ttyBmpGdb
monitor auto_scan
attach 1

The project guide identifies /dev/ttyBmpGdb as an example, not a universal device path. On Windows, use the COM port assigned to the GDB interface; the guide notes that a \. prefix works for COM ports both below and above COM10. On macOS, select /dev/cu.usbmodem…, not its /dev/tty.usbmodem… counterpart: the guide warns that opening the tty endpoint can freeze GDB. Linux users may need the project’s udev rules.

If automatic target detection fails

Use the scan command for the physical debug interface wired to the target, then attach to the discovered target:

Rank #2
Sale
Segger Microcontroller 8.08.91 J-Link EDU Mini JTAG/SWD Debugger and Programmer for ARM Cortex M/A/R Series MCUs, USB Interface
  • WIDE COMPATIBILITY: Supports ARM Cortex A5/A7/A8/A9/A12/A15/A17, Cortex M0/M0+/M1/M3/M4/M7/M23/M33/M85, and Cortex R4/R5/R8 MCUs.
  • MULTIPLE INTERFACE TYPES: Features cJTAG, JTAG, SWD, SWO, and USB interfaces for versatile in-circuit and in-system debugging and programming.
  • EDUCATIONAL USE: The J-Link EDU Mini is designed specifically for educational purposes, making it ideal for students and hobbyists learning embedded development.
  • OPERATING VOLTAGE: Runs at 3.3V operating supply voltage, ensuring compatibility with a wide range of modern microcontroller development boards.
  • COMPACT AND LIGHTWEIGHT: Part of the trusted J-Link series by Segger Microcontroller, this debugger/programmer weighs just 12.8 oz and is easy to use.
monitor jtag_scan
attach 1

For SWD, use monitor swd_scan instead. Once attached, use ordinary GDB commands to inspect and control the target.

Configure STM32CubeIDE

The project’s IDE instructions cover STM32CubeIDE, an Eclipse-based IDE for STM32 microcontrollers. The page refers to STM32CubeIDE v1.16.0 and says Black Magic Probe support is built in; that version reference is not a guarantee about later or other Eclipse-based releases. Follow the Black Magic Probe STM32CubeIDE guide if the labels in your installed version differ.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
SEGGER 8.24.00 J-Trace Pro Cortex-M/R/A and RISC-V Trace Probe, SuperSpeed USB 3.0, 64 MB On-Board Buffer
  • SUPERSPEED USB 3.0 INTERFACE: Enables continuous streaming trace with full trace clock, eliminating the limits of internal buffers for deeper code optimization insights.
  • UNLIMITED STREAMING TRACE: Features a 64 MB on-board trace buffer and supports long-period trace capture, making it ideal for recording infrequent, hard-to-reproduce bugs.
  • BROAD ARCHITECTURE SUPPORT: Compatible with Cortex-M, Cortex-R, Cortex-A, and RISC-V devices, making it a versatile debug probe for a wide range of embedded development projects.
  • HIGH-SPEED PERFORMANCE: Delivers up to 4.0 MB/s download speed, ensuring fast and efficient data transmission during debugging and tracing sessions.
  • PRO SOFTWARE PACKAGE INCLUDED: Comes with J-Flash, J-Flash SPI, Unlimited Flash Breakpoints, Ozone J-Link Debugger, Monitor Mode, and ARM RDI/RDDI, plus one year of email support.
  1. In STM32CubeIDE, open Run > Debug Configurations… and create a GDB Hardware Debugging configuration.
  2. Choose Black Magic Probe as the debug server.
  3. Set the GDB command to arm-none-eabi-gdb if that is the executable installed with your toolchain.
  4. Enter the operating system’s actual GDB serial interface in the connection settings.
  5. In the initialization commands, use the documented sequence:
    set logging on
    set mem inaccessible-by-default off
    monitor auto_scan
    attach 1
  6. Save the configuration and start the debug session.

Reset and run-configuration limitations

If the target does not connect with the default software reset, the project guide suggests adding monitor connect_rst enable before monitor auto_scan. This hardware-reset method cannot be used to debug a target that is already running. The guide also documents an optional mass-erase command; use it only when erasing the target is intentional, since mass erase removes its programmed contents.

STM32CubeIDE does not support hardware GDB run configurations, according to the integration guide. It describes duplicating the debug configuration as a workaround. These are STM32CubeIDE-specific instructions, not a guarantee for all Eclipse packages.

Rank #4
Jeff Probe - Open Source JTAG by Flirc
  • Supports many targets, including Raspberry Pi Pico
  • Open Source and Open Hardware, Based on Black Magic Probe
  • Built In Voltage Translator
  • Raspberry Pi: RP2040
  • Atmel: SAMD20, SAMD21, SAM32, SAM3X, SAM3S, SAM3U, SAM4L, SAM4S
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check target power and supported hardware features

VCC is disabled by default on the probe’s UART and JTAG/SWD interfaces to avoid conflicts when more than one power source is connected. The guide says the probe can supply target power with monitor tpwr enable. Check the target board’s power arrangement before enabling it.

The supported hardware page lists official Black Magic Probe V2.3 as active. It describes jumpers for connecting UART TX/RX pins to the JTAG/SWD connector. The same page lists 16 MB of onboard flash and TraceSWO UART decoding hardware, but says firmware support for those features is pending; their presence on hardware alone does not make them usable capabilities.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Treedix Debugger Programmer for JTAG, Downloader Supports Two Modes of MDK JTAG/SWD,Virtual Serial Port, Applicable to GD32/STM32, etc.
  • 【Widely Applicable】The downloader is suitable for the entire ARM Cortex-M series, including GD32/STM32, etc.
  • 【Supports MDK JTAG/SWD Modes】Standard 20PIN JTAG/SWD can be used without installing drivers; supports MDK compilation download.
  • 【Supports Virtual Serial Port】SWD debugging port, 2.54mm pitch, four-wire without reset; UART virtual serial port, 2.54mm pitch, four-wire.
  • 【Supports Connect to Small System Boards】Equipped with a dedicated 20cm adapter cable for small system boards, the dedicated SWD port can directly connect to small system boards via the dedicated cable. Supports debugging and downloading.
  • 【Package Includes】1pcs DAP-Link V1 downloader; 1pcs Acrylic and copper pillar screws and nuts (not pre-installed by default);1pcs 20cm 2.54mm pitch to 2.0mm pitch adapter cable;1pcs 15cm 2.54mm pitch standard DuPont cable set (4 wires, 2 sets);1pcs 50cm angled Type-C USB data cable;1pcs 20cm 2.54mm pitch 20-pin standard JTAG FC gray ribbon cable

Update probe firmware

For most users of official native hardware, the project recommends bmputil-cli for firmware updates. Its automatic update procedure is documented for native hardware. Third-party hardware running Black Magic firmware may need a manually built firmware image and platform-specific instructions rather than that automatic process. See the project’s release and firmware information before updating.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.