to check the serial
lsusb -d VID:PID -v | grep iSerial
ftdi chips may have none. It is writable with FT_PROG from windows. Virtualbox works. You need to install the drivers (https://www.ftdichip.com/Drivers/D2XX.htm ) otherwise no devices are shown.
/etc/udev/rules.d/99-ftjtag.rules reads
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", ATTRS{serial}=="FT4KPCVJ", KERNEL=="ttyUSB*", RUN+="/etc/udev/scripts/unbind_ftdi.sh"
#!/bin/sh
# traverse sysfs to find the USB ID
# of the USB device which is parent/ancestor of ttyUSB*
# something like "1-1.6:1.0"
TTYDEV=$(basename $DEVNAME)
BOUND_DEVICES=/sys/bus/usb/drivers/ftdi_sio/*/
for DEVICE in ${BOUND_DEVICES}; do
if [ ! -z $TTYDEV ] && [ -e $DEVICE/$TTYDEV ]; then
USBID=$(basename $DEVICE)
#echo "$TTYDEV wanna unbind $USBID" >> /tmp/toUnbind.txt
echo "$USBID" > /sys/bus/usb/drivers/ftdi_sio/unbind
break
fi
done
lsusb -d VID:PID -v | grep iSerial
ftdi chips may have none. It is writable with FT_PROG from windows. Virtualbox works. You need to install the drivers (https://www.ftdichip.com/Drivers/D2XX.htm ) otherwise no devices are shown.
/etc/udev/rules.d/99-ftjtag.rules reads
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", ATTRS{serial}=="FT4KPCVJ", KERNEL=="ttyUSB*", RUN+="/etc/udev/scripts/unbind_ftdi.sh"
where /etc/udev/scripts/unbind_ftdi.sh is
#!/bin/sh
# traverse sysfs to find the USB ID
# of the USB device which is parent/ancestor of ttyUSB*
# something like "1-1.6:1.0"
TTYDEV=$(basename $DEVNAME)
BOUND_DEVICES=/sys/bus/usb/drivers/ftdi_sio/*/
for DEVICE in ${BOUND_DEVICES}; do
if [ ! -z $TTYDEV ] && [ -e $DEVICE/$TTYDEV ]; then
USBID=$(basename $DEVICE)
#echo "$TTYDEV wanna unbind $USBID" >> /tmp/toUnbind.txt
echo "$USBID" > /sys/bus/usb/drivers/ftdi_sio/unbind
break
fi
done
reload the rules with
udevadm control --reload-rules && udevadm trigger
sources:
No comments:
Post a Comment