Skip to content

Instantly share code, notes, and snippets.

@natevw
Last active October 10, 2022 22:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save natevw/14d1f1fe669ec6e201c5 to your computer and use it in GitHub Desktop.
Save natevw/14d1f1fe669ec6e201c5 to your computer and use it in GitHub Desktop.
Using Bus Blaster v4 with STM32F4x SWD

Using Bus Blaster v4 with STM32F4x SWD

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.

Helpful links

@fatalfeel
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment