我曾尝试将两个评估套件连接到装有 Silabs CP210x 芯片的 Ubuntu 22.04 系统。我原本以为/dev/ttyUSB
当我将 USB 电缆插入系统时会看到一个字符设备文件(就像我之前在 18.04 系统上所做的那样),而无需手动加载内核驱动程序。然而,这并没有奏效。
lsusb
列表:Bus 003 Device 024: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
- modinfo 显示 usbserial 驱动程序存在(/lib/modules/5.15.0-43-generic/kernel/drivers/usb/serial/usbserial.ko )
- lsmod 显示正确的驱动程序已加载并正在使用:
lsmod | grep cp210x
cp210x 40960 0
usbserial 57344 1 cp210x
lsusb -d 10c4:ea60 -v
返回:
Bus 003 Device 024: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x10c4 Silicon Labs
idProduct 0xea60 CP210x UART Bridge
bcdDevice 1.00
iManufacturer 1 Silicon Labs
iProduct 2 CP2102 USB to UART Bridge Controller
iSerial 3 0001
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0020
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 2
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
一切似乎都正常。那么为什么没有创建字符设备文件呢?
答案1
dmesg
重新评估答案:
sudo dmesg | grep cp210x
[11475.182843] cp210x 3-11:1.0: cp210x converter detected
[11475.185804] usb 3-11: cp210x converter now attached to ttyUSB0
[11479.400467] usb 3-11: usbfs: interface 0 claimed by cp210x while 'brltty' sets config #1
[11479.400838] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0
[11479.400850] cp210x 3-11:1.0: device disconnected
brltty
正在声明设备。对我来说,解决方案就是移除 brltty 并拔下/插入 USB 电缆。我也可以禁用该brltty
服务正如这里提到的。