libftdi Archives

Subject: Re: EEPROM handling work

From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Wed, 15 Sep 2010 18:50:32 +0200
>>>>> "DJ" == DJ Delorie <dj@xxxxxxxxxxx> writes:

    >> Usage pattern is like * (open device) *
    >> ftdi_eeprom_initdefaults(ftdi, "My_MANU","MY_DESC","MY_Serial") with
    >> libftdi setting values according to ftdi->type * change
    >> ftdi->eeprom->xx items according to local needs * ftdi_erase_eeprom()

    DJ> This is wrong for the FT232R.  For that, you always read the
    DJ> existing eeprom data first, *then* make changes.  Never start with a
    DJ> blank eeprom or you'll lose the unique serial number that FTDI puts
    DJ> in each FT232R, which is stored *after* the regular eeprom data!
    DJ> This number is separate from the MY_Serial in your email, although
    DJ> FTDI puts a unique one of those in also, which your use pattern
    DJ> would lose.

I forgot to mention:
On FT2232R, the USB control message
   libusb_control_transfer(ftdi->usb_dev, FTDI_DEVICE_OUT_REQTYPE, 
    SIO_ERASE_EEPROM_REQUEST, 0, 0, NULL, 0, ftdi->usb_write_timeout) < 0)
doesn't do anything  and the new code returns even before
sending the control message. Only data below 0x80 is considered writable at
all under checksum protection.

Daring now to give my code a try?


Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

libftdi - see for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread