Giter VIP home page Giter VIP logo

black-magic-probe-book's Introduction

Debugging, Tracing & Programming with the Black Magic Probe

This guide covers setting up and using the Black Magic Probe. The Black Magic Probe is a relatively cheap JTAG/SWD probe for ARM Cortex micro-controllers. A distinguishing feature of the Black Magic Probe is that it embeds a GDB server. As a result, the GNU Debugger can directly connect to the Black Magic Probe. While setting up and using the Black Magic Probe has also been covered in wikis and blogs, I found that those description often only scratched the surface of the subject. With this guide, I set out to give a more comprehensive account.

Utilities

Several utilities accompagny this guide. Some are small, such as bmscan to locate the (virtual) serial port at which the Black Magic Probe is found. Another is a helper tool for a specific family of micro-controllers (elf-postlink). There are GUI utilities and text-mode utilities. All have been tested under Microsoft Windows and Linux.

Building the software

Several makefiles are provided for various compilers. Use the one that is appropriate for your system. Most makefiles include a file called "makefile.cfg" for confuguration. Each makefile has a short section near the top to document which macros you can put in makefile.cfg. The file makefile.cfg is not in this repository; it should be written by you. The makefiles also include a dependencies file (if it exists), called "makefile.dep". However, this file is not in the repository either. The project builds without this file, but for tinkering with the code, good dependencies are vital. To get a dependencies file, you need to run make depend. This in turn requires that you have the utility makedepend installed.

Linux

Prerequisites are

  • libusb-1.0
  • glfw-3.3

The development packages for these modules must be present. If you build glfw from source (as a static library), you can configure the path to the include files and the library in makefile.cfg.

Windows with MingW

A common stumbling block with the MingW compiler is that it lacks the header and library files for WinUSB. The header files are in the Microsoft WDK (and they may come with Visual Studio too). These files have the typical "All rights reserved" copyright banner in the header comment, so I cannot distribute them. You will have to get them from the WDK or another source. The files that it concerns are:

  • usb.h
  • usb100.h
  • usb200.h
  • winusb.h
  • winusbio.h

The repository for this project contains the file winusb.def. You can use this file to create an import library for MingW using dlltool. The command line options to use are documented on top of the file winusb.def. The location of the header and library files for WinUSB can be set in makefile.cfg, see the Makefile.mingw for details.

Windows with Visual C/C++

The makefile for Visual C/C++ uses Microsoft's nmake, which is a bare-bones make clone. Generating the dependencies does not work yet at this moment.

black-magic-probe-book's People

Contributors

compuphase avatar sidprice avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.