Created
July 18, 2014 15:43
-
-
Save bgamari/72948857c1a4bd7b1aa5 to your computer and use it in GitHub Desktop.
A small script to test the pins of an FTDI JTAG adapter with OpenOCD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat >ftdi-test.cfg <<EOF | |
source [find interface/ftdi/dp_busblaster.cfg] | |
ftdi_layout_signal TCK -data 0x01 | |
ftdi_layout_signal TDI -data 0x02 | |
ftdi_layout_signal TDO -data 0x04 | |
ftdi_layout_signal TMS -data 0x08 | |
transport select jtag | |
adapter_khz 10 | |
init | |
EOF | |
sudo echo | |
sudo openocd -f ftdi-test.cfg & | |
oo=$! | |
for signal in TCK TDO TMS; do | |
( | |
while true; do | |
echo "$signal = 0" | |
echo "ftdi_set_signal $signal 0" | nc localhost 3333 | |
sleep 1 | |
echo "$signal = 1" | |
echo "ftdi_set_signal $signal 0" | nc localhost 3333 | |
sleep 1 | |
done | |
) & | |
p=$! | |
read | |
kill $p | |
done | |
sudo kill $oo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment