Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

StarterWare USB Bulk device programming problems

Other Parts Discussed in Thread: OMAPL138, OMAP-L138

Hi,

I am using StartWare USB Generic Bulk device library. There are some errors and warning when I build my application.

1. warning: #145-D a value of type "unsigned long(*) (void*, unsigned long, unsigned long, void*) cannot be used to initialize an entity of type "tUSBCallback".

For simplity, I don't use buffer. My tUSBDBulkDevice structure is:

const tUSBDBulkDevice g_sBulkDevice = {

    USB_VID, USB_PID, 500, USB_CONF_ATTR_SELF_PWR,

    myUSBReceiveEventCallback,

    *pvRxCBData, myUSBTransmitEventCallback, *pvTxCBData, *ppStringDescriptors, ulNumStringDescriptors, *psPrivateBulkData }

my usb receive callback function is:

unsigned long myUSBReceiveEventCallback(void* pvcBdata, unsigned long ulEvent, unsigned long ulMsgParam, void* pvMsgData) .

2. Compilation failure.

undefined symbol ,

IntAINTCInit, IntChannelSet,...

It looks like the application can't find the functions about interrupts although I added "interrupt.h".

3. #Include search path

In the Include options, is it possible to search the path recursively. For instance, only adding C:\ti\OMAPL138_StarterWare_1_10_03_03 instead of adding individual paths like C:\ti|OMAPL138_StarterWare_1_10_03_03\include\hw and C:\ti\OMAPL138_StarterWare_1_10_03_03\usblib\include, etc.

Any suggestion is welcome!

Jian

  • Hi Jian,

    Thanks for the post.

    Jian: said:

    2. Compilation failure.

    undefined symbol ,

    IntAINTCInit, IntChannelSet,...

    It looks like the application can't find the functions about interrupts although I added "interrupt.h".

    1. If you want to build it for ARM of OMAP-L138 then please select the following include path in Include options.

    "include/armv5"
    "include/armv5/omap-l138"

    2. The Starterware of OMAP-L138 has the examples for both ARM & DSP. Please download the Starterware for OMAP-L138(01.10.04.01) from below link.

    http://processors.wiki.ti.com/index.php/StarterWare

    Jian: said:

    3. #Include search path

    In the Include options, is it possible to search the path recursively. For instance, only adding C:\ti\OMAPL138_StarterWare_1_10_03_03 instead of adding individual paths likeC:\ti|OMAPL138_StarterWare_1_10_03_03\include\hw and C:\ti\OMAPL138_StarterWare_1_10_03_03\usblib\include, etc.

    No. It is not possible to include recursively.

  • Hi Rajasekaran,

    Thank you very much for your response.

    I add the armv5 and omapl138 paths in ARM compiler include options. Also, I add the system_config\armv5\omapl138, which include the source code, in the ARM linker file search path. But the compilation errors are still there.

    The build log is as follwing:

    **** Build of configuration Debug for project StarterWare_USB ****

     

    C:\ti\ccsv5\utils\bin\gmake -k all
    'Building file: ../main.c'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv5/tools/compiler/tms470_4.9.1/bin/cl470" -mv5e --code_state=32 --abi=eabi -me -g --include_path="C:/ti/ccsv5/tools/compiler/tms470_4.9.1/include" --include_path="C:/ti/StarterWare_1_10_03_03/system_config/armv5/omapl138" --include_path="C:/ti/OMAPL138_StarterWare_1_10_03_03/include/hw" --include_path="C:/ti/OMAPL138_StarterWare_1_10_03_03/include/armv5/omapl138" --include_path="C:/ti/OMAPL138_StarterWare_1_10_03_03/include/armv5" --include_path="C:/ti/OMAPL138_StarterWare_1_10_03_03" --include_path="C:/ti/OMAPL138_StarterWare_1_10_03_03/usblib/include" --include_path="C:/ti/OMAPL138_StarterWare_1_10_03_03/include" --define=omapl138 --define=omapl137 --diag_warning=225 --display_error_number --preproc_with_compile --preproc_dependency="main.pp"  "../main.c"
    "C:/ti/OMAPL138_StarterWare_1_10_03_03/usblib/include/usblib.h", line 89: warning #36-D: #warn The packed attribute is not supported by this version of the TI ARM CGT.       Please upgrade to version 5.x or use an alternate toolchain instead.
    "../main.c", line 89: warning #145-D: a value of type "unsigned long (*)(void *, unsigned long, unsigned long, void *)" cannot be used to initialize an entity of type "tUSBCallback"
    "../main.c", line 91: warning #145-D: a value of type "unsigned long (*)(void *, unsigned long, unsigned long, void *)" cannot be used to initialize an entity of type "tUSBCallback"
    'Finished building: ../main.c'
    ' '
    'Building target: StarterWare_USB.out'
    'Invoking: ARM Linker'
    "C:/ti/ccsv5/tools/compiler/tms470_4.9.1/bin/cl470" -mv5e --code_state=32 --abi=eabi -me -g --define=omapl138 --define=omapl137 --diag_warning=225 --display_error_number -z --stack_size=0x800 -m"StarterWare_USB.map" --heap_size=0x800 -i"C:/ti/ccsv5/tools/compiler/tms470_4.9.1/lib" -i"C:/ti/OMAPL138_StarterWare_1_10_03_03/include/armv5/omapl138" -i"C:/ti/ccsv5/tools/compiler/tms470_4.9.1/include" -i"C:/ti/OMAPL138_StarterWare_1_10_03_03/system_config/armv5/omapl138" --reread_libs --warn_sections --display_error_number --rom_model -o "StarterWare_USB.out"  "./main.obj" -l"libc.a" "../OMAPL138.cmd"
    <Linking>

     undefined                 first referenced
      symbol                       in file    
     ---------                 ----------------
     IntAINTCInit              ./main.obj     
     IntChannelSet             ./main.obj     
     IntGlobalEnable           ./main.obj     
     IntIRQEnable              ./main.obj      
     IntMasterIRQEnable        ./main.obj     
     IntRegister               ./main.obj     
     IntSystemEnable           ./main.obj     
     USB0DeviceIntHandler      ./main.obj     
     USBDBulkInit              ./main.obj     
     USBDBulkPacketRead        ./main.obj     
     USBDBulkRxPacketAvailable ./main.obj     

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

    >> Compilation failure
    gmake: *** [StarterWare_USB.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

    Any suggestion is very welcome!

    Jian

  • Hi Jian,

    Thanks.

    From your log, there is an issue while linking. Please add the required library files to build the application. From my understanding, you may need include system_config.lib & usblib.lib.

    Please refer the below screenshot which was taken on usb_bulk_dev example application(Starterware). 

  • Hi Rajasekaran,

    Thank you very much for your reply. I added the system_config.lib and usblib.lib and the old errors are gone. But a new error appears.

     undefined                 first referenced                                                                                       
      symbol                       in file                                                                                            
      ---------                 ----------------                                                                                       
      USBClearOtgIntr        

    What other libs do I need to add? And where can I find more information about OMAPL138 compiler and linker?

    Besides, the warning are still there.

    warning #36-D: #warn The packed attribute is not supported by this version of the TI ARM CGT.       Please upgrade to version 5.x or use an alternate toolchain instead. 

    I use code composer studio v5.

    warning #145-D: a value of type "unsigned long (*)(void *, unsigned long, unsigned long, void *)" cannot be used to initialize an entity of type "tUSBCallback"

    The tUSBCallback type is: typedef unsigned long(*tUSBCallback) (void *pvCBdata, unsigned long ulEvent, unsigned long ulMsgParam, void *pvMsgData) and I don't know if there is anything I missed about the tUSBCallback.

    Thanks again and any suggestion is very welcome.

    Jian

  • warning #145-D: a value of type "unsigned long (*)(void *, unsigned long, unsigned long, void *)" cannot be used to initialize an entity of type "tUSBCallback"

    warning #145-D is removed by typecast (tUSBCallback) myUSBReceiveEventCallback.

     

  • Hi Rajasekaran,

    undefined symbol errors are gone by adding all needed libs under OMAPL138_StarterWare\binary\armv5\cgt_ccs.

    Thank you very much for your help.

     

  • I think the packed attribute is required to properly compile most of the USB examples. You might be lucky and there are no odd alignments or holes between USB structure members. You might not. You should upgrade your compiler. Examples might fail to enumerate.

    Casting myUSBReceiveEventCallback to tUSBCallback is not quite right. The function myUSBReceiveEventCallback appears to use "long" for parameters while the tUSBCallback type uses "int". On the ARM side, that is probably okay to use a cast as "int" and "long" are both 32-bits. The same code on the DSP side might not as "long" is not the same as "int". The "long" type is 40 bits on the DSP. In either case, the compiler considers "int" and "long" as different.

  • Hi Norman,

    Thank you very much for your reply. I appreciate it.

    I am using CCS version 5. I think it is the latest version. Where can I find more information about OMAPL138 compiler and linker?

    From reference spmu020o(Stellaris USB library user's guide), the tUSBCallback is typedef unsigned long (*tUSBCallback) (void*, unsigned long, unsigned long, void*). I know Stellaris USB is old, but I can not find the StarterWare usb libraray user's guide. There are only web pages about it. I don't know if there is any misundersanding about tUSBCallback.

    Any suggestion is welcome!

    Jian

  • The Stellaris USB library documentation is correct for StellarisWare. But StarterWare is different. See

    OMAPL138_StarterWare_1_10_03_03\usblib\include\usblib.h

    typedef unsigned int (* tUSBCallback)(void *pvCBData, unsigned int ulEvent,
                                           unsigned int ulMsgParam,
                                           void *pvMsgData);

    Ultimately, the code is THE documentation. The linux guys seem to believe in that the most.

    The CCS version is not the same as the Code Generation Tools (CGT). See the software manifests at
    http://processors.wiki.ti.com/index.php/Download_CCS

    Summary of versions
    CCS ARM DSP
    5.5 5.1 7.4
    5.4 5.0 7.4
    5.3 5.0 7.4
    5.2 4.9 7.3
    5.1 4.9 7.3
    5.0 4.2 7.0

    You will need at least CCS 5.3. You can get the component versions of your CCS install somewhere under "about" or something like that. Not at my PC. Can't say exactly.

  • In re-reading your thread, I am wondering if you tried using the pre-made examples in StarterWare? These examples have projects pre-configured with correct include paths and libraries. Maye try using the usb_dev_bulk example as basis for your own.

    Source
    examples\evmOMAPL138\usb_dev_bulk
    examples\lcdkOMAPL138\usb_dev_bulk

    Project
    build\armv5\cgt_ccs\omapl138\evmOMAPL138\usb_dev_bulk
    build\armv5\cgt_ccs\omapl138\lcdkOMAPL138\usb_dev_bulk
    build\c674x\cgt_ccs\omapl138\evmOMAPL138\usb_dev_bulk
    build\c674x\cgt_ccs\omapl138\lcdkOMAPL138\usb_dev_bulk

    Binaries
    binary\armv5\cgt_ccs\omapl138\evmOMAPL138\usb_dev_bulk
    binary\armv5\cgt_ccs\omapl138\lcdkOMAPL138\usb_dev_bulk
    binary\c674x\cgt_ccs\omapl138\evmOMAPL138\usb_dev_bulk
    binary\c674x\cgt_ccs\omapl138\lcdkOMAPL138\usb_dev_bulk

  • Hi Norman,

    Thank you very much for your reply. It really helps.

    Best,

    Jian