From nobody Tue May 24 17:09:11 2022 X-Original-To: freebsd-questions@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 5A0641B44552 for ; Tue, 24 May 2022 17:09:19 +0000 (UTC) (envelope-from mychaela.falconia@gmail.com) Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L70zf2hGVz3NV2 for ; Tue, 24 May 2022 17:09:18 +0000 (UTC) (envelope-from mychaela.falconia@gmail.com) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-2ff7b90e635so122994847b3.5 for ; Tue, 24 May 2022 10:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RvLUv8OVnx4X/nKqXUGK+WAkeAK0NK4jB6c7udCSEe0=; b=DhqmL7UtMMTeiMP0wMdWUJi41h5J/gHc1DO86UlWlLfNB10skWEZkRGkfPDWMR+FOv wN2OtH0TJavBDEm+hLzualf+nIcO3iOE5ejVIgJ5bOAakHqHvX0q83Oq0ny1ErdwLs8H 2+VXgOW5QSF885Y+20j2CrhsaftFIue8s5TZtqvCKeIKfb/duyinL33ImkxeXH41FCir /Kc8OsDDvNy+iY42sa9gCjSHtB6ptYvMoHPt0M1VlWmrKbCmfHbuWGuiFoGC9yh3F3Rv 1IPKPriGUPX6XGEU4RpT4bDwkoOWekR6nS3lEgyJx+zjL5tQpxyR/kPKUAXvQL6L0+9o BHRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RvLUv8OVnx4X/nKqXUGK+WAkeAK0NK4jB6c7udCSEe0=; b=V7nyoaJkObBNBFAV9wDAbqHHrkbke/yV4cXfxEJ/5CRRqmW58ep26nCkfURsf1yYek oAJ29Ip08rgCYjIfmQpc9ED1iqLirjHUCs/F5J7faXOkpTloEk1SULivyFlZnGEZicpX KvgeWXrJjwrXSpAINzJQ1JgIKMYUVEmuFwNvmm/aIiRHfXtBKGIR5NpfzS+DJIiOaSgP YAEM/Zfj9Ll3ywoTEbuYaFWfL24mGcqq7jd4X2kuWHfZR+8cxNXP2rfLsmI5XhHEdD+s Y3gLADBfBYbjwR0ajsuUssmOkJ/R08AwVhZ7r94WVLnlnpmwyy7w+A95vBN2BMrULnAS zyGQ== X-Gm-Message-State: AOAM533N1rUAK8GefcoANo9vDQBPYDC9TPLrYLLdGutHQIhIIRM+7G/0 Wd8t6uiAs+4EFWIfG/82SUYGF/hSuyVTpCiJlN6kYHOE X-Google-Smtp-Source: ABdhPJyYH5AF6rPDB7aB/jCVKFU0QfwL4Z2bAjUsWPyENJwC7nS1J/86uHIDHpV9iM0UkyslemmP65lEZrBxGj+vAqQ= X-Received: by 2002:a81:4f51:0:b0:2ff:e87d:b966 with SMTP id d78-20020a814f51000000b002ffe87db966mr12131256ywb.4.1653412151956; Tue, 24 May 2022 10:09:11 -0700 (PDT) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Received: by 2002:a05:7000:668c:0:0:0:0 with HTTP; Tue, 24 May 2022 10:09:11 -0700 (PDT) In-Reply-To: References: From: Mychaela Falconia Date: Tue, 24 May 2022 09:09:11 -0800 Message-ID: Subject: Re: Unwanted auto-assertion of DTR & RTS on serial port open To: Daniel Feenberg Cc: freebsd-questions@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4L70zf2hGVz3NV2 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=DhqmL7Ut; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mychaelafalconia@gmail.com designates 2607:f8b0:4864:20::112e as permitted sender) smtp.mailfrom=mychaelafalconia@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::112e:from]; MLMMJ_DEST(0.00)[freebsd-questions]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Daniel Feenberg wrote: > The man page adds the (-)rtsdtr option in version 13.1: > > https://www.freebsd.org/cgi/man.cgi?query=stty > > and I can confirm it is an invalid argument in 13.0. Huh? That very same man.cgi on freebsd.org tells me that (-)rtsdtr first appears in 13.0 (there is a typo in the man page, the negative form is -rtsdtr, not --rtsdtr as the man page says), ditto for the appearance of CNO_RTSDTR in termios(4), the underlying kernel interface. > You should be able to test it with any old desktop computer pretty > easily though. Still a massive learning curve, given that I don't regularly use FreeBSD (or any other alphabetic-prefix-BSD) at all, only Slackware Linux. It will probably be a few months before I can make the necessary time allocation. Lots of other higher priorities: I need to finish setting up my own test GSM network, I need to get my Venus board into PCB layout, etc - you get the idea. Testing whether or not FreeBSD's recent CNO_RTSDTR addition really fixes the design flaw inherited from 1970s UNIX is only a side project here... > Documented things tend to work. It looks like the key point of my inquiry mas missed. I have no doubt that the newly added CNO_RTSDTR termios flag (and stty -rtsdtr user front end to it) works as documented, meaning that on subsequent opens of the "regular" (sans .init) tty device the unwanted auto-assertion of DTR & RTS will be suppressed. But the part which is not clear at all, which is not documented anywhere I could find, is whether or not the act of opening /dev/ttyU1.init (for the purpose of setting the termios flag) will jerk the modem control lines. If the latter line jerking still happens, then FreeBSD's recent "fix" does NOT really fix the ancient design flaw from 1970s - or if opening of the .init device does not assert modem control lines, *then* (and only then) we will be able to celebrate, and tell the world that FreeBSD is the first Unix-style OS that finally fixed the old 1970s serial port control misdesign. > Have you thought of the alternative solution of cutting some wires > in the serial cable? Ahmm, I am the _designer_ of the hardware in question. If I wanted to modify my design, I wouldn't be cutting wires, I would modify the design at the source. But why would I agree to modify what I consider to be a beautiful design? My approach is one of philosophical principle: if the flawed design of 1970s Unix is the thing that's in the wrong, then it is the flawed OS that needs to be fixed (which in my case is Linux - I am merely _inquiring_ about FreeBSD), rather than me giving up on my idea of elegant hw design to please the broken OS. > Does your device even need those signals? Yes, I put that circuit in there for a reason: with this circuit added, giving a -Prts (pulse RTS) command line flag to my FreeCalypso tools fc-loadtool, fc-iram, fc-xram, rvinterf etc causes a PWON (current hw) or RPWON (next upcoming hw) pulse to be given to Iota VRPC, whereas giving a -Pdtr (pulse DTR) command line flag to the same tools causes a deep reset pulse to be sent to the target. These host-controlled boot modes are super-helpful for both hardware bring-up and firmware development. > Would it work at a lower data rate? What do data rates have anything to do with DTR & RTS control signal issues? But as far as data rates go, "would it work at a lower data rate" is the wrong question to ask - instead it is the duty of hardware engineers like me to design our hardware so that the highest possible data rates will work. My Calypso GSM chip (no, I didn't make the chip, I only make boards with these chips on them, but I do act as a sort of Adoptive Mother to the chip design itself too) supports standard UART baud rates up to 115200 bps, and GSM-specific (otherwise non-standard) baud rates up to 812500 bps. FT2232D handles all of them just fine, and so does Linux. And when you are routinely transferring >2 MiB code images (flash or run-from-RAM) in the course of firmware development, that highest baud rate of 812500 bps really does help. Back to FreeBSD: as of right now, I don't have any active or even prospective users of my FreeCalypso GSM devices who have expressed a desire to use my GSM gear with FreeBSD instead of Linux. But about a year and a half ago, when I went to battle against Linux kernel gatekeepers^Wmaintainers, trying to get them to mainline my patch that fixes the DTR & RTS problem in Linux, one of them pointed me to that FreeBSD review D20031, showing how the problem has recently been addressed in FreeBSD. I know for certain that the solution which this particular Linux maintainer has been advocating for would not work correctly in Linux, which lacks ttyXX.init devices altogether - but I am still seeking to find out whether or not FreeBSD's seeming-fix actually fixes the problem in FreeBSD, as a matter of information gathering. It appears that the topic at hand is too obscure and specialized for anyone to have a ready answer - so it looks like there is no other way to proceed than biting the bullet and getting FreeBSD installed just for this test. I will now go back to setting up my test GSM network, but maybe I can squeeze in this FreeBSD install in between the test network and FC Venus board. M~