Skip to content

Getting Started

Gareth McMullin edited this page Aug 3, 2014 · 19 revisions

To use the Black Magic Probe, you will need an ARM cross toolchain for developing and debugging embedded ARM Cortex applications on your computer. The gcc-arm-embedded toolchain is recommended.

user@host ~ $ arm-none-eabi-gdb
GNU gdb (GNU Tools for ARM Embedded Processors) 7.6.0.20140228-cvs
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-linux-gnu --target=arm-none-eabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) 

When connected via USB, the Black Magic probe will enumerate as a CDC-ACM device which the OS should present as a tty device or serial port. The GDB remote debugging protocol is implemented over this virtual character stream. To connect your ARM GDB to the target device use the following commands:

(gdb) target extended-remote /dev/ttyACM0
Remote debugging using /dev/ttyACM0
(gdb) monitor jtag_scan
Target voltage: 3.4V
Device  IR Len  IDCODE      Description
0       4       0x4BA00477  ARM Limited: ADIv5 JTAG-DP port.
1       5       0x06413041  ST Microelectronics: STM32F4xx.

Available Targets:
No. Att Driver
 1      STM32F4xx

(gdb) attach 1
Attaching to Remote target
0x080071b2 in ?? ()

The command monitor swdp_scan may be used to use the Serial-Wire Debug Protocol instead of JTAG to connect to the target.

Once attached, all the standard GDB commands may be used to start and control the execution of the embedded application. Useful GDB Commands provides a quick introduction.

Note: On Mac OS X use the /dev/cu.usbmodem<somenumber>. Don't use the tty version of this device as this one will freeze gdb when it tries to open it.

A Windows driver is available here. After installing the driver, the device should appear in the device manager as a serial port (COMx). Use this instead of /dev/ttyACM0 on Windows.

NOTICE: The content of this wiki has been moved to http://black-magic.org website. Please update your links.

Clone this wiki locally