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.

TMS320F28377D: usblib undefined symbols

Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE,

Hello,

I am using a TMS320F28377D part in a custom board.  At the moment I am trying to write the code that will read a file in USB stick connected to it.  Therefore I am adding ublib.lib from C2000Ware_3_03_00_00.

When building the project I get:

undefined first referenced
symbol in file
--------- ----------------
_Interrupt_disable C:\ti\c2000\C2000Ware_3_03_00_00\libraries\communications\usb\f2837xd\lib\usblib_coff.lib<usbhostenum.obj>
_Interrupt_enable C:\ti\c2000\C2000Ware_3_03_00_00\libraries\communications\usb\f2837xd\lib\usblib_coff.lib<usbhostenum.obj>
_SysCtl_delay C:\ti\c2000\C2000Ware_3_03_00_00\libraries\communications\usb\f2837xd\lib\usblib_coff.lib<usbhostenum.obj>

error #10234-D: unresolved symbols remain

usbhostenum.c include interrupt.h, which has the function prototypes for the Interrupt_enable and _disable.  There is also interrupt.c, which contains the functions.  I am not sure why those are undefined.

Thank you,

  • Hi Stefani, 

    Looks like there is a mismatch between the output formats between the project and the usblib, driverlib for TMS320F28377D that you are using. 

    Please make sure that you are using COFF or EABI for all the projects. (driverlib, usblib and your code). 

    This should resolve your issue.

    Best Regards

    Siddharth

  • Siddharth,

    Thank you for replying.

    In the C2000 Linker: File Search Path:,  I included usblib_coff.lib.

    How do I include driverlib that is COFF version?  I don't see driverlib for TMS320F28377D.

    Thanks.

  • Hi Stefani,

    "driverlib_coff.lib" file is available at C:\ti\c2000\C2000Ware_3_03_00_00\driverlib\f2837xd\driverlib\ccs\Debug

    Alternatively , you can import the the driverlib project is available at C:\ti\c2000\C2000Ware_3_03_00_00\driverlib\f2837xd\driverlib  and rebuild it for COFF format.

    You can also add the file to the project by right-click on the CCS project and select "Add Files..." instead of specifying it in the File Search Path.

    Best Regards

    Siddharth

  • Thank you Siddarth!

    Now I can build the code.  I have a USB flash drive (USB stick) connected to the USB(A), but the g_eState stays at USB_NO_DEVICE.  I tried pulling out the USB flash drive and reinserting it, and nothing seems to change.

    Where is the detection of insertion / removal of the USB flash drive?

    USBHCDMain() is already called periodically.

    Thank you,

    Stefani.

  • Hi Stefani, 

    It should trigger an event on detection of the USB drive. The callback function for the event changes the state of the device. 

    You can refer the example "usb_ex7_host_msc.c" in C2000Ware for F2837xd device . This example application demonstrates reading a FatFS file system from a USB mass storage class device.

    Best Regards

    Siddharth

  • Hi Siddharth,

    So now I can get the ISR to trigger and detects connect and disconnect.  The device is is unknown though, so I get USB_EVENT_UNKNOWN_CONNECT in the USBHCDEvents function.

    USBHCDDevClass(pEventInfo->ui32Event) and USBHCDDevClass(pEventInfo->ui32Instance) result in zeroes for both.

    Should the instance be 8 for USB_CLASS_MASS_STORAGE?  Where does it get that?

    I using the example you referred as a starting point but I had to modify it for our custom hardware.

    Thanks.

  • Hi Stefani,

    Devices are identified by descriptors. When a USB device is connected, the host will try to determine what device is attached using a question/answer approach. The USB host will send a "Get Device Descriptor" command and the response should include a package of bytes which contains the descriptor info. 

    There is a bDeviceClass parameter in the descriptor which should be set to 0x9 for a mass storage device. Looks like your custom hardware is not sending/sending incorrect descriptor info. hence the device is not recognized. 

    Can you debug and check the descriptor info that is sent by your custom hardware?

    Best Regards

    Siddharth

  • Siddharth,

    The interrupt calls USB0HostIntHandler(), which I believe is in the usblib: usbhostenum.c:  USBHostIntHandlerInternal() function.

    How can I debug functions that are in the library?  I just included a modified usb_ex7_host_msc.c and called it USB.c.

    Shouldn't the device descriptor be sent by the USB flash drive?  The custom hardware is the board with the DSP, and USB A connector.  I plug in a USB flash drive / pen drive.

    Thank you.

  • Hi Stefani, 

    The source code of the USB Library is included in the C2000Ware located at <C2000Ware>\libraries\communications\usb\f2837xd .

    Yes, the device descriptor should be sent by the Flash driver as a response to the Get Device Descriptor command once a new device is detected.

    Best Regards

    Siddharth

  • Hi Siddharth,

    I found that I did not configure the AUX Clock properly.  So once I did that the USB flash drive was detected.  The state moved to USB_STATE_ENUM.

    f_mount is successful, but f_opendir returns with FR_NO_FILESYSTEM.  I reformatted the drive twice and same results.

    My question is do I need to modify tff.h, tff.c, ff.h, ff.c?  I am not modifying them at the moment.

    Thanks.

  • Hi Stefani,

    What is the file system on the USB flash drive? 

    The example "usb_ex7_host_msc.c" supports only FatFs file system and uses a open source driver which is included in <C2000Ware>\utilities\third_party\f2837xd\fatfs directory. 

    Can you single step and check why is it returning "FR_NO_FILESYSTEM"?

    Best Regards

    Siddharth

  • Siddharth,

    I found some #defines in tff.h that I needed to modify.  The file system is FAT32, but in C2000Ware that was not included by default.  So I copied the Fatfs files and modified if and now I am good to go.

    Thank you so much for all of your help!

    Stefani