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.

MSP430FR2355: fatal error #1965: cannot open source file "driverlib.h"

Part Number: MSP430FR2355

  This seems to be a very common error.  Note that the error message:

fatal error #1965: cannot open source file "driverlib.h"

  would be infinitely more useful if the full pathname of the file it could not find was given.  Clearly the IDE was looking in an exact place. That exact path should be passed on to the user in the error message.

  At any rate, I created a new project in CCS Version: 12.1.0.00007 .  Prior to this I was working on another existing project without any problems.

  After creating the project (a blank template) I brought in some .c and .h files from a previous project. (this is a next version of the circuit board). When I attempted to compile the project, I got the error.

  How is it a new project where the path for the project and the processor type were specified was not able to find the include files ?

  Looking in the"Includes" fikterm U see:

I see the directory specified,. It contains:

  What are my next steps ?

  • Hi Peter,

    Can you please post the console output that includes the errors and the compiler commands? 

    I was able to import a driverlib example and build it without any issues. So I suspect that there is something missing in your project settings. This is what my compiler include path is. Can you check yours to make sure it is pointing to valid driverlib location? (Note that in my project, there is a local copy of the driverlib. This is not a requirement, but this may be a workaround for you).

    Regards,

    Evan

  • Here is the console output:

    **** Build of configuration Debug for project agcModule ****

    "C:\\ti\\ccs1210\\ccs\\utils\\bin\\gmake" -k -j 12 all -O

    Building file: "../adcFifo.c"
    Invoking: MSP430 Compiler
    "C:/ti/ccs1210/ccs/tools/compiler/ti-cgt-msp430_21.6.1.LTS/bin/cl430" -vmspx --use_hw_mpy=F5 --include_path="C:/ti/ccs1210/ccs/ccs_base/msp430/include" --include_path="D:/petePcbKiCad/agcModule/agcSoftware" --include_path="C:/ti/ccs1210/ccs/tools/compiler/ti-cgt-msp430_21.6.1.LTS/include" --advice:power=all --advice:hw_config=all --define=__MSP430FR2355__ --define=_FRWP_ENABLE --define=_INFO_FRWP_ENABLE -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="adcFifo.d_raw" "../adcFifo.c"

    >> Compilation failure
    subdir_rules.mk:9: recipe for target 'adcFifo.obj' failed
    "../adcFifo.c", line 9: fatal error #1965: cannot open source file "driverlib.h"
    1 catastrophic error detected in the compilation of "../adcFifo.c".
    Compilation terminated.
    gmake: *** [adcFifo.obj] Error 1
    Building file: "../main.c"
    Invoking: MSP430 Compiler
    "C:/ti/ccs1210/ccs/tools/compiler/ti-cgt-msp430_21.6.1.LTS/bin/cl430" -vmspx --use_hw_mpy=F5 --include_path="C:/ti/ccs1210/ccs/ccs_base/msp430/include" --include_path="D:/petePcbKiCad/agcModule/agcSoftware" --include_path="C:/ti/ccs1210/ccs/tools/compiler/ti-cgt-msp430_21.6.1.LTS/include" --advice:power=all --advice:hw_config=all --define=__MSP430FR2355__ --define=_FRWP_ENABLE --define=_INFO_FRWP_ENABLE -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="main.d_raw" "../main.c"

    >> Compilation failure
    subdir_rules.mk:9: recipe for target 'main.obj' failed
    "../main.c", line 55: fatal error #1965: cannot open source file "driverlib.h"
    1 catastrophic error detected in the compilation of "../main.c".
    Compilation terminated.
    gmake: *** [main.obj] Error 1
    Building file: "../serialIo.c"
    Invoking: MSP430 Compiler
    "C:/ti/ccs1210/ccs/tools/compiler/ti-cgt-msp430_21.6.1.LTS/bin/cl430" -vmspx --use_hw_mpy=F5 --include_path="C:/ti/ccs1210/ccs/ccs_base/msp430/include" --include_path="D:/petePcbKiCad/agcModule/agcSoftware" --include_path="C:/ti/ccs1210/ccs/tools/compiler/ti-cgt-msp430_21.6.1.LTS/include" --advice:power=all --advice:hw_config=all --define=__MSP430FR2355__ --define=_FRWP_ENABLE --define=_INFO_FRWP_ENABLE -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="serialIo.d_raw" "../serialIo.c"

    >> Compilation failure
    subdir_rules.mk:9: recipe for target 'serialIo.obj' failed
    "../serialIo.c", line 46: fatal error #1965: cannot open source file "driverlib.h"
    1 catastrophic error detected in the compilation of "../serialIo.c".
    Compilation terminated.
    gmake: *** [serialIo.obj] Error 1

      I'll dig around looking for files, tnx for reply.  (and put in a word to make the error message more useful by providing the entire pathname when a file can't be found !)

  • I added the missing directory path that was in your screen shot, there is still the same error trying to find "driverlib.h"

    This is very odd that creating a new project fails to set up a path to what must surely be an extremely common library...

  •   Just for grins, exactly what is the full path to find the driverlib.h and, for that matter, the other "core" include files needed for a given hardware platform and the standard C libraries ?

  • Peter,

    Check your build console to make sure your compiler command has a flag something like this:

    --include_path="C:/{{your_local_driver_lib_installation}}/driverlib/MSP430FR2xx_4xx"

    If you aren't seeing this flag, then you will need to add it as an include path. You mentioned above that you tried this based on the screenshot I provided, but the path in my screenshot is likely not the path on your system.

    On my system driverlib is installed via MSPWare at this location:

    C:\ti\msp430ware_3_80_14_01\driverlib\driverlib\MSP430FR2xx_4xx

    Hopefully this helps.

    Regards,

    Evan

  • Just for grins, exactly what is the full path to find the driverlib.h and, for that matter, the other "core" include files needed for a given hardware platform and the standard C libraries ?

    The MSP standard library will be will be contained in the CCS instally directory. This pulled in via:

    • --include_path="C:/ti/ccs1210/ccs/ccs_base/msp430/include" 
    • --include_path="C:/ti/ccs1210/ccs/tools/compiler/ti-cgt-msp430_21.6.1.LTS/include"

    Driverlib can be located anywhere your system.

  • "C:/ti/ccs1210/ccs/tools/compiler/ti-cgt-msp430_21.6.1.LTS/include"

    has all sorts of includes, many of which I recognize. But no where in the include folder (I search each directory and sub directory) is there a "driverlib.h".

    Presumably all the files under the directory "ccs1210" are installed when that version in installed.

    "C:/ti/ccs1210/ccs/tools/compiler/ti-cgt-msp430_21.6.1.LTS/include"  also has no "driverlib.h".

    As you saw in my 1st post with a picture of the "includes", both of those directories were set-up as include paths.

    I'm at a loss as to how this include file is nowhere to be found. A windows search also can not find it anywhere in the ccs1210 directory.

    In my other project that still compiles, there is a "driverlib" directory. Somehow, when I created this new project no such directory was created

    next steps ?????

  •    I grabbed the "driverlib" directory from my other project, update the includes and things compiled OK.

    So the question I have now is this:  When you create a new project, it looks like not all of the directories are created. I have no idea where driverlib came from or if it is up to date.

    1) What is the original source for driverlib ?

    2) Why does it not get created along with all the other directories (includes, Debug, TargetConfigs) that get created when you create a new project ?

      While things are working, it's a bit unsettling that I don't really know "what" libraries are loaded and if they are the "latest" or not.

  • 1) What is the original source for driverlib ?

    drilverlib is packaged as part of MSPWare. The most up-to-date version can always be found here:

    https://www.ti.com/tool/MSPWARE

    2) Why does it not get created along with all the other directories (includes, Debug, TargetConfigs) that get created when you create a new project ?

    Many users will opt to not use driverlib for their projects so it is not included by default. 

    Regards,

    Evan

**Attention** This is a public forum