[ 2004-February-01 16:20 ]
I have developed a few USB devices. First, my fourth year design project as part of my degree in Computer Engineering at the University of Waterloo was a USB Oscilloscope. It was built using an Altera Excalibur FPGA development board and the OpenCores USB1.1 IP Core. My second USB device is a Super Nintendo controller USB adapter, currently under development. Here is a collection of tips that I have on debugging USB devices.
- Get an established reference design working first. The USB descriptors are complex and easy to screw up. Do not modify them until you have the PC recognizing the device correctly.
- The USB specification is your friend. It is massive, but it contains everything you really need.
- Use Linux. The information that is generated by the Linux kernel with the USB debugging option enabled is very useful. It will report that it thinks a device is connected and will dump parts of the descriptors. I don't even know how to get this information from Windows.
- Use libusb to avoid writing a device driver. Libusb is a user space USB library. It only supports bulk reads and writes, but provides a straightforward interface. It sure beats writing a driver for simple devices. There is a Windows port as well, but I didn't have much success with a very early version.
- Prototype your descriptors and your device using an easy device, like Cypress's EZ-USB. You can hack an existing device and download different firmware to it. It provides a very nice development environment.
- Use HID Explorer to view your HID device report descriptor, as seen by your Mac OS X machine.