gpt4 book ai didi

ubuntu - 未检测到 FTDI 设备

转载 作者:行者123 更新时间:2023-12-04 18:29:05 25 4
gpt4 key购买 nike

将 FTDI 设备连接到 USB 端口后,FT_OpenEx()返回错误代码 2,即 FT_DEVICE_NOT_FOUND .然而,在终端中运行“lsusb”时,FTDI 设备确实出现了。
是什么导致 FT_Open_Ex()返回 FT_DEVICE_NOT_FOUND如果该设备由 lsusb 列出?可能的问题和解决方案是什么?

lsusb的输出:

Bus 001 Device 003: ID 0bda:5776 Realtek Semiconductor Corp. 
Bus 001 Device 002: ID 8087:8000 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

dmesg 的输出 | grep FTDI:
[28153.244220] usbserial: USB Serial support registered for FTDI USB Serial Device
[28153.244260] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
[28153.244509] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0

dmesg 的输出 | grep -i FTDI:
[28153.244206] usbcore: registered new interface driver ftdi_sio
[28153.244220] usbserial: USB Serial support registered for FTDI USB Serial Device
[28153.244260] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
[28153.244509] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0

最佳答案

dmesg 输出显示 ftdi_sio(一个内核模块)已声明 USB 端口来模拟串行端口。这是典型 Ubuntu 安装的默认行为。
FT_OpenEx 是 FTDI D2XX API 的一部分,它无法访问 ftdi_sio 已声明的设备。
FTDI Linux D2XX notes建议:

sudo lsmod 

If "ftdi_sio" is listed:Unload it (and its helper module, usbserial), as follows.

sudo rmmod ftdi_sio
sudo rmmod usbserial

这将允许 D2XX 程序访问设备,直到下次重新启动内核将再次加载 ftdi_sio。 This answer提供了一种避免在每次重新启动后手动卸载它的方法。

关于ubuntu - 未检测到 FTDI 设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45054026/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com