Date: Wed, 14 Sep 2022 18:55:05 +0300 From: Daniel Braniss <danny@cs.huji.ac.il> To: CeDeROM <cederom@tlen.pl> Cc: freebsd-hackers <hackers@freebsd.org>, "usb@freebsd.org" <usb@freebsd.org> Subject: Re: USB chip CH9102F Message-ID: <DA41DFB7-C619-4801-A067-F816D83A7BD6@cs.huji.ac.il> In-Reply-To: <CAFYkXjmrA=jR69JwS=dt-H%2BNotQw6zT2H5JGzQk4P92nmJn9Sg@mail.gmail.com> References: <DD3BBD04-3455-4732-9DA1-68D79A2195A3@cs.huji.ac.il> <CAFYkXjmrA=jR69JwS=dt-H%2BNotQw6zT2H5JGzQk4P92nmJn9Sg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <cederom@tlen.pl> 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 <port> / stty > -crtscts <port> 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 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br = class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div = class=3D"">On 14 Sep 2022, at 18:14, CeDeROM <<a = href=3D"mailto:cederom@tlen.pl" class=3D"">cederom@tlen.pl</a>> = wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><div = class=3D"">On Wed, Sep 14, 2022 at 3:43 PM Daniel Braniss wrote:<br = class=3D""><blockquote type=3D"cite" class=3D"">Hi,<br class=3D"">is = there/will there be any support for this chip? CH9102F.<br class=3D""><br = class=3D"">there is a driver for linux and windows, but event though it = sort of works on FreeBSD,<br class=3D"">the magic needed to flash the = firmware on newer esp32=E2=80=99s is not working.<br = class=3D""></blockquote><br class=3D"">I also bought USB-C based = UART-to-USB adapter from Waveshare with<br class=3D"">CH343G chip and = use it for ESP32 flashing.<br class=3D""><br class=3D"">This chip is a = bit tricky and I have noticed it is less reliable for<br = class=3D"">initial flashing on a custom ESP32 board (boot mode selection = using<br class=3D"">RTS/CTS pins). It sometimes fails, while older = USB-UART converters<br class=3D"">works fine.<br class=3D""><br = class=3D"">What are your problems exactly?<br class=3D""><br = class=3D"">Are you sure this is not the custom hardware design issue?<br = class=3D""><br class=3D"">Do you have Reset and BootSel pins on your = board that you can trigger<br class=3D"">by hand in order to help = USB-UART cable?<br class=3D""><br class=3D"">What is your magic that you = need to do in order to flash the chip successfully?<br class=3D""><br = class=3D"">Does standard operations (UART CLI) work as expected?<br = class=3D""><br class=3D"">Did you take a look at man stty and use stty = crtscts <port> / stty<br class=3D"">-crtscts <port> to see = if that fixes anything?<br class=3D""><br class=3D"">--<br = class=3D"">CeDeROM, SQ7MHZ, <a href=3D"http://www.tomek.cedro.info" = class=3D"">http://www.tomek.cedro.info</a><br = class=3D""></div></div></blockquote><br class=3D""></div><div>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</div><div>batch of = m5stack base black v1,26 which i get:</div><div><br class=3D""></div><span= style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = Menlo-Regular; font-size: 12px;" class=3D"">pampa> = /vol/src/esp/current/components/esptool_py/esptool/esptool.py -p = /dev/ttyU0 read_mac</span><br style=3D"caret-color: rgb(0, 0, 0); color: = rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 12px;" = class=3D""><span style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, = 0); font-family: Menlo-Regular; font-size: 12px;" class=3D"">esptool.py = v3.3-dev</span><br style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, = 0); font-family: Menlo-Regular; font-size: 12px;" class=3D""><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = Menlo-Regular; font-size: 12px;" class=3D"">Serial port = /dev/ttyU0</span><br style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, = 0, 0); font-family: Menlo-Regular; font-size: 12px;" class=3D""><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = Menlo-Regular; font-size: 12px;" class=3D"">Connecting...</span><br = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = Menlo-Regular; font-size: 12px;" class=3D""><span style=3D"caret-color: = rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Menlo-Regular; = font-size: 12px;" class=3D"">Failed to get PID of a device on = /dev/ttyU0, using standard reset sequence.</span><br style=3D"caret-color:= rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Menlo-Regular; = font-size: 12px;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); = color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 12px;" = class=3D"">.</span><br style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, = 0, 0); font-family: Menlo-Regular; font-size: 12px;" class=3D""><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = Menlo-Regular; font-size: 12px;" class=3D"">Detecting chip type... = ESP32-C3</span><br style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, = 0); font-family: Menlo-Regular; font-size: 12px;" class=3D""><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = Menlo-Regular; font-size: 12px;" class=3D"">Chip is ESP32-C3 (revision = 3)</span><br style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); = font-family: Menlo-Regular; font-size: 12px;" class=3D""><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = Menlo-Regular; font-size: 12px;" class=3D"">Features: Wi-Fi</span><br = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = Menlo-Regular; font-size: 12px;" class=3D""><span style=3D"caret-color: = rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Menlo-Regular; = font-size: 12px;" class=3D"">Crystal is 40MHz</span><br = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = Menlo-Regular; font-size: 12px;" class=3D""><span style=3D"caret-color: = rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Menlo-Regular; = font-size: 12px;" class=3D"">MAC: 7c:df:a1:a3:61:74</span><br = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = Menlo-Regular; font-size: 12px;" class=3D""><span style=3D"caret-color: = rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Menlo-Regular; = font-size: 12px;" class=3D"">Uploading stub...</span><br = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = Menlo-Regular; font-size: 12px;" class=3D""><br style=3D"caret-color: = rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Menlo-Regular; = font-size: 12px;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); = color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 12px;" = class=3D"">A fatal error occurred: Failed to write to target RAM (result = was 01070000: Operation timed out)</span><div class=3D""><span = style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: = Menlo-Regular; font-size: 12px;" class=3D""><br = class=3D""></span></div><div class=3D""><span style=3D"caret-color: = rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Menlo-Regular; = font-size: 12px;" class=3D""><br class=3D""></span></div><div = class=3D""><span style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, = 0); font-family: Menlo-Regular; font-size: 12px;" class=3D"">the fatal = error I also get when trying to </span><font color=3D"#000000" = face=3D"Menlo-Regular" class=3D""><span style=3D"caret-color: rgb(0, 0, = 0); font-size: 12px;" class=3D"">flash/erase/ = etc.</span></font></div><div class=3D""><font color=3D"#000000" = face=3D"Menlo-Regular" class=3D""><span style=3D"caret-color: rgb(0, 0, = 0); font-size: 12px;" class=3D""><br class=3D""></span></font></div><div = class=3D""><font color=3D"#000000" face=3D"Menlo-Regular" class=3D""><span= style=3D"caret-color: rgb(0, 0, 0); font-size: 12px;" class=3D""><br = class=3D""></span></font></div><div class=3D""><font color=3D"#000000" = face=3D"Menlo-Regular" class=3D""><span style=3D"font-size: 12px;" = class=3D"">i have some esp32 that have usb, some don=E2=80=99t, = some can flash, some need sounding g0, etc,</span></font></div><div = class=3D""><font color=3D"#000000" face=3D"Menlo-Regular" class=3D""><span= style=3D"font-size: 12px;" class=3D"">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</span></font></div><div class=3D""><font = color=3D"#000000" face=3D"Menlo-Regular" class=3D""><span = style=3D"font-size: 12px;" class=3D"">fail to flash with the = above =E2=80=98A fatal error =E2=80=A6</span><span = style=3D"caret-color: rgb(0, 0, 0); font-size: 12px;" = class=3D"">=E2=80=99</span></font></div><div class=3D""><br = class=3D""></div><div class=3D""><br class=3D""></div><div class=3D"">BTW,= regular connect via usb works, so i get console messages ok.</div><div = class=3D""><br class=3D""></div><div class=3D"">thanks,</div><div = class=3D""><br class=3D""></div><div class=3D""><span = class=3D"Apple-tab-span" style=3D"white-space:pre"> = </span>danny</div><div class=3D""><br class=3D""></div><div class=3D""><br= class=3D""></div></body></html>= --Apple-Mail=_04A01092-B1D2-4D18-A892-6500F906BB84--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DA41DFB7-C619-4801-A067-F816D83A7BD6>