2013年9月28日 星期六

Bus Blaster flash to Swd mode in OpenOcd

Refer to
https://yeah.nah.nz/embedded/busblaster-kt-link
https://bgamari.github.io/posts/2014-08-23-swd-with-busblaster-and-openocd.html
http://bgamari.github.io/posts/2013-07-24-flashing-busblaster-cpld-with-openocd.html
https://discuss.96boards.org/t/sdw-debugging-carbon-stm32-using-bus-blaster-v3/958
https://gist.github.com/natevw/14d1f1fe669ec6e201c5

1.
~circuit
Bus Blaster SWD connect to Target
TCK ──────────────────────── SWCK
TMS ──────────────────────── SWDAT
GND ──────────────────────── GND

Using Bus Blaster V3C or V4.1a
http://dangerousprototypes.com/docs/Bus_Blaster_v3_design_overview
http://dangerousprototypes.com/docs/Bus_Blaster_v4_design_overview

2.
~Preinstall openocd 
https://github.com/fatalfeel/openocd_integrated

3. check swd function in dp_busblaster_kt-link.cfg
dp_busblaster_kt-link.cfg
https://review.openocd.org/gitweb?p=openocd.git;a=blob;f=tcl/interface/ftdi/dp_busblaster_kt-link.cfg;h=d49a4c98f401cd33e61986cce2a981416a249bca;hb=refs/changes/83/5283/4

olimex-arm-usb-tiny-h.cfg
https://review.openocd.org/gitweb?p=openocd.git;a=blob;f=tcl/interface/ftdi/olimex-arm-usb-tiny-h.cfg;h=eac25b6da795c811ed07ccc759d0fa40b7251ce1;hb=refs/changes/83/5283/4

olimex-arm-jtag-swd.cfg
https://review.openocd.org/gitweb?p=openocd.git;a=blob;f=tcl/interface/ftdi/olimex-arm-jtag-swd.cfg;h=2153fd65f59c83f84bdfc7d23191819f0e0f3864;hb=refs/changes/83/5283/4

confirm:
dp_busblaster_kt-link.cfg = olimex-arm-usb-tiny-h.cfg + olimex-arm-jtag-swd.cfg

note: command "transport select swd" can write in cfg of target directory
example: rk3308.cfg
https://review.openocd.org/gitweb?p=openocd.git;hb=ed73398eb0b4ce6db63e5cec447ab052d084261a;f=tcl%2Ftarget%2Frk3308.cfg

4. Bus Blaster V3C jtag become to swd
wget --continue https://github.com/bharrisau/busblaster/raw/master/synthesis/system.svf
openocd -f /opt/openocd/share/openocd/scripts/board/dp_busblaster_v3.cfg -c "adapter speed 1000; init; svf ./system.svf; shutdown"

5. 
Bus Blaster V3C swd restore to jtag
wget --continue https://raw.githubusercontent.com/DangerousPrototypes/Bus_Blaster/master/manufacturing_resources/v3c/Programming/svf/bbv3.svf
openocd -f /opt/openocd/share/openocd/scripts/board/dp_busblaster_v3.cfg -c "adapter speed 1000; init; svf ./bbv3.svf; shutdown"

6. Bus Blaster V4.1a jtag become to swd
https://review.openocd.org/gitweb?p=openocd.git;a=blob;f=tcl/board/dp_busblaster_v4.cfg;h=7b3bee8fcfbf7cc309f06655f9ff4a3863743f8b;hb=67ff6701a5aa53071f0842873d2868e943deecde
~~~dp_busblaster_v4.cfg said:
# The Bus Blaster has a configurable buffer between the FTDI FT2232H
# and the JTAG header which allows it to emulate various debugger
# types. This config works with KT-Link compatible implementation from
# https://raw.githubusercontent.com/dergraaf/busblaster_v4/master/ktlink/ktlink.svf
#
# To reprogram the on-board CPLD do:
# openocd -f board/dp_busblaster_v4.cfg -c "adapter speed 1000; init; svf <path_to_svf>; shutdown"

(a)
Move the MODE jumper to Update Buffer position
(b)
wget --continue https://raw.githubusercontent.com/dergraaf/busblaster_v4/master/ktlink/ktlink.svf
openocd -f /opt/openocd/share/openocd/scripts/board/dp_busblaster_v4.cfg -c "adapter speed 1000; init; svf ./ktlink.svf; shutdown"
(c)
Move the MODE jumper to Normal position

7. Bus Blaster V4.1a swd restore to jtag
(a)
Move the MODE jumper to Update Buffer position
(b)
wget --continue https://raw.githubusercontent.com/DangerousPrototypes/Bus_Blaster/master/manufacturing_resources/v4.1/Programming/svf/bbv4.svf
openocd -f /opt/openocd/share/openocd/scripts/board/dp_busblaster_v4.cfg -c "adapter speed 1000; init; svf ./bbv4.svf; shutdown"
(c)
Move the MODE jumper to Normal position

沒有留言:

張貼留言