• 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 » Embedded Software » StarterWare » StarterWare forum » usb_dev_bulk: cannot use FIFO 1024 bytes or larger?
Share
StarterWare
  • Forum
Options
  • Subscribe via RSS

Forums

usb_dev_bulk: cannot use FIFO 1024 bytes or larger?

This question is answered
Jonathan Chen
Posted by Jonathan Chen
on Apr 03 2012 16:16 PM
Intellectual635 points

StarterWare AM1808 1.00.03.03 usb_dev_bulk example

Adjusting library code at usblib / device / usbdbulk.c

  • #define DATA_IN_EP_FIFO_SIZE USB_FIFO_SZ_1024 // enumerates, but has problems described in a later post
  • #define DATA_IN_EP_FIFO_SIZE USB_FIFO_SZ_2048 // cannot enumerate
  • #define DATA_IN_EP_FIFO_SIZE USB_FIFO_SZ_4096 // cannot enumerate
  • in all cases
    - #define DATA_OUT_EP_FIFO_SIZE   DATA_IN_EP_FIFO_SIZE
    - examples / usb_dev_bulk / usb_bulk_structs.h: #define BULK_BUFFER_SIZE 4096

By "cannot enumerate" I mean on Windows hosts in Device Manager: "This device cannot start. (Code 10)"

am i missing something? thanks!!

StarterWare USB usb device usb_dev_bulk
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Jonathan Chen
    Posted by Jonathan Chen
    on Apr 03 2012 17:33 PM
    Intellectual635 points

    Is this why?

    sprufw6b.pdf section 2.6:

    • "The USB controller supports a total of 4K RAM to dynamically allocate FIFO to all endpoints."
    • "The Endpoint 0 FIFO has a fixed size (64 bytes)"

    Therefore RX(2048) + TX(2048) will be too big? But then why can't I set, say, the IN FIFO to 1024 and the OUT FIFO to 2048? Is there a symmetry requirement?

    Are the 2048 and 4096 options vestigial?  (E.g., work for OMAP-L138?) And what does the "biju" comment mean for 8192?


    Alternatively, USB in a nutshell: Maximum data payload size for high-speed devices is 1024 bytes. [but isn't packet > payload?]? But then, why are the 2048, 4096, 8192 options even available at all?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Naga Sirish Kumar Sannala
    Posted by Naga Sirish Kumar Sannala
    on Apr 05 2012 06:49 AM
    Prodigy515 points

    Hi Jonathan Chen,

    The 4K restriction is true for Dynamic FIFO configurations only.

    The StarterWare USB stack supports endpoint FIFOs and have been tested for FIFO size 64.

    Are you testing the bulk class application provided with StarterWare?

    Can you please let us know the reason for your trying to go for FIFO sizes up to 4k please?

    have you made any changes to use DMA in your application?

    Regards

    Sirish

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jonathan Chen
    Posted by Jonathan Chen
    on Apr 05 2012 08:50 AM
    Intellectual635 points

    Dear Sirish,

    Yes, I am testing the StarterWare AM1808 usb_dev_bulk example, no changes to DMA in the example or the library code.

    Reasons for changing FIFO size:

    • curiosity while testing custom host (PC) code, using libusb-1.0
    • problems with PC code for a bulk IN transfer that is exactly the FIFO size
      - if I can't fix my PC code, I would at least want to maximize FIFO/packet size
      - see this thread

    Newer observations from my testing with usb_dev_bulk, using the same size FIFO for Tx and Rx (this is probably required for loopback?):

    • all FIFO sizes from 8-512 seemed to work correctly
    • transfer problems were encountered for 1024 + usb_bulk_example.exe (modified to allow 1024 input)
      - host bugs out for transfers greater than 950 bytes and requires hard shutdown to release USB device!
      - smaller transfers still work fine
      - enumeration still works fine
    • as before, 2048 and 4096 do not enumerate

    Thank you!
    Jonathan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jonathan Chen
    Posted by Jonathan Chen
    on Apr 06 2012 10:50 AM
    Verified Answer
    Verified by Anonymous
    Intellectual635 points

    Also, from sprufw6b.pdf Section 2.7.1.2.1.2

    the payload (packet size) for transfers over the USB and is required by the USB Specification to be either 8, 16, 32, 64 (Full-Speed or High-Speed) or 512 bytes (High-Speed only)

    Further testing with EVM as a Full Speed device (default was High Speed)

    • FIFO sizes 8, 16, 32, 64 all enumerate and work correctly
    • FIFO sizes 128, 256, 512, 1024, 2048, 4096 all fail to enumerate

    This pretty much explains the problem, although there are some outstanding mysteries:

    • Why does FIFO size 1024 enumerate at high speed, and work for packets up to ~800 bytes?
      - host reads wMaxPacketSize = 1024
      - I guess since this is a non-standard value, USB controller hardware is bugging out somewhere?

    • Why do FIFO sizes < 512 work at high speed?
      - USB 2.0 specification section 5.8.3 [emphasis mine]

      All Host Controllers are required to have support for 8-, 16-, 32-, and 64-byte maximum packet sizes for
      full-speed bulk endpoints and 512 bytes for high-speed bulk endpoints. No Host Controller is required to
      support larger or smaller maximum packet sizes.

      - high-speed host controller on my PC is a bit forgiving?
    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