[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: usb CH9102 serial chip
From:       Daniel Braniss <danny () cs ! huji ! ac ! il>
Date:       2022-02-17 13:12:51
Message-ID: 59810B39-C889-436F-8BC4-81680E09154B () cs ! huji ! ac ! il
[Download RAW message or body]

> On 17 Feb 2022, at 11:48, Daniel O'Connor <darius@dons.net.au> wrote:
> 
> 
> 
> > 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:
> > > 
> > > > On 17 Feb 2022, at 19:50, Daniel Braniss <danny@cs.huji.ac.il> wrote:
> > > > 
> > > > > If that is the case then the chip/driver are working fine since that \
> > > > > requires bidirectional communication etc.. 
> > > > 
> > > > 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): 
> > > > 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=4, set address \
> > > > failed! (USB_ERR_IOERROR, ignored)
> > > 
> > > What sort of dev board is it?
> > 	m5 stamp C3U
> > https://shop.m5stack.com/products/m5stamp-c3u-mate-with-pin-headers?_pos=2&_sid=3df9b5f0d&_ss=r&variant=42341016633601
> > 
> 
> 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. 
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 ‘official documentation'.

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. 
> --
> Daniel O'Connor
> "The nice thing about standards is that there
> are so many of them to choose from."
> -- Andrew Tanenbaum


[Attachment #3 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html; \
charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote \
type="cite" class=""><div class="">On 17 Feb 2022, at 11:48, Daniel O'Connor &lt;<a \
href="mailto:darius@dons.net.au" class="">darius@dons.net.au</a>&gt; wrote:</div><br \
class="Apple-interchange-newline"><div class=""><br style="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=""><br \
style="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=""><blockquote type="cite" style="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="">On 17 Feb 2022, at \
20:04, Daniel Braniss &lt;<a href="mailto:danny@cs.huji.ac.il" \
class="">danny@cs.huji.ac.il</a>&gt; wrote:<br class=""><blockquote type="cite" \
class="">On 17 Feb 2022, at 11:30, Daniel O'Connor &lt;<a \
href="mailto:darius@dons.net.au" class="">darius@dons.net.au</a>&gt; wrote:<br \
class=""><br class=""><blockquote type="cite" class="">On 17 Feb 2022, at 19:50, \
Daniel Braniss &lt;<a href="mailto:danny@cs.huji.ac.il" \
class="">danny@cs.huji.ac.il</a>&gt; wrote:<br class=""><br class=""><blockquote \
type="cite" class="">If that is the case then the chip/driver are working fine since \
that requires bidirectional communication etc..<br class=""><br \
class=""></blockquote><br class="">but that works only if I power up the board while \
pressing a button, then it also appears as /dev/ttyU0, and<br class="">so then I can \
flash, after reset, the device is gone and there are errors ( BTW, the flashed image \
workes):<br class=""><br class="">Feb 17 09:46:59 pampero kernel: \
usbd_setup_device_desc: getting device descriptor at addr 4 failed, \
USB_ERR_IOERROR<br class="">Feb 17 09:47:00 pampero kernel: usbd_req_re_enumerate: \
addr=4, set address failed! (USB_ERR_IOERROR, ignored)<br class=""></blockquote><br \
class="">What sort of dev board is it?<br class=""></blockquote><span \
class="Apple-tab-span" style="white-space: pre;">	</span>m5 stamp C3U<br class=""><a \
href="https://shop.m5stack.com/products/m5stamp-c3u-mate-with-pin-headers?_pos=2&amp;_sid=3df9b5f0d&amp;_ss=r&amp;variant=42341016633601" \
class="">https://shop.m5stack.com/products/m5stamp-c3u-mate-with-pin-headers?_pos=2&amp;_sid=3df9b5f0d&amp;_ss=r&amp;variant=42341016633601</a><br \
class=""></blockquote><br style="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=""><span \
style="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="">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="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=""><br \
style="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=""></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  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 <code class="">Tools</code>-&gt;<code \
class="">USB CDC on Boot</code>-<code class="">Enabled</code>, IDF users please refer \
to ESP IDF official documentation.)</div><div>now to hunt down the ‘official \
documentation'.</div><div><br class=""></div><div>thanks,</div><div><span \
class="Apple-tab-span" style="white-space:pre">	</span>danny</div><div><br \
class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><span \
style="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="">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="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=""><br style="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=""><span \
style="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="">--</span><br style="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=""><span \
style="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="">Daniel O'Connor</span><br \
style="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=""><span style="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="">"The nice \
thing about standards is that there</span><br style="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=""><span \
style="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="">are so many of them to choose \
from."</span><br style="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=""><span style="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="">-- Andrew Tanenbaum</span></div></blockquote></div><br \
class=""></body></html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic