I wanted to use a FT232H board for some hardware hacking. The FTDI FTxxx family of devices and boards based on this chip is categorized as a Multi-Protocol Synchronous Serial Engine (MPSSE), which can be used to debug UART, I2C, SPI and JTAG devices. I’ve used single-purpose devices, as well as the BusPirate, however there are limitations.
I like the BusPirate a lot. It’s fun to use and has many handy features. But it’s slow, and doesn’t support JTAG very well. The FT2xx family of chips do a much better job.
I have several boards that use this chip, including:
Others include:
I looked at some libraries and software, but I wanted one that supported all the chips I have, including the FT2232H-based TUMPA board. I also wanted to use python, a popular language for hardware hacking.
There are a few differences between FT232H and FT2232H boards.
By the way, the FT4232H chip supports 4 channels, compared to the FT2232H’s 2 channels and the FT232H’s single channel. So think of the variations as a single, dual or quad version of the same MPSSE.
I also learned that the Shikra board was developed because the TUMPA had a “very high failure rate (they’d burn up easily or stop working inexplicably).” The Shikra does have a MOSFET circuit to limit current to the device.
Before we install the software, there are a few options:
Ubuntu uses the group staff as the group that can work with installed files. In particular, the directory /usr/local/lib/python3.6/dist-packages belongs to group staff. However, members of the group staff do not have write permission. This can be fixed using
sudo chmod g+w /usr/local/lib/python3.6/dist-packages
Also, the executable directory /usr/local/bin belongs to group root. We need to change this to group staff and make it group writable:
sudo chgrp staff /usr/local/bin sudo chmod g+w /usr/local/bin
There is another step – add yourself to group staff.
sudo addgroup $USER staff
However, before you can install the software, you have to log out and log in. Use the command groups(1) to make sure you are in the group.
I decided to use this method, because:
Warning: Python also installs files under $HOME/.local/lib so the above be aware of this.
I started with a fairly clean version of Ubuntu. I downloaded the pyftdi source from the Github respository. Note that the repository is likely more up-to-date. I had build errors untill I used the most recent version. The code uses python3, (you will get syntax errors if you use python 2) and you have to install the python setup tools if you haven’t already:
sudo apt-get install python3-setuptools
Now go to your repository and type the following:
python3 ./setup.py build python3 ./setup.py install
That should be all you need to do. To test this, plug in the board and type
ftdi_urls.py
You should see the following two interfaces
Available interfaces: ftdi://ftdi:2232:3:2a/1 (Dual RS232-HS) ftdi://ftdi:2232:3:2a/2 (Dual RS232-HS)
If not, the board may have a different vendor or product
The way to check this is to do plug in the board, and type the dmesg command and look for a string like this
New USB device found, idVendor=0403, idProduct=8a98
If this is the case, then you should add a new line to /etc/udev/rules.d/11-ftdi.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="8a98", GROUP="plugdev", MODE="0666"
The udev subsystem has to be restarted after this change:
However, to get pyftdi to work, I had to have to modify the source. One way to do this is to add the product ID into the source by modifying pyftdi/ftdi.py
--- ftdi.py.orig 2020-03-22 13:37:57.919150970 -0400 +++ ftdi.py 2020-03-22 10:56:17.390397876 -0400 @@ -82,6 +82,7 @@ '2232': 0x6010, '2232d': 0x6010, '2232h': 0x6010, + '2232h': 0x8a98, '4232': 0x6011, '4232h': 0x6011, '230x': 0x6015, @@ -93,6 +94,7 @@ 'ft2232': 0x6010, 'ft2232d': 0x6010, 'ft2232h': 0x6010, + 'ft2232h': 0x8a98, 'ft4232': 0x6011, 'ft4232h': 0x6011, 'ft230x': 0x6015,
Then reinstall the software as above. Be aware that you might have multiple versions of the executables, and if you execute an old one, it will not work.
However, this isn’t the approved method.
A second method is to reprogram the EEPROM and modify the product ID.
A third method it to use an option added in v0.48.3:
ftdi_urls.py -P 0x403:0x8a98
A fourth method is to add the new product ID with an API call. But that’s only needed if you are writing your own code.