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 ****
