Solved

How do I mount a USB to Serial adapter in FreeBSD 5.5?

Posted on 2008-06-10
10
2,726 Views
Last Modified: 2013-12-06
I need a serial port for development of an embedded system in FreeBSD 5.5. I'm currently running FreeBSD 5.5 in VMware Fusion on OS-X. I have a Keyspan USA-19HS USB to Serial adapter, but if some other USB to Serial device would work more easily, I would happily purchase a different device as part of the solution.

I can mount the serial device on the OS-X host, but sadly, VMware Fusion will not allow me to share the serial device on the host with the FreeBSD system. However, I believe I can mount the raw USB device just fine on FreeBSD--when I plug in the device I see this message in /var/log/messages:

Jun 10 16:43:53 development kernel: ugen0: Keyspan, a division of InnoSys Inc. Keyspan USA-19H, rev 1.10/1.00, addr 2

and when I look in /dev:

crw-r--r--   1 root  operator  228,   1 Jun 10 13:41 ugen0.1
crw-r--r--   1 root  operator  228,   2 Jun 10 13:41 ugen0.2
crw-r--r--   1 root  operator  228,   3 Jun 10 13:41 ugen0.3

If someone can help me to mount this USB device as a serial port, I think I'd be in great shape. Any help will be greatly appreciated,

Andy
0
Comment
Question by:andywiese
  • 5
  • 5
10 Comments
 

Author Comment

by:andywiese
Comment Utility
The problem may be more difficult than I thought. I found this maillist post on a similar topic:
http://osdir.com/ml/os.freebsd.devel.mobile/2002-09/msg00357.html
Which mentions the need to load new firmware onto the Keyspan (and I can't find that firmware). As said above, any other USB to Serial adapter which would work more easily would be fine as a solution.
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
There is no "mount" involved.

Please post what "usbdevs -d -v" say.
Try "kldload ucom" and kldload anything else you find on "man ucom"

They say "contact support departament"
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
Link you found provides device identification information for FreeBSD with description what is this device under that ID
0
 

Author Comment

by:andywiese
Comment Utility
Thank you! I feel like this gets me closer. It looks like the keyspan is recognized by usbcontroller, and I see
/dev/ugen
/dev/ugen0.1
/dev/ugen0.2
/dev/ugen0.3

# usbdevs -d -v
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
  uhub0
 port 1 addr 2: full speed, power 100 mA, config 1, Keyspan USA-19H(0x0121), Keyspan, a division of InnoSys Inc.(0x06cd), rev 1.00
   ugen0
 port 2 addr 3: full speed, self powered, config 1, VMware Virtual USB Hub(0x0002), vendor 0x0e0f(0x0e0f), rev 1.00
   uhub1
  port 1 powered
  port 2 powered
  port 3 powered
  port 4 powered
  port 5 powered
  port 6 powered
  port 7 powered

Next, kldload seems to say that ucom is loaded:

# kldload -v ucom
kldload: can't load ucom: File exists

man ucom says (iiuc) that device should appear as /dev/ucom*, but I don't see any of those in /dev

I did not understand your comments about "contact support department" or your last comment about device identification information. Can you explain a bit more what you meant there?
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
I wanted you to look into manual page for other usb serial chipsets. uvisor is obvious miss, but others may do.
Maybe you can install driver into OS-X and use it as normal serial port? I doubt there is FreeBSD firmware loader available. Maybe it is just as easy as copying firmware file to usb config space - who knows - it takes lots of time looking into linux driver to write FreeBSD one.
Reference to support because I was dropped into 404 when looking for them Solaris driver.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:andywiese
Comment Utility
I was traveling and couldn't get back to you for a few days, sorry.

I tried to load the serial port in os-x and share that with the vm, but vmware does not allow this on os-x (unlike other platforms). Too bad! I want to be able to use a usb-to-serial in a native freebsd anyway, and I think your help has gotten me close.

I think understand the serial-adapter drivers now better now. Please tell me if this is not correct:
- the ucom driver is the general usb-to-serial driver that provides the /dev/ucom.* device.
- the ucom driver uses one of the hardware-specific drivers such as (on my 5.5 system) uftdi(4), umct(4), uplcom(4),  uvscom(4).
- If I plug in a usb-to-serial device that is recognized by one of those drivers, it should just appear as a ucom.* device.

My problem appears to be that I don't have a supported usb-to-serial. The uplcom driver supports IOGear UC-232A. I have ordered an IOGear GUC-232A from amazon with arrives today. I will see if that is close enough to work.



 If I understand right, the serial port should appear as a /dev/ucom.* if I use a usb-to-serial that is supported by one of these drivers. (if I have the ucom and
0
 
LVL 61

Accepted Solution

by:
gheist earned 500 total points
Comment Utility
1) Yes - you are right
2) no - ucom is generic device class driver (as defined by USB-SIG) others are hardware-specific for hw makers that does not support usb communications class (BTW most mobile phones work with standard ucom driver)
3) Yes.

You will have to insert device identifications from usbdevs into driver file and recompile kernel (and submit patch to FreeBSD)
driver file is here:
/usr/src/sys/dev/usb/uplcom.c

static const struct uplcom_product {
// blah blah
} uplcom_products [] = {
//add it here in array.
};

Otherwise you will get ugen again.
0
 

Author Comment

by:andywiese
Comment Utility
Got it!
While waiting for the IOGear adapter to arrive, I tried adding the Keyspan adapter to the uplcom.c driver as you described, because I read somewhere that the Keyspan is Prolific based. I think that almost worked... but dmesg reported an error when trying to load keyspan.

When the IOGear adapter arrived, I found that the vendor and product id reported in usbdevs was already in the uplcom_products array. When I plug in that adapter, I get a /dev/ucom0, and dmesg reports: ucom0: Prolific Technology Inc. USB-Serial Controller D, rev 1.10/3.00, addr 2

I learned a lot from this experience. Thank you!

Contact me at andy@bluestem.net if you're interested in FreeBSD consulting for our company.
0
 

Author Closing Comment

by:andywiese
Comment Utility
see my comment. contact me at anderson@cortexatechnology.com if you're interested in freebsd consulting for our home automation system company.
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
Cool! It is almost same with PCI devices if you ever need to fix something there.
Maybe try puc.c for keyspan device id if you need some computer excersizes.
IOgear device names looked similar to supported one. Keyspan makes about 20 different USB serial adaptors and maybe one of them is prolific based and another supports USB comm class.

Thanks for offer, I am on the other side of globe, so Ill better stay with this website along with my jobs.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
Teach the user how to delpoy the vCenter Server Appliance and how to configure its network settings Deploy OVF: Open VM console and configure networking:
Teach the user how to use create log bundles for vCenter Server or ESXi hosts Open vSphere Web Client: Generate vCenter Server and ESXi host log bundle:  Open vCenter Server Appliance Web Management interface and generate log bundle: Open vCenter Se…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now