qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Baremetal Netduino2 -- cannot output on UARTs 2-4


From: Seth K
Subject: Re: [Qemu-devel] Baremetal Netduino2 -- cannot output on UARTs 2-4
Date: Thu, 6 Oct 2016 17:52:26 -0400

You're right, qemu was not happy with that command line, but your pointer
really helped me out, thank you!! I think a combination of my
misunderstanding what the arguments meant, and a weird bug with this chip,
resulted in my complete confusion.

Using the command line:
../qemu/arm-softmmu/qemu-system-arm -M netduino2 -nographic -kernel
output.bin -serial unix:///tmp/uart1,server -serial
unix:///tmp/uart2,server -serial unix:///tmp/uart3,server -serial
unix:///tmp/uart4,server

and opening 4 sockets:
socat - UNIX-CONNECT:/tmp/uart1 ...

sends data written to UART1 to /tmp/uart1 and UART4 to /tmp/uart4. 2 and 3
still disappear but that seems to be a bug and I have reported it. Now to
test this on a chip with 8 UARTS...

Thanks again!

On Wed, Oct 5, 2016 at 5:21 PM, Alistair Francis <address@hidden>
wrote:

> On Wed, Oct 5, 2016 at 10:45 AM, Seth K <address@hidden> wrote:
> > Thanks for that link.
> >
> > I tried that command line and it output UART4 but UART 1 disappeared and
> > UART2-3 are still missing. That page doesn't seem to have an explanation
> of
> > what that command line is doing nor why /dev/null is used twice, so I'm a
> > little lost. Removing the first /dev/null made UART4 disappear but UART1
> > came back. In the past I've looked for documentation that explained the
> > command line but everything I found was very vague.
>
> Hey Seth,
>
> Each -serial option is used to specify where to send the serial
> output. These are parsed in order when passed into QEMU. So the first
> -serial option controls where to send UART0 data and so on.
>
> That example I sent you is for a Netduino 2 so you will need to
> changed the -serial options to match what you want to print, but it is
> a good example you can use. Especially for muxing multiple serial
> devices.
>
> It sounds like you want something like:
> -chardev stdio,mux=on,id=terminal -serial chardev:terminal -serial
> chardev:terminal -serial chardev:terminal -serial chardev:terminal
> -monitor chardev:terminal
>
> Which will output everything to the terminal. I can image that will
> cause some problems though, so you might want to output some to
> telnet/sockets instead to stop everything being mixed together.
>
> Remember that -chardev creates the output device but doesn't connect
> it to a UART. You need the -serial option to do that.
>
> Thanks,
>
> Alistair
>
> >
> > build.sh has a bunch of command lines I've found online and tried:
> >
> > $QEMU/arm-softmmu/qemu-system-arm -M netduino2 -nographic -kernel
> output.bin
> >
> >
> > #this one sends UART1 to a socket but not UART2
> > #../qemu/arm-softmmu/qemu-system-arm -M netduino2 -m 128M -nographic
> -kernel
> > output.bin -serial unix:///tmp/uart,server -serial
> unix:///tmp/uart2,server
> > #socat - UNIX-CONNECT:/tmp/uart
> >
> > #../../qemu/arm-softmmu/qemu-system-arm -M netduino2 -m 128M -nographic
> > -kernel output.bin -serial unix:///tmp/uart1,server,id=uart2 -serial
> > unix:///tmp/uart2,server,id=uart1
> > #didn't redirect
> >
> > #other desperation
> > #../qemu/arm-softmmu/qemu-system-arm -M netduino2 -m 128M -nographic -s
> -d
> > cpu,in_asm -kernel output.bin
> > #../qemu/arm-softmmu/qemu-system-arm -M netduino2 -m 128M -nographic
> -serial
> > unix:///tmp/uart,server -kernel output.bin
> > #../qemu/arm-softmmu/qemu-system-arm -M netduino2 -m 128M -nographic
> > -chardev socket,id=usar0,host=localhost,port=31337,server -kernel
> output.bin
> > #../qemu/arm-softmmu/qemu-system-arm -M netduino2 -m 128M -nographic
> > -chardev socket,id=chardev,host=localhost,port=31337,server -kernel
> > output.bin
> > #../../qemu/arm-softmmu/qemu-system-arm -M netduino2 -m 128M -nographic
> > -kernel output.bin -s -S
> >
> > On Tue, Oct 4, 2016 at 12:59 PM, Alistair Francis <address@hidden>
> > wrote:
> >>
> >> On Mon, Oct 3, 2016 at 1:25 PM, Seth K <address@hidden> wrote:
> >> > I have made a bare metal "Hello World" program for the Netduino2. I
> have
> >> > pushed it here:
> >> >
> >> > https://github.com/skintigh/baremetal_netduino2
> >> >
> >> > It should output "Test 1/4" to USART 1, "Test 2/4" to USART 2, "Test
> >> > 3/4"
> >> > to USART 3 and "Test 4/4" to UART 4.
> >> >
> >> > What actually happens in QEMU is only the first string is output. That
> >> > may
> >> > be a command line argument error on my part, so for a sanity check I
> put
> >> > printf statements in the function stm32f2xx_usart_write in
> >> > qemu/hw/char/stm32f2xx_usart.c and recompiled qemu. The result is text
> >> > sent
> >> > to UART1 and UART4 make is to the function (though only 1 is output),
> >> > while
> >> > writes to 2 and 3 simply disappear and never make it to that
> function. I
> >> > assumed all writes to UARTs would go to that function.
> >> >
> >> > Am I doing something dumb? Is this a bug? Any help would be greatly
> >> > appreciated.
> >>
> >> Hello Seth,
> >>
> >> I haven't looked at the multiple UART problem in a while. It sounds
> >> like your command line arguments are incorrect.
> >>
> >> Have a look at this wiki page for details on what the serial options
> >> should look like:
> >> https://github.com/alistair23/qemu/wiki/Getting-Started
> >>
> >> If that doesn't work can you copypaste your command line arguments?
> >>
> >> Thanks,
> >>
> >> Alistair
> >>
> >> >
> >> > Thanks,
> >> > Seth
> >
> >
>


reply via email to

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