RS422 doesn't work in Win XP guest

Discussions about using Windows guests in VirtualBox.
Post Reply
kdar1987
Posts: 9
Joined: 30. Mar 2012, 17:19

RS422 doesn't work in Win XP guest

Post by kdar1987 »

I am running Windows 7 as my host and Windows XP is a VirtualBox guest install.

I set up two serial ports, one is COM1 and another COM2. COM2 is RS232 and COM1 is RS422. COM2 works fine, no problems. But COM1 returns an error when it tries to contact one address... It recognizes the address and tries to contact it, but fails with message "address response(s) could not be reconciled". What can be the problem? I set both COM ports in Guest settings are Host Device.

I will really appreciate any help. I need to get this working badly.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: RS422 doesn't work in Win XP guest

Post by mpack »

I'm sure the RS422 part works just fine. It sounds like you are using an addressable protocol on top of that, and it's the protocol which is failing, probably due to timing latencies. What bit rate is this running at?
kdar1987
Posts: 9
Joined: 30. Mar 2012, 17:19

Re: RS422 doesn't work in Win XP guest

Post by kdar1987 »

Default baudrate is set to 115200.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: RS422 doesn't work in Win XP guest

Post by mpack »

No way a speed that high is going to work in a VM. The UART being simulated is a 16450, so no FIFO buffers. Every character transmitted or received involves a (virtual) interrupt, with all the latencies you would expect of a VM context switch. That's an enormous overhead.

Direct comms to a USB/422 adapter might work, but otherwise I'd be surprised if you got any joy with it.
kdar1987
Posts: 9
Joined: 30. Mar 2012, 17:19

Re: RS422 doesn't work in Win XP guest

Post by kdar1987 »

Ah.. thanks. That's why... I wasn't aware of this limitation.
Now it makes more sense why my COM2 worked, one for communication, since I was polling it at 9600 rate.
I might try to poll COM1 at 9600, if I can.
====
I think I might try USB/422 adapter option too. It would be treated as a USB device by VirtualBox, right? But I will able to make it appear as regular COM port to guest Win XP?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: RS422 doesn't work in Win XP guest

Post by mpack »

XP supports plug and play USB serial devices, I know because I use USB/RS485 adapters on XP machines at work. To an XP app it's just another comm port, though some older apps have problems if XP assigns a comm number >= 10.

Just be sure to Google "USB and site:forums.virtualbox.org", as lots of newbies have trouble getting USB to work, for a variety of reasons.
kdar1987
Posts: 9
Joined: 30. Mar 2012, 17:19

Re: RS422 doesn't work in Win XP guest

Post by kdar1987 »

It kind of makes sense to me.
VM will treat it like a USB device and whatever I try to use COM1 for in guest session will think it is a COM port.
Hopefully I will able to try this tomorrow. Thanks in advance.
kdar1987
Posts: 9
Joined: 30. Mar 2012, 17:19

Re: RS422 doesn't work in Win XP guest

Post by kdar1987 »

What is the reason what simulated UART in VirtualBox is 16450? Will this be ever changed in VirtualBox to change to more recent simulation of UART with support for FIFO buffers?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: RS422 doesn't work in Win XP guest

Post by mpack »

kdar1987 wrote:What is the reason what simulated UART in VirtualBox is 16450?
It just is. My main work is in the embedded world where a "System On a Chip" processor is sometimes used, these often include an onboard UART implementation - and it's often the same there, i.e. a 16450 UART is simulated, instead of a 16550. So instead of using your standard 16550 driver you typically have to write a new driver to use their more complicated DMA feature if you want to avoid overhead and data loss (not an option available to you). I guess it's because the UART is often an afterthought.
kdar1987 wrote:Will this be ever changed in VirtualBox to change to more recent simulation of UART with support for FIFO buffers?
Only the devs can truly answer questions like that, and they usually don't. In fact there is already code in there that mentions the 16550 - it looks like 16550 support is an option, but I don't know of any way to turn it on, short of building the sources myself of course. I also don't know why it isn't turned on by default: perhaps it didn't work.
Post Reply