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/LAUNCHXL-F28027F: Creating new project

Part Number: LAUNCHXL-F28027F
Other Parts Discussed in Thread: C2000WARE

Tool/software: TI C/C++ Compiler

I create a new ccs project,i get error

**** Build of configuration Debug for project test ****
"C:\\ti\\ccsv8\\utils\\bin\\gmake" -k -j 2 all -O
 
Building file: "../main.c"
Invoking: C2000 Compiler
"C:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.3.LTS/bin/cl2000" -v28 -ml -mt --include_path="C:/ti/C2000Ware_1_00_05_00_Software/device_support/f2802x" --include_path="C:/ti/C2000Ware_1_00_05_00_Software/device_support/f2802x/common/include" --include_path="C:/ti/C2000Ware_1_00_05_00_Software/device_support/f2802x/headers/include" --include_path="C:/ti/C2000Ware_1_00_05_00_Software/libraries/math/IQmath/c28/include" --include_path="C:/Users/shad/workspace_v8/test" --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.3.LTS/include" -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="main.d_raw"  "../main.c"
Finished building: "../main.c"
 
Building target: "test.out"
Invoking: C2000 Linker
"C:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.3.LTS/bin/cl2000" -v28 -ml -mt -g --diag_warning=225 --diag_wrap=off --display_error_number -z -m"test.map" --stack_size=0x300 --warn_sections -i"C:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.3.LTS/lib" -i"C:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.3.LTS/include" --reread_libs --diag_wrap=off --display_error_number --xml_link_info="test_linkInfo.xml" --rom_model -o "test.out" "./main.obj" "../28027_RAM_lnk.cmd"  -llibc.a
<Linking>
 
 undefined              first referenced
  symbol                    in file    
 ---------              ----------------
 _ADC_init              ./main.obj     
 _CLK_enableAdcClock    ./main.obj     
 _CLK_init              ./main.obj     
 _CLK_setOscSrc         ./main.obj     
 _CPU_clearIntFlags     ./main.obj     
 _CPU_disableGlobalInts ./main.obj     
 _CPU_init              ./main.obj     
 _FLASH_init            ./main.obj     
 _GPIO_init             ./main.obj     
 _PIE_disable           ./main.obj     
 _PIE_disableAllInts    ./main.obj     
 _PIE_init              ./main.obj     
 _PLL_init              ./main.obj     
 _PLL_setup             ./main.obj     
 _PWM_init              ./main.obj     
 _WDOG_disable          ./main.obj     
 _WDOG_init             ./main.obj     
 
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "test.out" not built
 
>> Compilation failure
makefile:141: recipe for target 'test.out' failed
makefile:137: recipe for target 'all' failed
gmake[1]: *** [test.out] Error 1
gmake: *** [all] Error 2
**** Build Finished ***
*
  • How did you created your example?
    Could you import TI example and build it?
  • I create a new ccs project and then attached the headers file
  • Comment out your modifications and try to build an empty project.
  • I create whole new project .

    sir,can u guide me how to add all necessary files to this and what are the necessary files????
    thank sir
  • Could you comment out your modifications and try to compile?
  • yes it is successfully compiled
  • Ok,
    than add paths to header files you need and try to build,
    also post main.c
  • sir,how can I add paths to header files
  • Please show your main.c.
    Build project and show console output.
    You need to learn from this document: dev.ti.com/.../
  • main
    #include "DSP28x_Project.h" // Device Headerfile and Examples Include File

    #include "common/include/adc.h"
    #include "common/include/clk.h"
    #include "common/include/flash.h"
    #include "common/include/gpio.h"
    #include "common/include/pie.h"
    #include "common/include/pll.h"
    #include "common/include/timer.h"
    #include "common/include/wdog.h"

    //
    // Function Prototypes
    //
    __interrupt void cpu_timer0_isr(void);

    uint16_t interruptCount = 0;

    ADC_Handle myAdc;
    CLK_Handle myClk;
    FLASH_Handle myFlash;
    GPIO_Handle myGpio;
    PIE_Handle myPie;
    TIMER_Handle myTimer;

    //
    // Main
    //
    void main(void)
    {
    CPU_Handle myCpu;
    PLL_Handle myPll;
    WDOG_Handle myWDog;

    //
    // Initialize all the handles needed for this application
    //
    myAdc = ADC_init((void *)ADC_BASE_ADDR, sizeof(ADC_Obj));
    myClk = CLK_init((void *)CLK_BASE_ADDR, sizeof(CLK_Obj));
    myCpu = CPU_init((void *)NULL, sizeof(CPU_Obj));
    myFlash = FLASH_init((void *)FLASH_BASE_ADDR, sizeof(FLASH_Obj));
    myGpio = GPIO_init((void *)GPIO_BASE_ADDR, sizeof(GPIO_Obj));
    myPie = PIE_init((void *)PIE_BASE_ADDR, sizeof(PIE_Obj));
    myPll = PLL_init((void *)PLL_BASE_ADDR, sizeof(PLL_Obj));
    myTimer = TIMER_init((void *)TIMER0_BASE_ADDR, sizeof(TIMER_Obj));
    myWDog = WDOG_init((void *)WDOG_BASE_ADDR, sizeof(WDOG_Obj));

    //
    // Perform basic system initialization
    //
    WDOG_disable(myWDog);
    CLK_enableAdcClock(myClk);
    (*Device_cal)();

    //
    // Select the internal oscillator 1 as the clock source
    //
    CLK_setOscSrc(myClk, CLK_OscSrc_Internal);

    //
    // Setup the PLL for x10 /2 which will yield 50Mhz = 10Mhz * 10 / 2
    //
    PLL_setup(myPll, PLL_Multiplier_10, PLL_DivideSelect_ClkIn_by_2);

    //
    // Disable the PIE and all interrupts
    //
    PIE_disable(myPie);
    PIE_disableAllInts(myPie);
    CPU_disableGlobalInts(myCpu);
    CPU_clearIntFlags(myCpu);

    //
    // If running from flash copy RAM only functions to RAM
    //
    #ifdef _FLASH
    memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
    #endif

    //
    // Setup a debug vector table and enable the PIE
    //
    PIE_setDebugIntVectorTable(myPie);
    PIE_enable(myPie);

    //
    // Register interrupt handlers in the PIE vector table
    //
    PIE_registerPieIntHandler(myPie, PIE_GroupNumber_1, PIE_SubGroupNumber_7,
    (intVec_t)&cpu_timer0_isr);

    //
    // Configure CPU-Timer 0 to interrupt every 500 milliseconds:
    // 60MHz CPU Freq, 50 millisecond Period (in uSeconds)
    //
    //ConfigCpuTimer(&CpuTimer0, 60, 500000);
    //
    TIMER_stop(myTimer);
    TIMER_setPeriod(myTimer, 50 * 500000);
    TIMER_setPreScaler(myTimer, 0);
    TIMER_reload(myTimer);
    TIMER_setEmulationMode(myTimer,
    TIMER_EmulationMode_StopAfterNextDecrement);
    TIMER_enableInt(myTimer);

    TIMER_start(myTimer);

    //
    // Configure GPIO 0-3 as outputs
    //
    GPIO_setMode(myGpio, GPIO_Number_0, GPIO_0_Mode_GeneralPurpose);
    GPIO_setMode(myGpio, GPIO_Number_1, GPIO_0_Mode_GeneralPurpose);
    GPIO_setMode(myGpio, GPIO_Number_2, GPIO_0_Mode_GeneralPurpose);
    GPIO_setMode(myGpio, GPIO_Number_3, GPIO_0_Mode_GeneralPurpose);

    GPIO_setDirection(myGpio, GPIO_Number_0, GPIO_Direction_Output);
    GPIO_setDirection(myGpio, GPIO_Number_1, GPIO_Direction_Output);
    GPIO_setDirection(myGpio, GPIO_Number_2, GPIO_Direction_Output);
    GPIO_setDirection(myGpio, GPIO_Number_3, GPIO_Direction_Output);

    GPIO_setLow(myGpio, GPIO_Number_0);
    GPIO_setHigh(myGpio, GPIO_Number_1);
    GPIO_setLow(myGpio, GPIO_Number_2);
    GPIO_setHigh(myGpio, GPIO_Number_3);

    //
    // Enable CPU INT1 which is connected to CPU-Timer 0:
    //
    CPU_enableInt(myCpu, CPU_IntNumber_1);

    //
    // Enable TINT0 in the PIE: Group 1 interrupt 7
    //
    PIE_enableTimer0Int(myPie);

    //
    // Enable global Interrupts and higher priority real-time debug events
    //
    CPU_enableGlobalInts(myCpu);
    CPU_enableDebugInt(myCpu);

    for(;;)
    {
    __asm(" NOP");
    }
    }

    //
    // cpu_timer0_isr -
    //
    __interrupt void
    cpu_timer0_isr(void)
    {
    interruptCount++;

    //
    // Toggle GPIOs
    //
    GPIO_toggle(myGpio, GPIO_Number_0);
    GPIO_toggle(myGpio, GPIO_Number_1);
    GPIO_toggle(myGpio, GPIO_Number_2);
    GPIO_toggle(myGpio, GPIO_Number_3);

    //
    // Acknowledge this interrupt to receive more interrupts from group 1
    //
    PIE_clearInt(myPie, PIE_GroupNumber_1);
    }

    //
    // End of File
    //




    console
    **** Build of configuration Debug for project test_ ****

    "C:\\ti\\code composer\\ccsv8\\utils\\bin\\gmake" -k -j 4 all -O

    Building file: "../main.c"
    Invoking: C2000 Compiler
    "C:/ti/code composer/ccsv8/tools/compiler/ti-cgt-c2000_18.1.1.LTS/bin/cl2000" -v28 -ml -mt --include_path="C:/Users/vecmo/workspace_v8/test_" --include_path="C:/ti/c2000/C2000Ware_1_00_05_00" --include_path="C:/ti/code composer/ccsv8/tools/compiler/ti-cgt-c2000_18.1.1.LTS/include" -g --diag_warning=225 --diag_wrap=off --display_error_number --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 4: fatal error #1965: cannot open source file "DSP28x_Project.h"
    1 catastrophic error detected in the compilation of "../main.c".
    Compilation terminated.
    gmake: *** [main.obj] Error 1
    gmake: Target 'all' not remade because of errors.

    **** Build Finished ****
  • You need to link driverlib.
  • Aash,

    If you are creating a new project from scratch rather than using one of the example projects from C2000Ware as a starting point, then open one of the example projects and use it as a reference. In particular, make sure that the compiler include paths and linker search paths and libraries match up with the examples. Note that the INSTALLROOT_F2802x variable referenced in the examples is a variable that is automatically set to a specific device directory inside C2000Ware. If you are creating a new project from scratch you would need to create this variable yourself (refer to this page for more on variables).

    Finally, as Tom mentioned, make sure to add or link driverlib.lib to your project to resolve the undefined symbol linker errors.