From nobody Thu Feb 17 09:48:40 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 3BA7119C94C1 for ; Thu, 17 Feb 2022 09:49:01 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from midget.dons.net.au (2403-5800-5200-4700-225-90ff-fe47-39b4.ip6.aussiebb.net [IPv6:2403:5800:5200:4700:225:90ff:fe47:39b4]) (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-signature ECDSA (P-384) client-digest SHA384) (Client CN "dons.net.au", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jzqlw0w2Qz4bNM for ; Thu, 17 Feb 2022 09:48:59 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from midget.dons.net.au (localhost [127.0.0.1]) by midget.dons.net.au (8.17.1/8.16.1) with ESMTPS id 21H9mi6n068168 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Thu, 17 Feb 2022 20:18:53 +1030 (ACDT) (envelope-from darius@dons.net.au) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dons.net.au; s=default; t=1645091337; bh=z6nFtwHEwyhiuwNrT2NQjdaJN5Cxj/cMbgjPl0IYiRg=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=YyjXibdcfNdBTr9qmzdUiKuZ3onPGNaD+DS5ZGhaf8Bz4ufx49Rj/wuPatU2mFH6L WMuGPm4IvmgG7xxp6FkQtj6CbYGIbgaSM12pvbona7pWI9jk4E2wD2eW+c2oZIMv4A 2FHQ7Ch9ua2tRvd4byQumQ9E0sPnJ17mo7dtc3X0= Received: (from mailnull@localhost) by midget.dons.net.au (8.17.1/8.16.1/Submit) id 21H9meDd068164 for ; Thu, 17 Feb 2022 20:18:40 +1030 (ACDT) (envelope-from darius@dons.net.au) X-MIMEDefang-Relay-0ce1a11234c790b6ab6410cd70c6fdb820520472: 2403:5800:5200:4700:4490:1d13:a302:f4a7 Received: from smtpclient.apple (2403-5800-5200-4700-4490-1d13-a302-f4a7.ip6.aussiebb.net [2403:5800:5200:4700:4490:1d13:a302:f4a7]) by 2403-5800-5200-4700-225-90ff-fe47-39b4.ip6.aussiebb.net (envelope-sender ) (MIMEDefang) with ESMTP id 21H9me7p068158; Thu, 17 Feb 2022 20:18:40 +1030 Content-Type: text/plain; charset=us-ascii 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 15.0 \(3693.40.0.1.81\)) Subject: Re: usb CH9102 serial chip From: "Daniel O'Connor" In-Reply-To: <17E09096-A45B-43F5-BFE4-7645E8A2275D@cs.huji.ac.il> Date: Thu, 17 Feb 2022 20:18:40 +1030 Cc: freebsd- , "usb@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <7DD6E1FA-3EA4-44D9-A272-9E51FB9F2BFC@dons.net.au> <013FB4BA-7D32-4FFB-AFD3-E594CF638A66@dons.net.au> <17E09096-A45B-43F5-BFE4-7645E8A2275D@cs.huji.ac.il> To: Daniel Braniss X-Mailer: Apple Mail (2.3693.40.0.1.81) X-Spam-Score: 0.5 () No, score=0.5 required=5.0 tests=KHOP_HELO_FCRDNS, PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.5 X-Scanned-By: MIMEDefang 2.83 on 10.0.2.1 X-Rspamd-Queue-Id: 4Jzqlw0w2Qz4bNM X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=dons.net.au header.s=default header.b=YyjXibdc; dmarc=pass (policy=quarantine) header.from=dons.net.au; spf=pass (mx1.freebsd.org: domain of darius@dons.net.au designates 2403:5800:5200:4700:225:90ff:fe47:39b4 as permitted sender) smtp.mailfrom=darius@dons.net.au X-Spamd-Result: default: False [-3.50 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[dons.net.au:s=default]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+mx:c]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[hackers@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[dons.net.au:+]; DMARC_POLICY_ALLOW(-0.50)[dons.net.au,quarantine]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[hackers]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:4764, ipnet:2403:5800:5000::/36, country:AU]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N > On 17 Feb 2022, at 20:04, Daniel Braniss wrote: >> On 17 Feb 2022, at 11:30, Daniel O'Connor wrote: >>=20 >>> On 17 Feb 2022, at 19:50, Daniel Braniss = 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 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. 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