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/MSP432P401R: System_printf not working in CCS 9.1.0

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hello,

Previously I was using CCS V7 with System_printf with no issue.

I now upgrade to CCS V9.1.0 but I can no longer use System_printf  to print to the console. I am using the MSP432P401R LaunchPad Development Kit.

When I compiled, I got the following error:

fatal error #1965: cannot open source file "xdc/runtime/System.h"

Please someone can tell me what I was missing.

Thanks.

  • Viet Nguyen1 said:
    fatal error #1965: cannot open source file "xdc/runtime/System.h"

    Is this your own custom project that you were working with in CCSv7 that you then imported into CCSv9? Or is it a TI provided example project? 
    When importing projects created with older versions of CCS into newer versions, make sure to always open a new workspace and import into it rather than opening the old workspace directly with the newer version of CCS.

    Make sure that the XDCtools version and SimpleLink SDK versions match up with what you were using with CCSv7 and then try to rebuild. You can also compare the build output for the two versions to help identify differences that may be causing the error. It is possible that the migration impacted the build process somehow and perhaps the .cfg file is not getting passed properly to the XDCtools command.

  • Since I haven’t heard back from you, I’m assuming you were able to move past this issue. If not, please feel free to post a reply with an update below (or create a new thread). Thanks!

  • Hi AartiG,

    I was able to import a project from CCS7, compile and run in CCS9 using System_printf. I import that project in CCS9 workspace.

    But when I tried to use  System_printf in one new example in CCS9, I included the same headers as the above project, but it complained:

    fatal error #1965: cannot open source file "xdc/runtime/System.h"

    fatal error #1965: cannot open source file "xdc/std.h"

  • Viet Nguyen1 said:
    But when I tried to use  System_printf in one new example in CCS9, I included the same headers as the above project, but it complained

    The error in general indicates that the compiler was unable to open the mentioned header file because it could not find the path to it. In this case it does not know where to find "xdc/runtime/System.h" and "xdc/std.h".

    These paths/files are typically under C:\ti\<ccs_version>\<xdctools_version>\packages

    In the example projects, this path is automatically added to the compiler's include path when the .cfg file is built. As part of the build, the XDCtools generate a compiler.opt file (in the \Debug\configPkg directory) that is then passed to the compiler when building the C source files, like below:

     "C:/CCStudio_9.1.0.00007/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --include_path="C:/CCStudio_9.1.0.00007/ccs/ccs_base/arm/include" --include_path="C:/CCStudio_9.1.0.00007/ccs/ccs_base/arm/include/CMSIS" --include_path="C:/workspaces/ccsv910/msp_workspace/hello_MSP432P401R" --include_path="C:/CCStudio_9.1.0.00007/ccs/tools/compiler/ti-cgt-arm_18.12.2.LTS/include" --advice:power=all --define=__MSP432P401R__ --define=ccs -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="hello.d_raw" --cmd_file="configPkg/compiler.opt" "../hello.c"

    So if you set up your project similar to one of the examples, (ie) with a similar RTSC .cfg file and build settings, then that should fix the error. 

    Alternately, you can manually add this path to your project's Compiler->Include Options->--include_path setting (after changing to match your versions):

    C:/CCStudio_9.1.0.00007/xdctools_3_55_02_22_core/packages

    However, to avoid other issues that may pop up later in the build, it will be best to compare all settings of your new project with a known good example. Or better yet, make a copy of an example project and use that as a starting point for your new development.

    Hope this helps.

  • I couldn't locate where the file RTSC.cfg. I also tried to include some path settings, then it produced other errors such as undefined this and that.

    I just wonder why I couldn't find any sample for my LaunchPad MSP432P401R that has a System_printf function. That would make it so much easier.

  • There are several TI-RTOS Kernel examples that use System_printf. If you import one of them and have a look at the RTSC cfg file, code and settings, that should help get an understanding of how it is used. You can import them directly from Resource Explorer in CCS.

  • Thanks Aartig, this resolved my issue.

    Viet