On Mon, Oct 29, 2018 at 11:37 AM Yegor Yefremov
wrote:
>
> 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:
> 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+unsubscr...@developer.intra2net.com