pl011_qemu

Crates.iopl011_qemu
lib.rspl011_qemu
version0.2.0
sourcesrc
created_at2020-12-23 01:53:38.70013
updated_at2020-12-30 05:33:09.63424
descriptionSimple Driver for PL011 UARTs in QEMU
homepagehttps://github.com/apgoetz/pl011_qemu
repositoryhttps://github.com/apgoetz/pl011_qemu
max_upload_size
id326324
size34,621
Andy Goetz (apgoetz)

documentation

README

Embedded Hal driver for QEMU serial ports

This crate provides basic drivers for the UARTS exposed by QEMU. You can see the implementation of these uarts here

The QEMU target actually exposes 4 different UARTS, that can each be redirected to arbitary character devices or files. This crate allows those UARTS to be accessed in order to support more complicated use cases than can be provided by cortex_m_semihosting.

EXAMPLES

To run the examples, you will need an arm QEMU. An example can be seen below:

In order to run these examples, your cargo runner should be set to something like: qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting -serial mon:stdio -kernel

The classic example

$ cargo run --example hello
Hello, World!

Another example, this time tee-ing the input to a file:

$ cargo run --example tee -- -serial file:test.txt
testing 123
^D
$ cat test.txt
testing 123
Commit count: 5

cargo fmt