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/TMS320C5515: CCS debug build and release build issues

Part Number: TMS320C5515


Tool/software: Code Composer Studio

Hi ,

For an example as below:

#define _DBG  1

#if(_DBG == 1)

  Uint16 abc = 1

  xxxxxxx

#endif

If CCS Build Set Active is Debug , the code will run #if(_DBG == 1).

If CCS Build Set Active is Release , the code does not run #if(_DBG == 1). In other words , #define _DBG  will from 1 to 0.

How to set different define for Debug / Release build?

  • Open the properties for the project.  Under advanced options there is a predefined symbols section.  In there you can add defines.   At the top of the dialog you can change the configuration and set a different define for another configuration as build options are set on a per configuration basis.

    Regards,

    John

  • Hi guys,

    I would like to copy ccs configuration setting to new PC.
    What path/file do ccs configuration setting ? filename.xx?
  • For workspace preferences you can save them and copy them to another PC.
    www.youtube.com/watch

    If you mean the build configuration that is saved in the project files. You can copy the project folder to another machine but there isn't a way to just save off the build options.

    Regards,
    John
  • Hi John,

    When I build by "Debug" , the timer is normal . When I build by "Release" , the timer is faster.

    Do you know what do "Debug" and "Release" speed difference?
    Could you give any advice to fix "Debug" build / "Release" build task speed issue?


    example:
    Uint16 g_u16_cnt =0;
    #define _CNT 32 // debug build is normal

    if(g_u16_cnt % _CNT) == 0)
    {
    // do somthing....
    }
  • Are you saying the code runs faster when using the release configuration vs the debug configuration?  If so that is expected.  By default for C5515 a new project has the optimization level for the compiler disabled in the debug configuration and the release configuration has it set for level 2.  The amount of symbol information for debugging is also different.  The debug configuration will have full symbolic debug information generated and the release configuration will have a minimal amount.

    You can change these options in the properties of the project.

    Regards,

    John

  • Hi John,

    I found Optimization Level description is as below:
    Option Range of Optimization
    --opt_level=off None
    --opt_level=0 Statements
    --opt_level=1 Blocks
    --opt_level=2 Functions
    --opt_level=3 Whole File
    --opt_level=4 Between files and libraries

    I did not see the affect for Optimization Level.
    When I set level is 1, the task/timer was normal.
    When I set level is > 2 , the task/timer was faster.

    example:
    Uint16 g_u16_cnt =0;

    main_task()
    {
    g_u16_cnt ++;
    if(g_u16_cnt >10)
    {
    // do sometime....
    // level<=1 , g_u16_cnt is slower to 11
    // level>2 , g_u16_cnt is faster to 11 .
    }
    }

    1) Could you advise for timer issue when I set opt_level >= 2?
    2) If opt_level >= 2 , How to adjust speed the same with opt_level = 1?
    ps: For my verified , I think the speed was irregular when opt_level is >= 2. 

    3) What effect is in C5515 for Optimization Level 0,1,2,3,4 in debug build and release build?

  • The compiler manual has some more information on what the optimization levels mean.  

    http://www.ti.com/lit/pdf/spru281

    In general the "Statement/block/functions/whole file/between files and libraries" is the scope in which the optimizer will work.  i.e. it will optimize within the boundaries of the code block or within the function or within the whole file... You can set the optimization for just that file if you like.  Right click on the file and select properties or show build settings.  You can then set the optimization level for just this file.

    If you want to know exactly what is happening at opt_level >= 2 you could look at the generated assembly.  Someone in the compiler forum may be able to provide more insight.

    Regards,

    John