-
-
Notifications
You must be signed in to change notification settings - Fork 781
Frequently Asked Questions
The Black Magic probe currently supports ARMv6-M and ARMv7-M architecture targets, specifically Cortex-M0, Cortex-M3 and Cortex-M4. Any device with these cores should work with possibly the exception flash memory programming.
Memory map and flash programming are supported for these specific implementations:
-
efm32.c
: Silicon Labs EFM32, EZR32 -
kinetis.c
: Freescale Kinetis KL25, KL27, KL02 -
lmi.c
: Texas Instruments: LM3S, TM4C -
lpc11xx.c
: NXP LPC8xx, LPC11xx -
lpc15xx.c
: NXP LPC15xx -
lpc17xx.c
: NXP LPC17xx -
lpc43xx.c
: NXP LPC43xx -
lpc546xx.c
: NXP LPC546 -
msp432.c
: MSP432P401 -
nrf51.c
: Nordic nRF51, nRF52 -
nxpke04.c
: Kinetis KE04 -
sam3x.c
: Atmel SAM3N, SAM3X, SAM3S, SAM3U, SAM4S -
sam4l.c
: Atmel SAM4L -
samd.c
: Atmel SAM D20, D21 -
samd5.c
: Atmel SAM51 -
samdx5x.c
:Atmel SAMD5x/E5x -
stm32f1.c
: ST Microelectronics STM32F0, STM32F1, STM32F3 -
stm32f4.c
: ST Microelectronics STM32F2, STM32F4, STM32F7 -
stm32h7.c
: ST Microelectronics H7 -
stm32l0.c
: ST Microelectronics STM32L0, STM32L1 -
stm32l4.c
: ST Microelectronics STM32L4, STM32G0, STM32G4
As additions happen, you to update the firmware to profit from these additions. There is experimental support for Cortex-A (ARMv7-A architecture). This is being used with success on Xilinx Zynq-7000 SoC (Dual-core Cortex-A9) and Raspberry Pi 2 (Quad-core Cortex-A7).
The official Black Magic Probe hardware is available from these distributors in alphabetical order:
- DE: 1BitSquared Germany Black Magic Probe V2.1
- NZ / AU: Greenstage Black Magic Probe V1.0
- USA: 1BitSquared US Black Magic Probe V2.1
- USA: 1BitSquared US Tindie Black Magic Probe V2.1
- USA: Adafruit Black Magic Probe V2.1
- USA: DigiKey Black Magic Probe V2.1
- USA: Hackerwarehouse Black Magic Probe V2.1
- USA: Mouser Black Magic Probe V2.1
- USA: OSHPark Black Magic Probe V2.1
- Black Magic Probe Mini v2.1
- Black Magic Probe Mini v2.0
- Black Magic Probe Mini
- Original Black Magic Probe
The JTAG/SWD connector is FTSH-105-01-F-DV-K from Samtec (Buy: Digi-key, 1BitSquared).
The JTAG/SWD connector is a 0.05" (50mil/1.27mm) pitch, 2 row 10pin connector. The Samtec version is the only one that includes a keying shroud and does not occupy a large space on the PCB. There are other manufacturers that make connectors that can be used too. Here are a few options:
- Amphenol FCI 20021121-00010C4LF unshrouded SMD (Buy: Digi-key)
- Amphenol FCI 20021111-00010T4LF unshrouded TH (Buy: Digi-key)
- Amphenol FCI 20021521-00010T1LF shrouded SMD (Buy: Digi-key)
- Amphenol FCI 20021211-00010T1LF shrouded TH (Buy: Digi-key)
- CNC Tech 3220-10-0300-00 shrouded SMD (Buy: Digi-key)
- CNC Tech 3220-10-0100-00 shrouded TH (Buy: Digi-key)
- And many many more ... 😸
The JTAG/SWD cable is FFSD-05-D-xx.xx-01-N where the x
stand for the length of the cable. Common length is 6 inches. (Buy: Digi-key, 1BitSquared)
You can build your own JTAG/SWD ribbon cable using the following materials. (consider just an example there are many manufacturers making 1.27mm pitch IDC crimps and ribbons)
- CNC Tech 3230-10-0103-00 IDC crimp with polarizing key. (Buy: Digi-key)
- 3M 3756/10 0.025" (0.64mm) pitch 10 conductor flat ribbon cable. (Buy: Digi-key)
The UART connector is Molex PicoBlade 0532610471. (Buy: Digi-key).
The UART cable can be built by hand using the following materials:
- Molex PicoBlade 050079-8000 26-28AWG or 50058-8000 28-32AWG crimp sockets. (Buy: Digi-key Digi-key)
- Molex PicoBlade 0510210400 housing (Buy: Digi-key)
- Molex PicoBlade 0638271400 crimp tool (Buy: Digi-key) (Warning: if you don't want to be very frustrated and destroy a lot of crimps skip trying to use cheaper options that claim to be compatible with the PicoBlade crimps, they are not.)
- 26-32AWG wire of your choosing and whatever termination you need on the other side of the cable.
The UART cable can also be built with pre crimped wires:
- Digi-key red 150mm pre crimped cable
- Digi-key red 300mm pre crimped cable
- 1BitSquared pre crimped cable assortment
There are also pre made UART cables:
- 1BitSquared UART to 0.1" pin header pigtail cable.
- 1BitSquared UART to Paparazzi UAV autopilot cable.
Many vendors provide adapters allowing easy connection between different JTAG/SWD and UART interfaces. For example 1BitSquared offers a wide range of different adapters and cables. There is also a collection of adapter designs that you can find on the 1BitSquared GitHub Page that you can use as basis for your custom adapter. If there is an adapter missing for your specific application it is usually quite easy to put one together using KiCad and order the needed board from OSHPark.
Automatically built firmware images for the official hardware are here.
The peripheral registers are not included in the memory map provided to GDB.
It is suggested that you add the command set mem inaccessible-by-default off
to
your .gdbinit
file. That will allow you to access addresses outside of
the memory map. It will treat anything outside of the memory map as
RAM.
The first 512 bytes of the address space are mapped to boot ROM by default. Once you write the SYSMEMREMAP
register (address 0x40048000
) to have a value of 2, those 512 bytes are mapped to flash and all sections will match. The LPC bootloader automatically does this upon detecting valid user code, but the bootloader cannot run while you are holding the chip in reset with a debugger. See section 3.5.1 of the manual. In gdb, you can set {int}0x40048000 = 2
to achieve the same result.
You can add the following to your .gdbinit
to set the bit on startup.
set mem inaccessible-by-default off
set {int}0x40048000 = 2
This solution is known to work on the LPC8xx/LPC11xx families of chips. If you are using something different refer to the reference manual and look for SYSMEMREMAP
register. If the address differs please add it to this FAQ item or let us know in the Discord #blackmagic channel or mailing list. For the discussion of this problem refer to issue #99.
Use the bmp devices created under /dev/serial/by-id/usb-Black_Sp...-if00 or
create a file named /etc/udev/rules.d/99-blackmagic.rules
with the following contents:
# Black Magic Probe
# there are two connections, one for GDB and one for uart debugging
SUBSYSTEM=="tty", ATTRS{interface}=="Black Magic GDB Server", SYMLINK+="ttyBmpGdb"
SUBSYSTEM=="tty", ATTRS{interface}=="Black Magic UART Port", SYMLINK+="ttyBmpTarg"
Then unplug / replug the probe, or restart the computer.
Now you can access the probe at the stable names /dev/ttyBmpGdb
and /dev/ttyBmpTarg
.
You can use stty and netcat. On the machine with the probe connected, make a little TCP server on port 2000 with these commands:
stty -F /dev/ttyBmpGdb raw -onlcr -iexten -echo -echoe -echok -echoctl -echoke
nc -vkl -p 2000 > /dev/ttyBmpGdb < /dev/ttyBmbGdb
In gdb on the remote machine, connect with target extended-remote hostname:2000
where hostname
is the name or IP address of the machine running the probe.
Yes, under normal operations the Black Magic Probe V2.1 is drawing 30-60mA. When using the tpwr
functionality to supply power to a target like the 1Bitsy it can draw up to 120mA resulting in 0.6W of dissipated heat. The voltage regulator can heat up to 75°C under normal operations, it is rated for up to 125°C.
The problem is fixes with firmware newer than Dec. 16 2020.
There are a few advantages of the Black Magic Probe. BMP is open-source, meaning that you can look inside it if you need or want to. We are getting support for new ARM Cortex-M based chips on a regular basis, so you are not limited to just the STM32. We have preliminary support for Cortex-A this will result in the ability to use the probe with Raspberry PI and Beagle Bone Black and many others. The Black Magic Probe also supports JTAG not only SWD, because not all microcontrollers use SWD. Also JTAG makes it possible to chain together more than one microcontroller. The GDB server is implemented on the probe itself, this means we do not use some proprietary protocol to talk to your debugger software, making the setup more repeatable and removing the need for custom config files. All you need to do is fire up GDB and connect to the virtual serial port of the Black Magic Probe, no special setup necessary. It is physically small, you can plug it into your hardware even if it is buried deeply inside your killer robot. We have equipped the Black Magic Probe V2.1 (this is the version the Kickstarter backers will receive) with dual supply level shifters that make it possible to connect to targets that run on voltages as low as 1.7V and as high as 5V. The transceivers are more robust than the STM32 GPIO meaning that if the BMP is connected wrongly to the target it is less likely you will hurt either the Black Magic Probe or your target. Also the Black Magic Probe comes with a TTL level UART providing a bonus USB to Serial capability that can be used simultaneously with the GDB JTAG/SWD debugger.
If the device is not a ADIv5 device, because we currently only support ADIv5 devices. If it is a ADIv5 device, because nobody contributed the needed procedures yet. Look on Github if there is eventually a pending pull request for your target. Report success/failure in that PR to en/discourage merge of the pull.
Because it is an old ARM TDMI architecture, that is not compitable with ADIv5. (if you want to work on adding support for this contact us on Gitter we have some sample code that needs work, if you want to dig deep into protocol spec sheets this is a project for you. :) )
Because it is a 64Bit chip. We are working on adding 64bit support but it is not trivial. If you want to help with that contact us on Gitter.
Because Texas Instruments.... but we are working on it. :) If you want to help with that contact us on Gitter. See issue #166 for details.
Use "scripts/stm32_mem.py src/blackmagic.bin". Be sure to compile for your platform! Stm32_mem.py is (still) a python2 script. Even when used with some bad firmware, stm32_mem.py will not touch the bootloader. So re-flashing the right firmware will still be possible afterwards. Eventually force bootloader entry with the procedure for your platform when some wrong firmware behaves strange. For those using stlink on boards/platforms with an STM32F103x8, stm32mem tries to write above 64 kiB. All writes are verified.