From nobody Sun Jul 31 12:40:59 2022 X-Original-To: bugs@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 4Lwgph0M63z4YFMg for ; Sun, 31 Jul 2022 12:41:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lwgpg5PyDz3dPh for ; Sun, 31 Jul 2022 12:40:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Lwgpg4SvpztBK for ; Sun, 31 Jul 2022 12:40:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 26VCexxF005457 for ; Sun, 31 Jul 2022 12:40:59 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 26VCexS9005456 for bugs@FreeBSD.org; Sun, 31 Jul 2022 12:40:59 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 265533] uchcom: baud rate is not correct for CH34x Date: Sun, 31 Jul 2022 12:40:59 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: trombik1973@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659271259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9WuS9OI467fng+r5jF9hX4yPLJtZGAsJO67j+sR5p7I=; b=keUH6zTtD6I5I4SMRXh8gbJYWkVgszLJ1sOf9ITSmBR5ylexV7UxmOK6YThyW0IJNOXRSQ +uCBbFJ4VxAxSGvJWuYAqNy37+Z0tUcKgr3QUbDtTbtfyV8/gjuA5VPI7KIyZyoPe1zmiR VigsBFcb7Jn26IKtnZniUIz4cdLbgPphvrcKARE+9raypEZ+hU9FA3OuKFuIyJvfUrqXrF k/c1Zd5b2wfY1GsImT4LBzvODbeRtTZ9Nsjz4xSwYt9pHvpbbqVrg+UWnUfopX107DYhoW E4cksCaXKcQWxch7zeswFsJpQuIPMIzcKVovQLXqgXfp1mdW5UP/L5XyBVJncQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659271259; a=rsa-sha256; cv=none; b=nluP49DdGjzhsmBdXB951ilyYWXQDWqjjyrh3DKKY7DJH7mFpSXG2bbiEY4/PVexpK0rCy piRbE+wpcqOtkkR91hLicX+acHAEhfqXvuBsRA+QmgS0QjoKZF7SUHwJBghrH0xeoOaezo 07ViUUpPRRJcwrphyGaHQ6aY38EEv3kxjJGn0e/VuLO97yv00HH+KXTQ4IoryjGgAuwy35 KhxKkydRLhNUSpa560FyyO6wySrh43jEi2iNktuEEVI4ztkW5gUIfkacPBpV3UnoHAx36C dbJa6ZK1em5UpUtALjAPPTZwP1+Ek9weyVs6XDqgqVW6ro6hEVD/WMADAgJPmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265533 Bug ID: 265533 Summary: uchcom: baud rate is not correct for CH34x Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: trombik1973@gmail.com the symptom is that, when uploading code with avrdude, sometimes the result= is successful, but not always. I have dozens of Chinese clones of arduino nano with CH340C. uploading fail= s on about 6 of 10. usually ends up with `expect=3D0xWHATEVER, resp=3D0xfc`. dur= ing the process, some commands get proper replies, such as `Device signature =3D 0x= 1e950f (probably m328p)`, others do not. this seems like a baud rate issue. the Linux kernel driver had a similar issue in the past. but recent kernel = does not, which was verified on Fedora 36. avrdude on the Fedora can upload code= to all the problematic nano boards. after reading this report on GitHub, i was convinced that the uchcom(4) has issues. https://github.com/nospam2000/ch341-baudrate-calculation when `uchcom_calc_divider_settings()` is replaced with the one in NetBSD, a= ll boards work. Sometimes, I am facing issues when avrdude verifies the flash content, but I am not yet sure what is wrong. could not find common denominators yet. at least, uploading always works with old bootloader (boud rate 57600), and new bootloader (115200). --=20 You are receiving this mail because: You are the assignee for the bug.=