annotate doc/FT232R-notes @ 55:c0084bf153e5

cp2102: Intel HEX reading implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 11 Sep 2023 19:45:56 +0000
parents f5fbcf1ff032
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
34
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 Unlike FT2232x devices with external EEPROMs, an FT232R device is not expected
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 to ever have a blank EEPROM in normal usage: these chips have their EEPROM
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 built in, and FTDI probably ships them with this internal EEPROM already
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 programmed. I said "probably" because I have not yet had an occasion to build
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 my own FT232R-containing board where I would be getting completely pristine
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 "bare" chips from Digi-Key, thus I have no first-hand verified knowledge.
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 As an experiment, I have programmed "blank" (0xFFFF in every word) images into
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 the two FT232R devices I have available for play at the moment (specifically
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 devices which I could afford to brick if things went badly), and FT232R behaves
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 the same way as FTDI's earlier chips with external EEPROMs: it runs with a fixed
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 default config when the EEPROM is invalid. But this configuration is NOT
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 recommended for production use - you should always have a valid EEPROM config
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 in your FT232R chip.
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 When our FreeCalypso fteeprom tools were first put together in 2019-04, I was
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 getting erratic behaviour: when I tried to program my own EEPROM config
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 generated with ftee-gen232r, the resulting EEPROM content became a bitwise AND
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 between the previous image and the new one, as if the "EEPROM" is not really an
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 erasable memory, but one of OTP kind where ones can be turned into zeros, but
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 not the other way around. I was doing this experiment on a no-name FT232RL
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 adapter from ebay, thus my first thought was that the FT232RL chip was bad, a
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 less-than-perfect clone rather than genuine FTDI. But then I bought a UB232R
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 module from Digi-Key (presumably containing a genuine FT232RQ chip), and it
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 behaved the same way.
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 Further investigation revealed that FT232R EEPROM write operations work
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 correctly only if they are preceded by this magic sequence:
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 ftdi_usb_reset(&ftdi);
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 ftdi_poll_modem_status(&ftdi, &modem_status);
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 ftdi_set_latency_timer(&ftdi, 0x77);
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 I can see how FTDI could have reasonably implemented a sort of safety lock on
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 their EEPROM write operations, allowing them only if a special unlock sequence
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 has been given - but it completely baffles me why they are doing some sort of
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 OTP emulation in the absence of the right magic sequence, as opposed to
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 disabling EEPROM writes altogether. It is worth noting that this magic sequence
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 is NOT needed for programming external EEPROMs behind FT2232x chips - were FTDI
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 folks being deliberately malicious in designing their FT232R chip to simulate
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 appearance of being bricked when it is programmed with older (or third-party)
f5fbcf1ff032 doc: initial import from freecalypso-hwlab
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 software tools that don't know the new magic sequence? Who knows...