• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » C5000 Ultra Low Power DSP » C5000 Ultra Low Power DSP Forum » USB Enumeration Problem on EZDsp5535 kit
Share
C5000 Ultra Low Power DSP
  • Forum
  • Announcements
Options
  • Subscribe via RSS
Top 6 Wiki Links
  • C5000 Main Wiki
  • C5000 Software
  • C5515 Boot-Image Programmer
  • CSL (including CSL 3.00)
  • C5000 Connected Audio Framework
  • Porting C5000 Teaching ROM to C5535 eZdsp
  • Forums

    USB Enumeration Problem on EZDsp5535 kit

    This question is answered
    Bruno Paillard
    Posted by Bruno Paillard
    on Feb 08 2012 08:36 AM
    Intellectual430 points

    Dear TI staff

    I am working on the USB aspects of the EZDsp5535.

    I based the USB firmware layer on CSL_USB.

    I notice that when enumerating in High-Speed, sometimes (once every 10 or 20 connections) the first GetDeviceDescriptor request from the host (just after the SetAddress request) is not acked. The host transmits 3 GetDeviceDescriptor requests in a row. None are acked. Then the host resets the bus, and starts enumerating again. Most of the time the second attempt, after the USB reset, succeeds.

    At first I suspected my code. However, it appears that the Connected-Audio-Framework software does the same thing. To demonstrate, simply rebuild the Connected-Audio-Framework demo, simply comment-out the call to USB_setFullSpeedMode() in csl_usb_iso_fullspeed_example.c, so the demo will enumerate in high-speed.

    I know that it is not proper to have an audio-class 1.0 device enumerate in high-speed, but that is irrelevant here because:

    - A Windows host will enumerate a high-speed Audio-Class 1.0 device normally (as if it was full-speed)

    - The problem occurs at the first GetDeviceDescritor request, just after the initial SetAddress request. At that time the host does not yet know that the device is audio-1.0. All it knows is that it just addressed a new device on the bus, and is trying to read its device descriptor.

    Thank you for your help

    Regards

    Bruno

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Steve Tsang
      Posted by Steve Tsang
      on Feb 08 2012 10:37 AM
      Genius12655 points

      Hello Bruno,

      Let me try to answer your question.

      When a device is attached to a hub, the hub will inform the host and perform reset to the new device (I think this is what you see). The spec requires the host waits at least 100ms for the new device and hub to complete their process. The host will then read the device descriptor to determine how to interface to the device. This is where the speed mode is determine.

      Does this explains what you see?

      Regards.

      -------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question

      --------------------------------------------------------------------------------------------------------

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Bruno Paillard
      Posted by Bruno Paillard
      on Feb 08 2012 11:05 AM
      Intellectual430 points

      Hi Steve

      Not quite.

      On a Windows high-speed-capable host the enumeration proceeds as follows: (probably on other hosts as well, although the exact sequence may vary a bit from host driver to host driver).

      1) The host detects the newly connected device (in full speed)

      2) The host then attempts to negotiate high-speed with the device (sends the high-speed chirp and waits for the response). If the device is high-speed capable the host and device switch to high-speed signaling.

      3) The host then sends an initial GetDeviceDescriptor request. The device is not addressed yet, but it must respond to that request at address 0.

      4) After parsing that descriptor  the host then resets the bus and renegotiates the high-speed transition

      5) The host addresses the device (sends a SetAddress request). At that time the device has its address, and will stop responding to address 0, and respond to the newly-defined address.

      6) After addressing the device the host sends a new GetDeviceDescriptor request, but this time at the newly-defined device address. This is the first step in discovering the complete set of device descriptors.

      The problem that I see occurs at step 6. The host has sent the SetAddress request, which the host has acked. At that time the device is supposed to respond at the new address. Then the host sends the GetDeviceDescriptor request, which the device DOES NOT ACK.

      The host then proceeds to send 2 more GetDeviceDescriptor requests very close together (within 5 us of each other). The device does not ack either of them. Then the host resets the bus and does everything again from the top. The second time around the device usually responds correctly.

      Everything looks like the device has not programmed its address register properly after the SetAddress request.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Michael W
      Posted by Michael W
      on Feb 21 2012 12:46 PM
      Expert3285 points

      Hello Steve,

      Do you have an update on this?

      Regards,

      Michael W

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Steve Tsang
      Posted by Steve Tsang
      on Feb 21 2012 14:28 PM
      Genius12655 points

      I am working on capturing an USB transaction with an USB bus protocol analyzer.

      Regards.

      -------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question

      --------------------------------------------------------------------------------------------------------

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Bruno Paillard
      Posted by Bruno Paillard
      on Feb 21 2012 14:32 PM
      Intellectual430 points

      Hi Steve

      Let me know if you need me to capture one. I should not be too difficult to set up the test again.

      Bruno

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Steve Tsang
      Posted by Steve Tsang
      on Feb 21 2012 17:18 PM
      Genius12655 points

      Hi Bruno,

      Yes. Please.

      Regards.

      -------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question

      --------------------------------------------------------------------------------------------------------

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Bruno Paillard
      Posted by Bruno Paillard
      on Feb 21 2012 17:47 PM
      Intellectual430 points

      Hi Steve

      I made a file for TotalPhase's Beagle 5000. If you do not have that analyzer, the software is downloadable for free from the www.totalphase.com web site.

      The file is almost 3 MB. It is zipped. You can download it from

      http://dl.dropbox.com/u/24636754/C5535EZDsp_EnumProblem.zip

      The problem is visible at index location 5059

      Let me know how it goes.

      Regards

      Bruno

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Steve Tsang
      Posted by Steve Tsang
      on Feb 21 2012 17:50 PM
      Genius12655 points

      Thanks. I will check it out.

      Regards.

      -------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question

      --------------------------------------------------------------------------------------------------------

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Steve Tsang
      Posted by Steve Tsang
      on Mar 01 2012 11:16 AM
      Genius12655 points

      Hello Bruno,

      We know the csl example works. You cannot just comment out the call. Instead, change it to USB_setHighSpeedMode() and try again.

      Regards..

      -------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question

      --------------------------------------------------------------------------------------------------------

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Bruno Paillard
      Posted by Bruno Paillard
      on Mar 01 2012 12:45 PM
      Intellectual430 points

      Hi Steve

      1) There is no mention of USB_SetHighSpeedMode() function (or any similar function) in the USB CSL library documentation. I am using the html documentation that is supposedly the most up-to-date document.

      2) If I try to use that name in the code the project does not link with an error indicating that the above function is not resolved.

      I must conclude that the function you are referring to does not exist...!

      Should I be talking to someone else...?

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Steve Tsang
      Posted by Steve Tsang
      on Mar 01 2012 15:49 PM
      Genius12655 points

      Hi Bruno,

      We took this capture with USB example 3 in CSL 2.50 release at High Speed. I attached the host driver for this to work.

      .1731.C5505_USB_Host_Tool.zip

      In order to get the Connected-Audio-Framework demo to work in high speed requires additional modifications. It is entered as an enhancement request for future CSL release.

      Thanks.

      -------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question

      --------------------------------------------------------------------------------------------------------

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Bruno Paillard
      Posted by Bruno Paillard
      on Mar 02 2012 06:49 AM
      Intellectual430 points

      Hi Steve

      I am not interested in the audio-class implementation, but I had hoped to reuse the USB framework in another design. From your answer I guess this is not a good idea...

      Do you have any information about the "additional modifications" required to make that framework respond reliably to the SetAddress request in high-speed?

      I notice that the example that you demonstrate does all the USB processing in the interrupt. Could it be a question of response time?

      Thank you for your help

      Bruno

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Bruno Paillard
      Posted by Bruno Paillard
      on Mar 18 2012 21:51 PM
      Verified Answer
      Verified by Michael W
      Intellectual430 points

      Hi Steve

      I finally found the problem in project "CSL_USB_IsoFullSpeedExample_ezdsp_Out". It is located at lines 556 and 557 of app_usb.c

      In those lines the PERI_CSR0_INDX register is updated in two separate steps:

      1)   usbRegisters->PERI_CSR0_INDX |= CSL_USB_PERI_CSR0_INDX_SERV_RXPKTRDY_MASK;
      2)   usbRegisters->PERI_CSR0_INDX |= CSL_USB_PERI_CSR0_INDX_DATAEND_MASK;

      Between step 1 and step 2 there is a window of opportunity for the host to send the next IN packet, BEFORE the DATAEND bit has been set, thereby triggering a SetupEnd error condition.

      This happens during the handling of a number of other requests (for instance lines 431-432, 443-444...etc.). But in those other cases the error is more benign because the processing is done immediately and the error is cancelled at the next setup packet (at the next request). This is fatal for Set-Address however because the processing of this request is performed in the CSL_USB_EP0_STATUS_IN stage of the request... And does not get processed when the error occurs.

      In order to correct the problem, both flags should be set at once, as in:

      usbRegisters->PERI_CSR0_INDX |= (CSL_USB_PERI_CSR0_INDX_SERV_RXPKTRDY_MASK | CSL_USB_PERI_CSR0_INDX_DATAEND_MASK);

      By the way, the problem ALSO OCCURS IN FULL-SPEED in that example project, not just in high-speed as I said earlier.

      The USB Command Verifier is a very good way to demonstrate the problem because of the 150 consecutive enumerations... The probability of the error is high-enough that the device never goes through all the 150 enumerations.

      Also, you may want to check the handling of other requests, because that example DOES NOT PASS several of the other tests of the USB Command Verifier.

      Hope this helps. Don't hesitate if you have any question.

      Regards

      Bruno

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Steve Tsang
      Posted by Steve Tsang
      on Mar 19 2012 12:50 PM
      Genius12655 points

      Bruno,

      Thanks. I have logged it for CSL development.

      Regards.

      -------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question

      --------------------------------------------------------------------------------------------------------

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use