• 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 » Microcontrollers » Stellaris® ARM® Microcontrollers » Stellaris® ARM® LM3S Microcontrollers Forum » USB Bulk with CLI (Command Line Interface)
Share
Stellaris® ARM® Microcontrollers
  • Forum
Options
  • Subscribe via RSS
Helpful Stellaris® LM4F Series Links
  • LM4F Series
  • Stellaris PinMux Utility
  • Stellaris® LM4F120 LaunchPad
  • LM4F MCU Applications
  • LM4F MCU Video
  • ARM Cortex-M4F Whitepaper
  • Stellaris MCU Brochure
  • LM4F232 Eval Kit
  • Forums

    USB Bulk with CLI (Command Line Interface)

    This question is not answered
    Ehud BenHagai
    Posted by Ehud BenHagai
    on Apr 28 2012 09:17 AM
    Prodigy50 points

    04/28/2012

    Hello everybody. I need some help

    I wish to design a simple cli between the host - PC and the device - Stellaris MCU LM3S9xxx. using USB bus

    The host sends short text messages the device decodes the commands and send a response back to the host.

    My problem is with a dialog involved transfer large buffers (16KBytes) from the device to the host in response to a request from the host

    I am not clear about how to do this. I started from the USB_Bulk example but I can't find a simple way how to modified example to make the device send this buffer

    in response to the host request

    Any help is very appreciated

    Ehud

     

    LM USB
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Kendall Witte
      Posted by Kendall Witte
      on Apr 30 2012 14:35 PM
      Intellectual1320 points

      Ehud,

      It's not clear to use what will be the best solution for you.  Sending back the 16K buffer as text bytes should work, but may be too slow.

      Using a composite device with a bulk transfer device and a character device should also work, but we don't have sample code for exactly this.  It's certainly not clear to us how you would plan to synchronize these devices.

      KC Witte

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Ehud BenHagai
      Posted by Ehud BenHagai
      on May 01 2012 10:32 AM
      Prodigy50 points
      adc_iir_usn_v2.zip

      Hello KC. Thank you very much for your response

      "It's not clear to use what will be the best solution for you"

      At this point speed is not that critical I just need it to work correctly.

      I can send a command from the host to the device "SendBuf". the device transfer buffer back

      The size of the buffer as much as I define: #define BULK_BUFFER_SIZE        256

      When I define#define BULK_BUFFER_SIZE       1024 I get about 1KB  . If I need for instance 16KB I can simply repeat this command 16 times in a for loop

      I have one issue with my code - it send only BULK_BUFFER_SIZE  -7. the 7 is the length of the command itself "SendBuf" and I can't get rid of it.

      Can you take a look at my code and see if you can come up with an idea how to make it transfer exactly 1KB?

      Thank you in advance

      Ehud Benhagai

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Kendall Witte
      Posted by Kendall Witte
      on May 02 2012 16:01 PM
      Intellectual1320 points

      Ehud,

      I'm not quite clear on what is happenning here.  Are the first seven characters after you send the SendBuf command the echoed "SendBuf"?  If so, I suspect you don't want to call EchoNewDataToHost before sending your buffer.  If this isn't what you're seeing, can you provide a little more detail?

      KC Witte

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Ehud BenHagai
      Posted by Ehud BenHagai
      on May 03 2012 10:46 AM
      Prodigy50 points
      usb_bulk_example_Rev_7xxx.zip

      Hello KC

      I  attach the ost side project so you may try to run it and see what is going on. The problem is that the available space for transmission is is 248 not 256 as I ecpect so I get only the first 248 elements in the Tx buffer correctly and the last 7 are not. I can't understand why and may be you can help here

      Actualy I solve this problem by increasing the #define BULK_BUFFER_SIZE        256 to 320. Then everything works OK

       

      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