Bug 278716 - ucom(4)/uslcom(4)/uchcom(4) serial driver: communcation problem with FBSD > 13.2-RELENG
Summary: ucom(4)/uslcom(4)/uchcom(4) serial driver: communcation problem with FBSD > 1...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-05-03 11:09 UTC by O. Hartmann
Modified: 2024-05-07 11:34 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2024-05-03 11:09:23 UTC
uslcom(4) driver in 14-STABLE onward does have serious problems with several USB subsystems. I can not give specific details, but I can provide some experiences.

I'd like to use FreeBSD as the base system for some MCU development, mainly ESP32 based, also some USB UART I2C targets (Amtel) are in focus.

I have a couple of hardware platforms (Lenovo T560, T570, 460, 470 notebooks, oldish IvyBridge based Intel host, Fujitsu Esprimo D538, Fujitsu Celsius M740, Pine64).

ESP32 is WROOM32, some oldish ESP32 dev boards and ESP32 D1 mini with a more recent chip. All in common is a CP210X UART (mostly CP2102).
Another  toy is an  Amtel88 based I2C busmaster with Silicon Labs CP2102 UART.

All hardware platforms running FreeBSD > 13.3 in common is:

comms/py-esptool (Python 3.9)  -> fails to communicate with any ESP32 I have on any computer running FreeBSD > 13.3
devel/arduino18 -> fails to communicate with any ESP32 I have, same as esptool.

py-esptool reports:
ohartmann@hebe:~ $ esptool.py --chip esp32 --baud 115200 --port /dev/cuaU0 read_mac
esptool.py v4.7.0
Serial port /dev/cuaU0
Connecting........

A serial exception error occurred: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
Note: This error originates from pySerial. It is likely not a problem with esptool, but with the hardware connection or drivers.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html


The ONLY HOST operating with the very same hardware and ANY OS up to recent 14-STABLE (as of compiled today) is the mentioned Fujitsu Celsius M740 and the PINE64.

The other hardware mentioned above (Fujitsu Esprimo, Lenovo Notebooks) do well with FreeBSD 13.2, 13.3, but fail with 14-STABLE and CURRENT.


The Amtel88 bases I2C busmaster is supposed to act as development toy for sensors we use fpr meteorological purpeses, it can be equipted with several I2C sensors, the usage is a bit cryptic, but it works and delivers measurement results with FBSD < 14, but stays silent (LED flickers, indicating traffic, but no output is emmited - same with ESP32's with bus indicator LED).

From my perspective, this insicates a serious problem either with the USB subsystem/uslcom driver in recent FreeBSD or a serious probelm with my understanding of FreeBSD/FreeBSD's setup.

Using a recent Xubuntu 24.04-LTS on the very same hardware indicates NO PROBLEMS!
Comment 1 O. Hartmann 2024-05-04 08:16:36 UTC
Addendum: I ordered ESP32 with CH340 UART to verify my observations with uslcom(4) and CP2102 or CP2104 UARTs on devices I use. I'll report.

Also I'm inclined to install a Lenovo T560 notebook with FBSD 13.2, 14.0 and 14.1-PRERELEASE to check, whether the problem persists and were the "terminator" might reside.

In the meanwhile I tried to move to Linux, Xubuntu 24.04 LTS to be specific and used the convenient ESP-IDF installation for quick testing.

Using the very same cabling, ESP32s test platforms, Xubuntu had out of 20 attempts of connections with esptool (taken from the IDF 5.1.3, which seems to be 4.7.0 as the FreeBSD's port) one failure on the hardware platform Lenovo T560 to connect. In all other cases connection was established.

My skills regarding FreeBSD's internal serial system are very limited, but if I can provide some more details while setting up the test platforms please contact me - and be patient, try to get to it as soon as possible.
Comment 2 O. Hartmann 2024-05-07 11:34:39 UTC
Another ESP32, this time with CH340 (uchcom(4)) chipset.
On the Fujitsu Esprimo D538, attached with a Micro-USB cabling, consecutive connect attempts results in partial errors, while the CH340 seems to send at least something, while CP2102/CP2104 seems to give me nothing (see PR report above):

[...]
ohartmann@hebe:~ $ esptool.py --chip esp32 --baud 115200 --port /dev/cuaU0 read_mac
esptool.py v4.7.0
Serial port /dev/cuaU0
Connecting.......
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: XX:XX:XX:XX:XX:XX
Uploading stub...

A fatal error occurred: Invalid head of packet (0xAC): Possible serial noise or corruption.
ohartmann@hebe:~ $ esptool.py --chip esp32 --baud 115200 --port /dev/cuaU0 read_mac
esptool.py v4.7.0
Serial port /dev/cuaU0
Connecting....................
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: XX:XX:XX:XX:XX:XX
Uploading stub...

A fatal error occurred: Invalid head of packet (0x00): Possible serial noise or corruption.

ohartmann@hebe:~ $ esptool.py --chip esp32 --baud 115200 --port /dev/cuaU0 read_mac
esptool.py v4.7.0
Serial port /dev/cuaU0
Connecting.....
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: XX:XX:XX:XX:XX:XX
Uploading stub...
Running stub...
Stub running...
MAC: 9XX:XX:XX:XX:XX:XX
Hard resetting via RTS pin...
ohartmann@hebe:~ $ 
[...]