Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Feb 2022 15:12:51 +0200
From:      Daniel Braniss <danny@cs.huji.ac.il>
To:        Daniel O'Connor <darius@dons.net.au>
Cc:        freebsd- <hackers@freebsd.org>, "usb@freebsd.org" <usb@FreeBSD.org>
Subject:   Re: usb CH9102 serial chip
Message-ID:  <59810B39-C889-436F-8BC4-81680E09154B@cs.huji.ac.il>
In-Reply-To: <D227A4C0-8870-422E-BED5-0B173AB13345@dons.net.au>
References:  <C8258774-B183-48DD-905F-260F5999152C@cs.huji.ac.il> <7DD6E1FA-3EA4-44D9-A272-9E51FB9F2BFC@dons.net.au> <C07DE6BE-65AB-43FA-8C52-2A7D0197767E@cs.huji.ac.il> <013FB4BA-7D32-4FFB-AFD3-E594CF638A66@dons.net.au> <17E09096-A45B-43F5-BFE4-7645E8A2275D@cs.huji.ac.il> <D227A4C0-8870-422E-BED5-0B173AB13345@dons.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_89F3905D-F8FB-42AA-A831-8CE40CE41E81
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8



> On 17 Feb 2022, at 11:48, Daniel O'Connor <darius@dons.net.au> wrote:
>=20
>=20
>=20
>> On 17 Feb 2022, at 20:04, Daniel Braniss <danny@cs.huji.ac.il> wrote:
>>> On 17 Feb 2022, at 11:30, Daniel O'Connor <darius@dons.net.au> =
wrote:
>>>=20
>>>> On 17 Feb 2022, at 19:50, Daniel Braniss <danny@cs.huji.ac.il> =
wrote:
>>>>=20
>>>>> If that is the case then the chip/driver are working fine since =
that requires bidirectional communication etc..
>>>>>=20
>>>>=20
>>>> but that works only if I power up the board while pressing a =
button, then it also appears as /dev/ttyU0, and
>>>> so then I can flash, after reset, the device is gone and there are =
errors ( BTW, the flashed image workes):
>>>>=20
>>>> Feb 17 09:46:59 pampero kernel: usbd_setup_device_desc: getting =
device descriptor at addr 4 failed, USB_ERR_IOERROR
>>>> Feb 17 09:47:00 pampero kernel: usbd_req_re_enumerate: addr=3D4, =
set address failed! (USB_ERR_IOERROR, ignored)
>>>=20
>>> What sort of dev board is it?
>> 	m5 stamp C3U
>> =
https://shop.m5stack.com/products/m5stamp-c3u-mate-with-pin-headers?_pos=3D=
2&_sid=3D3df9b5f0d&_ss=3Dr&variant=3D42341016633601
>=20
> According to the docs the 'U' variant doesn't have a serial chip on =
it. If you look at the schematic the USB +/- pins go straight to the =
MCU.
>=20
RTFM, then again RTFM :-)
to quote:
By default, USB CDC is not enabled, the serial port output started by =
C3U will be output through UART0, if you need to output through USB, =
please use IDE to make it USB CDC before downloading the program option =
enabled. (Arduino users can enable it through Tools->USB CDC on =
Boot-Enabled, IDF users please refer to ESP IDF official documentation.)
now to hunt down the =E2=80=98official documentation=E2=80=99.

thanks,
	danny


> I suspect it has a boot loader which emulates the CH9102, when your =
code is running it is whatever that does with the USB port, so if there =
is a bug or whatever then it will exhibit weird behaviour.
>=20
> --
> Daniel O'Connor
> "The nice thing about standards is that there
> are so many of them to choose from."
> -- Andrew Tanenbaum


--Apple-Mail=_89F3905D-F8FB-42AA-A831-8CE40CE41E81
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 17 Feb 2022, at 11:48, Daniel O'Connor &lt;<a =
href=3D"mailto:darius@dons.net.au" class=3D"">darius@dons.net.au</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><blockquote type=3D"cite" style=3D"font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; text-decoration: none;" class=3D"">On 17 =
Feb 2022, at 20:04, Daniel Braniss &lt;<a =
href=3D"mailto:danny@cs.huji.ac.il" class=3D"">danny@cs.huji.ac.il</a>&gt;=
 wrote:<br class=3D""><blockquote type=3D"cite" class=3D"">On 17 Feb =
2022, at 11:30, Daniel O'Connor &lt;<a href=3D"mailto:darius@dons.net.au" =
class=3D"">darius@dons.net.au</a>&gt; wrote:<br class=3D""><br =
class=3D""><blockquote type=3D"cite" class=3D"">On 17 Feb 2022, at =
19:50, Daniel Braniss &lt;<a href=3D"mailto:danny@cs.huji.ac.il" =
class=3D"">danny@cs.huji.ac.il</a>&gt; wrote:<br class=3D""><br =
class=3D""><blockquote type=3D"cite" class=3D"">If that is the case then =
the chip/driver are working fine since that requires bidirectional =
communication etc..<br class=3D""><br class=3D""></blockquote><br =
class=3D"">but that works only if I power up the board while pressing a =
button, then it also appears as /dev/ttyU0, and<br class=3D"">so then I =
can flash, after reset, the device is gone and there are errors ( BTW, =
the flashed image workes):<br class=3D""><br class=3D"">Feb 17 09:46:59 =
pampero kernel: usbd_setup_device_desc: getting device descriptor at =
addr 4 failed, USB_ERR_IOERROR<br class=3D"">Feb 17 09:47:00 pampero =
kernel: usbd_req_re_enumerate: addr=3D4, set address failed! =
(USB_ERR_IOERROR, ignored)<br class=3D""></blockquote><br class=3D"">What =
sort of dev board is it?<br class=3D""></blockquote><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;">	</span>m5 stamp =
C3U<br class=3D""><a =
href=3D"https://shop.m5stack.com/products/m5stamp-c3u-mate-with-pin-header=
s?_pos=3D2&amp;_sid=3D3df9b5f0d&amp;_ss=3Dr&amp;variant=3D42341016633601" =
class=3D"">https://shop.m5stack.com/products/m5stamp-c3u-mate-with-pin-hea=
ders?_pos=3D2&amp;_sid=3D3df9b5f0d&amp;_ss=3Dr&amp;variant=3D4234101663360=
1</a><br class=3D""></blockquote><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: Menlo-Regular; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><span style=3D"caret-color: rgb(0, 0, =
0); font-family: Menlo-Regular; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">According to the docs the 'U' variant doesn't have a serial =
chip on it. If you look at the schematic the USB +/- pins go straight to =
the MCU.</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""></div></blockquote>RTFM, then again RTFM =
:-)</div><div>to quote:</div><div>By default, USB CDC is not enabled, =
the serial port output started by=20
C3U will be output through UART0, if you need to output through USB,=20
please use IDE to make it USB CDC before downloading the program option=20=

enabled. (Arduino users can enable it through <code =
class=3D"">Tools</code>-&gt;<code class=3D"">USB CDC on =
Boot</code>-<code class=3D"">Enabled</code>, IDF users please refer to =
ESP IDF official documentation.)</div><div>now to hunt down the =
=E2=80=98official documentation=E2=80=99.</div><div><br =
class=3D""></div><div>thanks,</div><div><span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span>danny</div><div><br =
class=3D""></div><div><br class=3D""><blockquote type=3D"cite" =
class=3D""><div class=3D""><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Menlo-Regular; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">I suspect it has a boot loader which emulates the CH9102, =
when your code is running it is whatever that does with the USB port, so =
if there is a bug or whatever then it will exhibit weird =
behaviour.</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">--</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">Daniel =
O'Connor</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">"The nice =
thing about standards is that there</span><br style=3D"caret-color: =
rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 12px; font-style: =
normal; font-variant-caps: normal; font-weight: normal; letter-spacing: =
normal; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><span style=3D"caret-color: rgb(0, 0, =
0); font-family: Menlo-Regular; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">are so many of them to choose from."</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">-- Andrew =
Tanenbaum</span></div></blockquote></div><br class=3D""></body></html>=

--Apple-Mail=_89F3905D-F8FB-42AA-A831-8CE40CE41E81--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?59810B39-C889-436F-8BC4-81680E09154B>