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.

Compiler/MSP430F5528: Driver Library Compiler Error

Part Number: MSP430F5528


Tool/software: TI C/C++ Compiler

Hi,

In the attached file SPI_UCB0.c, I have encountered a compiler error that has stymied me.

After a clean/build this is what it says:   #148 declaration is incompatible with "USCI_B_SPI_initMasterParam  my_spi_param"  (declared at line 11)

If I delete this file from my project, it compiles OK

In the path variables  ( see attached Path_Variables.pdf ), I see that I have 2 references to the MSP430_DIVERLIB for my project.

Could this be the cause of my error ? 

Thank you for any assistance.

Roy

Path_Variables.pdf

/*
 * SPI_UCB0.c
 *
 *  Created on: Feb 20, 2018
 *
 */

#include <usci_b_spi.h>

//Initialize Master
USCI_B_SPI_initMasterParam my_spi_param;
my_spi_param.selectClockSource = USCI_B_SPI_CLOCKSOURCE_SMCLK;

  • Hi Roy,

    could you please post the whole command line output? It includes some more information in the issue.

    I assume that this issue is caused by a mismatch between the "USCI_B_SPI_initMasterParam" declaration and the referenced driverlib version.
    Please put only 1 reference to the driverlib in your project and pull the latest version from the Web. Then crosscheck that the "USCI_B_SPI_initMasterParam" declaration and the driverlib definition are matching.

    Best regards,
    Britta
  • Hi Britta,

    I have attached the command line output as you requested.  I copied and pasted it into a text editor.  Is this info written to a file someplace in my project ?

    Per your instructions I will remove the two driverlib references from my path variables, and install a new one from the web.

    Thank you for the help.

    Roy 

    
    **** Build of configuration Debug for project F2-1 ****
    
    "C:\\ti2\\ccsv7\\utils\\bin\\gmake" -k all 
    gmake[1]: Entering directory 'C:/adata/CCSV7_workspace/F2-1/Debug'
    'Building file: ../empty_min.cfg'
    'Invoking: XDCtools'
    "C:/ti/xdctools_3_32_00_06_core/xs" --xdcpath="C:/ti/tirtos_msp43x_2_16_01_14/packages;C:/ti/tirtos_msp43x_2_16_01_14/products/bios_6_45_02_31/packages;C:/ti/tirtos_msp43x_2_16_01_14/products/tidrivers_msp43x_2_16_01_13/packages;C:/ti/tirtos_msp43x_2_16_01_14/products/uia_2_00_05_50/packages;C:/ti/msp430/MSPWare_3_30_00_18/driverlib/packages;C:/ti/msp430/MSPWare_3_30_00_18/driverlib;C:/ti2/ccsv7/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.msp430.elf.MSP430X -p ti.platforms.msp430:MSP430F5529 -r release -c "C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS" --compileOptions "-vmspx --data_model=restricted -Ooff --opt_for_speed=2 --use_hw_mpy=F5 --include_path=\"C:/ti2/ccsv7/ccs_base/msp430/include\" --include_path=\"C:/adata/CCSV7_workspace/F2-1\" --include_path=\"C:/ti/tirtos_msp43x_2_16_01_14/products/msp430_driverlib_2_21_00_08a/driverlib/MSP430F5xx_6xx\" --include_path=\"C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include\" --advice:power_severity=suppress --advice:power=all -g --define=ccs --define=MSP430WARE --define=__MSP430F5528__ --display_error_number --diag_warning=225 --diag_warning=255 --diag_wrap=off --abi=eabi --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU23 --silicon_errata=CPU40 --printf_support=minimal  " "../empty_min.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring empty_min.xe430X from package/cfg/empty_min_pe430X.cfg ...
    generating custom ti.sysbios library makefile ... 
    generating custom ti.sysbios.family.msp430 Hwi stubs ... 
    Starting build of library sources ...
    making C:/adata/CCSV7_workspace/F2-1/src/sysbios/sysbios.ae430X ...
    gmake[1]: Entering directory `C:/adata/CCSV7_workspace/F2-1/src/sysbios'
    cle430X C:/ti/tirtos_msp43x_2_16_01_14/products/bios_6_45_02_31/packages/ti/sysbios/BIOS.c ...
    asme430X C:/ti/tirtos_msp43x_2_16_01_14/products/bios_6_45_02_31/packages/ti/sysbios/family/msp430/Hwi_switch_asm.asm ...
    asme430X C:/ti/tirtos_msp43x_2_16_01_14/products/bios_6_45_02_31/packages/ti/sysbios/family/msp430/TaskSupport_asm.asm ...
    are430X BIOS.obj msp430_Hwi_switch_asm.obj msp430_TaskSupport_asm.obj ...
    gmake[1]: Leaving directory `C:/adata/CCSV7_workspace/F2-1/src/sysbios'
    Build of libraries done.
    cle430X package/cfg/empty_min_pe430X.c ...
    'Finished building: ../empty_min.cfg'
    ' '
    gmake[1]: Leaving directory 'C:/adata/CCSV7_workspace/F2-1/Debug'
            1 file(s) copied.
    making ../src/sysbios/sysbios.ae430X ...
    gmake[1]: Entering directory 'C:/adata/CCSV7_workspace/F2-1/src/sysbios'
    gmake[1]: Nothing to be done for 'all'.
    gmake[1]: Leaving directory 'C:/adata/CCSV7_workspace/F2-1/src/sysbios'
    'Building file: ../ADC12.c'
    'Invoking: MSP430 Compiler'
    "C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -Ooff --opt_for_speed=2 --use_hw_mpy=F5 --include_path="C:/ti2/ccsv7/ccs_base/msp430/include" --include_path="C:/adata/CCSV7_workspace/F2-1" --include_path="C:/ti/tirtos_msp43x_2_16_01_14/products/msp430_driverlib_2_21_00_08a/driverlib/MSP430F5xx_6xx" --include_path="C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power_severity=suppress --advice:power=all -g --define=ccs --define=MSP430WARE --define=__MSP430F5528__ --display_error_number --diag_warning=225 --diag_warning=255 --diag_wrap=off --abi=eabi --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU23 --silicon_errata=CPU40 --printf_support=minimal --preproc_with_compile --preproc_dependency="ADC12.d_raw" --cmd_file="configPkg/compiler.opt" "../ADC12.c"
    'Finished building: ../ADC12.c'
    ' '
    'Building file: ../I2C_UCB1.c'
    'Invoking: MSP430 Compiler'
    "C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -Ooff --opt_for_speed=2 --use_hw_mpy=F5 --include_path="C:/ti2/ccsv7/ccs_base/msp430/include" --include_path="C:/adata/CCSV7_workspace/F2-1" --include_path="C:/ti/tirtos_msp43x_2_16_01_14/products/msp430_driverlib_2_21_00_08a/driverlib/MSP430F5xx_6xx" --include_path="C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power_severity=suppress --advice:power=all -g --define=ccs --define=MSP430WARE --define=__MSP430F5528__ --display_error_number --diag_warning=225 --diag_warning=255 --diag_wrap=off --abi=eabi --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU23 --silicon_errata=CPU40 --printf_support=minimal --preproc_with_compile --preproc_dependency="I2C_UCB1.d_raw" --cmd_file="configPkg/compiler.opt" "../I2C_UCB1.c"
    'Finished building: ../I2C_UCB1.c'
    ' '
    'Building file: ../MSP_EXP430F5529LP.c'
    'Invoking: MSP430 Compiler'
    "C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -Ooff --opt_for_speed=2 --use_hw_mpy=F5 --include_path="C:/ti2/ccsv7/ccs_base/msp430/include" --include_path="C:/adata/CCSV7_workspace/F2-1" --include_path="C:/ti/tirtos_msp43x_2_16_01_14/products/msp430_driverlib_2_21_00_08a/driverlib/MSP430F5xx_6xx" --include_path="C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power_severity=suppress --advice:power=all -g --define=ccs --define=MSP430WARE --define=__MSP430F5528__ --display_error_number --diag_warning=225 --diag_warning=255 --diag_wrap=off --abi=eabi --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU23 --silicon_errata=CPU40 --printf_support=minimal --preproc_with_compile --preproc_dependency="MSP_EXP430F5529LP.d_raw" --cmd_file="configPkg/compiler.opt" "../MSP_EXP430F5529LP.c"
    'Finished building: ../MSP_EXP430F5529LP.c'
    ' '
    'Building file: ../SPI_UCB0.c'
    'Invoking: MSP430 Compiler'
    "C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -Ooff --opt_for_speed=2 --use_hw_mpy=F5 --include_path="C:/ti2/ccsv7/ccs_base/msp430/include" --include_path="C:/adata/CCSV7_workspace/F2-1" --include_path="C:/ti/tirtos_msp43x_2_16_01_14/products/msp430_driverlib_2_21_00_08a/driverlib/MSP430F5xx_6xx" --include_path="C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power_severity=suppress --advice:power=all -g --define=ccs --define=MSP430WARE --define=__MSP430F5528__ --display_error_number --diag_warning=225 --diag_warning=255 --diag_wrap=off --abi=eabi --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU23 --silicon_errata=CPU40 --printf_support=minimal --preproc_with_compile --preproc_dependency="SPI_UCB0.d_raw" --cmd_file="configPkg/compiler.opt" "../SPI_UCB0.c"
    
    >> Compilation failure
    subdir_rules.mk:30: recipe for target 'SPI_UCB0.obj' failed
    "../SPI_UCB0.c", line 12: warning #78-D: this declaration has no storage class or type specifier
    "../SPI_UCB0.c", line 12: error #148: declaration is incompatible with "USCI_B_SPI_initMasterParam my_spi_param" (declared at line 11)
    "../SPI_UCB0.c", line 12: error #66: expected a ";"
    2 errors detected in the compilation of "../SPI_UCB0.c".
    gmake: *** [SPI_UCB0.obj] Error 1
    'Building file: ../com.c'
    'Invoking: MSP430 Compiler'
    "C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -Ooff --opt_for_speed=2 --use_hw_mpy=F5 --include_path="C:/ti2/ccsv7/ccs_base/msp430/include" --include_path="C:/adata/CCSV7_workspace/F2-1" --include_path="C:/ti/tirtos_msp43x_2_16_01_14/products/msp430_driverlib_2_21_00_08a/driverlib/MSP430F5xx_6xx" --include_path="C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power_severity=suppress --advice:power=all -g --define=ccs --define=MSP430WARE --define=__MSP430F5528__ --display_error_number --diag_warning=225 --diag_warning=255 --diag_wrap=off --abi=eabi --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU23 --silicon_errata=CPU40 --printf_support=minimal --preproc_with_compile --preproc_dependency="com.d_raw" --cmd_file="configPkg/compiler.opt" "../com.c"
    'Finished building: ../com.c'
    ' '
    'Building file: ../main.c'
    'Invoking: MSP430 Compiler'
    "C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -Ooff --opt_for_speed=2 --use_hw_mpy=F5 --include_path="C:/ti2/ccsv7/ccs_base/msp430/include" --include_path="C:/adata/CCSV7_workspace/F2-1" --include_path="C:/ti/tirtos_msp43x_2_16_01_14/products/msp430_driverlib_2_21_00_08a/driverlib/MSP430F5xx_6xx" --include_path="C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power_severity=suppress --advice:power=all -g --define=ccs --define=MSP430WARE --define=__MSP430F5528__ --display_error_number --diag_warning=225 --diag_warning=255 --diag_wrap=off --abi=eabi --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU23 --silicon_errata=CPU40 --printf_support=minimal --preproc_with_compile --preproc_dependency="main.d_raw" --cmd_file="configPkg/compiler.opt" "../main.c"
    'Finished building: ../main.c'
    ' '
    'Building file: ../my_board.c'
    'Invoking: MSP430 Compiler'
    "C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -Ooff --opt_for_speed=2 --use_hw_mpy=F5 --include_path="C:/ti2/ccsv7/ccs_base/msp430/include" --include_path="C:/adata/CCSV7_workspace/F2-1" --include_path="C:/ti/tirtos_msp43x_2_16_01_14/products/msp430_driverlib_2_21_00_08a/driverlib/MSP430F5xx_6xx" --include_path="C:/ti2/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power_severity=suppress --advice:power=all -g --define=ccs --define=MSP430WARE --define=__MSP430F5528__ --display_error_number --diag_warning=225 --diag_warning=255 --diag_wrap=off --abi=eabi --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU23 --silicon_errata=CPU40 --printf_support=minimal --preproc_with_compile --preproc_dependency="my_board.d_raw" --cmd_file="configPkg/compiler.opt" "../my_board.c"
    'Finished building: ../my_board.c'
    ' '
    gmake: Target 'all' not remade because of errors.
    
    **** Build Finished ****
    

  • Hi Roy,

    were you able to resolve your issue or did it still occur after installing the most recent driverlib version?
    Please let me know what the current status is and click "Verify answer" in case your issue was solved.

    Best regards,
    Britta
  • Hi Britta,
    I downloaded and installed the latest driver library. This seemed to go OK. I can now see the newly installed files on C:\ti\msp path.

    What still eludes me is getting the project settings properly configured so that it will use the new driver library.

    When I perform a clean / build, and then comb through the build process, I can see that it is still referencing at least 1 old library. Maybe more.

    What is needed are some instructions on how to configure the project properties so it will use the library I want (I think).

    Thank you for the help.
    Roy
  • Hi Roy,

    did you already adapt your project settings and deleted the links to the older libraries and added a new link to the newest version?

    For more instructions you could take a look at the Include paths and options wiki page, it should hopefully help you to get the right settings in your project.

    Let me know if this helps.

    Best regards,

    Britta

  • Include_Options.pdfHi Britta,

    I added a new include path, that I believe leads to the new driverlib.  Please see the attached screen shot of my include options.

    This is the first line of the include options.  This did not solve the compiler error.

    After that there are cryptic entries that I am not sure if they should be modified, or possibly delete.

    For the 2nd entry {MSP430_DRIVERLIB_INCLUDE_PATH},      Not sure what to do here 

    The 5th entry,  {COM_TI_RTSC_TIRTOSMSP430_INSTALL_DIR}   Seems to lead to lead to another driverlib.  Again, not sure of action here.

    I am wary of changing things that I do not fully grasp.  I could make things worse.

    I will take a look at the wiki page, but some guidance on these entries would help.

    Thanks

    Roy

  • Hi Roy,

    the indicated wiki page should give you a hint on the different paths you have included in your project settings.
    The entries in question seem cryptic as they use relative paths to allow easy portability of the projects.
    Hopefully this is explained with enough detail on the wiki page I've indicated before.

    I understand that you are unsure what to change without damaging your project, so there are two different ways that I can indicate for you:
    1) Instead of adding new include paths (as you did to link to the most recent driverlib version) you could also edit the existing ones and point them to the most recent driverlib version instead of the one they currently point to. To do so please take a look at every include search path and se where it exaclty points to.
    2) You could set up a new project step by step and make sure it points to the most recent driverlib version from the beginning.

    Please let me know if one of those are feasible for you.

    Thanks and best regards,
    Britta

**Attention** This is a public forum