解决Ubuntu22.04无法使用ch34x串口问题

问题背景

在去年RDC2022上很幸运抽中了纪念板柿饼M7。在此感谢RT-Thread!!!本文介绍了Ubuntu22.04下开发RT Smart遇到的无法使用ch34x串口问题。


问题描述

Ubuntu22.04无法使用ch34x串口
使用lsusb命令可以看到有Bus 001 Device 005: ID 1a86:7523 QinHeng Electronics CH340 serial converter是能识别出ch34x设备


原因分析

  1. Ubuntu22.04自带的ch34x驱动版本过老
    使用ls /lib/modules/$(uname -r)/kernel/drivers/usb/serial命令查看Ubutnu自带驱动,找到ch341.ko发现是2013年的文件…(无语~)先把旧驱动删除sudo rm ch341.ko
    找到一篇相似的文章ubuntu20.4系统安装CH340驱动并使用串口调试助手看来不是我一个人遇到相同的问题…
    2.brltty进程占用了串口
    使用sudo dmesg | grep tty命令可以看到
    [ 0.223411] printk: console [tty0] enabled
    [ 44.099146] usb 1-1: ch341-uart converter now attached to ttyUSB0
    [ 44.673749] usb 1-1: usbfs: interface 0 claimed by ch34x while ‘brltty’ sets config #1
    [ 44.675063] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0

解决过程

WCH官网下载最新的驱动CH341SER_LINUX.ZIP

解压驱动

unzip CH341SER_LINUX_ZIP 得到三个文件ch34x.c Makefile readme.txt

// ChangeLog 
// 1.0 - 1.1   modified to solve transmition between ch341 and ch341
// 1.1 - 1.2   Support high Linux kernel
Instructions

Note: 1.Please run followed executable programs as root privilege
      2.Current Driver support versions of linux kernel range from 2.6.25 to 3.13.x
      3.Current Driver support 32bits and 64bits linux systems

Usage:
	(load or unload linux driver of CH34x)
	//compile 
	#make
	//load ch34x chips driver
	#make load
	//unload ch34x chips driver
	#make unload
// 1.2 - 1.3 Fix some bugs			

编译安装驱动

readme.txt里面介绍到驱动的加载方式,但注意到第7行写着支持的内核版本从2.6.

  • 25
    点赞
  • 76
    收藏
    觉得还不错? 一键收藏
  • 12
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值