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.
Hello everyone,
I'm beginning a new project with the F2808 DSP. I followed the recommended steps (C280x/C2801x C/C++ Header Files an Peripheral Examples Quick Start, pages 20-25) to start a project with the structure of registers (v 1.60) alredy done. But when I included the file "DSP280x_CpuTimers.c", I had this error:
#############################################################
---------------------------- genesis.pjt - Debug ----------------------------
[DSP280x_CpuTimers.c] "C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -g -pdr -fr"C:/CCStudio_v3.3/MyProjects/genesis/Debug" -i"C:/CCStudio_v3.3/MyProjects/genesis/../tidcs/c28/DSP280x/v160/DSP280x_headers/include" -i"C:/CCStudio_v3.3/MyProjects/genesis/../tidcs/c28/DSP280x/v160/DSP280x_common/include" -d"_DEBUG" -d"LARGE_MODEL" -ml -v28 -@"../../../../../../genesis/Debug.lkf" "DSP280x_CpuTimers.c"
[DSP280x_GlobalVariableDefs.c] "C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -g -pdr -fr"C:/CCStudio_v3.3/MyProjects/genesis/Debug" -i"C:/CCStudio_v3.3/MyProjects/genesis/../tidcs/c28/DSP280x/v160/DSP280x_headers/include" -i"C:/CCStudio_v3.3/MyProjects/genesis/../tidcs/c28/DSP280x/v160/DSP280x_common/include" -d"_DEBUG" -d"LARGE_MODEL" -ml -v28 -@"../../../../../../genesis/Debug.lkf" "DSP280x_GlobalVariableDefs.c"
[genesis.cpp] "C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -g -pdr -fr"C:/CCStudio_v3.3/MyProjects/genesis/Debug" -i"C:/CCStudio_v3.3/MyProjects/genesis/../tidcs/c28/DSP280x/v160/DSP280x_headers/include" -i"C:/CCStudio_v3.3/MyProjects/genesis/../tidcs/c28/DSP280x/v160/DSP280x_common/include" -d"_DEBUG" -d"LARGE_MODEL" -ml -v28 -@"Debug.lkf" "genesis.cpp"
"genesis.cpp", line 135: remark: controlling expression is constant
[Linking...] "C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -@"Debug.lkf"
<Linking>
>> warning: entry point symbol _c_int00 undefined
undefined first referenced
symbol in file
--------- ----------------
FS$$MPY C:\CCStudio_v3.3\MyProjects\genesis\Debug\DSP280x_CpuTimers.obj
FS$$TOL C:\CCStudio_v3.3\MyProjects\genesis\Debug\DSP280x_CpuTimers.obj
>> error: symbol referencing errors - './Debug/genesis.out' not built
>> Compilation failure
Build Complete,
2 Errors, 1 Warnings, 1 Remarks.
#############################################################
I found the error generator. It was a floating point multiplication as showed below in the code of “DSP280x_CpuTimers.c”.
#############################################################
void ConfigCpuTimer(struct CPUTIMER_VARS *Timer, float Freq, float Period)
{
Uint32 temp;
// Initialize timer period:
Timer->CPUFreqInMHz = Freq;
Timer->PeriodInUSec = Period;
temp = (long) (Freq * Period); // <- This is the line with problem.
Timer->RegsAddr->PRD.all = temp;
// Set pre-scale counter to divide by 1 (SYSCLKOUT):
Timer->RegsAddr->TPR.all = 0;
Timer->RegsAddr->TPRH.all = 0;
// Initialize timer control register:
Timer->RegsAddr->TCR.bit.TSS = 1; // 1 = Stop timer, 0 = Start/Restart Timer
Timer->RegsAddr->TCR.bit.TRB = 1; // 1 = reload timer
Timer->RegsAddr->TCR.bit.SOFT = 1;
Timer->RegsAddr->TCR.bit.FREE = 1; // Timer Free Run
Timer->RegsAddr->TCR.bit.TIE = 1; // 0 = Disable/ 1 = Enable Timer Interrupt
// Reset interrupt counter:
Timer->InterruptCount = 0;
}
#############################################################
When I comment the line “temp = (long) (Freq * Period);”, the error disappear.
After comment this line, I made a test in the main source file, writing this code:
#############################################################
int main(void)
{
float test1, test2, test3;
test1 = 1.0;
test2 = 2.0;
test3 = test1 * test2;
...
}
#############################################################
And then, this is the error message:
#############################################################
---------------------------- genesis.pjt - Debug ----------------------------
[DSP280x_CpuTimers.c] "C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -g -pdr -fr"C:/CCStudio_v3.3/MyProjects/genesis/Debug" -i"C:/CCStudio_v3.3/MyProjects/genesis/../tidcs/c28/DSP280x/v160/DSP280x_headers/include" -i"C:/CCStudio_v3.3/MyProjects/genesis/../tidcs/c28/DSP280x/v160/DSP280x_common/include" -d"_DEBUG" -d"LARGE_MODEL" -ml -v28 -@"../../../../../../genesis/Debug.lkf" "DSP280x_CpuTimers.c"
"DSP280x_CpuTimers.c", line 97: warning: variable "temp" is used before its value is set
[genesis.cpp] "C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -g -pdr -fr"C:/CCStudio_v3.3/MyProjects/genesis/Debug" -i"C:/CCStudio_v3.3/MyProjects/genesis/../tidcs/c28/DSP280x/v160/DSP280x_headers/include" -i"C:/CCStudio_v3.3/MyProjects/genesis/../tidcs/c28/DSP280x/v160/DSP280x_common/include" -d"_DEBUG" -d"LARGE_MODEL" -ml -v28 -@"Debug.lkf" "genesis.cpp"
"genesis.cpp", line 140: remark: controlling expression is constant
"genesis.cpp", line 40: warning: variable "test3" was set but never used
[Linking...] "C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -@"Debug.lkf"
<Linking>
>> warning: entry point symbol _c_int00 undefined
undefined first referenced
symbol in file
--------- ----------------
FS$$MPY C:\CCStudio_v3.3\MyProjects\genesis\Debug\genesis.obj
>> error: symbol referencing errors - './Debug/genesis.out' not built
>> Compilation failure
Build Complete,
2 Errors, 3 Warnings, 1 Remarks.
#############################################################
I changed the test operation to Add, and then the error was:
#############################################################
...
undefined first referenced
symbol in file
--------- ----------------
FS$$ADD C:\CCStudio_v3.3\MyProjects\genesis\Debug\genesis.obj
...
#############################################################
It looks like a floating point operation error. Is it right? How can I fix it?
Thank you in advance.
Regards,
Hatus
It appears that you need to include the Run-Time Support library to your project.
Have you done this already? The RTS library should be in your code generation tools ./lib directory.