Bug 272803 - uchcom(4) does not support ch343, or ch34[2347]
Summary: uchcom(4) does not support ch343, or ch34[2347]
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-usb (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-30 00:58 UTC by Tomoyuki Sakurai
Modified: 2024-01-26 07:50 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomoyuki Sakurai 2023-07-30 00:58:09 UTC
the ch343 chip is relatively new, but recent unofficial ESP32 dev boards, such as WeAct Studio ESP32-C6 and ESP32-S3 Core, use the chip. according to the linux source, there are other models, ch910[1234] as well. the kernel detects it as a CDC device, but flashing does not work. reading serial output works.

ch341 linux driver: https://www.wch-ic.com/downloads/CH341SER_LINUX_ZIP.html
ch343 linux driver: https://github.com/WCHSoftGroup/ch343ser_linux/

dmesg and dump_device_desc:

Jul 30 07:44:09 t480s kernel: ugen0.6: <vendor 0x1a86 USB Single Serial> at usbus0
Jul 30 07:44:09 t480s kernel: umodem0 on uhub1
Jul 30 07:44:09 t480s kernel: umodem0: <vendor 0x1a86 USB Single Serial, class 2/0, rev 1.10/4.45, addr 5> on usbus0
Jul 30 07:44:09 t480s kernel: umodem0: data interface 1, has no CM over data, has no break

ugen0.6: <vendor 0x1a86 USB Single Serial> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (138mA)

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0110 
  bDeviceClass = 0x0002  <Communication device>
  bDeviceSubClass = 0x0000 
  bDeviceProtocol = 0x0000 
  bMaxPacketSize0 = 0x0008 
  idVendor = 0x1a86 
  idProduct = 0x55d3 
  bcdDevice = 0x0445 
  iManufacturer = 0x0000  <no string>
  iProduct = 0x0002  <USB Single Serial>
  iSerialNumber = 0x0003  <5577032363>
  bNumConfigurations = 0x0001
Comment 1 Tomasz "CeDeROM" CEDRO 2024-01-13 02:05:17 UTC
+1 here! Does not work on FreeBSD 13.2-RELEASE-p8 and ESP32-S3-Pico development board..

usb_alloc_device: set address 8 failed (USB_ERR_IOERROR, ignored)
usbd_setup_device_desc: getting device descriptor at addr 8 failed, USB_ERR_STALLED
usbd_req_re_enumerate: addr=8, set address failed! (USB_ERR_IOERROR, ignored)
usbd_setup_device_desc: getting device descriptor at addr 8 failed, USB_ERR_STALLED
usbd_req_re_enumerate: addr=8, set address failed! (USB_ERR_IOERROR, ignored)
usbd_setup_device_desc: getting device descriptor at addr 8 failed, USB_ERR_STALLED
usbd_req_re_enumerate: addr=8, set address failed! (USB_ERR_IOERROR, ignored)
usbd_setup_device_desc: getting device descriptor at addr 8 failed, USB_ERR_STALLED
usbd_req_re_enumerate: addr=8, set address failed! (USB_ERR_IOERROR, ignored)
usbd_setup_device_desc: getting device descriptor at addr 8 failed, USB_ERR_STALLED
ugen0.8: <Unknown > at usbus0 (disconnected)
uhub_reattach_port: could not allocate new device
usb_alloc_device: set address 8 failed (USB_ERR_IOERROR, ignored)
usbd_setup_device_desc: getting device descriptor at addr 8 failed, USB_ERR_STALLED
usbd_req_re_enumerate: addr=8, set address failed! (USB_ERR_IOERROR, ignored)
usbd_setup_device_desc: getting device descriptor at addr 8 failed, USB_ERR_STALLED
usbd_req_re_enumerate: addr=8, set address failed! (USB_ERR_IOERROR, ignored)
Comment 2 Tomasz "CeDeROM" CEDRO 2024-01-13 02:07:32 UTC
ESP32-S3-Pico board details:
https://www.waveshare.com/wiki/ESP32-S3-Pico
Comment 3 Tomasz "CeDeROM" CEDRO 2024-01-26 06:36:33 UTC
There is a discussion on AVRDUDE GH project regarding CH340 chip problems. These problems are not found on OpenBSD and NetBSD:

https://github.com/avrdudes/avrdude/discussions/1639#discussioncomment-8252976

I also searched for boards that I have and found out that aside non-detectable ESP32-S3-Pico devkit I also have WaveShare 21442 USB-to-UART converter with CH343G and it seems to work! It does not work as well as CP2101 or FTDI chips for ESP32 flashing (control lines) but for terminal it seems to work :-)

I have ordered 2 x CH340 + 1 x CH341 boards they should arrive next friday will check with those.
Comment 4 Tomasz "CeDeROM" CEDRO 2024-01-26 07:46:58 UTC
This is device desc dump for WaveShare 21442 CH343G based USB-to-UART converter:

% usbconfig -d 0.7 dump_device_desc
ugen0.7: <vendor 0x1a86 USB Single Serial> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (134mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0110
  bDeviceClass = 0x0002  <Communication device>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0008
  idVendor = 0x1a86
  idProduct = 0x55d3
  bcdDevice = 0x0443
  iManufacturer = 0x0000  <no string>
  iProduct = 0x0002  <USB Single Serial>
  iSerialNumber = 0x0003  <5434023603>
  bNumConfigurations = 0x0001
Comment 5 Tomasz "CeDeROM" CEDRO 2024-01-26 07:50:02 UTC
Initial testing on AVRDUDE confirms WaveShare 21442 (CH343G based) operations. It uses libusb + wrappers to access not a system driver. So there must be something wrong with those ESP32-SX-XXX devkits and/or system drivers..?

https://github.com/avrdudes/avrdude/pull/1640