From nobody Wed Sep 14 15:55:05 2022 X-Original-To: hackers@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 4MSPzx5MTFz4cRHp; Wed, 14 Sep 2022 15:55:09 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.116.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4MSPzw4L4sz3FWY; Wed, 14 Sep 2022 15:55:08 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cs.huji.ac.il; s=57791128; h=References:To:Cc:In-Reply-To:Date:Subject:Mime-Version:Content-Type:Message-Id:From; bh=BQqmicVjnGSa7XzyQbDZp5bj9RgmnA65DmdAiud1fIk=; b=zEa8Zw/99X+BrNmzRhK7Lr7QzlHlbGYabZXlZ4vZ1Qfz7Lyiq2EfZ6n/DghciQS0eFBH9vxoyof8G2WkqQKaU3p6MN5zjfHCIr6t0fiGRt4EQUEcss45N14FCC0XC7u2TytT39j9XJVij2HIURdnIyEMj6RxyUhzcqrP45Sfc69pI9NqORTlfwUQBSlUCAu2/Kl0FPibI0DsN3RplF8MxMwfyndGMNMxLkt8BzDDuPGn+RMQq+bqEOdzrYijrbNRXYcHCDrcZLX/MFI2eF/ohMuXzVSkjrkLAQ0AfPEPe0x1l699ArJD+goG1Kd8o50iVkhubivlEAfuYzdhF+yMHg==; Received: from imac.bk.cs.huji.ac.il ([132.65.179.42] helo=smtpclient.apple) by kabab.cs.huji.ac.il with esmtp id 1oYUjB-000FlJ-MI; Wed, 14 Sep 2022 18:55:05 +0300 From: Daniel Braniss Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_04A01092-B1D2-4D18-A892-6500F906BB84" List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: USB chip CH9102F Date: Wed, 14 Sep 2022 18:55:05 +0300 In-Reply-To: Cc: freebsd-hackers , "usb@freebsd.org" To: CeDeROM References: X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4MSPzw4L4sz3FWY X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cs.huji.ac.il header.s=57791128 header.b="zEa8Zw/9"; dmarc=pass (policy=none) header.from=huji.ac.il; spf=none (mx1.freebsd.org: domain of danny@cs.huji.ac.il has no SPF policy when checking 132.65.116.210) smtp.mailfrom=danny@cs.huji.ac.il X-Spamd-Result: default: False [-3.30 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[huji.ac.il,none]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[cs.huji.ac.il:s=57791128]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[hackers@freebsd.org,usb@freebsd.org]; R_SPF_NA(0.00)[no SPF record]; ASN(0.00)[asn:378, ipnet:132.64.0.0/15, country:IL]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[danny]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[cs.huji.ac.il:+]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_04A01092-B1D2-4D18-A892-6500F906BB84 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 14 Sep 2022, at 18:14, CeDeROM wrote: >=20 > On Wed, Sep 14, 2022 at 3:43 PM Daniel Braniss wrote: >> Hi, >> is there/will there be any support for this chip? CH9102F. >>=20 >> there is a driver for linux and windows, but event though it sort of = works on FreeBSD, >> the magic needed to flash the firmware on newer esp32=E2=80=99s is = not working. >=20 > I also bought USB-C based UART-to-USB adapter from Waveshare with > CH343G chip and use it for ESP32 flashing. >=20 > This chip is a bit tricky and I have noticed it is less reliable for > initial flashing on a custom ESP32 board (boot mode selection using > RTS/CTS pins). It sometimes fails, while older USB-UART converters > works fine. >=20 > What are your problems exactly? >=20 > Are you sure this is not the custom hardware design issue? >=20 > Do you have Reset and BootSel pins on your board that you can trigger > by hand in order to help USB-UART cable? >=20 > What is your magic that you need to do in order to flash the chip = successfully? >=20 > Does standard operations (UART CLI) work as expected? >=20 > Did you take a look at man stty and use stty crtscts / stty > -crtscts to see if that fixes anything? >=20 > -- > CeDeROM, SQ7MHZ, http://www.tomek.cedro.info i have many esp32=E2=80=99s, all the old ones work fine, it=E2=80=99s = only the latest ones, for example: m5stac esp3c3 and my latest batch of m5stack base black v1,26 which i get: pampa> /vol/src/esp/current/components/esptool_py/esptool/esptool.py -p = /dev/ttyU0 read_mac esptool.py v3.3-dev Serial port /dev/ttyU0 Connecting... Failed to get PID of a device on /dev/ttyU0, using standard reset = sequence. . Detecting chip type... ESP32-C3 Chip is ESP32-C3 (revision 3) Features: Wi-Fi Crystal is 40MHz MAC: 7c:df:a1:a3:61:74 Uploading stub... A fatal error occurred: Failed to write to target RAM (result was = 01070000: Operation timed out) the fatal error I also get when trying to flash/erase/ etc. i have some esp32 that have usb, some don=E2=80=99t, some can flash, = some need sounding g0, etc, I can mostly work with them, it=E2=80=99s only the latest batch, which = =E2=80=99seem=E2=80=99 to have this CH9102f that fail to flash with the above =E2=80=98A fatal error =E2=80=A6=E2=80=99 BTW, regular connect via usb works, so i get console messages ok. thanks, danny --Apple-Mail=_04A01092-B1D2-4D18-A892-6500F906BB84 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On 14 Sep 2022, at 18:14, CeDeROM <cederom@tlen.pl> = wrote:

On Wed, Sep 14, 2022 at 3:43 PM Daniel Braniss wrote:
Hi,
is = there/will there be any support for this chip? CH9102F.

there is a driver for linux and windows, but event though it = sort of works on FreeBSD,
the magic needed to flash the = firmware on newer esp32=E2=80=99s is not working.

I also bought USB-C based = UART-to-USB adapter from Waveshare with
CH343G chip and = use it for ESP32 flashing.

This chip is a = bit tricky and I have noticed it is less reliable for
initial flashing on a custom ESP32 board (boot mode selection = using
RTS/CTS pins). It sometimes fails, while older = USB-UART converters
works fine.

What are your problems exactly?

Are you sure this is not the custom hardware design issue?

Do you have Reset and BootSel pins on your = board that you can trigger
by hand in order to help = USB-UART cable?

What is your magic that you = need to do in order to flash the chip successfully?

Does standard operations (UART CLI) work as expected?

Did you take a look at man stty and use stty = crtscts <port> / stty
-crtscts <port> to see = if that fixes anything?

--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info

i have = many esp32=E2=80=99s, all the old ones work fine, it=E2=80=99s only the = latest ones, for example: m5stac esp3c3 and my latest
batch of = m5stack base black v1,26 which i get:

pampa> = /vol/src/esp/current/components/esptool_py/esptool/esptool.py -p = /dev/ttyU0 read_mac
esptool.py = v3.3-dev
Serial port = /dev/ttyU0
Connecting...
Failed to get PID of a device on = /dev/ttyU0, using standard reset sequence.
.
Detecting chip type... = ESP32-C3
Chip is ESP32-C3 (revision = 3)
Features: Wi-Fi
Crystal is 40MHz
MAC: 7c:df:a1:a3:61:74
Uploading stub...

A fatal error occurred: Failed to write to target RAM (result = was 01070000: Operation timed out)


the fatal = error I also get when trying to flash/erase/ = etc.


i have some esp32 that have usb, some don=E2=80=99t, = some can flash, some need sounding g0, etc,
I can mostly work with them, = it=E2=80=99s only the latest batch, which =E2=80=99seem=E2=80=99= to have this CH9102f that
fail to flash with the = above =E2=80=98A fatal error =E2=80=A6=E2=80=99


BTW,= regular connect via usb works, so i get console messages ok.

thanks,

= danny

= --Apple-Mail=_04A01092-B1D2-4D18-A892-6500F906BB84--