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.

ek-tm4c123gxl USB host example: Undefined references to functions from usbhostenum.c.

Hello everybody. I'm trying to build example to use USB device to store some data, but I encountered undefined symsbols from usbhostenum.c. This symbols are visible in standard tivaWare libdriver.a library as listed by 'nm' tool, but during linking it still fails. Could someone help me work this out?

56:arm-none-eabi-ld -T tempCtrl.ld --entry ResetISR --gc-sections -o gcc/tempCtrl.axf gcc/usb_task.o gcc/fat_usbmsc.o gcc/ff.o gcc/buttons.o gcc/tempCtrl.o gcc/heap_2.o gcc/led_task.o gcc/display_task.o gcc/data_acq_task.o gcc/wiFiTask.o gcc/getTemp.o gcc/list.o gcc/port.o gcc/queue.o gcc/rgb.o gcc/startup_gcc.o gcc/switch_task.o gcc/tasks.o gcc/uartstdio.o gcc/ustdlib.o ../../../../driverlib/gcc/libdriver.a ../../../../usblib/gcc/libusb.a ../../../../grlib/gcc/libgr.a /home/hc/programs/gcc-arm-none-eabi-4_8-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/armv7e-m/softfp/libm.a /home/hc/programs/gcc-arm-none-eabi-4_8-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/armv7e-m/softfp/libc.a /home/hc/programs/gcc-arm-none-eabi-4_8-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/armv7e-m/softfp/libgcc.a
57:../../../../usblib/gcc/libusb.a(usbhostenum.o): In function `USBHCDPipeAllocSize':
58:usbhostenum.c:(.text.USBHCDPipeAllocSize+0x72): undefined reference to `USBHostEndpointStatusClear'
59:usbhostenum.c:(.text.USBHCDPipeAllocSize+0x7e): undefined reference to `USBEndpointDataToggleClear'
60:usbhostenum.c:(.text.USBHCDPipeAllocSize+0xaa): undefined reference to `USBFIFOConfigSet'
61:usbhostenum.c:(.text.USBHCDPipeAllocSize+0xb8): undefined reference to `USBHostAddrSet'
62:usbhostenum.c:(.text.USBHCDPipeAllocSize+0xce): undefined reference to `USBHostHubAddrSet'
63:usbhostenum.c:(.text.USBHCDPipeAllocSize+0x12e): undefined reference to `USBHostEndpointStatusClear'
64:usbhostenum.c:(.text.USBHCDPipeAllocSize+0x138): undefined reference to `USBEndpointDataToggleClear'
65:usbhostenum.c:(.text.USBHCDPipeAllocSize+0x158): undefined reference to `USBFIFOConfigSet'
66:usbhostenum.c:(.text.USBHCDPipeAllocSize+0x164): undefined reference to `USBHostAddrSet'
67:usbhostenum.c:(.text.USBHCDPipeAllocSize+0x176): undefined reference to `USBHostHubAddrSet'
68:../../../../usblib/gcc/libusb.a(usbhostenum.o): In function `USBHCDPipeConfig':
69:usbhostenum.c:(.text.USBHCDPipeConfig+0xba): undefined reference to `USBHostEndpointConfig'
70:../../../../usblib/gcc/libusb.a(usbhostenum.o): In function `USBHCDPipeFree':
71:usbhostenum.c:(.text.USBHCDPipeFree+0x56): undefined reference to `USBHostAddrSet'
72:usbhostenum.c:(.text.USBHCDPipeFree+0xbe): undefined reference to `USBHostAddrSet'
73:usbhostenum.c:(.text.USBHCDPipeFree+0xca): undefined reference to `USBHostHubAddrSet'
74:usbhostenum.c:(.text.USBHCDPipeFree+0x68): undefined reference to `USBHostHubAddrSet'
75:usbhostenum.c:(.text.USBHCDPipeFree+0xd6): undefined reference to `USBHostRequestINClear'
76:make: *** [gcc/tempCtrl.axf] Error 1

 

  • Hello Pawel,

    Instead of giving libdriver.a can you just give driver in the linker stage?

    Regards
    Amit
  • Pawel Pyszko said:
    ../../../../driverlib/gcc/libdriver.a ../../../../usblib/gcc/libusb.a

    The standard linker behavior is to only read each library file once in the order they appear on the command line, and only use symbols from each library if the symbols are undefined when the library is read.

    Since the lubsb.a library uses symbols from the libdriver.a library, try moving the order the libraries are given to the linker so that libdriver.a is after libusb.a 

  • Exactly, that is correct solution. I resolved it with help of my friend earlier today even though we didn't know that order of library occurrence in parameter list is relevant. We learned that today. Thank you anyway Guru.