简体   繁体   中英

QEMU: USART communication between two MCUs (STM32)

I try to create two qemu instances and let them communicate via usart. the background is, that I want to emulate the communication while the boards aren't even finished but the code is already testable.

So the creating of two parallel qemu instances is no problem, but the communication between these two doesn't happen.

The way I thought it maybe could work is to extend the command line of the master device with -serial pty to bind the USART1 of the STM32 to an pty socket and after that binding the USART1 of the slave to the same pty. But obviously it doesn't work.

The code I use is already tested with two Olimex development boards so there have to be problems in the qemu setup.

Does anyone have tried something like this or can provide a different way to establish an emulated connection?

Use semihosting with unix pipes. I have implemented this approach and it works well. Only drawback is that there is no way in the semihosting spec to configure a file descriptor to be async, so it will always block when you do a read.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM