From nobody Fri Oct 08 07:25:37 2021 X-Original-To: freebsd-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 3801112D43E9 for ; Fri, 8 Oct 2021 07:25:40 +0000 (UTC) (envelope-from debdrup@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQfqS15myz4k9W for ; Fri, 8 Oct 2021 07:25:40 +0000 (UTC) (envelope-from debdrup@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1633677940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+4Y3HGNAFc7XoMigpM0My59Yfvtf/1ATSXzaVSVJiF0=; b=DKd4oCua4A84ri3QXuudeji/doDIts1EUNA/OG0nTad2DxKRUU7P34qaA/EJDX8RePXxp+ p33xNM8+xGaATPpfcz9j2bvFqr8mQF3Gc6ZuHvn8Aap4E7mvOfyRZz5I91ivjbp5txbpEs IQV9g+8tcSAX+lrBJVaT7N4k5I4qo+SW6a8FMZun5AZMiaUfb/EYwjKQ2+67Nidnrd3IYI iF7nayw/vM8w9LtWk+sTu7YOedXXp4QmXCJgGEdSp2mH+4vcsjy8abJOdfKtURWNmek8Fu G0qNwTPpotxU1OPh7ds1C21EnUWI2ILvsNOec3n4oP75LHdtrwf9h1NIrpg0DA== Received: by freefall.freebsd.org (Postfix, from userid 1471) id 14F111BEC7; Fri, 8 Oct 2021 07:25:40 +0000 (UTC) Date: Fri, 8 Oct 2021 09:25:37 +0200 From: Daniel Ebdrup Jensen To: freebsd-hackers@freebsd.org Subject: Re: Persistent USB serial? Message-ID: <20211008072537.vytjzyqol5cksy5d@nerd-thinkpad.local> Mail-Followup-To: Daniel Ebdrup Jensen , freebsd-hackers@freebsd.org References: <20211008080016.7830e3d5@zeta.dino.sk> 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 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2irchopb7p54edbx" Content-Disposition: inline In-Reply-To: <20211008080016.7830e3d5@zeta.dino.sk> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1633677940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+4Y3HGNAFc7XoMigpM0My59Yfvtf/1ATSXzaVSVJiF0=; b=Oll6mXKJJlwHWEzVmz8cG24cJgBxXElmKpMQNAt5gJUjxu4HueoJUyLWllb0fDXkgTQiA3 KA2aA9xUz/cV6dOA/UJKYmpDrFXQPPAQN3G80kaiztaIGK0vGvZCANgp5V6t6kJOBhqiqI dSLxGsa66pQjloN2U+FhC+d0sMaivopl7sBeG9iqU78kSHnaamVa6bamYTRNNKvv4en4NZ YVbfNZbc98UCEjvNX0LBnQZKDm84/3Rc3/6woGYOdC902rs2Zmilj+OS7umTG3j7Ud4SjT TA8ycvAGx2nwWwD8j091+3rL8I0AAkVpF5a/i7GxJSWuS0ZwTCukeXXLWUMvfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1633677940; a=rsa-sha256; cv=none; b=Ck6YGR7vbacRyLdoT5SAEXaUrToEykEFBtaLFEUl9sHTVjaGjW04VVKK5KkZNS4WbA0DPq PgsyUY9p9K0eSr1+LPMp+zpxq/vZFEeqPIouVJqjuQxvJCX5trQT4AszRY8VLJ/KnG0V6Q xlNnDbh/EKVevB/kSWBYdNRAbJWqTIiKvol2dq8THei/wPgvSyzn5+Swi81IYxCFqFBlEH Uj84n63oesUYA0V6rYv7s4AvKDbjoaIGxu0hR5OmJdt+6PSRSDs47n5E+GdOYkJTOyw5mh XiSX4qRyK9UTxMspjgrIlKH7ykIP/9iQwAIzLdoDTZkrfKlIl9l1/sDSV80VMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N --2irchopb7p54edbx Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline On Fri, Oct 08, 2021 at 08:00:16AM +0200, Milan Obuch wrote: >Hi, > >I'd like to solicit opinions/hints for following scenario, which is >quite common currently. > >There are some development and evaluation boards designed with USB port >as power source and serial console at the same time (sometimes even >more ports or JTAG as well). When board has power on switch, usually no >activity is present on USB wire without board being powered - there is >some USB-to-UART circuitry powered from board power source. So serial >port device /dev/cuaUn et al. get created only after power on of the >board. > >Problem: port number can be different depending on USB port enumeration >or connection order. Another one: it is easy to miss first characters >sent from the board if you are not able to write required command like >'cu -l /dev/cuaU9 -s 115200' quickly. > >Maybe it is possible to write some devd config file snippet which >ensures consistent device naming without need of maintaining correct >(everytime the same) order of cable connecting, but even that, this >does not solve second problem, starting up some terminal or terminal >like program in time. > >Has anybody some experience in this area who can share it? Some hints >what to test? Do we have some pseudo serial device, which can be used >as device argument for cu command, which can just grab the real USB >serial when it appears on connecting the board under test? > >Regards, >Milan > Hi Milan, There's an open review [1] for location-based unit numbering for USB, which some of us have been using for quite some time - and while it's not completely done, it's very useful. Yours, Daniel Ebdrup Jensen 1: https://reviews.freebsd.org/D21886 --2irchopb7p54edbx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEDonNJPbg/JLIMoS6Ps5hSHzN87oFAmFf8nFfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDBF ODlDRDI0RjZFMEZDOTJDODMyODRCQTNFQ0U2MTQ4N0NDREYzQkEACgkQPs5hSHzN 87ob7AgAk5UO37K8hkFMlNVFCrcur/0recy33yw0jZC2FU9bAL1cpgAt2X02eSF7 5/YldPVBEkqlja6LGGftVc1JqHVTLB4q+jm/2cdcrVE822cq+m+en1ShRWU5KSud x/6EBeEIOY38wFtZBJLdo2o4O36ALQAz0v9Tz6pE0b2Uv5KJfJOOZpg56RV9aVs1 kDSZfyDaVevmDBNl67/ira6umQv14s+l8VUxldFptrFxKtgxtP+jbxBDg34g1+BA Uioj61e4URPAtnEL/r0xokKmOntPaXVZbUTp99pR622rcYguHyMAFlsBhZnhOIqs lNRQ6GnntnK1F2fAP7oCMYLT7gvktw== =O9JP -----END PGP SIGNATURE----- --2irchopb7p54edbx--