libftdi Archives

Subject: Re: eeprom->size

From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 9 Apr 2012 21:05:14 +0200
>>>>> "Thomas" == Thomas Heller <theller@xxxxxxxxxx> writes:

    Thomas> I cannot make sense of the way eeprom->size is handled.
    Thomas> ftdi_read_eeprom() sets it to -1 (unknown), 0x40, 0x80, 0x100
    Thomas> correctly by comparing the read buffer.

    Thomas> ftdi_eeprom_initdefaults() clears everything, then sets it to
    Thomas> 0x80 for TYPE_R chip or -1 for all others.

    Thomas> ftdi_eeprom_build() sets it to 0x100 depending on external
    Thomas> eeprom chip, or to 0x80 for all others.

    Thomas> In my eeprom programmer, I'm calling these functions in the
    Thomas> sequence ftdi_read_eeprom() ftdi_eeprom_initdefaults()
    Thomas> ftdi_eeprom_build() then ftdi_eeprom_write() to flash the chip.

    Thomas> I have changed ftdi_eeprom_initdefaults() and
    Thomas> ftdi_eeprom_build() to keep the current eeprom->size.  Which
    Thomas> works for the FT232R and FT2232H chip that I currently have
    Thomas> here.

    Thomas> Does this approach make sense, or am I overlooking something?

You can't rely on the size you read back. The EEPROM may be blank or
corrupted. Only the size determined by writing and probing in
ftdi_eeprom_build has some meaning.

Bye
-- 
Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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

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

Current Thread
  • eeprom->size, Thomas Heller
    • Re: eeprom->size, Uwe Bonnes <=