Difference between revisions of "FT2232SPI Programmer"

From flashrom
Jump to: navigation, search
m (Coming soon: Amontec JTAGkey2)
(update JTAGkey and add olimex flashers)
Line 1: Line 1:
Recent versions of [[flashrom]] support the '''-p ft2232_spi''' (or '''-p ft2232spi''' in older flashrom revisions) option which allows you to use a '''FTDI FT2232H/FT4232H''' based device as external SPI programmer.
+
Recent versions of [[flashrom]] support the '''-p ft2232_spi''' (or '''-p ft2232spi''' in older flashrom revisions) option which allows you to use a '''FTDI FT2232/FT4232H''' based device as external SPI programmer.
  
This is made possible by using [http://www.intra2net.com/en/developer/libftdi/ libftdi]. flashrom autodetects the presence of libftdi headers and enables FT2232H/FT4232H support if they are available.
+
This is made possible by using [http://www.intra2net.com/en/developer/libftdi/ libftdi]. flashrom autodetects the presence of libftdi headers and enables FT2232/FT4232H support if they are available.
  
 
= DLP Design DLP-USB1232H =
 
= DLP Design DLP-USB1232H =
Line 61: Line 61:
 
Where to buy: [http://apple.clickandbuild.com/cnb/shop/ftdichip?op=catalogue-products-null&prodCategoryID=75&title=FT4232H+Module FTDI]
 
Where to buy: [http://apple.clickandbuild.com/cnb/shop/ftdichip?op=catalogue-products-null&prodCategoryID=75&title=FT4232H+Module FTDI]
  
= ''Coming soon:'' Amontec JTAGkey2 =
+
= Amontec JTAGkey2 =
  
 
[[File:Jtagkey2.jpg|thumb|right|Amontec JTAGkey2]]
 
[[File:Jtagkey2.jpg|thumb|right|Amontec JTAGkey2]]
 
[[File:JTAGKey_SPI.JPG‎|thumb|right|Cable pinout (click for larger image)]]
 
[[File:JTAGKey_SPI.JPG‎|thumb|right|Cable pinout (click for larger image)]]
  
* ''Note: Patch is still pending review (07/27/2010).''
+
The [http://www.amontec.com/ Amontec] [http://www.amontec.com/jtagkey2.shtml JTAGkey2] can be used with flashrom for programming SPI chips. [http://www.amontec.com/jtagkey.shtml JTAGkey] and [http://www.amontec.com/jtagkey-tiny.shtml JTAGkey-Tiny] should work, if you add them to <tt>ft2232_spi.c</tt> ('''untested''').
 
 
The [http://www.amontec.com/ Amontec] [http://www.amontec.com/jtagkey2.shtml JTAGkey2] can be used with flashrom for programming SPI chips. [http://www.amontec.com/jtagkey.shtml JTAGkey] and [http://www.amontec.com/jtagkey-tiny.shtml JTAGkey-Tiny] might work too (untested).
 
  
 
Where to buy: [http://www.amontec.com/eshop/cmd.php Amontec eShop]
 
Where to buy: [http://www.amontec.com/eshop/cmd.php Amontec eShop]
Line 85: Line 83:
  
 
The picture on the right-hand side shows the colors on the breakout cable.
 
The picture on the right-hand side shows the colors on the breakout cable.
 +
 +
= Olimex ARM-USB-TINY and related devices =
 +
 +
The [http://www.olimex.com/dev/index.html Olimex] [http://www.olimex.com/dev/arm-usb-tiny.html '''ARM-USB-TINY'''] (VID:PID 15BA:0004) can be used with flashrom for programming SPI chips. The [http://www.olimex.com/dev/arm-usb-tiny-h.html '''ARM-USB-TINY-H'''] (15BA:002A), [http://www.olimex.com/dev/arm-usb-ocd.html '''ARM-USB-OCD'''] (15BA:0003) and [http://www.olimex.com/dev/arm-usb-ocd-h.html '''ARM-USB-OCD-H'''] (15BA:002B) should also work, though they are currently <u>untested</u>.
 +
 +
The following setup can then be used to flash a BIOS chip through SPI.
 +
 +
{| border="1"
 +
| style="width:250px;" align="center" rowspan="9"| [[File:ARM-USB-TINY_pinout.png|Pinout]]
 +
|style="background:#f7f7f7;"|'''Pin (JTAG Name)''' ||style="background:#f7f7f7;"|'''SPI/Voltage Source'''
 +
|-
 +
|'''1''' (VREF)
 +
|'''VCC''' (from Voltage Source)
 +
|-
 +
|'''2''' (VTARGET)
 +
|'''VCC''' (to SPI target)
 +
|-
 +
|'''4''' (GND)
 +
|'''GND''' (from Voltage Source)
 +
|-
 +
|'''5''' (TDI)
 +
|'''SI'''
 +
|-
 +
|'''6''' (GND)
 +
|'''GND''' (to SPI target)
 +
|-
 +
|'''7''' (TMS)
 +
|'''CE#'''
 +
|-
 +
|'''9''' (TCK)
 +
|'''SCK'''
 +
|-
 +
|'''13''' (TDO)
 +
|'''SO'''
 +
|}
 +
 +
On the ARM-USB-TINY, VREF and VTARGET are internally connected, and all the GND lines (even numbered pins, from 4 to 20) share the same line as well, so they can be used to split VCC/GND between the voltage source and the target.
 +
 +
The voltage source should provide 3.0V to 3.3V DC but doesn't have to come from USB: it can be as simple as two AA or AAA batteries placed in serial (2 x 1.5V).
 +
 +
'''Invoking flashrom:'''
 +
 +
You first need to add the <code>-p ft2232_spi</code> option, and then specify one of <code>arm-usb-tiny</code>, <code>arm-usb-tiny-h</code>, <code>arm-usb-ocd</code> or <code>arm-usb-ocd-f</code> for the type. For instance, to use an ARM-USB-TINY, you would use:
 +
 +
$ '''flashrom -p ft2232_spi:type=arm-usb-tiny'''

Revision as of 13:23, 11 June 2011

Recent versions of flashrom support the -p ft2232_spi (or -p ft2232spi in older flashrom revisions) option which allows you to use a FTDI FT2232/FT4232H based device as external SPI programmer.

This is made possible by using libftdi. flashrom autodetects the presence of libftdi headers and enables FT2232/FT4232H support if they are available.

DLP Design DLP-USB1232H

The DLP Design DLP-USB1232H (datasheet) can be used with flashrom for programming SPI chips.

Sidenote: The module can also be used as JTAG programmer with OpenOCD support.

Where to buy: Digikey, Mouser, Saelig

Setup

DLP-USB1232H based SPI programmer schematics

In order to use the DLP-USB1232H device as SPI programmer you have to setup a small circuit (e.g. on a breadboard). See the schematics for details (you can also download the schematics as PDF for easier printing).

  • You must connect/shorten pins 8 and 9, which configures the device to be powered by USB. Without this connection it will not be powered, and thus not be detected by your OS (e.g. it will not appear in the lsusb output).
  • You need a 3.3V voltage regulator to convert the 5V from USB to 3.3V, so you can power the 3.3V SPI BIOS chip.
    • You can probably use pretty much any 3.3V voltage regulator, e.g. LD33V or LD1117xx. For usage on a breadboard the TO-220 packaging is probably most useful.
    • You have to connect two capacitors (e.g. 100nF and 10uF as per datasheets, but using two 10uF capacitors, or even two 47uF capacitors also works in practice) as shown in the schematics, otherwise the voltage regulator will not work correctly and reliably.
  • Connect the following pins from the DLP-USB1232H to the SPI BIOS chip:
    • 18 (SK) to SCLK
    • 16 (DO) to SI
    • 2 (DI) to SO
    • 5 (CS) to CS#
    • The WP# and HOLD# pins should be tied to VCC! If you leave them unconnected you'll likely experience strange issues.
    • All GND pins should be connected together (pins 1 and 10 on the DLP-USB1232H, pin 8 on the SPI chip, pin 1 on the voltage regulator).

You have to invoke flashrom with the following parameters:

$ flashrom -p ft2232_spi:type=2232H,port=A

On older flashrom versions the syntax was:

$ flashrom -p ft2232_spi:ft2232_type=2232:port=A

Photos

FTDI FT2232H Mini-Module

The FTDI FT2232H Mini-Module Evaluation Kit (datasheet) can be used with flashrom for programming SPI chips.

Where to buy: FTDI

FTDI FT4232H Mini-Module

The FTDI FT4232H Mini-Module Evaluation Kit (datasheet) can be used with flashrom for programming SPI chips.

Where to buy: FTDI

Amontec JTAGkey2

Amontec JTAGkey2
Cable pinout (click for larger image)

The Amontec JTAGkey2 can be used with flashrom for programming SPI chips. JTAGkey and JTAGkey-Tiny should work, if you add them to ft2232_spi.c (untested).

Where to buy: Amontec eShop

More info can be found on on the JTAGkey site.

  • You need a 3.3V voltage source - see above for details.
  • Connect the following pins from the JTAGkey2 to the SPI BIOS chip:
    • 1 (Vref) to VCC
    • 5 (MOSI/TDI) to SI
    • 7 (CS#/TMS) to CS#
    • 9 (CLK/TCK) to SCLK
    • 13 (MISO/TDO) to SO
    • 20 (GND) to GND
    • The WP# and HOLD# pins should be tied to VCC.

The picture on the right-hand side shows the colors on the breakout cable.

Olimex ARM-USB-TINY and related devices

The Olimex ARM-USB-TINY (VID:PID 15BA:0004) can be used with flashrom for programming SPI chips. The ARM-USB-TINY-H (15BA:002A), ARM-USB-OCD (15BA:0003) and ARM-USB-OCD-H (15BA:002B) should also work, though they are currently untested.

The following setup can then be used to flash a BIOS chip through SPI.

Pinout Pin (JTAG Name) SPI/Voltage Source
1 (VREF) VCC (from Voltage Source)
2 (VTARGET) VCC (to SPI target)
4 (GND) GND (from Voltage Source)
5 (TDI) SI
6 (GND) GND (to SPI target)
7 (TMS) CE#
9 (TCK) SCK
13 (TDO) SO

On the ARM-USB-TINY, VREF and VTARGET are internally connected, and all the GND lines (even numbered pins, from 4 to 20) share the same line as well, so they can be used to split VCC/GND between the voltage source and the target.

The voltage source should provide 3.0V to 3.3V DC but doesn't have to come from USB: it can be as simple as two AA or AAA batteries placed in serial (2 x 1.5V).

Invoking flashrom:

You first need to add the -p ft2232_spi option, and then specify one of arm-usb-tiny, arm-usb-tiny-h, arm-usb-ocd or arm-usb-ocd-f for the type. For instance, to use an ARM-USB-TINY, you would use:

$ flashrom -p ft2232_spi:type=arm-usb-tiny