qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple UARTs using -chardev and -device instead of -serial


From: Peter Maydell
Subject: Re: Multiple UARTs using -chardev and -device instead of -serial
Date: Tue, 20 Feb 2024 09:57:25 +0000

On Mon, 19 Feb 2024 at 20:57, Michael N. Moran <mike@mnmoran.org> wrote:
>
> I'm working on Linux with `qemu-system-arm -machine olimex-stm32-h405`, which 
> uses an `stm32f405-soc` that implements 8 USARTs(UARTs).
>
> I currently use two "-serial telnet" options which assigns the first two 
> USART ports sequentially and I can connect to both using telnet. This works 
> fine.
>
> I would like to avoid the sequential assignment and instead specify a subset 
> of the USARTs that is not sequential.
>
> The === Character Devices === section in qdev-device-use.txt alludes to a 
> "new way" to do this using "-chardev" and "-device" that I'm not able to make 
> work. The problem seems to be choosing an appropriate "-device" incantation.

The -device works only where you are configuring a new device that
you are plugging into the machine (e.g. an ISA or PCI serial adapter
on an x86 PC machine type), not for configuring ones
that are built in to it (like most embedded board UARTs).

For configuring embedded serial devices, use the -serial option.
Each -serial option configures one UART, so use several of
them in order to configure more than one UART. If you don't
care about the output from a particular UART then "-serial null"
will throw it away.

If you want the flexbility of the -chardev option for
configuring the backend to a builtin uart, you can do it
with something like:
  -chardev id=myserial,[options...] -serial chardev:myserial
(i.e. create a chardev with ID 'myserial', and then you can
use a -serial option that says "connect to this existing chardev".)

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]