FreeCalypso > hg > fc-usbser-tools
comparison doc/Icestick-instructions @ 38:6bf063ade588
doc/Icestick-instructions: new article
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 10 Sep 2023 07:30:01 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
37:825d3303b886 | 38:6bf063ade588 |
---|---|
1 If you have a Lattice iCEstick FPGA board (ICE40HX1K-STICK-EVN) and you wish to | |
2 program its FT2232H subsystem EEPROM with a sensible configuration that results | |
3 in the Linux kernel ftdi_sio driver leaving Channel A untouched and creating a | |
4 single ttyUSB device for Channel B, follow these instructions: | |
5 | |
6 1) Plug your iCEstick board into your PC/laptop or other Linux host, and run | |
7 lsusb. There should be one particular line in lsusb output that reads like | |
8 this: | |
9 | |
10 Bus 001 Device 014: ID 0403:6010 Future Technology Devices International, Ltd FT2232C/D/H Dual UART/FIFO IC | |
11 | |
12 or perhaps like this on older systems: | |
13 | |
14 Bus 001 Device 014: ID 0403:6010 Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC | |
15 | |
16 Bus and device numbers will be different on your system, but the important part | |
17 is ID 0403:6010 - it is the default USB ID of FT2232x chips that appears when | |
18 no custom ID has been assigned via the EEPROM. | |
19 | |
20 2) Ensure that you don't have any other USB devices with ID 0403:6010 - given | |
21 that it is the chip's default, lots of devices use it! | |
22 | |
23 Make sure that there is only one line in lsusb output that reads ID 0403:6010. | |
24 Unplug your iCEstick and make sure that this line disappears. Plug it back in | |
25 and make sure the line reappears. | |
26 | |
27 3) Once you are sure that you won't hit some other USB device using the same | |
28 popular ID code, execute this programming command pipeline: | |
29 | |
30 ftee-gen2232h -b icestick | fteeprom-prog i:0x0403:0x6010 | |
31 | |
32 This shell pipeline is a little long and looks complicated, but it must be | |
33 issued exactly as listed above. The first part of the pipeline generates an | |
34 image for an FT2232H chip (ftee-gen2232h) with 93C56 EEPROM (-b option) based | |
35 on standard (shipped with fc-usbser-tools) configuration named "icestick"; the | |
36 second part of the pipeline sends physical EEPROM write commands (USB control | |
37 endpoint requests, FTDI-specific) to the USB device matching the given ID. | |
38 | |
39 4) Unplug and replug the iCEstick for the EEPROM change to take effect. Run | |
40 lsusb again and note that the USB ID is now 0403:7150 instead of 0403:6010 - | |
41 still within FTDI's vendor ID, but with a specific, non-default product ID | |
42 code. | |
43 | |
44 With the new ID the Linux kernel ftdi_sio driver should create a ttyUSB device | |
45 only for FT2232H Channel B, which is the UART channel for talking to user logic | |
46 inside the FPGA. I (Mother Mychaela) also recommend that you create an | |
47 iceprog-7150 wrapper around the standard iceprog utility from IceStorm toolkit, | |
48 in the form of a shell script like this: | |
49 | |
50 #!/bin/sh | |
51 exec /usr/local/bin/iceprog -d i:0x0403:0x7150 "$@" | |
52 | |
53 It looks like Claire (the author of IceStorm) was not as bothered as I am by | |
54 the bogosity of a ttyUSB device for the MPSSE channel that appears on plug-in | |
55 but then disappears once you run a userspace program that exercises MPSSE via | |
56 libftdi: she coded iceprog to look for 0403:6010 in the absence of a -d option | |
57 giving a custom device selector string, rather than doing something similar to | |
58 what I did. With standard iceprog being as it is, we need to run it with this | |
59 -d option when we have programmed the FT2232H EEPROM to use a more sensible USB | |
60 ID, and in my opinion the most sane way to supply this needed option is via a | |
61 wrapper as recommended above. |