• 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.c Starterware and SYSBIOS
Share
StarterWare
  • Forum
Options
  • Subscribe via RSS

Forums

usb_dev_bulk.c Starterware and SYSBIOS

This question is not answered
Vincent St-Pierre
Posted by Vincent St-Pierre
on Feb 16 2012 14:38 PM
Intellectual540 points

Hi all,

I try to create a USB communication (Bulk), i use ccs 5.1, Starterware 1.10.02.02 and SYSBIOS 6.

I joint my USB.c file, its mostly the same as the usb_dev_bulk.c but without the LCD code.

6180.USB.zip

I want to create a task with SYSBIOS that will be run my function : void USB(void) (see in my USB.c) This task will manage all the traffic on the USB. The problem is when i create my task and associate the function void USB(void) to the task, i got this error:

undefined               first referenced
symbol in file
--------- ----------------
USBBufferDataWritten ./USB.obj
USBBufferFlush ./USB.obj
USBBufferInfoGet ./USB.obj
USBBufferInit ./USB.obj
USBBufferSpaceAvailable ./USB.obj
USBDBulkInit ./USB.obj
g_pucUSBRxBuffer ./USB.obj
g_pucUSBTxBuffer ./USB.obj
g_sBulkDevice ./USB.obj
g_sRxBuffer ./USB.obj
g_sTxBuffer ./USB.obj

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "Plasma_Detek_DSP.out" not
built

Does SYSBIOS support the Starterware function?

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Vincent St-Pierre
    Posted by Vincent St-Pierre
    on Feb 23 2012 09:11 AM
    Intellectual540 points

    No one know????  :(

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Slava Bogulmintsev
    Posted by Slava Bogulmintsev
    on Feb 25 2012 13:10 PM
    Prodigy60 points

    you should use:
    usb_bulk_structs.c
    usb_bulk_structs.h
    usbbuffer.c
    usbringbuf.c 

     and link to usblib.lib

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Vincent St-Pierre
    Posted by Vincent St-Pierre
    on Mar 26 2012 14:07 PM
    Intellectual540 points

    I'm still have the same problem...

    look like the usblib.lib can load correctly. Can some one tell my the difference with the cgt and cgt_ccs directory? And do i use debug or release version??? I try de different version but it wont compile... I pretty sure that I do something wrong but i cant find it.

    as you can see i got the file in my project and all the path in the project options

    It's possible that the usblib.lib as something wrong about it?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Vincent St-Pierre
    Posted by Vincent St-Pierre
    on Mar 27 2012 10:02 AM
    Intellectual540 points

    Ok, I finaly find what im doing wrong and i need to include all those lib:

    drivers.lib, ipclite.lib, platform.lib, system_config.lib, usblib.lib, utils.lib

    Now that I can compile my software I got a question, do I need to setup the interrupt with the SYSBIOS? or with this code its all configure:

     /* Initialize the DSP interrupt controller */
    IntDSPINTCInit();

    /* Enable DSP maskable interrupt */
    IntEnable(C674X_MASK_INT5);

    /* Enable DSP interrupts */
    IntGlobalEnable();

    /* Setup the DSP INTC */
    IntDSPINTCInit();
    IntGlobalEnable();

    IntRegister(4, USB0DeviceIntHandler);
    IntEventMap(4, SYS_INT_USB0_INT);
    IntEnable(4);

    //Delay timer setup
    DelayTimerSetup();

    // Initialize the transmit and receive buffers.
    USBBufferInit((tUSBBuffer *)&g_sTxBuffer);
    USBBufferInit((tUSBBuffer *)&g_sRxBuffer);

    // Pass our device information to the USB library and place the device on the bus.
    USBDBulkInit(0, (tUSBDBulkDevice *)&g_sBulkDevice);
    
    
    I want to know if i need to manage the USB interrupt. Or I just need to create a task that verify the communication flag (g_ulFlags) and verify if I receive data?
    
    
    thanks
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Slava Bogulmintsev
    Posted by Slava Bogulmintsev
    on Mar 28 2012 01:02 AM
    Prodigy60 points
    1. SYS/BIOS manages interrupts, you need only register usb isr, like this:
    	#ifdef _TMS320C6X
    const int irq_event = SYS_INT_USB0_INT;
    #else
    const int irq_event = SYS_INT_USB0;
    #endif
    m_Hwi.Create(irq_event, (HWI_FXN)USB0DeviceIntHandler, (Arg)0);
    2. RX and TX handlers are registered in file "usb_bulk_structs.cpp"
    const tUSBDBulkDevice g_sBulkDevice =
    {
    USB_VID,
    USB_PID,
    500,
    USB_CONF_ATTR_BUS_PWR,
    RxHandler,
    (void *)0,
    TxHandler,
    (void *)0,
    g_pStringDescriptors,
    NUM_STRING_DESCRIPTORS,
    &g_sBulkInstance
    };
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Vincent St-Pierre
    Posted by Vincent St-Pierre
    on Mar 28 2012 09:10 AM
    Intellectual540 points

    First ty for the answer.

    Slava Bogulmintsev
    1. SYS/BIOS manages interrupts, you need only register usb isr, like this:
    	#ifdef _TMS320C6X
    const int irq_event = SYS_INT_USB0_INT;
    #else
    const int irq_event = SYS_INT_USB0;
    #endif
    m_Hwi.Create(irq_event, (HWI_FXN)USB0DeviceIntHandler, (Arg)0);

    I add this code in my .cfg but i got this error "that interrupt index is out of range (19)". SYS_INT_USB0_INT define to be 19...

    What i read form the documentation is that the interrupt can be 4 to 15. I thing i need to configure a MUX but I cant find any documentation on that...

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Slava Bogulmintsev
    Posted by Slava Bogulmintsev
    on Mar 28 2012 09:46 AM
    Prodigy60 points

    1) i don't create hwi in script file, only from code
    2) if you have number of ISR in the system less 12, you can do it like this:

    unsigned int INT_ISR = 4; //global
    {

    	Hwi_Params hwiParams;
    Hwi_Params_init(&hwiParams);
    hwiParams.arg = (UArg)0;
    hwiParams.enableInt = TRUE;
    hwiParams.eventId = SYS_INT_USB0_INT;
    Hwi_Handle hHwi = Hwi_create(INT_ISR, (Hwi_FuncPtr)USB0DeviceHandler, &hwiParams, NULL);
     INT_ISR++;
    ASSERT(INT_ISR<16);
    }
    3) if number of ISR more 12, you need to programm interrupt combiner: see sprufk5a.pdf chapter7
    4) i am programming on C++ and my examples is not accurate, rather pseudo code 
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Vincent St-Pierre
    Posted by Vincent St-Pierre
    on Mar 28 2012 13:22 PM
    Intellectual540 points

    Ok but do i realy need to setup the interrupt for the USB0 in the .cfg file if i use this:

    IntRegister(4, USB0DeviceIntHandler);
    IntEventMap(4, SYS_INT_USB0_INT);
    IntEnable(4);
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Slava Bogulmintsev
    Posted by Slava Bogulmintsev
    on Mar 29 2012 00:41 AM
    Prodigy60 points

    in the .cfg have i have only one line related interrupts:
    var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');

    and if you use SYS/BIOS you should use Hwi module to configure and enable interrupts.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Vincent St-Pierre
    Posted by Vincent St-Pierre
    on Apr 10 2012 08:45 AM
    Intellectual540 points

    My HWI work but now my task stop running on task_sleep...

    I think that when i create my HWI for the USB, its disable the HWI for the clock_tick (use for the task_sleep). I try to activate it after i create the HWI of the USB but with no succes.

    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