This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

usb - high speed degredation

Guru 20755 points
Other Parts Discussed in Thread: CCSTUDIO

Hello,

I am trying to measure the speed of usb in both host and device mode. I wanted to try first to understand what value to expect to see in my measurements.

In 

I see that the speed of DM814x depends on several factor , and in most senarios was measured as ~15MB/S, which is, as far as I understand, below the 60MB/S theoretical limit for HS (480Mbit/sec of HS).

Is there any reason why there is such decrease between measurements to high speed maximum value ?

Thank you,

Ran

  • Ran,

    We have something similar with the SPI speed, see below:
    e2e.ti.com/.../1056619

    I would recommend you to check the speed with CCStudio, we have a DM814x EVM USB test that might be used.

    Regards,
    Pavel
  • The 480Mbit/sec is the speed at the PHY level. Some of it goes to data link overhead. The actual data rate depends on the which endpoint, what type of endpoint and support for multiple transfers per frame. Assuming the following:
    - High Speed.
    - Isochronous and Interrupt endpoint, implied is not endpoint 0
    - These endpoints have 1024 bytes per packet
    - These endpoints allow 3 packets per microframe - if supported by HW.
    - High Speed can have a microframe every 0.125ms or 8000 microframes/s.
    The theoretical maximum data rate is
    1024x3x3000 = 24576000 = 24MiB/s
    Other end point types will have a lower rate. In theory, you could have two of the endpoints for 48MiB/s.
  • While the bus is not occupied by periodics (isoc and interrupt), bulk transfer is faster than isoc/interrupt transfers. Theoretically, single bulk endpoint may put 13 transactions per micro-frame.

    512 bytes/transaction x 13 transactions/micro-frame x 8000 micro-frome/sec
    = around 52 Mbytes/sec

    Tsuneo

  • Hi Tsuneo. Rare that I get to talk an USB expert. I stand corrected. I've been dealing with an HID class with a Interrupt endpoint. If I understand correctly, the device can send up to 13 packets of 512 packets or 6656 bytes contiguously within a micro-frame. If there is a break between packets, I am guessing that the device has to wait till the next microframe to send again? What if the packets are not full? Is this chaining of packets implemented in SW or in the HW?
  • Norman Wong said:
    I've been dealing with an HID class with a Interrupt endpoint.

    As of HID interrupt IN/OUT endpoints,

    In the default interface after high-speed enumeration, interrupt endpoint should have 64 bytes (or less) MPS (Max Packet Size, bMaxPacketSize) on the endpoint descriptor. Greater MPS should be placed in an alternate interface. Unfortunately, the in-box HID drivers of Windows/Linux don't provide any way to send Set_Interface to HID device, to switch to an alternate interface. And then, the max transfer speed under the in-box HID drivers is limited to

    64 bytes/transaction x 1 transaction/micro-frame x 8000 micro-frames/sec

    = 512,000 bytes/sec

    You may get more speed over the default endpoint (ie. Set_/Get_Report) than interrupt endpoints. The MPS of the default endpoint is also 64 bytes, but two or more transactions are allowed per micro-frame.

    Tsuneo

  • My HID class has the usual EP0/control and EP1/interrupt. EP1 successfully enumerated with a MPS of 1024. I haven't been able to test whether this value works. I can't modify my Host application to try it out. It is constrained to 64 byte transactions. I do know that with GetReport on EP0, I am getting exactly 1 transaction per microframe. My test case is Windows PC USB Host, Embedded Linux USB Device and a 512 byte report. I am seeing a 512000 bytes/s transfer rate. No idea where to configure more than 1 transaction per microframe.

    Apologies to the original poster for a bit of thread hijack. I guess you can take all this discussion as a guide to calculating the maximum theoretical transfer rate for your situation.
  • Norman Wong said:
    EP1 successfully enumerated with a MPS of 1024.


    What is the Windows version?
    XP and older Windows don't check descriptor integrity so much in enumeration. But since Vista, Windows have introduced strict check for USB spec compliance.

    Norman Wong said:
     I do know that with GetReport on EP0, I am getting exactly 1 transaction per microframe. My test case is Windows PC USB Host, Embedded Linux USB Device and a 512 byte report.

    A large size report, like 512 bytes, is the key to get multiple transactions in a micro-frame at DATA stage of Control transfer. It's the right way for PC OS, Windows / Linux / MacOSX.

    But you got just one transaction per frame.
    Did you check the bus traffic with a hardware analyzer?
    If you would see IN-NAKs at the DATA stage, it should be the evidence that the device doesn't catch up the requests from the host.

    Tsuneo

  • I used to have an Ellisys USB Analyser around but unfortunately I don't have it anymore. My USB HID device driver sends down a 512 byte report to the linux USB Gadget driver. It does break up the report into smaller packets...just not contiguous packets. It is somewhat academic for me right now. My project is moving towards using ethernet instead of USB. Thanks for your expert insight though.