Black magic probe boundary scan
After looking through the source for the Black Magic Probe firmware, it does not appear that it supports boundary scan.

GDB commands to the BMP all go through gdb_main_loop, which contains commands for reading and writing memory and registers and for starting, stopping and resetting the target processor, as well as the extended q and v commands. v is primarily for writing to flash, while q provides some descriptions of the target, as well as the GDB monitor commands.

Since GDB itself does not have any support for JTAG boundary scans, it is these monitor commands that provide the best chance for support, since they are passed directly to the BMP. However, looking at the supported list of commands, none of them relate to JTAG boundary scanning.

While proving a negative is difficult, I can see no mechanism for handling boundary scan on the Black Magic Probe.

The most popular open source debugging tool that supports boundary scanning is most likely OpenOCD. It supports SVF scans, though I didn't see any way to control individual pins through OpenOCD commands. OpenOCD supports a wide range of hardware JTAG adapters, though it does not appear to document whether all of them support boundary scan. Since you're using an STM32, maybe try the ST-LINK/V2.