From nobody Fri Oct 8 07:58:40 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 9629D12DA1CA for ; Fri, 8 Oct 2021 07:59:16 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: from mail-vs1-xe2c.google.com (mail-vs1-xe2c.google.com [IPv6:2607:f8b0:4864:20::e2c]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQgZD3hnnz4qGH for ; Fri, 8 Oct 2021 07:59:16 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: by mail-vs1-xe2c.google.com with SMTP id g10so9587843vsb.8 for ; Fri, 08 Oct 2021 00:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KZHzRv00KPAvvqt4NDe4fiPSRhsCComxOs53qG1fxWk=; b=B9cYXIZaAZa810DMnvrXNGILaazoJZRI7/WpgQay7sGZVk38r9pVWZaBEgQ0zm8flC Wk6vVJL/4imn5REUQGuptTzpHLQdPU7MR+VndwF6Vy7RMFHdyQcL23lm/76BDTrgE1kF Bcmk2Dcs8f5M2+2pXICP1hBS0UZT64bXIPqB9ZcGM10YJbnWF9viRTKdX24U58EYHbZ3 SGR85BIwkDJkgvvxupzqOa31YIxl4luEfiiThluBJT0uSQEzda4e/Hobna4jg4DiD0nZ lZWqyRh1mY7WyI/8lsVJqhyKj08YNDP7mqmZ4DNEUCbZKoBlcOA8wlNoP0riNiw8hMSY YCGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KZHzRv00KPAvvqt4NDe4fiPSRhsCComxOs53qG1fxWk=; b=kk6CoeedSogr49Rt6boRxCM7qLlNJ5kad5yGMa0gPz4ARJ7ogpzDPMOQ4irM1paUNR Ot0TynTw3JS24Zc+trH/OySVx9UmvYE2yzllM7aWo3V5Sv5jH+A8bvHCPFpxAl/mZtrQ eBMA/z+z7FDHaJ3ObSLFW0iB086IoIybyZ8p84s5ASnZHjX1KUgl8ciyMQFOeqHYQPIs gSg9yWBZj5cLAe2XydrbYBTgrmwal/E1GjWmuYjR76irvCY6zc9j8hNidEYw6kgI7eSc VS7PQyyy+aMYnR4FLOZ90uX9PWlTFrC5d5f3X1KKnWA9SZI4cmhaMgftTTTYrm+OQpWi xz6g== X-Gm-Message-State: AOAM532CFF8xW34MgeAu0+VxPrPT6WwJ5PA+LgTIS5l7OcGN5vo0kOaJ aM/pc09Dp4V106vudZ+UQUzW9s8AKW+WVAYlHV7WS0WN X-Google-Smtp-Source: ABdhPJyOXLfAJmXsxROkn7xYFRpdw0YwBZrMZqEbcuOk6MRxGtCsK7I1RZI8KpivB+WavFii8kE+Ih3xYtK7BpB3Sz4= X-Received: by 2002:a05:6102:722:: with SMTP id u2mr9007178vsg.57.1633679956177; Fri, 08 Oct 2021 00:59:16 -0700 (PDT) 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 References: <20211008080016.7830e3d5@zeta.dino.sk> In-Reply-To: <20211008080016.7830e3d5@zeta.dino.sk> From: Mehmet Erol Sanliturk Date: Fri, 8 Oct 2021 10:58:40 +0300 Message-ID: Subject: Re: Persistent USB serial? To: Milan Obuch Cc: FreeBSD Hackers Content-Type: multipart/alternative; boundary="00000000000076f57505cdd2c14c" X-Rspamd-Queue-Id: 4HQgZD3hnnz4qGH X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: Y --00000000000076f57505cdd2c14c Content-Type: text/plain; charset="UTF-8" On Fri, Oct 8, 2021 at 9:01 AM 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 > > I am not using the following idea , but my opinion on that case is as follows : Assume that there is a list of ports to be defined such as USB , PCI , RS-232 , etc . If the board is a new one ( Boot the computer and obtain the above list . Make it a configuration file with ASSIGNED suitable port numbers by the user . ) otherwise use a previously prepared configuration . When the computer starts to boot , it looks at the above file . If it is present , ( without fancy mount operations by the user ) loads it and uses port numbersspecified in the given list . If it is not present , the computer uses its own defaults . In case of specified port numbers ( or names , labeling is not important ) , it uses giving numbers , causing repeatable boot sequences and the related scripts , etc. can continue as specified without being broken . Perhaps , such an application requires some changes in the boot processing sources which these are beyond my knowledge . Mehmet Erol Sanliturk --00000000000076f57505cdd2c14c--