Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Apr 2024 22:05:07 +0100
From:      "Tom Jones" <thj@freebsd.org>
To:        freebsd-current@freebsd.org
Subject:   Re: serial/ulscom: response timeout using pySerial/esptool.py
Message-ID:  <b1cf802d-244c-4f70-8334-0bb63fcee3c1@app.fastmail.com>
In-Reply-To: <20240425211814.539cccb7@thor.intern.walstatt.dynvpn.de>
References:  <20240425211814.539cccb7@thor.intern.walstatt.dynvpn.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Can you isolate out the extraneous stuff and loop tx and rx on a CP2101 =
board and send bytes through?=20

I did a bunch of development on an esp8266 board in the last few weeks a=
nd had no issues, but I=E2=80=99ve no idea if it were the same usb seria=
l chip.=20

I=E2=80=99ll have a dig around and see if I have something matching=20

On Thu, Apr 25, 2024, at 20:17, FreeBSD User wrote:
> Hello,
>
> Host: 15.0-CURRENT FreeBSD 15.0-CURRENT #36 main-n269703-54c3aa02e926:=20
> Thu Apr 25 18:48:56
> CEST 2024 amd64 or 14-STABLE recently compiled (dmesg/uname not at=20
> hand).
>
> Hardware: oldish Z77Pro 4 based Asrock mainboard, a Lenovo T560=20
> notebook, Fujitsu Esprimo Q5XX
> (simple desktop, Pentium Gold) or an oldish Fujitsu Celsius 7XX=20
> workstation, 6 core Haswell
> XEON.
>
> Phenomenon: a couple of weeks now I try to connect to several Xtensa=20
> ESP32 dev boards
> (ESP32-WROOM32 with CP2101 or CP2104 UART) via comms/py-esptool=20
> (doesn't matter whether it is
> tho port's py39-esptool 4.5 or the latest py-esptool 4.7.0, doesn't=20
> matter whether pkg package
> or self compiled on CURRENT and 14-STABLE, on all hardware platforms=20
> same result).
>
> Attaching the ESP devel module via Micro USB cable (several type,=20
> differnt vendors tried ...)
> show
>
> dmesg:
> [...]
> ugen0.4: <Silicon Labs CP2102 USB to UART Bridge Controller> at usbus0
> uslcom0 on uhub3
> uslcom0: <Silicon Labs CP2102 USB to UART Bridge Controller, class 0/0=
,=20
> rev 1.10/1.00, addr 4>
> on usbus0
> [...]
>
> When trying to connect to the ESP32 via below shown command (--trace=20
> not every time issued), I
> get no connection:
>
> [ohartmann]: esptool.py --trace --chip esp32 --baud 115200 --port=20
> /dev/cuaU1  flash_id
> esptool.py v4.7.0
> Loaded custom configuration from /pool/home/ohartmann/esptool.cfg
> Serial port /dev/cuaU1
> Connecting...TRACE +0.000 command op=3D0x08 data len=3D36 wait_respons=
e=3D1=20
> timeout=3D0.100 data=3D
>     0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
>     5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
>     55555555                          | UUUU
> TRACE +0.000 Write 46 bytes:=20
>     c000082400000000 0007071220555555 | ...$........ UUU
>     5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
>     5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
> TRACE +0.102 No serial data received.
> TRACE +0.052 command op=3D0x08 data len=3D36 wait_response=3D1 timeout=
=3D0.100=20
> data=3D
>     0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
>     5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
>     55555555                          | UUUU
> TRACE +0.000 Write 46 bytes:=20
>     c000082400000000 0007071220555555 | ...$........ UUU
>     5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
>     5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
> TRACE +0.107 No serial data received.
> TRACE +0.054 command op=3D0x08 data len=3D36 wait_response=3D1 timeout=
=3D0.100=20
> data=3D
>     0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
>     5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
>     55555555                          | UUUU
> TRACE +0.000 Write 46 bytes:=20
>     c000082400000000 0007071220555555 | ...$........ UUU
>     5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
>     5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
> TRACE +0.107 No serial data received.
> TRACE +0.054 command op=3D0x08 data len=3D36 wait_response=3D1 timeout=
=3D0.100=20
> data=3D
>     0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
>     5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
>     55555555                          | UUUU
> TRACE +0.000 Write 46 bytes:=20
>     c000082400000000 0007071220555555 | ...$........ UUU
>     5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
>     5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
>
>
> A serial exception error occurred: device reports readiness to read bu=
t=20
> returned no data
> (device disconnected or multiple access on port?) Note: This error=20
> originates from pySerial.
> It is likely not a problem with esptool, but with the hardware=20
> connection or drivers. For
> troubleshooting steps visit:
> https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.=
html
> [...]
>
>
> Whatever baud rate issued, in most cases on all tested OS versions and=20
> almost all hardware
> platforms except the Fujistu Celsius 7XX (2015 model) I do not get any=20
> connection! And it get
> more weird: To avoid out-of-sync-software I recompiled everything via=20
> "portmaster -df
> comms/py-pyserial comms/py-esptool" and after that, everything was=20
> fine, the connection was
> made, I got results out of the chip. Seconds later same problems.
>
> I exchanged cablings, exchanged the ESP32 model and vendor. Invariants=20
> are 14-STABLE, daily
> compiled, CURRENT. daily compiled. On my private box (old Z77 based=20
> IvyBridge ASRock crap), a
> couple of Lenovo T560 running 14-STABLE and several Fujitsu Esprimo=20
> Q5XX boxes there is always
> this weird error message, but in very rare cases I get connection.
>
> Only exception: the Fujsitus Celsius 7XX workstation (14-STABLE, last=20
> complied today noon). No
> matter what ESP32, no matter what vendor, no matter what cablin used:=20
> connection is established
> at any BAUD rate issued at any time. Not one single failure as shown=20
> above in any session (I
> checked several tenth times)!
>
> Now I'm out of ideas and I suspect the CP210X ulscom serial driver to=20
> have trouble with most
> onboard serial chipsets.
>
> Can anyone help me track down this issue? Is there anything I could ha=
ve missed?
>
> I drives me nuts ...
>
> Thanks in advance,
>
> Oliver
>
>=20
> --=20
> O. Hartmann

--=20
- Tom



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b1cf802d-244c-4f70-8334-0bb63fcee3c1>