Porting C code that talks to USB

I have C code that runs on Windows that talks to a custom USB device. What’s the best way to port this to a this environment? Do I need to “write” a driver to talk to the device?

This can be difficult as windows talk to USB through its kernel but in embedded systems you will need a special USB library.

GHI’s premium offers have raw USB drivers but you still need to understand USB.

It maybe easier to just reverse engineer the device and not worry about the windows driver.

What device is this?

the device is a spectrometer

I work closely with the vendor and I am investigating a platform to “networkize” their product for one of my customers. What does it entail to write code/driver/stack to enumerate a USB device on the gadgeteer platform? If I have the device specific code, whats’ the cost/difficulty?

It maybe best to contact GHI directly with details on your project.

Sounds like your after a USB/Ethernet converter. Search for them on Google/Bing…


My understanding is that USB to Ethernet convertors provide basic network connectivity (TCP/IP) from the host - for browsing or connecting to devices that are inherently ethernet. They do not (I can 't imagine how they could) convert a random USB device to ethernet so it’s on the network.

Or am I mistaken

Here’s a piece of software that does it: USB over Ethernet: powerful USB over Network sharing software

You can convert anything over ethernet, you just need 2 end-points (one endpoint is a physical device while the other is a device driver) that do the USB protocol abstraction.

I think these do what you want:

I don’t know how these deal with arbitrary USB devices, but there you go.

very cool. thanx

Ah, good somebody found them :slight_smile:

For a small number of devices using a USB<->Ethernet is an easy and relatively inexpensive way to go. If the manufacturer of the device in question wants to sell an Ethernet connected product in large numbers then using a small uC that can do both USB and Ethernet coms would probably be more cost effective.

Just saw that BB Electronics came out with a USB<->Ethernet device.


B&B products are never teh cheapest out there but they are very well made and rugged. I have always found them to be a good value for the money spent.