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: Michael N. Moran
Subject: Re: Multiple UARTs using -chardev and -device instead of -serial
Date: Tue, 20 Feb 2024 16:25:59 -0500
User-agent: Mozilla Thunderbird

On 2/20/24 04:57, Peter Maydell wrote:
> 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

Thanks Peter,

I did use the -chardev

I really wanted a way to specify associations between front-end (serial?) and 
back-end (chardev?) without the need for the sequential assignment of 
front-ends, and the need to skip unused front-ends by using the likes of 
-serial null.

I was able to successfully use your alternate syntax for the back-end 
(chardev). While that didn't satisfy my goal, it does help me to distinguish 
between front and back ends.


-- 
Michael N. Moran           (h) 770 704 9751
218 Wilshire Terrace       (c) 678 521 5460
White, GA, USA 30184       http://mnmoran.org





reply via email to

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