0%

Ubuntu CH341串口配置问题

一、前言

初次接触飞腾开发板,我的 ubuntu 系统无法正常使用 USB 串口线连接开发板,问题集中在 CH341 的驱动上面。

二、问题及解决办法

1. 驱动冲突

物理线路正确连接后,查询 ttyUSB 设备信息,连接后立即 disconnected。

1
2
3
lg@ubuntu:~$ sudo dmesg | grep ttyUSB
[12946.029195] usb 1-2.1: ch341-uart converter now attached to ttyUSB0
[12946.576807] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0

多次尝试后又得到如下报错信息:

1
2
3
4
5
6
7
8
lg@ubuntu:~$ sudo dmesg | grep ch341
[ 38.193329] usbcore: registered new interface driver ch341
[ 38.193360] usbserial: USB Serial support registered for ch341-uart
[ 38.193393] ch341 1-2.1:1.0: ch341-uart converter detected
[ 38.206613] usb 1-2.1: ch341-uart converter now attached to ttyUSB0
[ 38.758581] usb 1-2.1: usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1
[ 38.761742] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 38.761800] ch341 1-2.1:1.0: device disconnected

发现是 brltty 服务占用了设备接口。

卸载 brltty 即可:

1
sudo apt remove brltty
2. 驱动不适配

brltty 的冲突解决后,ls /dev 即可(应该?)看见 ttyCH341USB0 设备,但无法成功连接/连接不稳定,甚至无法识别。

原因是驱动与内核版本不适配。先卸载 ch341 驱动。

1
sudo rmmod ch341

然后按该帖步骤正确安装驱动:

Ubuntu系统上ttyUSB被挂载为ttyCH341USB_ubuntu ch341-CSDN博客

如遇到签名无效则参考下帖:

https://blog.csdn.net/qq_28680277/article/details/129162559

然后重新接入开发板,即可识别。

image-20240702195622618