Linux/FTDI

From Omnia
Revision as of 20:14, 5 November 2020 by Kenneth (talk | contribs) (→‎FTDI Programming)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

FTDI Driver

To detect the FTDI device, install the extra module package:

apt install linux-image-extra-`uname -r`

Then either reboot, or manually load the module

modprobe ftdi_sio

Find with:

/dev/ttyUSB0

FTDI Programming

apt install ftdi-eeprom
modprobe -r ftdi_sio
ftdi_eeprom --read-eeprom asmith.conf
modprobe ftdi_sio
tio /dev/ttyUSB0


udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB0) | less
   ATTRS{idProduct}=="6011"
   ATTRS{idVendor}=="0403"


---

mydevice.conf:

vendor_id=0x0403
product_id=0x6011

max_power=0

manufacturer="Aznot"
product="Aznot Device"
serial="1944d0021"

filename="eeprom.new"

---


# ftdi_eeprom --read-eeprom test.conf

FTDI eeprom generator v0.17
(c) Intra2net AG and the libftdi developers <opensource@intra2net.com>
FTDI read eeprom: 0
EEPROM size: 128
FTDI close: 0


---

# ftdi_eeprom --erase-eeprom asmith.conf

FTDI eeprom generator v0.17
(c) Intra2net AG and the libftdi developers <opensource@intra2net.com>
FTDI read eeprom: 0
EEPROM size: -1
FTDI erase eeprom: 0
Used eeprom space: 224 bytes
Writing to file: eeprom.new
FTDI close: 0

---

# ftdi_eeprom --flash-eeprom asmith.conf

FTDI eeprom generator v0.17
(c) Intra2net AG and the libftdi developers <opensource@intra2net.com>
FTDI read eeprom: 0
EEPROM size: -1
Used eeprom space: 96 bytes
FTDI write eeprom: 0
Writing to file: eeprom.new
FTDI close: -1

---

# ftdi_eeprom --flash-eeprom asmith.conf

FTDI eeprom generator v0.17
(c) Intra2net AG and the libftdi developers <opensource@intra2net.com>
FTDI read eeprom: 0
EEPROM size: 256
Used eeprom space: 224 bytes
FTDI write eeprom: 0
Writing to file: eeprom.new
FTDI close: 0

---

[18849.738246] usb 1-5: new high-speed USB device number 6 using xhci_hcd
[18849.880956] usb 1-5: New USB device found, idVendor=0403, idProduct=6011
[18849.880957] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[18849.880958] usb 1-5: Product: Aznot Device
[18849.880959] usb 1-5: Manufacturer: Aznot
[18849.882541] ftdi_sio 1-5:1.0: FTDI USB Serial Device converter detected
[18849.882555] usb 1-5: Detected FT4232H
[18849.882635] usb 1-5: FTDI USB Serial Device converter now attached to ttyUSB0
[18849.883942] ftdi_sio 1-5:1.1: FTDI USB Serial Device converter detected
[18849.883953] usb 1-5: Detected FT4232H
[18849.884028] usb 1-5: FTDI USB Serial Device converter now attached to ttyUSB1
[18849.885338] ftdi_sio 1-5:1.2: FTDI USB Serial Device converter detected
[18849.885349] usb 1-5: Detected FT4232H
[18849.885423] usb 1-5: FTDI USB Serial Device converter now attached to ttyUSB2
[18849.886763] ftdi_sio 1-5:1.3: FTDI USB Serial Device converter detected
[18849.886779] usb 1-5: Detected FT4232H
[18849.886866] usb 1-5: FTDI USB Serial Device converter now attached to ttyUSB3

---

that means that the EEPROM is erased (all 0xff); see ftdi_read_eeprom() in ftdi.c: "Guesses size of eeprom ... will not work with blank eeprom"

> Checksum Error: aaaa 0000 > Malloc failed, aborting

these errors follow from EEPROM size being -1

with an erased EEPROM the FTDI chip falls back to the default vendor:product (which is 0403:6011)

ref: [1]

---

Source:

https://chromium.googlesource.com/chromiumos/third_party/libftdi/+/b790d38e9fac3e2144293a84bfc6de72b01a6c6d/src/ftdi.c

UDEV

See Linux/udev

Notes

Barnaby Walters • How to read and program the EEPROM and configuration of FTDI FT2xx ICs on Linux or Mac OS X https://waterpigs.co.uk/articles/ftdi-configure-mac-linux/

Flashing the FTDI EEPROM under linux · mozilla-sensorweb/sensorweb-wiki Wiki · GitHub https://github.com/mozilla-sensorweb/sensorweb-wiki/wiki/Flashing-the-FTDI-EEPROM-under-linux

developer.intra2net.com Git - libftdi/blob - README.build http://developer.intra2net.com/git/?p=libftdi;a=blob;f=README.build


After updating the EEPROM, you should unplug and replug the board.

keywords