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.

CCS/MSP430F6659: CCS unresolved symbols in linker or compiler causing errors

Part Number: MSP430F6659
Other Parts Discussed in Thread: CODECOMPOSER

Tool/software: Code Composer Studio

I am newbee c programmer so be patient. I have a MSP430 C project in Code Composer Studio 7.3 using windows 7. My project (USB) was working fine and then I tried to add more code to incorporate a SPI interface and everything went sideways. I restored my original code but now have problems that weren't there before. Seems to compile but has several unresolved symbols errors in the linker (I think). I have searched/researched many answers to these types of problems on the forum and tried many things (over the past two days!!) and cannot resolve my problem. Possibly I made things worse by copying library/functions directly into my project directory but still didn't seem to change anything. The errors are related to standard MSP430 functions, not my code. My project tree looks like:

Errors from Console are:

From everything I have read it indicates that either I have a compiler library path problem or a linker file path problem. Tried a lot of combinations to no avail. Following are the compiler and linker path info:

f I look in my repository of library stuff downloaded from TI you can see that the dma.h and dma.c files which reference the error message lines in the files are there and I don't understand why the linker can't do its thing.

In the linker under library files I noticed the original libmath.a file didn't point to anything so I found one and added it (not help). Also the libc.a points to a section of 3 directories (different versions of a tool) which each have a different version of libc.a and I think I tried all of them. See below for directories

I have tried every combination of all the linker/compiler path/file combinations with no improvement.  What am I doing wrong??

  • Hi Roger,

    Could you please describe what you did to restore your original USB code? It sounds like something during this process may have caused the issue.

    Regards,
    Nathan
  • I have tried so many things its hard to remember. It was working fine, I think what happened is that I had imported into a new project the spi code example and was experimenting with it saw that there was a later version of the css libraries so I added them to my usb project along with the spi code I had been playing with as a separate c file. Later deleted the spi code file and reverted back to my working usb code versions Somehow maybe downloading the new libraries is related to that but I am again confused becvause the links in the linker file path seem to point to what it is looking regarding errors . None of the errors refer to anything in my code except the watchdog timer reference.
  • Wondering if the file path link could be an issue. My projects are on the c drive and my repository is on the d drive?
  • CLUE? In my quest to solve my issues, I created a new CCs project and pasted my main.c file in and then went through a series of compiles solving the errors as the showed up. I was down to one error : can't open source file hal.h. I believe this is a file that was included with the usb example code I started with. After copying it into my project I am back to square on with all the errors listed above. To get here I only needed to point the compiler to driverlib to solve previous errors.
  • Hi,

    Could you please post the includes that you have in your main.c file?

    Regards,
    Nathan
  • From my main file:

    #include <msp430.h>
    #include <stdio.h>
    #include <string.h>

    #include "driverlib.h"
    #include "stdint.h"
    #include "usb_inputToBuffer.h" // gets buffer data
    #include "USB_API/USB_Common/usb.h"

    From my usb_inputToBuffer.c file

    #include <string.h>
    #include <usb_inputToBuffer.h>
    #include "driverlib.h"
    #include "USB_config/descriptors.h"
    #include "USB_API/USB_Common/device.h"
    #include "USB_API/USB_Common/usb.h" // USB-specific functions
    #include "USB_API/USB_CDC_API/UsbCdc.h"
    #include "USB_app/usbConstructs.h"
  • THE CONSOLE LOG:

    **** Build of configuration Debug for project Testing ****

    "D:\\Ti\\ccsv7\\utils\\bin\\gmake" -k -j 8 all -O
    'Building file: ../usb_inputToBuffer.c'
    'Invoking: MSP430 Compiler'
    "D:/Ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.7.LTS/bin/cl430" -vmspx --data_model=restricted --near_data=none --use_hw_mpy=F5 --include_path="D:/Ti/ccsv7/ccs_base/msp430/include" --include_path="D:/Ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.7.LTS/include" --include_path="D:/Ti/MSP430USBDevelopersPackage_5_20_06_02/MSP430USBDevelopersPackage_5_20_06_02/MSP430_USB_Software/MSP430_USB_API/USB_API" --include_path="D:/Ti/MSP430USBDevelopersPackage_5_20_06_02/MSP430USBDevelopersPackage_5_20_06_02/MSP430_USB_Software/MSP430_USB_API/driverlib/MSP430F5xx_6xx" --include_path="C:/Users/rogers/0_TekServices/0-Tek_SVN/Nanometrics/OBE Board/Test Fixture/Launch Pad/CodeComposer/Testing" --include_path="C:/Users/rogers/0_TekServices/0-Tek_SVN/Nanometrics/OBE Board/Test Fixture/Launch Pad/CodeComposer/Testing" --advice:power=all --define=__MSP430F6659__ -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="usb_inputToBuffer.d_raw" "../usb_inputToBuffer.c"
    "../usb_inputToBuffer.c", line 121: warning #515-D: a value of type "char *" cannot be assigned to an entity of type "int *"
    "../usb_inputToBuffer.c", line 117: warning #179-D: variable "retPos" was declared but never referenced
    "../usb_inputToBuffer.c", line 127: remark #1544-D: (ULP 13.1) Detected loop counting up. Recommend loops count down as detecting zeros is easier
    "../usb_inputToBuffer.c", line 117: remark #1535-D: (ULP 8.1) variable "retPos" is used as a constant. Recommend declaring variable as either 'static const' or 'const'
    'Finished building: ../usb_inputToBuffer.c'
    ' '
    'Building target: Testing.out'
    'Invoking: MSP430 Linker'
    "D:/Ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.7.LTS/bin/cl430" -vmspx --data_model=restricted --near_data=none --use_hw_mpy=F5 --advice:power=all --define=__MSP430F6659__ -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 -z -m"Testing.map" --heap_size=160 --stack_size=160 --cinit_hold_wdt=on -i"D:/Ti/MSP430USBDevelopersPackage_5_20_06_02/MSP430USBDevelopersPackage_5_20_06_02/MSP430_USB_Software/MSP430_USB_API/driverlib/MSP430F5xx_6xx" -i"D:/Ti/MSP430USBDevelopersPackage_5_20_06_02/MSP430USBDevelopersPackage_5_20_06_02/MSP430_USB_Software/MSP430_USB_API/USB_API/USB_Common" -i"D:/Ti/MSP430USBDevelopersPackage_5_20_06_02/MSP430USBDevelopersPackage_5_20_06_02/MSP430_USB_Software/MSP430_USB_API/USB_API" -i"C:/Users/rogers/0_TekServices/0-Tek_SVN/Nanometrics/OBE Board/Test Fixture/Launch Pad/CodeComposer/Testing" -i"D:/Ti/ccsv7/ccs_base/msp430/include" -i"D:/Ti/ccsv7/ccs_base/msp430/lib/5xx_6xx_FRxx" -i"D:/Ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.7.LTS/lib" -i"D:/Ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.7.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="Testing_linkInfo.xml" --use_hw_mpy=F5 --rom_model -o "Testing.out" "./main.obj" "./process_buffer.obj" "./signalSet.obj" "./system_init.obj" "./system_pre_init.obj" "./usb_inputToBuffer.obj" "./USB_API/USB_CDC_API/UsbCdc.obj" "./USB_API/USB_Common/usb.obj" "./USB_API/USB_Common/usbdma.obj" "./USB_API/USB_HID_API/UsbHid.obj" "./USB_API/USB_HID_API/UsbHidReq.obj" "./USB_API/USB_MSC_API/UsbMscReq.obj" "./USB_API/USB_MSC_API/UsbMscScsi.obj" "./USB_API/USB_MSC_API/UsbMscStateMachine.obj" "./USB_API/USB_PHDC_API/UsbPHDC.obj" "./USB_API/hal.obj" "./USB_app/usbConstructs.obj" "./USB_app/usbEventHandling.obj" "./USB_config/UsbIsr.obj" "./USB_config/descriptors.obj" "../lnk_msp430f6659.cmd" "../USB_API/msp430USB.cmd" -l"D:/Ti/ccsv7/ccs_base/msp430/lib/5xx_6xx_FRxx/libmath.a" -llibmath.a -llibc.a
    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    DMA_disableTransferDuringReadModifyWrite ./USB_API/USB_Common/usbdma.obj
    DMA_disableTransfers ./USB_API/USB_Common/usbdma.obj
    DMA_enableTransferDuringReadModifyWrite ./USB_API/USB_Common/usbdma.obj
    DMA_enableTransfers ./USB_API/USB_Common/usbdma.obj
    DMA_getInterruptStatus ./USB_API/USB_Common/usbdma.obj
    DMA_init ./USB_API/USB_Common/usbdma.obj
    DMA_setDstAddress ./USB_API/USB_Common/usbdma.obj
    DMA_setSrcAddress ./USB_API/USB_Common/usbdma.obj
    DMA_setTransferSize ./USB_API/USB_Common/usbdma.obj
    DMA_startTransfer ./USB_API/USB_Common/usbdma.obj
    GPIO_setAsOutputPin ./USB_API/hal.obj
    GPIO_setAsPeripheralModuleFunctionOutputPin ./USB_API/USB_Common/usb.obj
    GPIO_setOutputLowOnPin ./USB_API/hal.obj
    PMM_setVCore ./main.obj
    TLV_getInfo ./USB_API/USB_Common/usb.obj
    UCS_initClockSignal ./USB_API/USB_Common/usb.obj
    UCS_initFLLSettle ./USB_API/hal.obj
    UCS_turnOffXT2 ./USB_API/USB_Common/usb.obj
    UCS_turnOnXT2WithTimeout ./USB_API/USB_Common/usb.obj
    WDT_A_hold ./main.obj

    error #10234-D: unresolved symbols remain
    remark #10372-D: (ULP 4.1) Detected uninitialized Port E in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.

    >> Compilation failure
    makefile:179: recipe for target 'Testing.out' failed
    makefile:175: recipe for target 'all' failed
    error #10010: errors encountered during linking; "Testing.out" not built
    gmake[1]: *** [Testing.out] Error 1
    gmake: *** [all] Error 2

    **** Build Finished ****
  • FIXED BUT WHY!!!
    To solve this issue I imported the drivlib directory from the TI repo on my D drive into my project. Now everything compiles. Can anyone tell me why I had to do that given that I had path directives to look on my D drive?? Can it be related to search path length being too long?
  • Hi,

    I'm glad you were able to get it fixed. I do not believe this was an issue with the search path length. Rather, your issue was that, although you had the right path directives, that is sufficient only for including .h files. In your case, though, you were trying to use variables and functions defined in .c files that were not included in your project, which means that they were not compiled. That is why you were seeing unresolved symbol errors. Those variables and functions were not being compiled, so the compiler could not find them when it was trying to execute your source code.

    Regards,
    Nathan

**Attention** This is a public forum