Re: [Fx2lib-devel] Negotiating high speed usb mode using libusb
Status: Beta
Brought to you by:
mulicheng
From: Dennis M. <de...@ub...> - 2009-09-21 15:45:52
|
Mark Brooks wrote: > Hi, > > I am using a Cyress EZ-USB FX2 chip. I have been using it in only > full-speed mode up to now, primarily since it is by default enumerated > that way at startup. The chip has the capability to run in "high-speed" > usb mode and the chips descriptor has been build with a "full-speed" and > "high-speed mode" (see below). > > My question is, how does one normally change to high speed mode in usb > devices. Is it in negotiation? Using libusb (0.1.12 verison) should I > change to another configuration using|:| > | int usb_set_configuration(usb_dev_handle *dev, int configuration);| > > > |My device descriptor in the USB chip looks something like this:| > |HighSpeedConfigDescr:: | > | .db 9 ; Descriptor length| > | .db TYPE_CONFIGURATION_DESCRIPTOR ; Descriptor type| > | .db (HighSpeedConfigDescrEnd-_HighSpeedConfigDescr) & 0xFF > ; Total Length (LSB)| > > > |_FullSpeedConfigDescr:: | > | .db 9 ; Descriptor length| > | .db TYPE_CONFIGURATION_DESCRIPTOR ; Descriptor type| > | .db (FullSpeedConfigDescrEnd-_FullSpeedConfigDescr) & 0xFF > ; Total Length (LSB)| > > |Anyone had any experience with this?| Hi Mark, Since you're showing assembly code for your device descriptor, I'm assuming you are developing your own firmware on the fx2. You might enjoy participating in the fx2lib mailing list [1]. Even if you don't use the library, we have some good information on fx2 firmware development now and then. As for your specific question, it takes a few things to get your device into high speed mode. 1) The device qualifier descriptor needs to be present to tell the system there is a usb2 descriptor available. 2) The OS reads the other speed descriptor and then sends the high speed interrupt. 3) you have to serve the full speed descriptor until you get the interrupt and then you start serving the high speed descriptor in response to the device config request. On a side note, fx2lib has routines that handle all this for you. (So does the Cypress/Keil firmware framework but fx2lib is written with SDCC and all LGPL). As for libusb, you don't have to do anything special. The library is used the same whether you are in full speed or high speed mode. -Dennis [1] http://sourceforge.net/mail/?group_id=247216 |