libftdi Archives

Subject: Re: [EEPROM branch] "size_check" init value

From: Xiaofan Chen <xiaofanc@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Fri, 24 Sep 2010 20:20:18 +0800
On Fri, Sep 24, 2010 at 7:03 PM, Thomas Jarosch
<thomas.jarosch@xxxxxxxxxxxxx> wrote:
> Hmm, if I read AN_121 correctly, the complete storage area
> for all strings is only 96 bytes / 0x60 - for all chip types/eeprom sizes.
>
> Could you check with MProg if they limit all strings to a total of 96 bytes?
> If yes, we can greatly simplify our "size_check" code like this:
>
> if (manfacturer_size*2 + product_size*2 + serial_size*2) > 96)
>        explode_and_die();

AN121 says this.
User Area Size (in bytes) = (48 – (Manufacturer string +
Description string + ManufacturerId string + SerialNumber string)) * 2

The help file for FT_Prog (replacement of MProg)
also mentions the following.

Section "EEPROM Programming -->EEPROM Settings -->USB String
Descriptors" of the help file (chm format) has the following.
"This allows for the string descriptors that the device will use to be
changed on the EEPROM.  The maximum number of characters
 that the string descriptors can take is 48 including the Manufacturer,
Product Description and Serial Number strings."

>From what I read using FT_prog dump of a Luminary LM321968
board (using FT2232D), of the 64 words EEPROM, the first
12s word are not for the strings. And the remaining 52 words, I guess
4 words are kind of checksum (or spacer or things like that) for the
three strings and the user area. I will call them "spacer" later.

So you got 48 words available for the 4 strings.

> AN_121 also mentions the "manufacturer ID" string additionally
> to the "manufacturer" string. Any idea what that is?
>

ftd2xx.h seems to mention it, but I do not see that in the dump.

        // structure to hold program data for FT_Program function
        //
        typedef struct ft_program_data {

                DWORD Signature1;                       // Header - must be 
0x00000000
                DWORD Signature2;                       // Header - must be 
0xffffffff
                DWORD Version;                          // Header - 
FT_PROGRAM_DATA version
                //                      0 = original
                //                      1 = FT2232C extensions
                //                      2 = FT232R extensions
                //                      3 = FT2232H extensions
                //                      4 = FT4232H extensions

                WORD VendorId;                          // 0x0403
                WORD ProductId;                         // 0x6001
                char *Manufacturer;                     // "FTDI"
                char *ManufacturerId;           // "FT"
                char *Description;                      // "USB HS Serial 
Converter"
                char *SerialNumber;                     // "FT000001" if fixed, 
or NULL
                WORD MaxPower;                          // 0 < MaxPower <= 500
                WORD PnP;                                       // 0 = 
disabled, 1 = enabled
                WORD SelfPowered;                       // 0 = bus powered, 1 = 
self powered
                WORD RemoteWakeup;                      // 0 = not capable, 1 = 
capable

Dump of the EK-LM3S1968 board FT2232D 93C46 EEPROM.

Read EEPROM Device 0
Word
0000: 1108 0304 D9BC 0005 80FA 1800 0002 9608
0008: 9E36 D412 4600 0803 4C00 4D00 4900 3603
0010: 5300 7400 6500 6C00 6C00 6100 7200 6900
0018: 7300 2000 4500 7600 6100 6C00 7500 6100
0020: 7400 6900 6F00 6E00 2000 4200 6F00 6100
0028: 7200 6400 1203 3000 3700 3000 3200 3000
0030: 3000 4100 3100 0203 0000 A100 0207 0000
0038: 0000 0000 0000 0000 0000 0000 0000 DBD6

4C00 4D00 4900 is "LMI"
3603 is probably the spacer after "LMI"

5300 7400 6500 6C00 6C00 6100 7200 6900
7300 2000 4500 7600 6100 6C00 7500 6100
7400 6900 6F00 6E00 2000 4200 6F00 6100
7200 6400  is "Stellaris Evaluation Board".
1203 is probably the spacer after it.

3000 3700 3000 3200 3000 3000 4100 3100
is the serial number "070200A1".
0203 is probably the spacer after it.

"LMI" has 3 characters.
"Stellaris Evaluation Board" has 26 characters.
"070200A1" has 8 characters.

48-3-26-8=11 words. So the following is probably
the user area.
                                 0000 A100 0207 0000
 0000 0000 0000 0000 0000 0000 0000
The last word is probably the spacer after user
area.


-- 
Xiaofan

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

Current Thread