Difference between revisions of "Raspdancer"

From YobiWiki
Jump to navigation Jump to search
m
Line 113: Line 113:
 
[[File:Raspdancer-proto1-full.jpg|400px]]
 
[[File:Raspdancer-proto1-full.jpg|400px]]
 
===Raspdancer11 PCB board===
 
===Raspdancer11 PCB board===
Thanks to Jean-Christophe Nicaise for his help!
+
Thanks to Jean-Christophe Nicaise and Zac Franken for their help!
 
<br>I didn't touch Eagle for so many years ^^
 
<br>I didn't touch Eagle for so many years ^^
 
<br>[[File:Raspdancer11_v10_brd.png|300px]] [[File:Raspdancer11_v10_brd_filled.png|300px]]
 
<br>[[File:Raspdancer11_v10_brd.png|300px]] [[File:Raspdancer11_v10_brd_filled.png|300px]]
Line 122: Line 122:
 
* JP4: Solder jumper to wire GPX to GPIO23 in case we'll need it
 
* JP4: Solder jumper to wire GPX to GPIO23 in case we'll need it
 
* J_RASP: Should work (except PoUSB) with a 2x6 connector instead of 2x13
 
* J_RASP: Should work (except PoUSB) with a 2x6 connector instead of 2x13
  +
 
==Raspdancer21==
 
==Raspdancer21==
 
===Raspdancer21 Schematics===
 
===Raspdancer21 Schematics===

Revision as of 11:52, 10 May 2013

Intro

Merging Facedancer11 and Facedancer21 with Raspberry Pi

Status

Code tested successfully with the Raspdancer11.
Raspdancer11 PCB not tested yet. Raspdancer11 prototype successfully tested.
Raspdancer21 PCB not tested yet, design not tested.

Rationale

Facedancer11 and Facedancer21 are one-purpose versions of the flexible GoodFET board.
It was well designed to move all the intelligence into the host controller, not in the embedded uC.
Facedancer11 hardware can be seen as:

 USBconn -- FT232RL -- MSP430F2618TPM -- MAX3420E -- USBconn

where the first two chips are only converting busses:

 USBconn -- FT232RL -- MSP430F2618TPM -- MAX3420E -- USBconn
         USB   <>   UART     <>       SPI   ...   (USB)

BoM view (Farnell prices with tax):

 USBconn -- FT232RL -- MSP430F2618TPM -- MAX3420E -- USBconn
 USBconn +  6.60€   +  15.80€         +  10.00€    +  USBconn

So 22.40€ to talk SPI over UART over USB while the Raspberry-Pi has natively SPI, hmmm.
Bus speed view: yes there is a kind of bottleneck there...

 USBconn -- FT232RL -- MSP430F2618TPM -- MAX3420E -- USBconn
        12MB/s      115200bauds       26MHz


Let's try to make a RPi extension board with only the MAX3420E.
And to save a few cents and construction pain let's replace the USB connector by a USB cable from a cannibalized mouse.
So:

                        RPI-MODA-256M -- MAX3420E -- USBcable

From a BoM point of view this becomes (depending on which RPi, what you add to the RPi, nice casing etc):

                        RPI-MODA-256M -- MAX3420E -- USBcable
                        33.50€        +  10.00€

Bus speed view:

                        RPI-MODA-256M -- MAX3420E -- USBcable
                                      26MHz

And we get a fully autonomous facedancer which can be even powered over USB and controlled remotely

Code

Travis did an amazing job at building a Python library and examples for the MAX3420E & MAX3421E, let's reuse them!
You'll need to get GPIO Python support and SPI Python support for your Raspberry Pi.
From the original facedancer code, you'll need GoodFETMAXUSB.py and the goodfet.maxusb* scripts
Then instead of the original GoodFET.py library, use [{{#file: GoodFET.py}} this GoodFET.py version]:

#!/usr/bin/env python
# (C) 2013 Philippe Teuwen <phil at teuwen.org>

import spi
import RPi.GPIO as GPIO

class GoodFET:
    data=""
    def __init__(self, *args, **kargs):
        GPIO.setmode(GPIO.BOARD)
        # pin15=GPIO22 is linked to MAX3420 -RST
        GPIO.setup(15, GPIO.OUT)
        GPIO.output(15,GPIO.LOW)
        GPIO.output(15,GPIO.HIGH)
        spi.openSPI(speed=26000000)
    def __del__(self):
        spi.closeSPI()
        GPIO.output(15,GPIO.LOW)
        GPIO.output(15,GPIO.HIGH)
        GPIO.cleanup()
    def writecmd(self, app, verb, count=0, data=[]):
        if verb: # ignore all but R/W cmd
            return
        if isinstance(data,str):
            data = [ord(x) for x in data]
        data = tuple(data)
        data = spi.transfer(data)
        self.data = "".join([chr(x) for x in data])
    def serInit(self):
        pass

There are probably better ways to integrate it into the GoodFET software stack but with this small code snippet, you can take the latest great GoodFETMAXUSB.py and goodfet.maxusb* python scripts and just drop them along this GoodFET.py, without need for re-applying any patch.

Note that with the raspdancer, goodfet.maxusbhid is becoming too fast and I'm missing the beginning of the injected string. I had to add some initial "NoEvent / key up" chars ("\x00" * 20) in typestring() in GoodFETMAXUSB.py:

def typestring(self):
    if self.typestrings.has_key(self.OsLastConfigType):
    return ("\x00" * 20) + self.typestrings[self.OsLastConfigType];
else:
    return ("\x00" * 20) + self.typestrings[-1];

Sources

All hardware (Eagle sch & brd, Gerber files) and software (GoodFET.py) sources are now available directly in Travis' SVN repository:

Raspdancer11

Raspdancer11 Schematics

One can optionally connect MAX_P24 VBCOMP to RPi_P4 5V0 to power directly the RPi via this USB entry but beware:

  • you're fuzzing the one which is powering you, don't cry if you experience power losses...
  • the polyfuse is left out, you can re-introduce a polyfuse 1A 6V (but being powered from a *real* USB port should be fine)

Raspdancer11 v10 sch.png

Raspdancer11 Components

Name   Package    Description
IC1    LQFP32-08  MAX3420E
R1     0603       33R USB Serie Resistor
R2     0603       33R USB Serie Resistor
C1     0603       1.0µF Capacitor
C2     0603       0.1µF Decoupling Capacitor
C3     0603       18pF Capacitor
C4     0603       18pF Capacitor
Q1     5x3.2      12MHz SMD Crystal, 18pF      (see note)
USB    USB MiniB  USB Receptacle e.g. UX60-MB-5ST
J_RASP 2x13       Receptacle, 2.54mm, 26way    (see note)

Notes: comparing to the components reused from the original Facedancer11, differences are:

  • smaller crystal package
  • 2x13 connector towards RPi, e.g. a SAMTEC BCS-113-L-D-TE, or even a smaller conn as 2x6 is enough, but be the sure to plug the board correctly into the larger connector!
  • one 1.0µF capacitor was left out, as it was left out later with the Facedancer21 design.

Raspdancer11 First proto

Using a TQFP32 to DIP32 PCB adapter from http://www.ett.co.th/ and a regular through-hole crystal

Raspdancer-proto1.jpg Raspdancer-proto1-full.jpg

Raspdancer11 PCB board

Thanks to Jean-Christophe Nicaise and Zac Franken for their help!
I didn't touch Eagle for so many years ^^
Raspdancer11 v10 brd.png Raspdancer11 v10 brd filled.png
Jumpers & connectors:

  • JP1: Jumper to get powered over USB (PoUSB)
  • JP2: Solder jumper to wire INT to GPIO24 in case we'll need it
  • JP3: Some pads to allow soldering directly a USB cable instead of using a USB connector
  • JP4: Solder jumper to wire GPX to GPIO23 in case we'll need it
  • J_RASP: Should work (except PoUSB) with a 2x6 connector instead of 2x13

Raspdancer21

Raspdancer21 Schematics

One can optionally connect MAX_P24 VBCOMP to RPi_P4 5V0 to power directly the RPi via this USB entry when using the raspdancer21 as USB peripheral but beware:

  • you're fuzzing the one which is powering you, don't cry if you experience power losses...
  • the polyfuse is left out, you can re-introduce a polyfuse 1A 6V (but being powered from a *real* USB port should be fine)

Raspdancer21 v10 sch.png

Raspdancer21 Components

Name   Package    Description
IC1    TQFP32-5mm MAX3421E
R1     0603       33R USB Serie Resistor
R2     0603       33R USB Serie Resistor
C1     0603       1.0µF Capacitor
C2     0603       0.1µF Decoupling Capacitor
C3     0603       18pF Capacitor
C4     0603       18pF Capacitor
Q1     5x3.2      12MHz SMD Crystal, 18pF      (see note)
USB1   USB MiniB  USB Receptacle e.g. UX60-MB-5ST
USB2   USB A      USB TYPE A SMT CONN receptacle
J_RASP 2x13       Receptacle, 2.54mm, 26way    (see note)

Notes: comparing to the components reused from the original Facedancer21, differences are:

  • smaller crystal package
  • 2x13 connector towards RPi, e.g. a SAMTEC BCS-113-L-D-TE, or even a smaller conn as 2x6 is enough, but be the sure to plug the board correctly into the larger connector!

Raspdancer21 PCB board


Raspdancer21 v10 brd.png Raspdancer21 v10 brd filled.png
Jumpers & connectors:

  • JP1: Jumper to get powered over USB (PoUSB)
  • JP2: Solder jumper to wire INT to GPIO24 in case we'll need it
  • JP4: Solder jumper to wire GPX to GPIO23 in case we'll need it
  • J_RASP: Should work (except PoUSB) with a 2x6 connector instead of 2x13
  • USB A female connector on the other side of the PCB

Contacts

For any suggestion or question, feel free to contact me