Getting started with the ctxLink
It was years ago that I bought the ctxLink — a Wi-Fi-enabled debug probe — via CrowdSupply. Once arrived, I threw it into a drawer and didn't look at it a second time. My use case for a wireless probe had since disappeared and my JLink EDU worked fine at the time. But now that JLink is harassing its paying customers with wait dialogs while also ignoring support requests to get those removed, I started looking for alternatives. When doing so I stumbled upon the BMP (Black Magic Probe), which is what the ctxLink firmware was based on back in the day. Nowadays, the firmware for the ctxLink is built straight out of mainline BMP Relevant information can be found in the platform's README.
Before doing anything else, I decided to get up to date with the ctxLink and update its firmware to the latest version.
Updating the ctxLink to the latest firmware
There is a purpose-built utility to update and manage your BMP;
the bmputil-cli.
Sadly, because the ctxLink does not have a bootloader of its own,
but rather just uses ST's built-in bootloader,
bmputil does not work for upgrading the ctxLink's firmware.
Instead, dfu-util must be used.
(I think this is a reasonable choice, btw.
Just slightly more inconvenient right now.)
Out of the box, bmputil was not able to do anything.
First, I needed to give it (myself, actually) some permissions via udev.
Conveniently, the BMP project maintains
rules files
that we can deploy.
I just needed to pick the one that fits my distribution.
For Arch Linux, the uucp flavor is the right one.
$ sudo cp 99-blackmagic-uucp.rules /etc/udev/rules.d/
After copying the file, re-plug the probe if it's been connected.
# dmesg
[ 3897.309240] usb 3-3: new full-speed USB device number 5 using xhci_hcd
[ 3897.496871] usb 3-3: New USB device found, idVendor=1d50, idProduct=6018, bcdDevice= 1.00
[ 3897.496881] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3897.496884] usb 3-3: Product: CtxLink - Wireless Debug Probe, (Firmware v1.6.1-546-gf9993bdd)
[ 3897.496887] usb 3-3: Manufacturer: Black Sphere Technologies
[ 3897.496890] usb 3-3: SerialNumber: 378836503237
$ ./bmputil-cli probe info
[2026-03-22T08:59:53Z ERROR bmputil::bmp] Error formatting BlackMagicProbeDevice: Product string doesn't start with 'Black Magic Probe'
Found: Unknown Black Magic Probe (error occurred fetching device details)
The currently installed firmware predates the merge with BMP firmware
and bmputil chokes on its product string.
Building the firmware for the ctxLink was quickly done by just running the commands from the platform README linked above. I'll not repeat them here because they might get outdated.
$ dfu-util -a 0 --dfuse-address 0x08000000:leave -D build/blackmagic_ctxlink_firmware.bin
# dmesg
[42010.735336] usb 3-3: new full-speed USB device number 9 using xhci_hcd
[42010.922409] usb 3-3: New USB device found, idVendor=1d50, idProduct=6018, bcdDevice= 2.00
[42010.922418] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[42010.922421] usb 3-3: Product: Black Magic Probe (ctxLink) v2.0.0-427-g7d51c114
[42010.922423] usb 3-3: Manufacturer: Black Magic Debug
[42010.922425] usb 3-3: SerialNumber: 378836503237
[42010.953669] cdc_acm 3-3:1.0: ttyACM0: USB ACM device
[42010.953326] cdc_acm 3-3:1.2: ttyACM1: USB ACM device
$ ./bmputil-cli probe info
Found: Black Magic Probe (ctxlink) 2.0.0-427-g7d51c114
Serial: 378836503237
Port: 3-3
Success.
The probe is registered as a serial device.
In addition to the device nodes mentioned in dmesg,
the udev rules have created /dev/ttyBmpGdb and /dev/ttyBmpTarg
for the GDB server and the target, respectively.
Under construction from this point on
I ran out of free time for now :(
Flashing & debugging via USB by command-line
(gdb) target extended-remote /dev/ttyBmpGdb
(gdb) monitor auto_scan
Flashing & debugging via USB by CLion
Flashing & debugging via Wi-Fi by CLion
(gdb) monitor wifi <SSID>,<passphrase>
(gdb) monitor wifi