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.

Debug build works, release build does not

Other Parts Discussed in Thread: TMS320F2812

Hello,

The code that I wrote for TMS320F2812 in CCS 5.1.1.00031 works fine in the debug build, but does not run as a release build. Please find the code attached below, as well as the text that appears in the build console for both build options.

With the debug build, no errors are created, only a warning appears in the Problems window saying

#10210-D creating ".stack" section with default size of 0x400; use the

The program works as expected.

When selecting release build however, after the program is loaded, another code tab opens next to main.c and it says in it

No source available for "main() at 0x3f629b"

What could cause this?

Regards,

Adrian

/*
 * timertry_T1PWM
 * main.c
 *
 * use the GP timer compare unit of event manager A, timer 1, to get a PWM signal with f = 20 kHz
 * GP timer 1 uses its own compare functionality (output T1PWM)
 * derived from timertry that also uses PWM1
 * output pin: T1PWM (pin 15)
 *
 */
#include "DSP281x_Device.h"
#include "math.h"
extern void InitSysCtrl(void);

void main() {
    float d=0.77;
    InitSysCtrl();

// configure pins as peripheral (here: timer) outputs (as compared to general digital I/O)
    EALLOW;
    GpioMuxRegs.GPAMUX.all=0x40;    // T1PWM pin, 6th bit
    EDIS;

// GP timer 1 setup
    EvaRegs.T1CON.bit.FREE=0;        // stop immediately on emulation suspend
    EvaRegs.T1CON.bit.SOFT=0;        // ... second part of it
    EvaRegs.T1CON.bit.TMODE=2;        // continuous up-counting mode
    EvaRegs.T1CON.bit.TPS=0;        // input clock prescaler, corresponds to factor 1
    EvaRegs.T1CON.bit.TENABLE=1;    // enable timer
    EvaRegs.T1CON.bit.TCLKS10=0;    // use HSPCLK as clock
    EvaRegs.T1CON.bit.TCLD10=0;        // reload compare register T1CMPR at beginning of switching period
    EvaRegs.T1CON.bit.TECMPR=1;        // enable timer compare

    EvaRegs.T1PR=7499;                // period register = 150MHz/20kHz-1 (HISPCP = 1, TPS = 0)
                                    // 16 bit register, max. value: 2^16-1 = 65,535
    EvaRegs.T1CMPR=floor(EvaRegs.T1PR*d);    // compare register for T1PWM
    EvaRegs.T1CNT=0;                // initialize counter register

// GP timer control register of EVA (for T1PWM)
    EvaRegs.GPTCONA.bit.T1CTRIPE=0;    // disable trip function that can drive output to high Z
    EvaRegs.GPTCONA.bit.TCMPOE=1;    // enable compare output
    EvaRegs.GPTCONA.bit.T1TOADC=0;    // don't set off ADC
    EvaRegs.GPTCONA.bit.TCMPOE=1;    // enable timer compare outputs
    EvaRegs.GPTCONA.bit.T1CMPOE=1;    // enable timer 1 compare outputs
    EvaRegs.GPTCONA.bit.T1PIN=1;    // polarity of T1PWM (1 = active L, 2 = active H)

    while(1){
    ;
    }
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**** Build of configuration Debug for project timertry_T1PWM ****

C:\ti\ccsv5\utils\bin\gmake -k all
'Building file: ../DSP281x_DefaultIsr.c'
'Invoking: C2000 Compiler'
"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/bin/cl2000" -v28 -ml -mt -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.0.3/include" --diag_warning=225 --display_error_number --preproc_with_compile --preproc_dependency="DSP281x_DefaultIsr.pp"  "../DSP281x_DefaultIsr.c"
'Finished building: ../DSP281x_DefaultIsr.c'
' '
'Building file: ../DSP281x_GlobalVariableDefs.c'
'Invoking: C2000 Compiler'
"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/bin/cl2000" -v28 -ml -mt -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.0.3/include" --diag_warning=225 --display_error_number --preproc_with_compile --preproc_dependency="DSP281x_GlobalVariableDefs.pp"  "../DSP281x_GlobalVariableDefs.c"
'Finished building: ../DSP281x_GlobalVariableDefs.c'
' '
'Building file: ../DSP281x_SysCtrl.c'
'Invoking: C2000 Compiler'
"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/bin/cl2000" -v28 -ml -mt -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.0.3/include" --diag_warning=225 --display_error_number --preproc_with_compile --preproc_dependency="DSP281x_SysCtrl.pp"  "../DSP281x_SysCtrl.c"
'Finished building: ../DSP281x_SysCtrl.c'
' '
'Building file: ../main.c'
'Invoking: C2000 Compiler'
"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/bin/cl2000" -v28 -ml -mt -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.0.3/include" --diag_warning=225 --display_error_number --preproc_with_compile --preproc_dependency="main.pp"  "../main.c"
'Finished building: ../main.c'
' '
'Building target: timertry_T1PWM.out'
'Invoking: C2000 Linker'
"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/bin/cl2000" -v28 -ml -mt -g --diag_warning=225 --display_error_number -z -m"timertry_T1PWM.map" --warn_sections -i"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/lib" -i"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/include" --reread_libs --rom_model -o "timertry_T1PWM.out"  "./main.obj" "./DSP281x_SysCtrl.obj" "./DSP281x_GlobalVariableDefs.obj" "./DSP281x_DefaultIsr.obj" -l"libc.a" "../DSP281x_Headers_nonBIOS.cmd" "../F2812.cmd"
<Linking>
warning #10210-D: creating ".stack" section with default size of 0x400; use the
   -stack option to change the default size
'Finished building target: timertry_T1PWM.out'
' '

**** Build Finished ****

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**** Build of configuration Release for project timertry_T1PWM ****

C:\ti\ccsv5\utils\bin\gmake -k all
'Building file: ../DSP281x_DefaultIsr.c'
'Invoking: C2000 Compiler'
"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/bin/cl2000" -v28 -ml -mt -O2 --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.0.3/include" --diag_warning=225 --display_error_number --preproc_with_compile --preproc_dependency="DSP281x_DefaultIsr.pp"  "../DSP281x_DefaultIsr.c"
'Finished building: ../DSP281x_DefaultIsr.c'
' '
'Building file: ../DSP281x_GlobalVariableDefs.c'
'Invoking: C2000 Compiler'
"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/bin/cl2000" -v28 -ml -mt -O2 --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.0.3/include" --diag_warning=225 --display_error_number --preproc_with_compile --preproc_dependency="DSP281x_GlobalVariableDefs.pp"  "../DSP281x_GlobalVariableDefs.c"
'Finished building: ../DSP281x_GlobalVariableDefs.c'
' '
'Building file: ../DSP281x_SysCtrl.c'
'Invoking: C2000 Compiler'
"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/bin/cl2000" -v28 -ml -mt -O2 --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.0.3/include" --diag_warning=225 --display_error_number --preproc_with_compile --preproc_dependency="DSP281x_SysCtrl.pp"  "../DSP281x_SysCtrl.c"
'Finished building: ../DSP281x_SysCtrl.c'
' '
'Building file: ../main.c'
'Invoking: C2000 Compiler'
"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/bin/cl2000" -v28 -ml -mt -O2 --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.0.3/include" --diag_warning=225 --display_error_number --preproc_with_compile --preproc_dependency="main.pp"  "../main.c"
'Finished building: ../main.c'
' '
'Building target: timertry_T1PWM.out'
'Invoking: C2000 Linker'
"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/bin/cl2000" -v28 -ml -mt -O2 --diag_warning=225 --display_error_number -z -m"timertry_T1PWM.map" --warn_sections -i"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/lib" -i"C:/ti/ccsv5/tools/compiler/c2000_6.0.3/include" --reread_libs --rom_model -o "timertry_T1PWM.out"  "./main.obj" "./DSP281x_SysCtrl.obj" "./DSP281x_GlobalVariableDefs.obj" "./DSP281x_DefaultIsr.obj" -l"libc.a" "../DSP281x_Headers_nonBIOS.cmd" "../F2812.cmd"
<Linking>
warning #10210-D: creating ".stack" section with default size of 0x400; use the
   -stack option to change the default size
'Finished building target: timertry_T1PWM.out'
' '

**** Build Finished ****

  • 3446793 said:

    When selecting release build however, after the program is loaded, another code tab opens next to main.c and it says in it

    No source available for "main() at 0x3f629b"

    In Release Mode, the -g option (full symbolic debug) is not enabled, therefore the symbol correlation with source file is not there. Typically the Release build is created/used after the program has been debugged and verified, and it is not necessary to still keep the debug information/symbols. 

    If you want to get rid of that error and have source file correlation, add the -g option to the Release Mode build.

     

  • I found something related to the -g option in the menu

    Project | Show Build Settings | CCS Build | C2000 Linker | Advanced Options | Symbol Management | Don't make global symbols static if -h is specified

    where -g is given in brackets. But apparently one has to enter a list of symbols to which -g then applies. Is this what you mean? If so, what should be written into the list?

  • I was actually referring to the -g compiler option. Check attached screenshot for where you can find it.