Reputation: 1011
I want to flash my STM32 board with my USB serial port. And my STM32 board comes with an extended board which carries CH340.
When I connected the board to my computer, I can see the device with the command lsusb
, and the output is Bus 001 Device 039: ID 1a86:7523 QinHeng Electronics CH340 serial converter
.
But I can't find the ttyUSB
file under /dev
path.
I ran dmesg | grep tty
, and here is the output:
[1182096.667353] usb 1-9: ch341-uart converter now attached to ttyUSB0
[1182096.729868] audit: type=1130 audit(1637925474.011:3648): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=brltty-device@sys-devices-pci0000:00-0000:00:14.0-usb1-1\x2d9 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[1182096.800144] audit: type=1130 audit(1637925474.081:3649): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=brltty@-sys-devices-pci0000:00-0000:00:14.0-usb1-1\x2d9 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[1182096.803145] usb 1-9: usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1
[1182096.803731] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
What's the problem here?
Upvotes: 48
Views: 29760
Reputation: 1011
There is the forum post Can't connect serial port - Error: ch341-uart disconnected from ttyUSB0. It seems for an Arch Linux/Manjaro system (I am not sure if it is suitable for other distribution), you need to remove some udev rules.
sudo mv /usr/lib/udev/rules.d/90-brltty-device.rules /usr/lib/udev/rules.d/90-brltty-device.rules.disabled
sudo mv /usr/lib/udev/rules.d/90-brltty-uinput.rules /usr/lib/udev/rules.d/90-brltty-uinput.rules.disabled
sudo udevadm control --reload-rules
I don't know why, but I did it. And it worked. Now I can find my ttyUSB0
device file.
Upvotes: 13
Reputation: 81
I was able to see the device using lsusb and dmesg/grep tty, but I was not able to upload code from PlatformIO.
sudo apt remove brltty
This fixed my upload issue with ESP8266 (CH341-UART converter) on Ubuntu 20.04 (Focal Fossa).
Upvotes: 6
Reputation: 1390
For Ubuntu 22.04 (Jammy Jellyfish), the simplest solution is to remove the package brltty via sudo apt remove brltty
, since it’s unnecessary unless you're using a braille e-reader. However, I am unsure if it could cause errors later on.
Also for information about brltty, visit their site.
Upvotes: 122
Reputation: 121
So, there is a braille ereader that uses this same serial converter, and the udev rules configure the chip for that device. You actually don't need to remove the udev rules files completely, you can simply disable/comment out the rule for the single device. It is this one:
# Device: 1A86:7523
# Baum [NLS eReader Zoomax (20 cells)]
ENV{PRODUCT}=="1a86/7523/*", ENV{BRLTTY_BRAILLE_DRIVER}="bm", GOTO="brltty_usb_run"
Comment the line starting with ENV.
Upvotes: 12