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.

C:\ti\mspware\MSPWare_2_30_00_49\driverlib\examples\MSP432P4xx\uart\uart_pc_echo_12mhz_brclk.c linking problem

Other Parts Discussed in Thread: MSPWARE

I tried to compile the example code, it seems OK, but linking could not generate an executable obj.

Including "cs.h", which has definition of function CS_setDCOCenteredFrequency(...), does not help.
Thank you very much in advance for your help.

Below are the console error messages.

**** Build of configuration Debug for project UART ****

"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all 
'Building file: ../uart_pc_echo_12mhz_brclk.c'
'Invoking: MSP432 Compiler'
"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me --include_path="C:/ti/mspware/MSPWare_2_30_00_49/driverlib/driverlib/MSP432P4xx" --include_path="C:/ti/ccsv6/ccs_base/arm/include" --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/include" --include_path="C:/ti/ccsv6/ccs_base/arm/include/CMSIS" --advice:power=all -g --gcc --define=__MSP432P401R__ --define=TARGET_IS_MSP432P4XX --define=ccs --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="uart_pc_echo_12mhz_brclk.pp"  "../uart_pc_echo_12mhz_brclk.c"
'Finished building: ../uart_pc_echo_12mhz_brclk.c'
' '
'Building target: UART.out'
'Invoking: MSP432 Linker'
"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me --advice:power=all -g --gcc --define=__MSP432P401R__ --define=TARGET_IS_MSP432P4XX --define=ccs --diag_warning=225 --display_error_number --diag_wrap=off -z -m"UART.map" --heap_size=1024 --stack_size=512 -i"C:/ti/ccsv6/ccs_base/arm/include" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/lib" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.6/include" --reread_libs --warn_sections --diag_wrap=off --display_error_number --xml_link_info="UART_linkInfo.xml" --rom_model -o "UART.out" "./msp432_startup_ccs.obj" "./uart_pc_echo_12mhz_brclk.obj" "../msp432p401r.cmd"  -l"libc.a" 
<Linking>
remark #10371-D: (ULP 1.1) Detected no uses of low power mode state changing instructions

 undefined                                  first referenced              
  symbol                                        in file                   
 ---------                                  ----------------              
 CS_setDCOCenteredFrequency                 ./uart_pc_echo_12mhz_brclk.obj
 GPIO_setAsPeripheralModuleFunctionInputPin ./uart_pc_echo_12mhz_brclk.obj

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "UART.out" not built

>> Compilation failure
gmake: *** [UART.out] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

  • Hi Su Jin,

     After reviewing your linker command line, the problem is that you are not linking the msp432p4xx_driverlib.lib

    My project does link it.

    'Invoking: MSP432 Linker'

    "C:/ti_6.1.0.000102/ccsv6/tools/compiler/ti-cgt-arm_5.2.5/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me --advice:power=all -g --gcc --define=__MSP432P401R__ --define=TARGET_IS_MSP432P4XX --define=ccs --diag_wrap=off --diag_warning=225 --display_error_number -z -m"uart_pc_echo_12mhz_brclk.map" --stack_size=512 -i"C:/ti_6.1.0.000102/ccsv6/ccs_base/arm/include" -i"C:/ti_6.1.0.000102/ccsv6/tools/compiler/ti-cgt-arm_5.2.5/lib" -i"C:/ti_6.1.0.000102/ccsv6/tools/compiler/ti-cgt-arm_5.2.5/include" --reread_libs --display_error_number --diag_wrap=off --warn_sections --xml_link_info="uart_pc_echo_12mhz_brclk_linkInfo.xml" --rom_model -o "uart_pc_echo_12mhz_brclk.out" "./msp432_startup_ccs.obj" "./uart_pc_echo_12mhz_brclk.obj" "C:/ti/msp/MSPWare_2_30_00_49/driverlib/driverlib/MSP432P4xx/ccs/msp432p4xx_driverlib.lib" "../uart_pc_echo_12mhz_brclk_ccs.cmd"  -l"libc.a"

    Not sure why it was not included when you imported the project, you should have something like this when you:

    The easiest fix is to add the MAP_ to the functions that the linker is not finding.

        /* Selecting P1.2 and P1.3 in UART mode */
        MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
                GPIO_PIN1 | GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
    
        /* Setting DCO to 12MHz */
        MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_12);

    Or you could manually add the driverlib.lib into your project.

      Best regards,

        David

  • Thank you very much.

    DavidL said:
    MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_12);

    Adding MAP_ doesn't work.

    DavidL said:
    After reviewing your linker command line, the problem is that you are not linking the msp432p4xx_driverlib.lib

    I agree you. But there are two points indicate it may be not true. (1) the compiler not the linker should show the error on its line "#include driverlib.h";

    and (2) I have manually add the file in the link path, see the screenshot:

    I really do not know what's wrong.

    Thank you very much for your time again.

    Su

  • Hi Su,

     You will need to include the library  as part of your project, the above screenshot only includes is for the header file search path. So you have a couple of options.

    Right click on your project > Add Files...  And look for the "msp432p4xx_driverlib.lib", it should be located in "C:\ti\msp\MSPWare_2_40_00_37\driverlib\driverlib\MSP432P4xx\ccs"

    Or under your project options, please add it in here:

    Regards,

      David

  • Yes, after add the lib in my project, no more problem.

    Thank you very much, David. I really appreciate your help.

    Su

**Attention** This is a public forum