libftdi Archives

Subject: Re: Writing EEPROM on FT232R / FT245R

From: Jim Paris <jim@xxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Wed, 25 Feb 2009 15:10:29 -0500
Marius Kintel wrote:
> Hi,
>
> Has anyone successfully managed to write to the EEPROM of FT232R or  
> FT245R chips.
> I tried writing to the former using the latest git revisions of libftdi 
> and ftdi_eeprom but without success. Symptoms are as follows:
> o Erase: Nothing happens.
> o Write: The device appears to be erased instead of written.
>
> In the README of ftdi_eeprom, it says that FT232BM/FT245BM is supported, 
> so this might just be missing support for the chips I want to use.
>
> If someone could verify/clarify this, I could take a look at  
> implementing support for this myself.
> In case, some tips for how to best capture raw USB communication from  
> MProg under Windows would be very welcome.

Hi Marius,

I traced MProg in the past and came up with the following patch.  I
don't think it's correct -- since all it does is set the latency
timer(?) -- but it seemed to work for me.  At some point I was going
to revisit this and try to figure out a more proper solution.

-jim

diff -urN libftdi-0.14-orig/src/ftdi.c libftdi-0.14/src/ftdi.c
--- libftdi-0.14-orig/src/ftdi.c        2008-10-01 17:53:51.000000000 -0400
+++ libftdi-0.14/src/ftdi.c     2008-10-01 17:54:01.000000000 -0400
@@ -1915,6 +1915,9 @@
     unsigned short usb_val;
     int i;
 
+    if (usb_control_msg(ftdi->usb_dev, 0x40, 0x09, 0x0077, i, NULL, 0, 
ftdi->usb_write_timeout) != 0)
+            ftdi_error_return(-1, "unable to start eeprom write");
+
     for (i = 0; i < ftdi->eeprom_size/2; i++) {
         usb_val = eeprom[i*2];
         usb_val += eeprom[(i*2)+1] << 8;

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

Current Thread