Page 1 of 1
RS422 doesn't work in Win XP guest
Posted: 30. Mar 2012, 23:18
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.
Re: RS422 doesn't work in Win XP guest
Posted: 31. Mar 2012, 11:49
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?
Re: RS422 doesn't work in Win XP guest
Posted: 31. Mar 2012, 17:06
by kdar1987
Default baudrate is set to 115200.
Re: RS422 doesn't work in Win XP guest
Posted: 31. Mar 2012, 19:14
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.
Re: RS422 doesn't work in Win XP guest
Posted: 31. Mar 2012, 19:26
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?
Re: RS422 doesn't work in Win XP guest
Posted: 1. Apr 2012, 11:31
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.
Re: RS422 doesn't work in Win XP guest
Posted: 2. Apr 2012, 04:10
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.
Re: RS422 doesn't work in Win XP guest
Posted: 4. Apr 2012, 16:36
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?
Re: RS422 doesn't work in Win XP guest
Posted: 4. Apr 2012, 16:59
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.