From nobody Thu Apr 25 19:17:47 2024 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VQQck6b2Tz5JMjx for ; Thu, 25 Apr 2024 19:18:30 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Received: from smtp6.goneo.de (smtp6.goneo.de [IPv6:2001:1640:5::8:31]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VQQcj0r9Lz4fgs for ; Thu, 25 Apr 2024 19:18:28 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=walstatt-de.de header.s=DKIM001 header.b=cMBIAq8j; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@walstatt-de.de designates 2001:1640:5::8:31 as permitted sender) smtp.mailfrom=freebsd@walstatt-de.de Received: from hub1.goneo.de (hub1.goneo.de [IPv6:2001:1640:5::8:52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp6.goneo.de (Postfix) with ESMTPS id 0903A240A82 for ; Thu, 25 Apr 2024 21:18:20 +0200 (CEST) Received: from hub1.goneo.de (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by hub1.goneo.de (Postfix) with ESMTPS id 1DCA22400D5 for ; Thu, 25 Apr 2024 21:18:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walstatt-de.de; s=DKIM001; t=1714072695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JmaJlVd1EKcoM6xM1L9kt/7XgCEmxkA8zDF9QcK39jE=; b=cMBIAq8juUmDHIeaSohgJ2E98P7TZgF2nJUtxDtc7gzkAcTPdaz/8jP0JpExOKe86ckN1Q 8LzjtLtTCyX5Yg1Mt/upFDo05OcVnmWrGf6NFdVvlGeNrc+ODs6Z0FHYxxH/5Kq+vPKn9O 2gDYba3zHiag8d9bFJnQiQtji8yCGaztowUVBUSvX438e9/FjSnVdtNtiaHp81y9fXUb6M sUBJlVeyBbZzp0a6sNPZoVZvlA27ztlME3SAa90uR1ydxEh8fDZiH+CqucPCgrp4Nw+023 0poa7cuGLIWk9YC8wXDOl6c3rrRU1BVMYhov0lxBsE2E5ANiPe/kbMuLKoZn8w== Received: from thor.intern.walstatt.dynvpn.de (dynamic-077-191-152-126.77.191.pool.telefonica.de [77.191.152.126]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hub1.goneo.de (Postfix) with ESMTPSA id D7D58240036 for ; Thu, 25 Apr 2024 21:18:14 +0200 (CEST) Date: Thu, 25 Apr 2024 21:17:47 +0200 From: FreeBSD User To: FreeBSD CURRENT Subject: serial/ulscom: response timeout using pySerial/esptool.py Message-ID: <20240425211814.539cccb7@thor.intern.walstatt.dynvpn.de> Organization: walstatt-de.de List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-UID: dbf9e4 X-Rspamd-UID: 206b7b X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[walstatt-de.de:s=DKIM001]; R_SPF_ALLOW(-0.20)[+ip6:2001:1640:5::8:0/112]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_ONE(0.00)[1]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_ORG_HEADER(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:25394, ipnet:2001:1640::/32, country:DE]; MISSING_XM_UA(0.00)[]; RCVD_TLS_ALL(0.00)[]; DMARC_NA(0.00)[walstatt-de.de]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; TO_DN_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[walstatt-de.de:+] X-Rspamd-Queue-Id: 4VQQcj0r9Lz4fgs Hello, Host: 15.0-CURRENT FreeBSD 15.0-CURRENT #36 main-n269703-54c3aa02e926: Thu Apr 25 18:48:56 CEST 2024 amd64 or 14-STABLE recently compiled (dmesg/uname not at hand). Hardware: oldish Z77Pro 4 based Asrock mainboard, a Lenovo T560 notebook, Fujitsu Esprimo Q5XX (simple desktop, Pentium Gold) or an oldish Fujitsu Celsius 7XX workstation, 6 core Haswell XEON. Phenomenon: a couple of weeks now I try to connect to several Xtensa ESP32 dev boards (ESP32-WROOM32 with CP2101 or CP2104 UART) via comms/py-esptool (doesn't matter whether it is tho port's py39-esptool 4.5 or the latest py-esptool 4.7.0, doesn't matter whether pkg package or self compiled on CURRENT and 14-STABLE, on all hardware platforms same result). Attaching the ESP devel module via Micro USB cable (several type, differnt vendors tried ...) show dmesg: [...] ugen0.4: at usbus0 uslcom0 on uhub3 uslcom0: on usbus0 [...] When trying to connect to the ESP32 via below shown command (--trace not every time issued), I get no connection: [ohartmann]: esptool.py --trace --chip esp32 --baud 115200 --port /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=0x08 data len=36 wait_response=1 timeout=0.100 data= 0707122055555555 5555555555555555 | ... UUUUUUUUUUUU 5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU 55555555 | UUUU TRACE +0.000 Write 46 bytes: c000082400000000 0007071220555555 | ...$........ UUU 5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU 5555555555555555 5555555555c0 | UUUUUUUUUUUUU. TRACE +0.102 No serial data received. .TRACE +0.052 command op=0x08 data len=36 wait_response=1 timeout=0.100 data= 0707122055555555 5555555555555555 | ... UUUUUUUUUUUU 5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU 55555555 | UUUU TRACE +0.000 Write 46 bytes: c000082400000000 0007071220555555 | ...$........ UUU 5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU 5555555555555555 5555555555c0 | UUUUUUUUUUUUU. TRACE +0.107 No serial data received. .TRACE +0.054 command op=0x08 data len=36 wait_response=1 timeout=0.100 data= 0707122055555555 5555555555555555 | ... UUUUUUUUUUUU 5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU 55555555 | UUUU TRACE +0.000 Write 46 bytes: c000082400000000 0007071220555555 | ...$........ UUU 5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU 5555555555555555 5555555555c0 | UUUUUUUUUUUUU. TRACE +0.107 No serial data received. .TRACE +0.054 command op=0x08 data len=36 wait_response=1 timeout=0.100 data= 0707122055555555 5555555555555555 | ... UUUUUUUUUUUU 5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU 55555555 | UUUU TRACE +0.000 Write 46 bytes: c000082400000000 0007071220555555 | ...$........ UUU 5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU 5555555555555555 5555555555c0 | UUUUUUUUUUUUU. 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 [...] Whatever baud rate issued, in most cases on all tested OS versions and almost all hardware platforms except the Fujistu Celsius 7XX (2015 model) I do not get any connection! And it get more weird: To avoid out-of-sync-software I recompiled everything via "portmaster -df comms/py-pyserial comms/py-esptool" and after that, everything was 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 are 14-STABLE, daily compiled, CURRENT. daily compiled. On my private box (old Z77 based IvyBridge ASRock crap), a couple of Lenovo T560 running 14-STABLE and several Fujitsu Esprimo 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 complied today noon). No matter what ESP32, no matter what vendor, no matter what cablin used: connection is established at any BAUD rate issued at any time. Not one single failure as shown above in any session (I checked several tenth times)! Now I'm out of ideas and I suspect the CP210X ulscom serial driver to have trouble with most onboard serial chipsets. Can anyone help me track down this issue? Is there anything I could have missed? I drives me nuts ... Thanks in advance, Oliver -- O. Hartmann