views:

675

answers:

6

I have a Linux virtual machine running on VMWare Fusion (on Mac OS X) that I intend to use as a development environment for an embedded system. Would it be possible for my Linux VM to talk to my embedded system's serial port using a USB-to-serial adapter? Any recommendations for what sort of adapter I should get?

A: 

Depends upon the VM software, but VMWare Fusion does support USB devices. The question becomes, does your IDE support talking to a USB device instead of an old-fashioned serial port? With Linux, probably yes.

Craig Trader
screen /dev/ttyUSB0 or gdb -> target remote /dev/ttyUSB0 is all the IDE I need.
sigjuice
+5  A: 

There are two ways to do it:

  1. Your host-OS supports your USB<->serial converter (very likely). If so you can just allow your VM to talk to the serial port. If so the VM will see a standard serial port and everything will be fine.

  2. Your guest-os in the VM supports the USB<->serial converter, AND your host-OS allows raw USB forwarding.

All in all the chances are good that it works..

Btw: there are good and bad USB<->Serial converters. If you find out that the serial connection seems to work (everything detects/works as expected for a couple of seconds), but you can't get a reliable connection for a longer time, then it's very possible that the usb<->serial dongle sucks....

You get what you pay for... When buying these things I'd check comp.arch.embedded and ask which usb dongles are known to just work, and which not. (My recommendation is to stick with products from Assmann. You can order them at digikey).

Nils Pipenbrinck
I'll second your comment about serial converters. We once bought some USB<->serial adapters for work. But we found that they dropped characters. On the other hand, I had a different brand that worked perfectly.
Craig McQueen
I agree that USB<-->Serial converters can be hit or miss. When using them with an embedded system, make sure that the embedded board runs on three-wire serial (requires only TX/RX/GND) and doesn't require any of the handshaking signals as many USB<-->Serial adapters don't use the other pins (CTS, RTS, etc). The serial ports on embedded boards can be a little pickier about signal quality, so I would avoid the $1.99 adapters. If you're lucky, the techs at your friendly local computer shop might have one you can test before you buy, so bring your board with you if you can.
bta
A: 

I had no problems whit serial adapters from ATEN.

USB serial adapter is USB standard device (just like mass storage) that mean that any USB compliant adapter should work.

ralu
A: 

I just picked up a USB 1.1 - RS232 adapter (Digitus DA-70119) from WeirdStuff for 10 bucks. I plugged it into my Mac mini and VMWare Fusion showed me this.

alt text

Once I clicked on the USB icon, my Ubuntu 9.10 VM had no trouble seeing it

$ lsusb
Bus 002 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

$ dmesg
    usb 2-1: new full speed USB device using uhci_hcd and address 4
    usb 2-1: configuration #1 chosen from 1 choice
    pl2303 2-1:1.0: pl2303 converter detected
    usb 2-1: pl2303 converter now attached to ttyUSB0

I can now use /dev/ttyUSB0 in my Linux VM to talk to my target system.

sigjuice
+1  A: 

I've found USB serial adaptors to be a bit hit & miss with embedded work. One thing to be aware of is that the buffering tends to work differently from "real" serial ports, and latency of characters through the system can be quite variable. Some embedded development systems (think bootloaders, cheap JTAG probes etc) can be quite sensitive to this and will give timeouts and so on.

Note this doesn't only apply to USB serial adaptors, I've had similar problems with high end multi-port serial cards, but usually with those you can tweak the FIFO / IRQ settings to get something working.

quietbob
Thanks for the tip. I guess I will find out once I start doing some real work. So far, all I have done is "screen /dev/ttyUSB0" in the VM and "screen /dev/tty0" on a connected Linux system. Whatever I type on end shows up on the other.
sigjuice
A: 

pl2303: I have found this device to be very reliable and are often in the generic and cheap USB to RS232 adapters. I've seen expensive adapters fail and my generic adapter from geeks.com work great.

steve