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.

CC2640 compilation error : "driverlib/sys_ctrl.h"

Other Parts Discussed in Thread: SYSBIOS

Hi,

I created a new RTSC project.
When I compile my project, i get this error :

cannot open source file "driverlib/sys_ctrl.h"  

But I have added the path in the "Include Options "

And a right click on " <driverlib/sys_ctrl.h>" opens the sys_ctrl. h file .

the file seems located. But why the compiler still cannot find the file?

Thank you!

  • Can you post the full output of the CCS build console? It is best to copy the full build log to a text file and attach it here.

    Also which version of CCS are you using?

  • Hi I am using CCS Version: 6.1.2.00015

    Below, the full output of the CCS build console
    Thank you!


    **** Build of configuration Debug for project PF ****

    "C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
    'Building file: ../PF.cfg'
    'Invoking: XDCtools'
    "C:/ti/xdctools_3_32_00_06_core/xs" --xdcpath="C:/ti/tirtos_cc13xx_cc26xx_2_16_00_08/packages;C:/ti/tirtos_cc13xx_cc26xx_2_16_00_08/products/tidrivers_cc13xx_cc26xx_2_16_00_08/packages;C:/ti/tirtos_cc13xx_cc26xx_2_16_00_08/products/bios_6_45_01_29/packages;C:/ti/tirtos_cc13xx_cc26xx_2_16_00_08/products/uia_2_00_05_50/packages;C:/ti/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.M3 -p ti.platforms.simplelink:CC2640F128 -r release -c "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.7" "../PF.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring PF.xem3 from package/cfg/PF_pem3.cfg ...
    generating custom ti.sysbios library makefile ...
    Starting build of library sources ...
    making C:/PROJET/PF/soft/dev/src/src/sysbios/sysbios.aem3 ...
    gmake[1]: Entering directory `C:/PROJET/PF/soft/dev/src/src/sysbios'
    clem3 C:/ti/tirtos_cc13xx_cc26xx_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/BIOS.c ...
    "C:/ti/tirtos_cc13xx_cc26xx_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/family/arm/cc26xx/Boot.c", line 36: fatal error: cannot open source file "driverlib/sys_ctrl.h"

    >> Compilation failure
    1 catastrophic error detected in the compilation of "C:/ti/tirtos_cc13xx_cc26xx_2_16_00_08/products/bios_6_45_01_29/packages/ti/sysbios/family/arm/cc26xx/Boot.c".
    Compilation terminated.
    gmake[1]: *** [BIOS.obj] Error 1
    gmake[1]: Leaving directory `C:/PROJET/PF/soft/dev/src/src/sysbios'
    gmake: *** [C:/PROJET/PF/soft/dev/src/src/sysbios/sysbios.aem3] Error 2
    Build of libraries failed.
    error: xdc.cfg.SourceDir: "C:/ti/xdctools_3_32_00_06_core/packages/xdc/cfg/SourceDir.xs", line 209: xdc.cfg.SourceDir : Build of generated source libraries failed: exit status = 2:

    js: "C:/ti/xdctools_3_32_00_06_core/packages/xdc/cfg/Main.xs", line 160: Error: Configuration failed!
    gmake.exe: *** [package/cfg/PF_pem3.xdl] Error 1
    gmake.exe: *** Deleting file `package/cfg/PF_pem3.xdl'
    gmake.exe: *** [package/cfg/PF_pem3.xdl] Deleting file `package/cfg/PF_pem3.h'
    gmake.exe: *** [package/cfg/PF_pem3.xdl] Deleting file `package/cfg/PF_pem3.c'
    js: "C:/ti/xdctools_3_32_00_06_core/packages/xdc/tools/Cmdr.xs", line 51: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.
    gmake: *** [configPkg/linker.cmd] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****
  • There is more than one error in the build log.

    Let us address this error first: "xdc.cfg.SourceDir : Build of generated source libraries failed: exit status = 2:"

    Take a look at this wiki for potential causes and resolutions: http://processors.wiki.ti.com/index.php/Build_Errors_in_CCS#RTSC_Diagnostics

    After this issue is fixed, let us know what build errors remain.

  • I checked there are no whitespaces and non-ASCII characters.
    But how can i check this :"Take a close look at the CCS build console and ensure that the sh.exe used for the build is the one from the CCS directory."?
  • ttl said:
    But how can i check this :"Take a close look at the CCS build console and ensure that the sh.exe used for the build is the one from the CCS directory."?

    If the build console does not show the shell invocation, I would suggest checking your system's PATH environment variable anyway. Check if there are any other tools in the PATH that may contain sh.exe (cygwin is a common one that has been known to cause issues).

  • I have a make.exe with Gnuwin32. To take precaution I add the "C:\ti\ccsv6\utils\bin" before the Gnuwin32. But I still have the same error.

    I don't have this error when I compile an example project. The error appears only when it is a new RTCS project created on my own.
  • ttl said:
    I don't have this error when I compile an example project. The error appears only when it is a new RTCS project created on my own.

    OK. I suspect you are missing some include paths. I see that you have added a path under the Compiler's Include Options, but I suspect you are missing it under XDCtools.

    I would suggest taking a look at one of the TI-RTOS example projects and cross-check the settings with your custom project. Specifically, in an example project, if you go into Properties->Build->XDCtools->Advanced Options, you should find "${COMPILER_FLAGS} " listed under --compileOptions. These are flags passed to the compiler during invocation of XDCtools. The actual value of ${COMPILER_FLAGS} can be seen defined under Build->Variables tab (after enabling the "Show system variables" checkbox). Since your build is not finding the header file during the XDCtools stage, I think you may be missing this option. 

    If that is the case, you can create a new variable with that name, copy its value from an example project into your custom project, and add that variable under XDCtools --compileOptions. In addition, you may be missing a few other similar options, so I would double-check to be sure.

    An alternate process, to avoid such missing dependencies, could be to make a copy of a TI-RTOS example project and use that as a baseline for starting your own project. You could delete all the source files in it and add your own, but at least the base properties and settings will be derived from the working examples.