I have successfully installed ccsv6 on my dedicated ubuntu 14.04 machine and created much source. I am writing usb host code for an am335x. I can compile but not link to the libusb library in the sdk. What am I missing?
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.
I have successfully installed ccsv6 on my dedicated ubuntu 14.04 machine and created much source. I am writing usb host code for an am335x. I can compile but not link to the libusb library in the sdk. What am I missing?
Hi,
From your description it seems you have a CCS project that uses an AM335x SDK (which one?) and is trying to include a library into the linker options of this project, is that so?
If so, you can check this short clip that talks about including these paths to a project.
If your project is Linux-based and you are using a makefile, then I am afraid you will have to edit the makefile directly in order to properly link this library (and its dependencies such as include files, etc.). This would be a bit beyond the scope of this forum.
If it is none of these, then please clarify so I can provide more targeted suggestions.
Regards,
Rafael
I am running CCSv6.1 on a dedicated pc. The pc is running Ubuntu 14.04. I downloaded and installed the sdk that is supposed to support the Beaglebone Black which apparently also supports an evm.
I put the libc and libusb (as "c" and "usb") in Properties->c/c++ Build->settings->GNU linker->libraries. The path is the link to <home>/ti-processor-sdk-linux-am335x-evm-02.00.01.07.
I get
"/home/cyoung57/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/arm-none-eabi-gcc" -Dam3359 -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"USB_Hbus.map" -L"/home/cyoung57/ti-processor-sdk-linux-am335x-evm-02.00.01.07/board-support/linux-4.1.13+gitAUTOINC+8dc66170d9-g8dc6617/include" -Wl,--defsym,STACKSIZE=0x1C000 -Wl,--defsym,HEAPSIZE=0x400 -o"USB_Hbus.out" "./HH_usb.o" "./Hbus_Msg.o" "./main.o" "./startup_ARMCA8.o" -Wl,-T"../AM335x.lds" -Wl,--start-group -l"c" "usb" -Wl,--end-group
arm-none-eabi-gcc: error: usb: No such file or directory
gmake: *** [USB_Hbus.out] Error 1
gmake: Target `all' not remade because of errors.
Thanks,
Charles,
Charles Younger said:"/home/cyoung57/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/arm-none-eabi-gcc" -Dam3359 -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"USB_Hbus.map" -L"/home/cyoung57/ti-processor-sdk-linux-am335x-evm-02.00.01.07/board-support/linux-4.1.13+gitAUTOINC+8dc66170d9-g8dc6617/include" -Wl,--defsym,STACKSIZE=0x1C000 -Wl,--defsym,HEAPSIZE=0x400 -o"USB_Hbus.out" "./HH_usb.o" "./Hbus_Msg.o" "./main.o" "./startup_ARMCA8.o" -Wl,-T"../AM335x.lds" -Wl,--start-group -l"c" "usb" -Wl,--end-group
This command line shows me the "usb" library is not being properly passed to the linker: it is missing the option -l. I am not sure what could be causing this, but I suspect it is being somehow incorrectly specified in the linker file path options. Do you have it specified similarly to what is shown in one of my examples (in my case it is the "libm.a" library)
Charles Younger said:This is a better picture of the problem.
**** Build of configuration Debug__GNU for project USB_Hbus ****
/home/cyoung57/ti/ccsv6/utils/bin/gmake -k all
Building target: USB_Hbus.out
Invoking: GNU Linker
"/home/cyoung57/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/arm-none-eabi-gcc" -Dam3359 -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"USB_Hbus.map" -L"/home/cyoung57/ti-processor-sdk-linux-am335x-evm-02.00.01.07/board-support/linux-4.1.13+gitAUTOINC+8dc66170d9-g8dc6617/include" -Wl,--defsym,STACKSIZE=0x1C000 -Wl,--defsym,HEAPSIZE=0x400 -o"USB_Hbus.out" "./HH_usb.o" "./Hbus_Msg.o" "./main.o" "./startup_ARMCA8.o" -Wl,-T"../AM335x.lds" -Wl,--start-group -l"c" -Wl,--end-group
./HH_usb.o: In function `HH_Init':
/home/cyoung57/workspace_v6_1/USB_Hbus/Debug__GNU/../HH_usb.c:72: undefined reference to `libusb_init'
/home/cyoung57/workspace_v6_1/USB_Hbus/Debug__GNU/../HH_usb.c:76: undefined reference to `libusb_open_device_with_vid_pid'
/home/cyoung57/workspace_v6_1/USB_Hbus/Debug__GNU/../HH_usb.c:79: undefined reference to `libusb_claim_interface'
./HH_usb.o: In function `HH_Exit':
/home/cyoung57/workspace_v6_1/USB_Hbus/Debug__GNU/../HH_usb.c:138: undefined reference to `libusb_exit'
./HH_usb.o: In function `HH_Bulk_TxRx':
/home/cyoung57/workspace_v6_1/USB_Hbus/Debug__GNU/../HH_usb.c:259: undefined reference to `libusb_bulk_transfer'
/home/cyoung57/workspace_v6_1/USB_Hbus/Debug__GNU/../HH_usb.c:263: undefined reference to `libusb_bulk_transfer'
./HH_usb.o: In function `HH_Ctrl_TxRx':
/home/cyoung57/workspace_v6_1/USB_Hbus/Debug__GNU/../HH_usb.c:327: undefined reference to `libusb_control_transfer'
/home/cyoung57/workspace_v6_1/USB_Hbus/Debug__GNU/../HH_usb.c:339: undefined reference to `libusb_control_transfer'
./HH_usb.o: In function `HH_Int_TxRx':
/home/cyoung57/workspace_v6_1/USB_Hbus/Debug__GNU/../HH_usb.c:402: undefined reference to `libusb_interrupt_transfer'
/home/cyoung57/workspace_v6_1/USB_Hbus/Debug__GNU/../HH_usb.c:411: undefined reference to `libusb_interrupt_transfer'
./Hbus_Msg.o: In function `HH_Startup_Seq':
/home/cyoung57/workspace_v6_1/USB_Hbus/Debug__GNU/../Hbus_Msg.c:174: undefined reference to `libusb_bulk_transfer'
This output is slightly different than the previous, where the libusb.a is not even in the linker parameters. Therefore the errors would be understandable.
Charles Younger said:/home/cyoung57/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
/home/cyoung57/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0x18): undefined reference to `_sbrk'
/home/cyoung57/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text._write_r+0x20): undefined reference to `_write'
/home/cyoung57/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/libc.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text._close_r+0x18): undefined reference to `_close'
/home/cyoung57/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/libc.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text._fstat_r+0x1c): undefined reference to `_fstat'
/home/cyoung57/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/libc.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c:(.text._isatty_r+0x18): undefined reference to `_isatty'
/home/cyoung57/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/libc.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text._lseek_r+0x20): undefined reference to `_lseek'
/home/cyoung57/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/libc.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text._read_r+0x20): undefined reference to `_read'
collect2: error: ld returned 1 exit status
gmake: *** [USB_Hbus.out] Error 1
gmake: Target `all' not remade because of errors.
**** Build Finished ****
I noticed you are passing the "libc.a" but is not using the "libgcc.a" and the basic runtime support (rdimon, nosys or nano). These errors are usually caused by the fact you are not using the basic runtime routines. To repair that you can either manually add each one to your project or use the ARM GCC baremetal .specs file. This file is passed to the compiler Miscellaneous options at:
Please give this a try and see if that helps you move forward.
Regards,
Rafael