Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 2021 10:58:40 +0300
From:      Mehmet Erol Sanliturk <m.e.sanliturk@gmail.com>
To:        Milan Obuch <freebsd-hackers@dino.sk>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Persistent USB serial?
Message-ID:  <CAOgwaMvNbWRpXhBkEDU4wChjF_TkDE6OX4%2BWB6FHncTBDK4GNA@mail.gmail.com>
In-Reply-To: <20211008080016.7830e3d5@zeta.dino.sk>
References:  <20211008080016.7830e3d5@zeta.dino.sk>

next in thread | previous in thread | raw e-mail | index | archive | help
--00000000000076f57505cdd2c14c
Content-Type: text/plain; charset="UTF-8"

On Fri, Oct 8, 2021 at 9:01 AM Milan Obuch <freebsd-hackers@dino.sk> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOgwaMvNbWRpXhBkEDU4wChjF_TkDE6OX4%2BWB6FHncTBDK4GNA>