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.

"usblib" + gcc 4.8.2 linker problem

Greetings,

 

I am currently working on a personal project using Tiva Launchpad together with Eclipse Kepler IDE and GNU ARM Embedded Tools (gcc version 4.8.2). Last week my efforts were focused on making the "usb_dev_serial" example (Tivaware 2.0.1.11577) work with that development setup (also i'm using it all on Windows 8).

 

So far, a simple I2C master + button interrupt + LED toggling example I've made with this development configuration is working OK. When the USB module was added ("usb_dev_serial" skeleton added to my project), some compiling issues arised, but got fixed after I put "libusb.a" as resource library for the linking process. Unfortunately, some linking problems appeared (CDT build console exposed below):

C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdcdc.o): In function `HandleRequests':
usbdcdc.c:(.text.HandleRequests+0x58): undefined reference to `USBDevEndpointDataAck'
usbdcdc.c:(.text.HandleRequests+0x64): undefined reference to `USBDevEndpointDataAck'
usbdcdc.c:(.text.HandleRequests+0x88): undefined reference to `USBDevEndpointDataAck'
usbdcdc.c:(.text.HandleRequests+0xba): undefined reference to `USBDevEndpointDataAck'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdcdc.o): In function `SendSerialState':
usbdcdc.c:(.text.SendSerialState+0x42): undefined reference to `USBEndpointDataPut'
usbdcdc.c:(.text.SendSerialState+0x52): undefined reference to `USBEndpointDataPut'
usbdcdc.c:(.text.SendSerialState+0x66): undefined reference to `USBEndpointDataSend'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdcdc.o): In function `CDCTickHandler':
usbdcdc.c:(.text.CDCTickHandler+0x8c): undefined reference to `USBEndpointDataAvail'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdcdc.o): In function `ProcessDataFromHost':
usbdcdc.c:(.text.ProcessDataFromHost+0xa): undefined reference to `USBEndpointStatus'
usbdcdc.c:(.text.ProcessDataFromHost+0x18): undefined reference to `USBDevEndpointStatusClear'
usbdcdc.c:(.text.ProcessDataFromHost+0x40): undefined reference to `USBEndpointDataAvail'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdcdc.o): In function `ProcessNotificationToHost':
usbdcdc.c:(.text.ProcessNotificationToHost+0xa): undefined reference to `USBEndpointStatus'
usbdcdc.c:(.text.ProcessNotificationToHost+0x16): undefined reference to `USBDevEndpointStatusClear'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdcdc.o): In function `ProcessDataToHost':
usbdcdc.c:(.text.ProcessDataToHost+0xa): undefined reference to `USBEndpointStatus'
usbdcdc.c:(.text.ProcessDataToHost+0x16): undefined reference to `USBDevEndpointStatusClear'
usbdcdc.c:(.text.ProcessDataToHost+0x52): undefined reference to `USBEndpointDataSend'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdcdc.o): In function `USBDCDCPacketWrite':
usbdcdc.c:(.text.USBDCDCPacketWrite+0x20): undefined reference to `USBEndpointDataPut'
usbdcdc.c:(.text.USBDCDCPacketWrite+0x46): undefined reference to `USBEndpointDataSend'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdcdc.o): In function `USBDCDCPacketRead':
usbdcdc.c:(.text.USBDCDCPacketRead+0x10): undefined reference to `USBEndpointStatus'
usbdcdc.c:(.text.USBDCDCPacketRead+0x3c): undefined reference to `USBEndpointDataAvail'
usbdcdc.c:(.text.USBDCDCPacketRead+0x50): undefined reference to `USBEndpointDataGet'
usbdcdc.c:(.text.USBDCDCPacketRead+0x64): undefined reference to `USBDevEndpointStatusClear'
usbdcdc.c:(.text.USBDCDCPacketRead+0x70): undefined reference to `USBDevEndpointDataAck'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdcdc.o): In function `USBDCDCRxPacketAvailable':
usbdcdc.c:(.text.USBDCDCRxPacketAvailable+0x16): undefined reference to `USBEndpointStatus'
usbdcdc.c:(.text.USBDCDCRxPacketAvailable+0x2a): undefined reference to `USBEndpointDataAvail'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdenum.o): In function `USBDEP0StateTx.clone.0':
usbdenum.c:(.text.USBDEP0StateTx.clone.0+0x22): undefined reference to `USBEndpointDataPut'
usbdenum.c:(.text.USBDEP0StateTx.clone.0+0x46): undefined reference to `USBEndpointDataSend'
usbdenum.c:(.text.USBDEP0StateTx.clone.0+0x36): undefined reference to `USBEndpointDataSend'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdenum.o): In function `USBDCDInit':
usbdenum.c:(.text.USBDCDInit+0x40): undefined reference to `USBClockEnable'
usbdenum.c:(.text.USBDCDInit+0x4a): undefined reference to `USBULPIEnable'
usbdenum.c:(.text.USBDCDInit+0x68): undefined reference to `USBULPIDisable'
usbdenum.c:(.text.USBDCDInit+0x74): undefined reference to `USBDevMode'
usbdenum.c:(.text.USBDCDInit+0x7e): undefined reference to `USBOTGMode'
usbdenum.c:(.text.USBDCDInit+0x94): undefined reference to `USBDevLPMConfig'
usbdenum.c:(.text.USBDCDInit+0x9c): undefined reference to `USBLPMIntEnable'
usbdenum.c:(.text.USBDCDInit+0xa2): undefined reference to `USBDevLPMEnable'
usbdenum.c:(.text.USBDCDInit+0xae): undefined reference to `USBDevLPMDisable'
usbdenum.c:(.text.USBDCDInit+0xb6): undefined reference to `USBDevLPMConfig'
usbdenum.c:(.text.USBDCDInit+0xfe): undefined reference to `USBIntStatusControl'
usbdenum.c:(.text.USBDCDInit+0x104): undefined reference to `USBIntStatusEndpoint'
usbdenum.c:(.text.USBDCDInit+0x10c): undefined reference to `USBIntEnableControl'
usbdenum.c:(.text.USBDCDInit+0x116): undefined reference to `USBIntEnableEndpoint'
usbdenum.c:(.text.USBDCDInit+0x11c): undefined reference to `USBDevConnect'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdenum.o): In function `USBDCDStallEP0':
usbdenum.c:(.text.USBDCDStallEP0+0x8): undefined reference to `USBDevEndpointStall'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `iDMAUSBChannelRelease':
usbdma.c:(.text.iDMAUSBChannelRelease+0x8): undefined reference to `USBDMAChannelDisable'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `iDMAUSBChannelAllocate':
usbdma.c:(.text.iDMAUSBChannelAllocate+0x1e): undefined reference to `USBDMAChannelDisable'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `iDMAUSBChannelDisable':
usbdma.c:(.text.iDMAUSBChannelDisable+0xa): undefined reference to `USBDMAChannelDisable'
usbdma.c:(.text.iDMAUSBChannelDisable+0x12): undefined reference to `USBDMAChannelIntDisable'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `iDMAUSBChannelIntDisable':
usbdma.c:(.text.iDMAUSBChannelIntDisable+0x4): undefined reference to `USBDMAChannelIntDisable'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `iDMAUSBChannelIntEnable':
usbdma.c:(.text.iDMAUSBChannelIntEnable+0x4): undefined reference to `USBDMAChannelIntEnable'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `iDMAUSBChannelEnable':
usbdma.c:(.text.iDMAUSBChannelEnable+0x36): undefined reference to `USBDMAChannelIntEnable'
usbdma.c:(.text.iDMAUSBChannelEnable+0x3e): undefined reference to `USBDMAChannelEnable'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `iDMAUSBTransfer':
usbdma.c:(.text.iDMAUSBTransfer+0x40): undefined reference to `USBDMAChannelAddressSet'
usbdma.c:(.text.iDMAUSBTransfer+0x4a): undefined reference to `USBDMAChannelCountSet'
usbdma.c:(.text.iDMAUSBTransfer+0x6e): undefined reference to `USBEndpointPacketCountSet'
usbdma.c:(.text.iDMAUSBTransfer+0x84): undefined reference to `USBEndpointDMAConfigSet'
usbdma.c:(.text.iDMAUSBTransfer+0x98): undefined reference to `USBDMAChannelConfigSet'
usbdma.c:(.text.iDMAUSBTransfer+0xc2): undefined reference to `USBEndpointDMAConfigSet'
usbdma.c:(.text.iDMAUSBTransfer+0xd2): undefined reference to `USBDMAChannelConfigSet'
usbdma.c:(.text.iDMAUSBTransfer+0xea): undefined reference to `USBEndpointDMAEnable'
usbdma.c:(.text.iDMAUSBTransfer+0xf2): undefined reference to `USBDMAChannelEnable'
usbdma.c:(.text.iDMAUSBTransfer+0xfa): undefined reference to `USBEndpointDMADisable'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `iDMAUSBIntStatus':
usbdma.c:(.text.iDMAUSBIntStatus+0x2): undefined reference to `USBDMAChannelIntStatus'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `iDMAUSBChannelStatus':
usbdma.c:(.text.iDMAUSBChannelStatus+0x8): undefined reference to `USBDMAChannelStatus'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `uDMAUSBUnitSizeSet':
usbdma.c:(.text.uDMAUSBUnitSizeSet+0x6e): undefined reference to `uDMAChannelControlSet'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `uDMAUSBArbSizeSet':
usbdma.c:(.text.uDMAUSBArbSizeSet+0x6e): undefined reference to `uDMAChannelControlSet'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `uDMAUSBIntStatus':
usbdma.c:(.text.uDMAUSBIntStatus+0x12): undefined reference to `uDMAChannelModeGet'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `uDMAUSBChannelRelease':
usbdma.c:(.text.uDMAUSBChannelRelease+0xe): undefined reference to `uDMAChannelAttributeDisable'
usbdma.c:(.text.uDMAUSBChannelRelease+0x2c): undefined reference to `USBEndpointDMADisable'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `uDMAUSBChannelEnable':
usbdma.c:(.text.uDMAUSBChannelEnable+0x5c): undefined reference to `USBEndpointDMAEnable'
usbdma.c:(.text.uDMAUSBChannelEnable+0x62): undefined reference to `uDMAChannelEnable'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `uDMAUSBTransfer':
usbdma.c:(.text.uDMAUSBTransfer+0x4a): undefined reference to `USBFIFOAddrGet'
usbdma.c:(.text.uDMAUSBTransfer+0x84): undefined reference to `uDMAChannelTransferSet'
usbdma.c:(.text.uDMAUSBTransfer+0xa2): undefined reference to `USBEndpointPacketCountSet'
usbdma.c:(.text.uDMAUSBTransfer+0xb6): undefined reference to `USBEndpointDMAConfigSet'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `uDMAUSBChannelDisable':
usbdma.c:(.text.uDMAUSBChannelDisable+0x2e): undefined reference to `USBEndpointDMADisable'
usbdma.c:(.text.uDMAUSBChannelDisable+0x34): undefined reference to `uDMAChannelDisable'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `uDMAUSBChannelAllocate':
usbdma.c:(.text.uDMAUSBChannelAllocate+0x86): undefined reference to `USBEndpointDMAChannel'
usbdma.c:(.text.uDMAUSBChannelAllocate+0x8e): undefined reference to `uDMAChannelAttributeDisable'
usbdma.c:(.text.uDMAUSBChannelAllocate+0x9a): undefined reference to `uDMAChannelControlSet'
usbdma.c:(.text.uDMAUSBChannelAllocate+0xb0): undefined reference to `USBEndpointDMADisable'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbdma.o): In function `USBLibDMAInit':
usbdma.c:(.text.USBLibDMAInit+0x7c): undefined reference to `USBControllerVersion'
C:\ti\TivaWare_C_Series-2.0.1.11577\usblib\gcc\libusb.a(usbulpi.o): In function `ULPIConfigSet':
usbulpi.c:(.text.ULPIConfigSet+0x8): undefined reference to `USBULPIRegRead'
usbulpi.c:(.text.ULPIConfigSet+0x18): undefined reference to `USBULPIRegWrite'
usbulpi.c:(.text.ULPIConfigSet+0x20): undefined reference to `USBULPIRegRead'
usbulpi.c:(.text.ULPIConfigSet+0x32): undefined reference to `USBULPIRegWrite'
usbulpi.c:(.text.ULPIConfigSet+0x3a): undefined reference to `USBULPIRegRead'
usbulpi.c:(.text.ULPIConfigSet+0x50): undefined reference to `USBULPIRegWrite'
collect2.exe: error: ld returned 1 exit status 

All undefined references point to functions declared in driverlib/usb. Does anybody have a clue where to start to fix this issue? 

  • Hello Volbert

    Is the following file included during the linking phase?

    C:\ti\TivaWare_C_Series-2.1.0.12573\driverlib\gcc\libdriver.a

    The C:\ path is where the TIVAWare is installed

    Regards

    Amit

  • Hello Amit,

    The "libdriver.a" file is included in my project (I've attached below a figure to show library current configurations for gcc linker).

      

  • Hi,

    You need to add a path to usblib folder where reside files includded (like #include "usblib/usblib.h") - you compile the *.c files, but the path to *.h files is not specified - go to Cross GCC Compiler -> Include tab and place there the path.

    Petrei 

  • Hi Petrei,

    The path for "usblib" folder is included (C:\ti\TivaWare_C_Series-2.0.1.11577) - added a screenshot below.

    Regards,

  • Hi,

    But did you added to your main file all the needed 'includes'? I.e. besides #include "usblib/usblib.h", you need to add some more *.h files - compare with the example provided by TI ( usbcdc.h, usbdma.h, ...).

    Petrei

  • Hi Petrei,

    Yes, I believe all needed include files were added to the project in main.c 

    #include <stdbool.h>
    #include <stdint.h>
    #include "inc/hw_ints.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "inc/hw_gpio.h"
    #include "inc/hw_uart.h"
    #include "inc/hw_sysctl.h"
    #include "driverlib/debug.h"
    #include "driverlib/fpu.h"
    #include "driverlib/gpio.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/systick.h"
    #include "driverlib/timer.h"
    #include "driverlib/uart.h"
    #include "driverlib/usb.h"
    #include "driverlib/rom.h"
    #include "usblib/usblib.h"
    #include "usblib/usbcdc.h"
    #include "usblib/usb-ids.h"
    #include "usblib/device/usbdevice.h"
    #include "usblib/device/usbdcdc.h"
    #include "utils/ustdlib.h"
    #include "usb_serial_structs.h"
    #include "utils/uartstdio.h"

    Regards,

  • Hi,

    Can you zip your project and post it to try it on another system? 

    Petrei

  • Hi,

    Please check again the names of your libraries: while libdriver.a is a correct name(but check the path), usb library must be added too, it is in Tiva/usblib/gcc/libusb.a, yours has another name.

    Petrei

  • Hi,

    Eclipse recognizes included libraries according to the post of this link:

    http://www.eclipse.org/forums/index.php/mv/msg/238028/734862/#msg_734862

    Paths are all checked. Just did a little sanity check: removed usb module from system, and the project compiles and links ok; after that I removed "libdriver.a" from gcc linker libraries and the project failed to link. Putting "libdriver.a" back (without USB code) the project compiles and links just fine.

  • Hi,

    I agree with you, but in the first picture posted I can see all libraries linked by you - the last one is "usb" -if you have one with that name is OK, but in usblib/gcc/ the library there is libusb.a.

    So which one is good?

    Petrei

  • Hello Petrei,

    I've included the libusb.a declaring "usb" in the library window, Cross GCC Linker, as shown in the first figure. If I declare "libusb" in lib window, the gcc linker doesn't recognize the library and the build fails in the linking procedure.

    Same for libdriver.a, if I declare "libdriver", it won't be recognized. But declaring "driver", the program builds just fine.

    Regards,

  • Hi,

    It seems you are blocked somehow - in this case the solution is to "think differently"- and in this case two steps can be taken:
    a) try to remove the usb library from the linking pane. But add the folder usblib to your project and compile it locally. Should solve most problems.
    b) improve your toolchain - add this plug-in: http://gnuarmeclipse.livius.net/blog/ - it provides a tight control of your project, many additional tools and remove some problems with path management, especially in Windows.
    Petrei
  • Hello Petrei, thanks for your help.

    Removing libusb from gcc linker results in the following errors:

    arm-none-eabi-gcc "-LC:\\gcc-arm-none-eabi-4_8-2013q4-20131204-win32\\arm-none-eabi\\lib\\armv7-m" "-LC:\\ti\\TivaWare_C_Series-2.0.1.11577\\driverlib\\gcc" "-LC:\\ti\\TivaWare_C_Series-2.0.1.11577\\usblib\\gcc" -Wl,-Map=ALMv1p0_uC_R001S002.map,--static,--gc-sections,-T../startup_src/TM4C.ld -mthumb -mcpu=cortex-m4 -o ALMv1p0_uC_R001S002.elf "startup_src\\TM4C_startup.o" main.o "ceedling_fixture\\src\\UI\\DebounceBlock\\UIModule_DebounceBlock_Model.o" "ceedling_fixture\\src\\UI\\DebounceBlock\\UIModule_DebounceBlock_Hardware.o" "ceedling_fixture\\src\\UI\\DebounceBlock\\UIModule_DebounceBlock_Conductor.o" "ceedling_fixture\\src\\UI\\ButtonsBlock\\UIModule_ButtonsBlock_Model.o" "ceedling_fixture\\src\\UI\\ButtonsBlock\\UIModule_ButtonsBlock_Hardware.o" "ceedling_fixture\\src\\UI\\ButtonsBlock\\UIModule_ButtonsBlock_Conductor.o" "ceedling_fixture\\src\\TaskFlag\\Timer0Block\\TaskFlagModule_Timer0BlockModel.o" "ceedling_fixture\\src\\TaskFlag\\Timer0Block\\TaskFlagModule_Timer0BlockHardware.o" "ceedling_fixture\\src\\TaskFlag\\Timer0Block\\TaskFlagModule_Timer0BlockConductor.o" "ceedling_fixture\\src\\TaskFlag\\LEDsBlock\\TaskFlagModule_LEDsBlock_Model.o" "ceedling_fixture\\src\\TaskFlag\\LEDsBlock\\TaskFlagModule_LEDsBlock_Hardware.o" "ceedling_fixture\\src\\TaskFlag\\LEDsBlock\\TaskFlagModule_LEDsBlock_Conductor.o" "ceedling_fixture\\src\\SysInit\\BootloaderBlock\\SysInitModule_BootloaderBlock_Model.o" "ceedling_fixture\\src\\SysInit\\BootloaderBlock\\SysInitModule_BootloaderBlock_Hardware.o" "ceedling_fixture\\src\\SysInit\\BootloaderBlock\\SysInitModule_BootloaderBlock_Conductor.o" "ceedling_fixture\\src\\SysInit\\BareMetalBlock\\SysInitModule_BareMetalBlock_Model.o" "ceedling_fixture\\src\\SysInit\\BareMetalBlock\\SysInitModule_BareMetalBlock_Hardware.o" "ceedling_fixture\\src\\SysInit\\BareMetalBlock\\SysInitModule_BareMetalBlock_Conductor.o" "ceedling_fixture\\src\\Support\\SupportModule.o" "ceedling_fixture\\src\\MainApp\\MainApp_RedLEDBlink_With_I2CMaster_and_IntSwitches.o" "ceedling_fixture\\src\\MainApp\\MainApp_R001S002.o" "ceedling_fixture\\src\\MainApp\\MainApp2b.o" "ceedling_fixture\\src\\MainApp\\MainApp2a.o" "ceedling_fixture\\src\\MainApp\\MainApp1b.o" "ceedling_fixture\\src\\MainApp\\MainApp.o" "ceedling_fixture\\src\\Comm\\USBSerialBlock\\usb_serial_structs.o" "ceedling_fixture\\src\\Comm\\USBSerialBlock\\CommModule_USBSerialBlock_Model.o" "ceedling_fixture\\src\\Comm\\USBSerialBlock\\CommModule_USBSerialBlock_Hardware.o" "ceedling_fixture\\src\\Comm\\USBSerialBlock\\CommModule_USBSerialBlock_Conductor.o" "ceedling_fixture\\src\\Comm\\I2CMasterBlock\\CommModule_I2CMasterBlock_Model.o" "ceedling_fixture\\src\\Comm\\I2CMasterBlock\\CommModule_I2CMasterBlock_Hardware.o" "ceedling_fixture\\src\\Comm\\I2CMasterBlock\\CommModule_I2CMasterBlock_Conductor.o" -ldriver -lc 
    ceedling_fixture\src\Comm\USBSerialBlock\CommModule_USBSerialBlock_Hardware.o: In function `CommModule_USBSerialBlock_Hardware_USBChannel_USB_TxBuffer_Init':
    E:\ALMv1p0_workspace\trunk\ALMv1p0_uC_R001S002\Debug/..\ceedling_fixture\src\Comm\USBSerialBlock/CommModule_USBSerialBlock_Hardware.c:194: undefined reference to `USBBufferInit'
    ceedling_fixture\src\Comm\USBSerialBlock\CommModule_USBSerialBlock_Hardware.o: In function `CommModule_USBSerialBlock_Hardware_USBChannel_USB_RxBuffer_Init':
    E:\ALMv1p0_workspace\trunk\ALMv1p0_uC_R001S002\Debug/..\ceedling_fixture\src\Comm\USBSerialBlock/CommModule_USBSerialBlock_Hardware.c:219: undefined reference to `USBBufferInit'
    ceedling_fixture\src\Comm\USBSerialBlock\CommModule_USBSerialBlock_Hardware.o: In function `CommModule_USBSerialBlock_Hardware_USBChannel_USB_DeviceMode_Init':
    E:\ALMv1p0_workspace\trunk\ALMv1p0_uC_R001S002\Debug/..\ceedling_fixture\src\Comm\USBSerialBlock/CommModule_USBSerialBlock_Hardware.c:247: undefined reference to `USBStackModeSet'
    ceedling_fixture\src\Comm\USBSerialBlock\CommModule_USBSerialBlock_Hardware.o: In function `CommModule_USBSerialBlock_Hardware_USBChannel_USB_LibInfoAndBus_Config':
    E:\ALMv1p0_workspace\trunk\ALMv1p0_uC_R001S002\Debug/..\ceedling_fixture\src\Comm\USBSerialBlock/CommModule_USBSerialBlock_Hardware.c:277: undefined reference to `USBDCDCInit'
    ceedling_fixture\src\Comm\USBSerialBlock\usb_serial_structs.o:(.rodata.g_sRxBuffer+0xc): undefined reference to `USBDCDCPacketRead'
    ceedling_fixture\src\Comm\USBSerialBlock\usb_serial_structs.o:(.rodata.g_sRxBuffer+0x10): undefined reference to `USBDCDCRxPacketAvailable'
    ceedling_fixture\src\Comm\USBSerialBlock\usb_serial_structs.o:(.rodata.g_sTxBuffer+0xc): undefined reference to `USBDCDCPacketWrite'
    ceedling_fixture\src\Comm\USBSerialBlock\usb_serial_structs.o:(.rodata.g_sTxBuffer+0x10): undefined reference to `USBDCDCTxPacketAvailable'
    ceedling_fixture\src\Comm\USBSerialBlock\usb_serial_structs.o:(.data.g_sCDCDevice+0x10): undefined reference to `USBBufferEventCallback'
    ceedling_fixture\src\Comm\USBSerialBlock\usb_serial_structs.o:(.data.g_sCDCDevice+0x18): undefined reference to `USBBufferEventCallback'
    collect2.exe: error: ld returned 1 exit status
    

    I'll try the second step suggested and post the results soon.

    Regards,

  • Hi all.

       I had similar situation a few minutes ago, and all I needed to do was to change the order of both libraries that were passed to gcc during the linking phase. At first I had this:

    /home/iwasz/local/share/arm-unknown-eabi-cortex-m4/bin/arm-unknown-eabi-gcc -std=gnu99 -ffunction-sections -fdata-sections -MD -Wall -pedantic -specs=tiva.specs CMakeFiles/tiva-usb-test.elf.dir/home/iwasz/Documents/workspace-CDT/tiva-usb-test/src/startup_gcc.c.o CMakeFiles/tiva-usb-test.elf.dir/home/iwasz/Documents/workspace-CDT/tiva-usb-test/src/main.c.o CMakeFiles/tiva-usb-test.elf.dir/home/iwasz/Documents/workspace-CDT/tiva-usb-test/src/syscalls.c.o -o tiva-usb-test.elf /home/iwasz/Documents/workspace-CDT/SW-TM4C-2.1.0.12573/driverlib/gcc/libdriver.a /home/iwasz/Documents/workspace-CDT/SW-TM4C-2.1.0.12573/usblib/gcc/libusb.a

    and this failed in a similar fashion like your command, and then, after changing the order of libusb and libdriver every worked fine:

    /home/iwasz/local/share/arm-unknown-eabi-cortex-m4/bin/arm-unknown-eabi-gcc -std=gnu99 -ffunction-sections -fdata-sections -MD -Wall -pedantic -specs=tiva.specs CMakeFiles/tiva-usb-test.elf.dir/home/iwasz/Documents/workspace-CDT/tiva-usb-test/src/startup_gcc.c.o CMakeFiles/tiva-usb-test.elf.dir/home/iwasz/Documents/workspace-CDT/tiva-usb-test/src/main.c.o CMakeFiles/tiva-usb-test.elf.dir/home/iwasz/Documents/workspace-CDT/tiva-usb-test/src/syscalls.c.o -o tiva-usb-test.elf /home/iwasz/Documents/workspace-CDT/SW-TM4C-2.1.0.12573/usblib/gcc/libusb.a /home/iwasz/Documents/workspace-CDT/SW-TM4C-2.1.0.12573/driverlib/gcc/libdriver.a

    I use CMake, and Eclipse invokes generated Makefile, so my setup is slightly different, but maybe it will help anyway.

    Regs.

  • Hi Lukasz,

    I tried here to change the order of linked libraries and it worked succesfully! Thank you very much for the tip, it solved my problem.

    Cheers,