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.

GRACE: Fatal error: could not open source file "Code"

Other Parts Discussed in Thread: MSP430G2231, CODECOMPOSER

I just installed GRACE. There werde no errors I am aware of. 

I now try to do the example from the "Getting Started Guid".

The only thing I did is to enable P1.0 for output and write the following lines to main.c:

    while(1){

     P1OUT ^= BIT0;

     __delay_cycles(120000);

    }

However, when I try to compile, I get the following message:

=============================================

**** Build of configuration Debug for project TestGrace2 ****

 

C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all 

'Building file: ../main.cfg'

'Invoking: XDCtools'

"C:/Program Files/Texas Instruments/xdctools_3_21_00_27_eng/xs" --xdcpath="C:/Program Files/Texas Instruments/grace_1_00_00_56_eng/packages;" xdc.tools.configuro -o configPkg -t ti.targets.msp430.MSP430 -p ti.platforms.msp430:MSP430G2231 -r debug -c "C:/Program Files/Texas Instruments/ccsv4/tools/compiler/MSP430 Code Generation Tools 3.3.3" "../main.cfg"

making package.mak (because of package.bld) ...

generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...

configuring main.p430 from package/cfg/main_p430.cfg ...

cl430 package/cfg/main_p430.c ...

Fatal error: could not open source file "Code"

1 fatal error detected in the compilation of "Code".

Compilation terminated.

=============================================

Theer seems to be a file "Code" missing. 
Can anybode give me a hint what this means?
cheers, Daniel

  • Almost looks like a path issue.  On Step 6 of http://processors.wiki.ti.com/index.php/Grace_Quick_Start_Guide#To_Create_a_Grace-Enabled_Project

    >>You can base your new project on one of the Grace example programs listed under Grace Examples

    I used  the Grace Examples for a couple of projects (The debounced "button" example is GREAT for a digital edge I needed to wake a processor out of IDLE). 

    You might start with a Grace Example this just to make sure your tools flow is OK.

     

  • Hi,

    thank's for your answer. I tried the example you proposed and got the same error. 

    During installation I did not need to specify anything, all was done automatically.

    cheers, Daniel

  • Below is my build log for your reference.  Looks like you are getting an error on a generated file that I have at:

    C:\workspace\MSP430_Grace\IDLE_Wake\Debug\configPkg\package\cfg\button_p430.c

    and builds fine

    >>configuring button.p430 from package/cfg/button_p430.cfg ...

    >>cl430 package/cfg/button_p430.c ...

    Do you see an xxx_p430.c file in that directory? 

    I don't see a file called "Code" anywhere in the Workspace,  Sometimes the generated errors messages can be a little confusing.

    **** Build of configuration Debug for project IDLE_Wake ****

    C:\Program Files\Texas Instruments\ccsv4_2_1\ccsv4\utils\gmake\gmake -k all

    'Building file: ../button.cfg'

    'Invoking: XDCtools'

    "C:/Program Files/Texas Instruments/ccsv4_2_1/xdctools_3_21_00_27_eng/xs" --xdcpath="C:/Program Files/Texas Instruments/ccsv4_2_1/grace_1_00_00_56_eng/packages;" xdc.tools.configuro -o configPkg -t ti.targets.msp430.MSP430 -p ti.platforms.msp430:MSP430G2231 -r debug -c "C:/Program Files/Texas Instruments/ccsv4_2_1/ccsv4/tools/compiler/msp430" "../button.cfg"

    making package.mak (because of package.bld) ...

    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...

    configuring button.p430 from package/cfg/button_p430.cfg ...

    cl430 package/cfg/button_p430.c ...

    'Finished building: ../button.cfg'

    ' '

    making ../src/csl/csl.lib ...

    cl430 CSL_init.c ...

    C:/PROGRA~1/TEXASI~1/ccsv4_2_1/ccsv4/tools/compiler/msp430/bin/cl430 -c --obj_directory=objs/ -D__MSP430G2231__ -vmsp -I C:/PROGRA~1/TEXASI~1/ccsv4_2_1/ccsv4/tools/compiler/msp430/include -g -qq -pdsw225 -I "C:\Program Files\Texas Instruments\ccsv4_2_1\grace_1_00_00_56_eng\packages" CSL_init.c

    cl430 WDTplus_init.c ...

    C:/PROGRA~1/TEXASI~1/ccsv4_2_1/ccsv4/tools/compiler/msp430/bin/cl430 -c --obj_directory=objs/ -D__MSP430G2231__ -vmsp -I C:/PROGRA~1/TEXASI~1/ccsv4_2_1/ccsv4/tools/compiler/msp430/include -g -qq -pdsw225 -I "C:\Program Files\Texas Instruments\ccsv4_2_1\grace_1_00_00_56_eng\packages" WDTplus_init.c

    cl430 GPIO_init.c ...

    C:/PROGRA~1/TEXASI~1/ccsv4_2_1/ccsv4/tools/compiler/msp430/bin/cl430 -c --obj_directory=objs/ -D__MSP430G2231__ -vmsp -I C:/PROGRA~1/TEXASI~1/ccsv4_2_1/ccsv4/tools/compiler/msp430/include -g -qq -pdsw225 -I "C:\Program Files\Texas Instruments\ccsv4_2_1\grace_1_00_00_56_eng\packages" GPIO_init.c

    cl430 BCSplus_init.c ...

    C:/PROGRA~1/TEXASI~1/ccsv4_2_1/ccsv4/tools/compiler/msp430/bin/cl430 -c --obj_directory=objs/ -D__MSP430G2231__ -vmsp -I C:/PROGRA~1/TEXASI~1/ccsv4_2_1/ccsv4/tools/compiler/msp430/include -g -qq -pdsw225 -I "C:\Program Files\Texas Instruments\ccsv4_2_1\grace_1_00_00_56_eng\packages" BCSplus_init.c

    cl430 InterruptVectors_init.c ...

    C:/PROGRA~1/TEXASI~1/ccsv4_2_1/ccsv4/tools/compiler/msp430/bin/cl430 -c --obj_directory=objs/ -D__MSP430G2231__ -vmsp -I C:/PROGRA~1/TEXASI~1/ccsv4_2_1/ccsv4/tools/compiler/msp430/include -g -qq -pdsw225 -I "C:\Program Files\Texas Instruments\ccsv4_2_1\grace_1_00_00_56_eng\packages" InterruptVectors_init.c

    ar430 csl.lib objs\CSL_init.obj ...

    C:/PROGRA~1/TEXASI~1/ccsv4_2_1/ccsv4/tools/compiler/msp430/bin/ar430 rq csl.lib objs\CSL_init.obj objs\WDTplus_init.obj objs\GPIO_init.obj objs\BCSplus_init.obj objs\InterruptVectors_init.obj

    'Building file: ../button.c'

    'Invoking: Compiler'

    "C:/Program Files/Texas Instruments/ccsv4_2_1/ccsv4/tools/compiler/msp430/bin/cl430" -vmsp -g --define=__MSP430G2231__ --include_path="C:/Program Files/Texas Instruments/ccsv4_2_1/ccsv4/msp430/include" --include_path="C:/Program Files/Texas Instruments/ccsv4_2_1/ccsv4/tools/compiler/msp430/include" --diag_warning=225 --printf_support=minimal --preproc_with_compile --preproc_dependency="button.pp" --cmd_file="./configPkg/compiler.opt" "../button.c"

    'Finished building: ../button.c'

    ' '

    'Building target: IDLE_Wake.out'

    'Invoking: Linker'

    "C:/Program Files/Texas Instruments/ccsv4_2_1/ccsv4/tools/compiler/msp430/bin/cl430" -vmsp -g --define=__MSP430G2231__ --diag_warning=225 --printf_support=minimal -z -m"IDLE_Wake.map" --stack_size=50 --heap_size=0 --warn_sections -i"C:/Program Files/Texas Instruments/ccsv4_2_1/ccsv4/msp430/include" -i"C:/Program Files/Texas Instruments/ccsv4_2_1/ccsv4/tools/compiler/msp430/lib" -i"C:/Program Files/Texas Instruments/ccsv4_2_1/ccsv4/tools/compiler/msp430/include" --reread_libs --rom_model -o "IDLE_Wake.out" -l"./configPkg/linker.cmd" "./button.obj" -l"libc.a" "../lnk_msp430g2231.cmd"

    <Linking>

    'Finished building target: IDLE_Wake.out'

    ' '

    Build complete for project IDLE_Wake

  • Hi,

    I appreciate your answer.

    Your output seems identical to mine up to the line:

    cl430 package/cfg/button_p430.c ...

    But then I get the error message instead of : 'Finished building: ../button.cfg'

    There is no file named  "Code" around, neither can I find it mentioned somewhere.

    But there is a file named: ...3\Debug\configPkg\package\cfg\button_p430.c :

    *****************************************************************************************************

    /*

     *  Do not modify this file; it is automatically 

     *  generated and any modifications will be overwritten.

     *

     * @(#) xdc-w17

     */

     

    #define __nested__

    #define __config__

     

    #include <xdc/std.h>

     

    /*

     * ======== GENERATED SECTIONS ========

     *     

     *     MODULE INCLUDES

     *     

     *     <module-name> INTERNALS

     *     <module-name> INHERITS

     *     <module-name> VTABLE

     *     <module-name> PATCH TABLE

     *     <module-name> DECLARATIONS

     *     <module-name> OBJECT OFFSETS

     *     <module-name> TEMPLATES

     *     <module-name> INITIALIZERS

     *     <module-name> FUNCTION STUBS

     *     <module-name> PROXY BODY

     *     <module-name> OBJECT DESCRIPTOR

     *     <module-name> SYSTEM FUNCTIONS

     *     <module-name> PRAGMAS

     *     

     *     INITIALIZATION ENTRY POINT

     *     PROGRAM GLOBALS

     *     CLINK DIRECTIVES

     */

     

     

    /*

     * ======== MODULE INCLUDES ========

     */

     

     

     

    /*

     * ======== xdc.cfg.Program TEMPLATE ========

     */

     

    /*

     *  ======== __ASM__ ========

     *  Define absolute path prefix for this executable's

     *  configuration generated files.

     */

    xdc__META(__ASM__, "@(#)__ASM__ = D:/D/CodeComposer/TestGrace3/Debug/configPkg/package/cfg/button_p430");

     

    /*

     *  ======== __ISA__ ========

     *  Define the ISA of this executable.  This symbol is used by platform

     *  specific "exec" commands that support more than one ISA; e.g., gdb

     */

    xdc__META(__ISA__, "@(#)__ISA__ = 430");

     

    /*

     *  ======== __PLAT__ ========

     *  Define the name of the platform that can run this executable.  This

     *  symbol is used by platform independent "exec" commands

     */

    xdc__META(__PLAT__, "@(#)__PLAT__ = ti.platforms.msp430");

     

    /*

     *  ======== __TARG__ ========

     *  Define the name of the target used to build this executable.

     */

    xdc__META(__TARG__, "@(#)__TARG__ = ti.targets.msp430.MSP430");

     

    /*

     *  ======== __TRDR__ ========

     *  Define the name of the class that can read/parse this executable.

     */

    xdc__META(__TRDR__, "@(#)__TRDR__ = ti.targets.omf.cof.Coff");

     

     

    /*

     * ======== ti.catalog.msp430.init.Boot TEMPLATE ========

     */

     

        extern ti_catalog_msp430_init_Boot_disableWatchdog(UInt address);

        extern ti_catalog_msp430_init_Boot_configureDCO();

     

    #if defined(__ti__)

    #pragma CODE_SECTION(ti_catalog_msp430_init_Boot_init, ".bootCodeSection")

    #endif

     

    /*

     *  ======== ti_catalog_msp430_init_Boot_init ========

     */

    Void ti_catalog_msp430_init_Boot_init()

    {

    }

     

     

     

    /*

     * ======== ti.mcu.msp430.csl.CSL TEMPLATE ========

     */

     

    /* CSL stuff */

     

    /*

     * ======== ti.mcu.msp430.csl.gpio.GPIO TEMPLATE ========

     */

     

    /* GPIO stuff from C:/Program Files/Texas Instruments/grace_1_00_00_56_eng/packages/ti/mcu/msp430/csl/gpio/./GPIO.xdt */

     

    /*

     * ======== ti.mcu.msp430.csl.clock.BCSplus TEMPLATE ========

     */

     

    /* 2xx Clock stuff from C:/Program Files/Texas Instruments/grace_1_00_00_56_eng/packages/ti/mcu/msp430/csl/clock/./BCSplus.xdt */

     

    /*

     * ======== ti.mcu.msp430.csl.watchdog.WDTplus TEMPLATE ========

     */

     

    /* WDTplus stuff from C:/Program Files/Texas Instruments/grace_1_00_00_56_eng/packages/ti/mcu/msp430/csl/watchdog/./WDTplus.xdt */

     

    /*

     * ======== ti.mcu.msp430.csl.interrupt_vectors.InterruptVectors TEMPLATE ========

     */

     

    /* Interrupt_Vectors stuff from C:/Program Files/Texas Instruments/grace_1_00_00_56_eng/packages/ti/mcu/msp430/csl/interrupt_vectors/./InterruptVectors.xdt */

     

    /*

     * ======== ti.mcu.common.SourceDir TEMPLATE ========

     */

     

     

     

    /*

     * ======== PROGRAM GLOBALS ========

     */

     

     

    /*

     * ======== CLINK DIRECTIVES ========

     */

    ********************************************************************************

     

    I would like another pecularity I observe. When I build (not Rebuild) the code a second time, I get an additional error:

    ===========================================================

    **** Build of configuration Debug for project TestGrace3 ****

     

    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all 

    making ../src/csl/csl.lib ...

    cl430 CSL_init.c ...

    C:/PROGRA~1/TEXASI~1/ccsv4/tools/compiler/MSP430 Code Generation Tools 3.3.3/bin/cl430 -c --obj_directory=objs/ -D__MSP430G2231__  -vmsp -I C:/PROGRA~1/TEXASI~1/ccsv4/tools/compiler/MSP430 Code Generation Tools 3.3.3/include  -g -qq -pdsw225  -I "C:\Program Files\Texas Instruments\grace_1_00_00_56_eng\packages" CSL_init.c

    'C:/PROGRA~1/TEXASI~1/ccsv4/tools/compiler/MSP430' is not recognized as an internal or external command,

    operable program or batch file.

    gmake[1]: *** [objs\CSL_init.obj] Error 1

    ==============================================================

    This error is created by the following lines from: ../stc/csl/makefile:

    CC = C:/PROGRA~1/TEXASI~1/ccsv4/tools/compiler/MSP430 Code Generation Tools 3.3.3/bin/cl430 -c --obj_directory=objs/ -D__MSP430G2231__  -vmsp -I C:/PROGRA~1/TEXASI~1/ccsv4/tools/compiler/MSP430 Code Generation Tools 3.3.3/include 

    AR = C:/PROGRA~1/TEXASI~1/ccsv4/tools/compiler/MSP430 Code Generation Tools 3.3.3/bin/ar430 rq

    Obviously, the problem is created by the spaces in the folder names. If I quotes the names, this error disappears, but not the one concerning the mistery file "Code". 

     

     

  • True, I don't have spaces (I use underscores whenever possible) in my "AR=" line in makefile.

    >>xdc__META(__ASM__, "@(#)__ASM__ = D:/D/CodeComposer/TestGrace3/Debug/configPkg/package/cfg/button_p430");

    Just as a quick question, is the above from your button_p430,c file a valid path? 

    It is legal but figured it was worth checking.

     

  • I am working on Vista. The spaces where inserted by the installer not by me.

    The path to button_p430.c exists and is valid.

    cheers, Daniel

  • Daniel,

    It looks like when XDCtools invokes cl430 it explicitly names the compiler's own include subdirectory in a -I option, but doesn't put quotes around it. You can verify this yourself by enabling verbose build output using the CCSv4 project properties:

     

    On my machine, XDCtools removes spaces from the pathname by using the DOS 8.3 filenames where needed instead, but I wonder if this isn't working on your machine. In any case, it would be better if XDCtools were to explicitly quote the path. I'll file a bug about this.

    It's possible, on NTFS drives, to turn off the creation of 8.3 filenames, see http://support.microsoft.com/kb/121007. I wonder if this the case on your drive? Can you please verify for me that the "MSP430 Code Generation Tools 3.3.3" portion of the compiler pathname actually has an 8.3 equivalent? Like, open a dos box in directory above, and do "dir /x"?

    Jon

  • Hi Jon,

    you are right, no short file names are created by dir /X.

    In the registry the key: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\\NtfsDisable8dot3NameCreation" ist set to "1".

    Do I need to change this to "0"?

    Do you think this has something to do with the problem of the mistery file "Code" ????

    cheers, Daniel

  • Yes, because the compiler is being invoked via something like:

        cl430 [...] -IC:/PROGRA~1/TEXASI~1/ccsv4/tools/compiler/MSP430 Code Generation Tools 3.3.3/include package/cfg/spi_p430.c

    Because there are no quotes it's taking "-IC:/PROGRA~1/TEXASI~1/ccsv4/tools/compiler/MSP430" as the include path option, and "Code" as the name of the C file.

    To fix this, I *think* that I would set that registry entry to 0 and reboot, like it says in Microsoft support article 121007. That won't create the 8.3 name yet, it will just allow it. To actually create the short name, you'll have to rename the "MSP430 Code Generation Tools 3.3.3" subdirectory to something else, then rename it back.

    There are other options to work around it. You could, for example, uninstall the MSP430 compiler and reinstall it into a subdirectory without spaces in the pathname.

    I'm recommending the trickier one because you might not have the compiler installer handy so this might actually be easier, and because turning off that registry entry will prevent similar problems in the future.

    There are various articles on the web recommending sysadmins disable short filenames on new XP and Vista installs for performance reasons. I am not a sysadmin but in my opinion that's a Bad Idea.

    Jon

  • Hi Jon,

    I thank  you so much. 

    Changing the key value to zero and renaming by deleting the spaces did the trick. 

    Did you file a report to TI about the missing quotes, otherwise I will do it.

    cheers, Daniel

  • Yes, filed as http://bugs.eclipse.org/335069

    Thanks for the feedback, it helps us improve Grace. Hope you find it useful.

    Jon

**Attention** This is a public forum