Difference between revisions of "Bus Pirate"
m (→Logic analyzer) |
m (→Installation) |
||
Line 19: | Line 19: | ||
If you've problems with modem-manager trying to access the device (as seen in /var/log/syslog), you can add the following rule: |
If you've problems with modem-manager trying to access the device (as seen in /var/log/syslog), you can add the following rule: |
||
ATTRS{idVendor}=="0403" ATTRS{idProduct}=="6001" ENV{ID_MM_DEVICE_IGNORE}="1" |
ATTRS{idVendor}=="0403" ATTRS{idProduct}=="6001" ENV{ID_MM_DEVICE_IGNORE}="1" |
||
+ | ===Firmware upgrade=== |
||
+ | My bus pirate is a hardware v3b, firmware v4.1 and boodloader v4.1 |
||
+ | <br>To upgrade those two last ones: |
||
+ | <br>Latest stable firmwares are available [https://code.google.com/p/the-bus-pirate/downloads/list here] |
||
+ | <br>Let's take [http://the-bus-pirate.googlecode.com/files/Bus.Pirate.firmware.v5.9.zip Bus.Pirate.firmware.v5.9.zip] |
||
+ | <br>And for the bootloader we'll follow [http://dangerousprototypes.com/docs/V4.x_to_v4.3_upgrade this procedure], using [http://the-bus-pirate.googlecode.com/files/BPv3-bootloaderv4xtov43-update-vb.zip this zip] |
||
+ | <br>To use the uploader, see [http://dangerousprototypes.com/docs/Pirate-Loader_console_upgrade_application_%28Linux,_Mac,_Windows%29 here] |
||
+ | $ screen /dev/bus_pirate 115200 |
||
+ | Type "$" to enter bootloader mode |
||
+ | Press ctrl-a \ y to quit screen |
||
+ | $ ./pirate-loader_lnx --dev=/dev/bus_pirate --hex=BPv3-bootloader-upgrade-v4xtov4.3.hex |
||
+ | $ screen /dev/bus_pirate 115200 |
||
+ | Type "yes" to upgrade bootloader |
||
+ | Press ctrl-a \ y to quit screen |
||
+ | $ ./pirate-loader_lnx --dev=/dev/bus_pirate --hex=BPv3-Firmware-v5.9.hex |
||
+ | Unplug/replug |
||
+ | Firmware v5.9 extra contains a few more things but only those modes: |
||
+ | Firmware v5.9 (r529) [HiZ 2WIRE 3WIRE KEYB LCD DIO] |
||
+ | While for normal firmware: |
||
+ | Firmware v5.9 (r539) |
||
+ | |||
==Usage== |
==Usage== |
||
===CLI=== |
===CLI=== |
Revision as of 00:16, 12 November 2010
Description
I'm talking about this beast
Installation
My udev rules
I added a /dev/bus_pirate symlink by following this post:
$ ATTRS=$(sudo udevadm info -a -p \ $(sudo udevadm info -q path -n /dev/$(dmesg|\ grep "FTDI.*attached"|\ tail -n 1|\ grep -o "ttyUSB[0-9]\+"))|\ egrep "ATTRS{(serial|idVendor|idProduct)}"|\ head -n 3) $ echo "SUBSYSTEM==\"tty\"" $ATTRS "SYMLINK+=\"bus_pirate\""|\ sudo tee /etc/udev/rules.d/91-usb-buspirate.rules
If you've problems with modem-manager trying to access the device (as seen in /var/log/syslog), you can add the following rule:
ATTRS{idVendor}=="0403" ATTRS{idProduct}=="6001" ENV{ID_MM_DEVICE_IGNORE}="1"
Firmware upgrade
My bus pirate is a hardware v3b, firmware v4.1 and boodloader v4.1
To upgrade those two last ones:
Latest stable firmwares are available here
Let's take Bus.Pirate.firmware.v5.9.zip
And for the bootloader we'll follow this procedure, using this zip
To use the uploader, see here
$ screen /dev/bus_pirate 115200 Type "$" to enter bootloader mode Press ctrl-a \ y to quit screen $ ./pirate-loader_lnx --dev=/dev/bus_pirate --hex=BPv3-bootloader-upgrade-v4xtov4.3.hex $ screen /dev/bus_pirate 115200 Type "yes" to upgrade bootloader Press ctrl-a \ y to quit screen $ ./pirate-loader_lnx --dev=/dev/bus_pirate --hex=BPv3-Firmware-v5.9.hex Unplug/replug
Firmware v5.9 extra contains a few more things but only those modes:
Firmware v5.9 (r529) [HiZ 2WIRE 3WIRE KEYB LCD DIO]
While for normal firmware:
Firmware v5.9 (r539)
Usage
CLI
screen /dev/bus_pirate 115200 i Bus Pirate v3 Firmware v4.2 Bootloader v4.2 DEVID:0x0447 REVID:0x3043 (B5) http://dangerousprototypes.com HiZ> ctrl-A \ (y) to quit
Pinouts
See also http://dangerousprototypes.com/category/pin-reference/
WARNING in the nice sticker colorscheme, the cable is put upside-down (it's said in the comment but I missed it completely the first time)
So if you put your cable going "outwards of the PCB", as seen in the introduction picture, pinout is the following:
GDN - brown, black EZhook +3.3 - red +5 - pink, red EZhook ADC - yellow Vpu - green AUX - blue CLK - violet MOSI - grey CS - white MISO - black
We can perform a self-test with the cable by connecting together red+yellow and pink+green, then simply run "~" on the CLI.
Logic analyzer
See http://dangerousprototypes.com/docs/Logic_analyzer_mode
Installing SUMP is not that easy...
I chose to try a fork of it mentioned in the comments of Sump PC client page
wget http://dl.dropbox.com/u/1026013/Java/Logic%20Analyzer/Logic%20Analyzer.zip unzip Logic%20Analyzer.zip sudo aptitude install libftdi-dev librxtx-java
I modified the runme as following for my Debian, and to be able to use a symlink to the runme:
#!/bin/bash
if [ -h $0 ]; then
DIR=$(dirname "$(readlink $0)")
cd "$DIR"
fi
java -Xmx256m -cp /usr/share/java/RXTXcomm.jar:analyzer.jar \
-Dgnu.io.rxtx.SerialPorts="/dev/bus_pirate" \
-Djava.library.path="/usr/lib/jni" \
org.sump.analyzer.Loader
Now trying it:
We've only to change the recording size to 4k or lower, other params should be ok
Pins & channels:
chan0 - CS - white chan1 - MISO - black chan2 - CLK - violet chan3 - MOSI - grey chan4 - AUX - blue GND - brown
See also other analyzers:
I also tried this fork: http://www.lxtreme.nl/ols/
and changed a bit the run.sh script to handle it through symlink :
if [ -h $0 ]; then
DIR=$(dirname "$(readlink $0)")
cd "$DIR"
BASEDIR=.
else
BASEDIR=$(dirname -- "${0}")
fi