write to USB port


I command a robot arm in real time under QNX os and the communication to the robot is via USB port. I just want to know how i can write and read on this USB port. My program in QNX is in C.
thanks you


Take a look at the USB DDK.

Does the robot come with instructions for how to use it as a USB device?

Be wary of what host controller you have. I have found that devu-uhci is very unreliable (fails to reply, SIGSEGVs). I have found that devu-ohci is OK, so if you have an OHCI chip on your host you will have better results.

rgallen. I’ve seen this as well. That was with 6.1. I have found it unreliable only if a bridge was involved.

Brice. It’s not easy as writting to USB port/device. USB specify a protocol and each device class has a different protocol. You Robot may have a custom protocol or could be bases on serial over USB protocol. Unfortunately I don’t think QNX support the serial protocol (which I guess is what the robot supports).

Once you know the protocol you typicaly implement it in a USB driver written with the help of the SDK.

Mario, thanks for confirming this. It is still there in 6.2.1B (although the 6.2.1B devu-uhci is better than the 6.2.1).

I’ve seen various other postings that seem to confirm this as well.


There is, unfortunatly, no such thing as a serial over USB protocol “standard”. Unike HID, Mass Storage, Printers, etc. It really sucks.

I could have swear ;-) I just check and I got confused with the Communication Device class which indeed is not serial over USB but rather modem over USB (and more then just modem)

Screw the serial over USB, is there any chance of getting a working USB stack over uhci hardware ;-)

The problem we have here is that we have a bunch of hardware (which we want to convert from QNX4 to QNX6) that has UHCI. If you tell me that UHCI hardware is hopelessly broken and will never work, then that’s cool (although it begs the question of why it works on other operating systems), otherwise a fixed devu-uhci would be a big help…

The 6.2.1B version of devu-uhci is about 99 % (vs maybe 98% for 6.2.1) reliability, unfortunately for industrial control that just ain’t good enough (we need at least 4 nines).

The problems come when unplugging and re-plugging devices, and under heavy load (when my driver has approx 800 outstanding 64 byte URBs - mixture of in/out).

The identical tests that produce failures with devu-uhci, work fine with devu-ohci (although devu-ohci occasionally fails to recognize a device that is already plugged in when it starts).

The failures manifest as either devu-uhci failing to reply (my driver has submitted URBs that never complete when there is clearly data arriving at the controller), or devu-uhci faults. The no-reply state is more common than the SIGSEGV state.

TIA for any, and all, help.

rgallen - I would talk to your sales rep and see if you can’t get into the 6.3.0 beta. There is a new usb stack (io-usb) that might fix the problems you are seeing.

thanks for your answer, i begin with QNX, that s why i answer so late.
to comunicate with the robot, i use a USB controller, the AT43USB355 from ATMEL
because I need an USB/SPI interface.
In fact, I just have to send a byte and receive one and reapeat this to command the robot.
I can configure the USB controller for any USB transfert. and I just want to Know if someone is able to do this and if it’s possible!!!



brice - read the USB ddk. It shows you how to write device interfaces under QNX for USB. The USB standard isn’t a simple serial interface like RS232, so it isn’t as simple as reading/writing a byte value to the USB “port”.