For SWD (instead of normal JTAG) you need a different CPLD "buffer logic" image on the Bus Blaster, the KT-Link compatible ones seem like the recommended means.
# with buffer logic at https://github.com/dergraaf/busblaster_v4/blob/master/ktlink/ktlink.svf
# via http://dangerousprototypes.com/forum/viewtopic.php?f=37&t=5954 from https://github.com/mchck/mchck/wiki/Getting-Started#wiki-bus-blaster
curl -O https://github.com/dergraaf/busblaster_v4/raw/master/ktlink/ktlink.svf
openocd -f board/dp_busblaster_v3.cfg -c "adapter_khz 1000; init; svf /Users/natevw/Downloads/ktlink.svf; shutdown"
Then start OpenOCD with the necessary configuration and connect to it:
openocd -f interface/ftdi/dp_busblaster_kt-link.cfg -c 'transport select swd' -f target/stm32f4x.cfg
# via http://openhardware.net/Embedded_ARM/OpenOCD_JTAG/#testocd
telnet 4444
> reg # should show registers
To program back the JTAG-Key, I think the file you need is https://dangerous-prototypes-open-hardware.googlecode.com/svn/trunk/Bus_Blaster/buffer_logic/BBv4-JTAGkey-selftest-v1.1.svf, the selftest in the filename is a little weird but accodring to http://dangerousprototypes.com/docs/Bus_Blaster_v2_manufacturing_resources#Hardware_selftest:
The hardware self test is part of the factory jtagkey-compatible buffer shipped with the Bus Blaster v2.
…so maybe that's fine.
- http://bgamari.github.io/posts/2014-08-23-swd-with-busblaster-and-openocd.html (general overview of SWD w/BB)
- http://dangerousprototypes.com/forum/viewtopic.php?f=37&t=5954 (buffer logic)
- http://bgamari.github.io/posts/2013-07-24-flashing-busblaster-cpld-with-openocd.html (how to flash it — just had to move mode jumper to "Update Buffer" on BBv4)
here is teaching you how to use openocd flash bus blaster v3 or v4 to swd mode, also restore back to jtag
https://fatalfeel.blogspot.com/2013/09/bus-blaster-flash-to-swd-mode-in-openocd.html