Discussion:
Issues reading EEPROM on FT2232HL and FT232HL
Yegor Yefremov
2018-10-29 10:37:39 UTC
Permalink
I have two devices one with FT2232HL and the other with FT232HL. lsusb output

Bus 001 Device 003: ID 0403:6010

and

Bus 001 Device 003: ID 0403:6014

I'm trying to decode EEPROM with this Python code:

import ftdi1 as ftdi

VID_FTDI = 0x0403
PID_FTDI_FT232H = 0x6014
PID_FTDI_FT2232H = 0x6010
PID_FTDI_FT4232H = 0x6011
PID_FTDI_FT_X = 0x6015


def read():
"""Read FTDI."""
# initialize FTDI library
context = ftdi.new()
if context is None:
print("Failed to initialize libftdi1")
return False

# find all FTDI chips
rc, devlist = ftdi.usb_find_all(context, VID_FTDI, PID_FTDI_FT2232H)
if rc <= 0:
print("No FTDI chips found")
return False

curnode = devlist
while curnode is not None:
if ftdi.usb_open_dev(context, curnode.dev) != 0:
print("Failed to open FTDI device")
return False

# read eeprom
eeprom_addr = 1
rc, eeprom_val = ftdi.read_eeprom_location(context, eeprom_addr)
if 0 != rc:
print("Failed to read FTDI EEPROM location")
return False

print("EEPROM location: {}".format(eeprom_val))

rc = ftdi.read_eeprom(context)
if rc < 0:
print("Failed to read EEPROM")
return False

rc = ftdi.eeprom_decode(context, 1)
if rc < 0:
print("Failed to decode EEPROM")
return False

# select next FTDI device
curnode = curnode.next

return True


read()

This is the output:

# python test.py
EEPROM location: -1
Checksum Error: aaaa 0000
Failed to decode EEPROM

Any idea? The same code has no problems with either FT4232H or FTX
chips. EEPROM is AT93C46D connected the same way as on the FT4232H
devices (16-bit mode ORG). I can also see the signals on oscilloscope.

What does location == -1 mean? FTDI cannot detect EEPROM?

Has anyone successfully used both FT2232HL and FT232HL with libftdi1?

Regards,
Yegor

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+***@developer.intra2net.com
Yegor Yefremov
2018-10-29 12:24:22 UTC
Permalink
On Mon, Oct 29, 2018 at 11:37 AM Yegor Yefremov
Post by Yegor Yefremov
I have two devices one with FT2232HL and the other with FT232HL. lsusb output
Bus 001 Device 003: ID 0403:6010
and
Bus 001 Device 003: ID 0403:6014
import ftdi1 as ftdi
VID_FTDI = 0x0403
PID_FTDI_FT232H = 0x6014
PID_FTDI_FT2232H = 0x6010
PID_FTDI_FT4232H = 0x6011
PID_FTDI_FT_X = 0x6015
"""Read FTDI."""
# initialize FTDI library
context = ftdi.new()
print("Failed to initialize libftdi1")
return False
# find all FTDI chips
rc, devlist = ftdi.usb_find_all(context, VID_FTDI, PID_FTDI_FT2232H)
print("No FTDI chips found")
return False
curnode = devlist
print("Failed to open FTDI device")
return False
# read eeprom
eeprom_addr = 1
rc, eeprom_val = ftdi.read_eeprom_location(context, eeprom_addr)
print("Failed to read FTDI EEPROM location")
return False
print("EEPROM location: {}".format(eeprom_val))
rc = ftdi.read_eeprom(context)
print("Failed to read EEPROM")
return False
rc = ftdi.eeprom_decode(context, 1)
print("Failed to decode EEPROM")
return False
# select next FTDI device
curnode = curnode.next
return True
read()
# python test.py
EEPROM location: -1
Checksum Error: aaaa 0000
Failed to decode EEPROM
Any idea? The same code has no problems with either FT4232H or FTX
chips. EEPROM is AT93C46D connected the same way as on the FT4232H
devices (16-bit mode ORG). I can also see the signals on oscilloscope.
What does location == -1 mean? FTDI cannot detect EEPROM?
Has anyone successfully used both FT2232HL and FT232HL with libftdi1?
I've tried eeprom tool from examples folder and it turned out, that
EEPROM was empty. It seems like there is no way to detect whether the
EEPROM is empty or the data is corrupted?

Yegor

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+***@developer.intra2net.com
Thomas Jarosch
2018-11-05 21:20:58 UTC
Permalink
Hi Yegor,
Post by Yegor Yefremov
I've tried eeprom tool from examples folder and it turned out, that
EEPROM was empty. It seems like there is no way to detect whether the
EEPROM is empty or the data is corrupted?
As far as I remember a FTDI chip ignores the eeprom content if the
checksum doesn't match. If a bit flips in the eeprom, you'll end up with
the default USB vendor/product ID, too.

Cheers,
Thomas

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+***@developer.intra2net.com
Loading...