I'm trying to use cp210x to flash a esp32 board on ubuntu 18.04. I first tried with the built-in driver, and then downloaded, compiled, and modprob'ed the newest version from https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers. I've added $USER to `dialout` group. Sometimes it works, and sometimes (most of the time) it doesn't. When it stops working, I have to reboot my computer (a Dell 13 700). The situation is similar to the one described in this AskUbuntu question (without answers so far).
I am running esp32's `make flash` script, which fails with `serial.serialutil.SerialException: Could not configure port: (5, 'Input/output error')`.
On the dmesg output, this is when I first plug the esp32:
[ 2404.860292] usb 1-3: new full-speed USB device number 27 using xhci_hcd
[ 2405.055668] usb 1-3: New USB device found, idVendor=10c4, idProduct=ea60
[ 2405.055680] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2405.055689] usb 1-3: Product: CP2102 USB to UART Bridge Controller
[ 2405.055697] usb 1-3: Manufacturer: Silicon Labs
[ 2405.055705] usb 1-3: SerialNumber: 0001
[ 2405.069661] cp210x 1-3:1.0: cp210x converter detected
[ 2405.071771] usb 1-3: cp210x converter now attached to ttyUSB0
And these are the logs for when I run `make flash`:
[ 2409.730169] usb 1-3: USB disconnect, device number 27
[ 2409.730517] cp210x ttyUSB0: failed set request 0x7 status: -19
[ 2409.730536] cp210x ttyUSB0: failed set request 0x12 status: -19
[ 2409.730545] cp210x ttyUSB0: failed set request 0x0 status: -19
[ 2409.730849] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0
[ 2409.730942] cp210x 1-3:1.0: device disconnected
[ 2410.040108] usb 1-3: new full-speed USB device number 28 using xhci_hcd
[ 2410.219745] usb 1-3: New USB device found, idVendor=10c4, idProduct=ea60
[ 2410.219755] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2410.219762] usb 1-3: Product: CP2102 USB to UART Bridge Controller
[ 2410.219769] usb 1-3: Manufacturer: Silicon Labs
[ 2410.219774] usb 1-3: SerialNumber: 0001
[ 2410.232560] cp210x 1-3:1.0: cp210x converter detected
[ 2410.234601] usb 1-3: cp210x converter now attached to ttyUSB0
I think the may be to my laptop's usb devices, but I've reached my limit debugging this. The esp32 works in other systems with same ubuntu version.
Thanks in advance.
Is it possible to determine when exactly the disconnect occurs? For how long is the device connected before you receive the "USB disconnect, device number 27" message? What is your Linux kernel version?
Please note that this driver has only been written and tested on the Linux 3.13.0 kernel on Ubuntu 14.04.
I am also talking to our driver team about this.
Sorry for the long delay! I tried this one more time, now using Windows 10, with the same Dell computer (Insiron 13 7359), and it again did not work. It looks like there is *some* imcompatibility between my Dell computer serial device and the one from Esp32.
Regarding your questions, I can't exactly remember but I'll try my best:
Is it possible to determine when exactly the disconnect occurs? sorry, I can't determine it right now.
For how long is the device connected before you receive the "USB disconnect, device number 27" message? I've tried many situations, including "testing just after connecting the device" and "testing 15 minutes after having the device connected"
What is your Linux kernel version? not exactly sure but probably 4.X
Now, as the same problem happens in the same computer model (I tried 2 Dell Inspiron 13 7359), both in Linux and Windows, I think it may have some idiosyncrasy between the two serial chips. Other Dell computers have worked in this setup.
Finding out the Linux version - https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/
There are three components that could be incompatible. So, we need to test accordingly. Can you try to isolate each device and test it individually with the computer?