• 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 Bulk In Transaction
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 Bulk In Transaction

    This question is answered
    Yusuf Sekman
    Posted by Yusuf Sekman
    on Apr 16 2012 07:08 AM
    Intellectual330 points

    Dear Friends,

    I am working on implementing Bulk data transfer between C5515USB Stick and PC. I did not use CSL library nor CSL_postTransaction functions. I simply went through usb.c example in t TI directory. Using the code below, I managed to read 64 bytes of data coming from PC. But, I could not send any data to PC. I don't think that the problem is about endpoint or configuration descriptors. What is the problem in my firmware code? Any help will be appreciated. Thanks..

    Regards...

    Yusuf


    //////////////////////////////
    / Initialize Bulk EP1 //
    //////////////////////////////

    USB_INDEX_TESTMODE = 1; // Select Index 1
    USB_RXFIFOADDR = 8; // Select offset 8
    USB_TX_RXFIFOSZ = ((fifosize | ((double_buffer & 1)<<4)) << 8) | (fifosize | ((double_buffer & 1)<<4)); // Buffer size
    USB_TXFIFOADDR = 8 + (1<<(fifosize+double_buffer));

    USB_RXMAXP_EP1 = FIFO_MAXP; // FIFO maximum packet size (value set in the begenning of this file)
    USB_TXMAXP_EP1 = FIFO_MAXP;

    USB_PERI_TXCSR_EP1 = 0x2000; //Configure PERI_TXCSR Register for ;Bulk In Transactions
    USB_PERI_TXCSR_EP1 |= 0x0010; // Flush FIFO
    USB_PERI_RXCSR_EP1 = 0x0000;
    USB_PERI_RXCSR_EP1 |= 0x0010; // Flush FIFO
    //////////////////////////////
    //EP1 interrupt service
    //////////////////////////////

    //EP1 sending a data package to host

    if (ep1_tx == 0x0002)
    {
    fifo_write_ep1(pBuffer16_ep1,64);
    USB_PERI_TXCSR_EP1 |= 0x01; //Set TXPKTRDY (B0 of PERI_TXCSR)
    }

    //EP1 receiving a data package from host

    if (ep1_rx == 0x0200)
    {
    fifo_read_ep1(pBuffer16_ep1_read, 32);
    USB_PERI_TXCSR_EP1 &= 0xFE;
    printBuffer (pBuffer16_ep1_read, 32);
    }
    
    
    void fifo_write_ep1(Uint16 *buf, int size)
    {
    int i;
    USBSCR |= 2; //enable byte access by CPU and LOW-byte is selected
      for (i=0; i<size; i++) 
    {
    USB_FIFO1R1 = *buf;
    buf++;
    }
    USBSCR &= ~0x03; //enable word access by CPU
    }

    void fifo_read_ep1(Uint16 *buf, int size)
    {
    int i;
    USBSCR |= 2; //enable byte access by CPU and LOW-byte is selected
     for (i=0; i<size; i++) 
    {
    *buf = USB_FIFO1R1 ;
    buf++;
    }
    USBSCR &= ~0x03; //enable word access by CPU
    }
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Yusuf Sekman
      Posted by Yusuf Sekman
      on Apr 20 2012 04:27 AM
      Verified Answer
      Verified by Yusuf Sekman
      Intellectual330 points

      I am using USBlyzer USB analyzer software in order to trace the transactions between host and device. According to the output, firmware sends STALL packet when IN transaction request has came.The endpoint should send data in response to IN token packets instead of stalling. Indeed, there is not any stall routine for EP1 in my code as seen above code. Thanks in advance for any help..

      Best...

      Yusuf

      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