Skip to main content
Topic: (Bus Blaster v1) FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART) (Read 86040 times) previous topic - next topic

(Bus Blaster v1) FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

This project idea stems from this thread:
http://dangerousprototypes.com/forum/in ... 86#msg3386

The goal is to make a high-speed programmer debugger for JTAG and ROM chips (and other buses) using the MPSSE module of the FTDI 2232H chip:
http://www.ftdichip.com/Products/FT2232H.htm
http://www.ftdichip.com/Documents/DataS ... T2232H.pdf

The H chip has two MPSSE's so JTAG and SPI ROM programming are possible from the same device at the same time.

Here are some ideas:
*Compatible with existing well-supported 2232 JTAG programmer for instant support in OpenOCD, etc.
--Question: what is the best supported device? What can be reversed from the OpenOCD source, what's open source?
*Compatible with existing well-supported 2232 SPI FLASH programmer (flashrom, OpenOCD also programs ROM?)
--Question: Separate pinout or adapter from JTAG cable? What's the overlap?

JTAG devices
USB ARM JTAG Debugger at Olimex (seems to work with a ton of stuff)
JTAG USB OCD Tiny
OOCDlinkh (open source, but I don't see a license)

ROM programmers
Flashrom 2232 programmer

Utilities
OpenOCD
Flashrom

Key chip points:
# +3.3V I/O interfacing (+5V Tolerant).
# Extended -40°C to 85°C industrial operating temperature range.
# Compact 64-LD Lead Free LQFP or LQFN package.
# +3.3V single supply operating voltage range.
2 MPSSE modules, both support JTAG/SPI, UART is separate mode (see pin table page 8)
MPSSE JTAG pins (page 15)
H version supports JTAG adaptive clocking (datasheet page 30)
May or may not need an eeprom (page 20, 42, etc)
Needs a 12MHz crystal (27pf load caps) (page 51)

I attached some schematics and tables. The big questions is which pins (besides the default JTAG pins) are used for what in an existing programmer. Which pin has adaptive clocking, which is NRST, etc. This can be reversed from the OpenOCD and flashrom code.

The pinout table shows that most of the common IO pins are shared (TX/MOSI/SDO/etc), just like the Bus Pirate, so the JTAG interface pins can be adapted to do SPI or UART (won't require routing separate headers).
Got a question? Please ask in the forum for the fastest answers.

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #1
Other stuff: price goal is $30, shipped.
Would like to name it in after the Bus Pirate line, like (JTAG) Bus Blaster or something (amazingly enough this isn't used in a quick google, and I was able to buy the domain, but I'm open to other suggestions).
ETD: Available in May?
Got a question? Please ask in the forum for the fastest answers.

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #2
It seems that OpenOCD will be the "ultimate" tool for the FT2232 adapters (and other multi-interface adapters like BP). With recent development on the mailing list, they have started to add abstraction for other transport protocols like SPI, UART, I2C, etc. The main use for these protocols is ability to program various processors either through embedded bootloader (stm32 bootloader), or through programing interface (like AVR ISP, jtag, SWD, ...).

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #3
found a suppler  for the 100ask.net openjtag thats outside of china http://www.micro4you.com/store/Open-ARM ... d_100.html
as this is the type of device i had in mind when i started this and built mine, tho i see no dedicated spi header on that, they will be there but dedicated pins would be nice, cost more i guess. but i'd lose the com port and just put another header (cost reduction)
anyways i like it has both 20pin header and 10

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #4
Bus Blaster sounds good ;)

@drewmerc From what i can see in the data sheets and other devices the jtag and spi interface pins are in a fixed position on the chip.
afaics ChanA pins 16-19, ChanB pins 38-41, are the jtag and spi ports, and whilst it would be nice to have dedicated headers you would only be duplicating pins because you cannot use jtag and spi on the same channel at same time.

i cannot make my mind up on the pin layout i suppose it depends on what we would consider the main function of the adapter,
i think a breakout similar to the bus pirate is the way i would go, but possibly keeping the jtag pins in a standard layout,

for the uses i have for it, its quite irrelevant what the layout is because none of the hardware i need to jtag uses standard headers or layout,
so i would be either looking at a lead similar to the seeed one for the bus pirate, or maybe a 1:1 lead and have a breakout board with separate leads/test clips/pinouts, i would rather have the ability to use all the functionality and have to rewire leads than increase costs/loose functionality

also if possible as with the olimex include level shifters to allow rs232 directly without extra interface boards needed, but maybe add a tap to the main uart, because i beleive it will run at higher speeds than the level shifter will?

i think we could end up designing a bus pirate on steroids lol

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #5
yes i have a problem, i do tend to dupe header's in my own designs, guess i should start buying crimp instead of idc for my cables
a super breakout cable like the bus pirate one would be great

tap and level shifters all sound good

a new one to look at http://www.freddiechopin.info/index.php ... -lock-pick

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #6
this site has a diagram showing the jtagkey buffering design
http://www.hs-augsburg.de/~hhoegl/proj/ ... bjtag.html
specifically
http://www.hs-augsburg.de/~hhoegl/proj/ ... schema.jpg

it shows the io buffering portion. but also the ports used on the ft2232

also here shows a "clones" of the jtagkey

http://circuitben.net/usb_jtag/index.php

http://www.geektalks.cn/mediagallery/me ... myjtag.jpg

http://modularcircuits.com/usb_programmer.htm

last one is non-commercial licence according to site, but seeing as we are only looking at who uses what pins to make it as compatible as possible and not using his design im guessing its ok?

i am looking for more info on ft2232 based spi/i2c devices atm and will post any info i find. as all above dont implement the spi.

some target's i use are BCM334X,BCM3350, and spi mx25l1605,mx25l8005

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #7
Great resources, thank you. It looks like post-C revision includes the adaptive clocking features. These also almost all have buffers - I'm pretty torn if a buffer is a good idea on the first revision, might be a lot easier to get it working without.

I'm also uncertain of the EEPROM, I'm leaning towards not needing it. I don't think it's needed if OpenOCD (etc) send the right configuration commands at initialization, but I don;t know if this happens yet. Can always place it but not populate it.
Got a question? Please ask in the forum for the fastest answers.

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #8
[quote author="ian"]
Great resources, thank you. It looks like post-C revision includes the adaptive clocking features. These also almost all have buffers - I'm pretty torn if a buffer is a good idea on the first revision, might be a lot easier to get it working without.

I'm also uncertain of the EEPROM, I'm leaning towards not needing it. I don't think it's needed if OpenOCD (etc) send the right configuration commands at initialization, but I don;t know if this happens yet. Can always place it but not populate it.
[/quote]

reading the section 4.13.1 in the datasheet i come to the conclusion that modes

ASYNC Serial UART,
ASYNC 245 FIFO,
Fast Serial interface,
CPU-Style FIFO
Are configurable using the eeprom

SYNC 245 FIFO
ASYNC Bit-bang
SYNC Bit-bang
MPSSE
FIFO Host Bus Emulation
are configurable using the software

but as you say is it needed or just an option that can be used to auto configure the chip on powerup. ie auto setup as a jtag.

but the eeprom also allows custom pid/vid and custom device names ect so i think unless cost is too much then it be better to have it show in controlpanel etc as Bus Blaster,

edit:

here is the datasheet explaining "user area"
http://www.ftdichip.com/Documents/AppNo ... _Usage.pdf
"FT2232H and FT4232H do not have any internal EEPROM. These need to be
connected to an external EEPROM such as the 93C46, 93C56 or 93C66 to configure device’s setting.
Note. The EEPROM used must be of a type with a 16-bit width."

heres a  another datasheet regarding the recovery of bricked ft2232 modules.
http://www.ftdichip.com/Documents/AppNo ... covery.pdf

"3.1 What the EEPROM Contains
The EEPROM contains standard descriptors to allow for unique identification of the device e.g. VID, PID, Serial number and strings such as manufacturer and product name.
In addition to the descriptors there are functional parameters that allow the device to be configured into different modes e.g. UART or FIFO."

edit:::

i take it back, re reading the datasheet it seems as if the module will function with a blank eeprom attached but not a corrupted one.
so back to square 1 lol is it needed? well hopefully we will find out soon.. i have just emailed the support team and asked them ;)

ok found more info on a different site.

"Do I need to fit the EEPROM?
The chip has in-built default parameters in silicon but if you need to change any of the following you will definately need to fit the EEPROM to be able to store your preferences: USB Power draw, Product ID, Serial number or the plug-and-play flag.
Additionaly the following requirements would necessitate updating (and therefore fitting) the EEPROM:
- If more than one of your device needs to be plugged into the same PC at any one time.
- If you require only one driver installation per PC, fix the serial number to be the same on all devices.
- If you need to set the PID as provided by AMC or the USB Forum to work with your drivers."

so dont look like we need it unless we use custom parameters or pid/vid, i personally would say to use one, but dependsing on costs ect then placing the pads on the pcb but leaving the chip off would allow people who wanted that facility to add the eeprom later on.

ive just finished editing the inf's and  eeprom on the buspirate, looks so much cooler having buspirate (com) instead of usb serial comport in the comport enumerations.

had a reply to my email
Quote
Hello,

 

It is not essential to use an EEPROM for MPSSE or UART mode.

 

You may want to add one to change device descriptors to customize the appearance of the design.

 

Regards,

 

Gordon Lunn

Senior Applications Engineer

 

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #9
Speaking with my flashrom hat on, I do welcome such ideas.
After all, it means flashrom can probably support this new device with maybe two lines of code (or even without any changes at all).

A few words of advice:
  • SPI on the FTDI devices with MPSSE is easy. There's an opensource libftdi which works pretty well (if you have a current libftdi, libusb and kernel). Older libusb/libftdi/kernel combinations may cause transactions longer than 32 bytes to become corrupted (incorrect USB packet separation, some status codes end up being interpreted as data)
  • We've had reports that interface A on either the FT2232H or FT4232H is somewhat busted, but others have been unable to confirm that.
  • If you keep a few things in mind, you can make the FT2232 with MPSSE into an all-purpose flash programmer (sort of like the Willem, but without the slowness and without the high price. Right now flashrom only supports SPI with the FT2232H/FT4232H, but it is pretty doable to add bitbanging/MPSSE LPC/FWH flash support (unfinished patch available) and it might even be possible to target old parallel flash chips which are appearing again in laptops. Flash interface requirements:
    • SPI needs 4 lines including clock (well, you can speed up accesses with a 5th line). Having SOIC8/SOIC8W pads and a DIP8 socket would be cool.
    • FWH/LPC can be done with 7 lines AFAIR. Most common form factor is PLCC32. One common PLCC32 socket for FWH/LPC is possible (same pinout). Rarely used alternative form factors are TSOP32 and TSOP40.
    • Parallel needs n address lines (usually 17-22), 8 or 16 data lines, and two control lines. Getting 32 lines coordinated can be tricky, so this may actually use two interfaces in lockstep (if possible) or some sort of buffer. Various form factors, among them half a dozen DIP variants and a PLCC32 socket (which has an incompatible pinout to the LPC/FWH PLCC32 socket and will fry the chip if you confuse the sockets). Usually handled by one large DIP socket where you left-align (or right-align) all chips, and one PLCC32 socket.
  • [/li]
  • Clock rate is variable, but I don't know if anything faster than 12 MHz works reliably. The variable clock rate is helpful for chips which max out at 20 MHz (some chips can take 150 MHz).
  • Some chips want 5 V, others 3.3 V, others 2.8 V. Voltage selection would be cool (some FTDI chips can use a reference voltage for all I/O.
If you have any flashrom problems, please mail flashrom@flashrom.org and include "Bus Pirate" in the subject line. As an alternative, you can send me a private message.
It is recommended to use at least flashrom 0.9.2 or later, and latest flashrom from svn if you want a 3x speedup.

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #10
some encouraging info there biosflasher,

i especially like the following.
[quote author="biosflasher"]
If you keep a few things in mind, you can make the FT2232 with MPSSE into an all-purpose flash programmer (sort of like the Willem, but without the slowness and without the high price. Right now flashrom only supports SPI with the FT2232H/FT4232H, but it is pretty doable to add bitbanging/MPSSE LPC/FWH flash support (unfinished patch available) and it might even be possible to target old parallel flash chips which are appearing again in laptops.
[/quote]

if we could get the project to that point it would be amazing

looking at the datasheet (page 8) the spi is only available on channel b.

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #11
Thanks for your experienced input. This is really gelling. I'd really like it to work out-of-the-box with OpenOCD and flashrom. Since it's a hardware module with fixed pins, I think it will be easy to make it compatible with existing supported tools.

I think an EEPROM footprint should be included, with the intent of it being available but not populated. A custom VID/PID is $4000 from the USB forum, so that's probably out of reach :)

SPI looks like it comes from the MPSSE module on both channels (ganged with the JTAG pins). The FSI (only on B) is a custom interface protocol - I got hung up on that at first.
Got a question? Please ask in the forum for the fastest answers.

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #12
[quote author="ian"]I think an EEPROM footprint should be included, with the intent of it being available but not populated. A custom VID/PID is $4000 from the USB forum, so that's probably out of reach :) [/quote]
Just for your information, you don't need to pay the USB forum for a custom VID/PID if you'd like one, FTDI offers to give you your own PID for free (yes, they actually do, we tried it...), see here at the bottom: http://www.ftdichip.com/FTDrivers.htm
Quote
"For customers wishing to create their own driver release, FTDI can issue you with a block of 8 product IDs (PIDs) for use with FTDI's vendor ID (VID) if you do not have your own vendor ID.  This service is free of charge, but the issued PIDs must only be used with FTDI's VID (0x0403)."

The bad news is, however, that you no longer are "FTDI-plug-and-play-everybody-recognizes-you-instantly" - you need customized INF files/linux driver package since obviously nobody knows what exactly you just plugged in anymore. :)

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #13
[quote author="EasyRider"]
[quote author="ian"]I think an EEPROM footprint should be included, with the intent of it being available but not populated. A custom VID/PID is $4000 from the USB forum, so that's probably out of reach :) [/quote]
Just for your information, you don't need to pay the USB forum for a custom VID/PID if you'd like one, FTDI offers to give you your own PID for free (yes, they actually do, we tried it...), see here at the bottom: http://www.ftdichip.com/FTDrivers.htm
Quote
"For customers wishing to create their own driver release, FTDI can issue you with a block of 8 product IDs (PIDs) for use with FTDI's vendor ID (VID) if you do not have your own vendor ID.  This service is free of charge, but the issued PIDs must only be used with FTDI's VID (0x0403)."

The bad news is, however, that you no longer are "FTDI-plug-and-play-everybody-recognizes-you-instantly" - you need customized INF files/linux driver package since obviously nobody knows what exactly you just plugged in anymore. :)
[/quote]

exactly what i did with my bus pirate ;) but as its only for me i have just edited the eeprom to a random pid and edited the inf file to match. (no point wasting an allocation)
where as it would be nice to have it auto install using ftdi standard drivers, i see no problem in having to download a small driver file when it allows total customisation of the pid and device descriptors, i have a few devices now that are ftdi based that all need custom drivers, including, bus pirate,infinity unlimited usb, and various others with built in usb/serial converters, all have custom names ect which makes it very easy to pick the right one when using more than one at a time. i have even renamed some myself just to get friendlier names in device manager,

being able to alter the pid/vid i beleive is a good thing as it will allow those who chouse to, to change the pid/vid to match other compatible devices and use software that allows only those devices also the ft2232 will function perfectly with a blank eeprom just as well as no eeprom, so doesn't have to be programmed at factory,

but i would be happy with the eeprom footprint being placed, atleast then we have a choice to add our own, or even have it added at production if needed without redesigning the pcb layout, measure twice cut once.

Re: FTDI 2232 high speed programmer debugger (JTAG/SPI/I2C/UART)

Reply #14
There is a device released under a free license that is very similar to what has been discussed here. It is called Floss-JTAG:
http://randomprojects.org/wiki/Floss-JTAG

It is also being used by the Openpilot project as their main device JTAG interface:
http://wiki.openpilot.org/Floss-JTAG

They are already compatible with OpenOCD, and the second interface is wired as a high-speed serial port. I'm using it at 4Mbps to communicate with some
sensors we are developing at the University where I work.

The board was designed in EAGLE and it is also available here:
  $ git clone git://github.com/esden/floss-jtag.git

It might be worth looking at it for ideas, or to extend it to become the Bus-Buster.