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: amplitude modulation



Tool/software: Code Composer Studio

//AM.c AM using table for carrier and baseband signals
#include "DSK6713_AIC23.h" //codec-dsk support file
#include "dsk6713.h"
#include "dsk6713_led.h"
#include "dsk6713_dip.h"
void comm_poll();
void output_left_sample(float out_data);
Uint32 fs=DSK6713_AIC23_FREQ_8KHZ; //set sampling rate
short amp = 1; //index for modulation
void main()
{

short baseband[20]={1000,951,809,587,309,0,-309,-587,-809,-951,-1000,-951,-809,-587,-309,0,309,587,809,951};//400Hz baseband
short carrier[20] ={1000,0,-1000,0,1000,0,-1000,0,1000,0,-1000,0,1000,0,-1000,0,1000,0,-1000,0}; //2kHz carrier
short output[20];
float output_left_sample[20];
short k;
comm_poll(); //init DSK, codec, McBSP
while(1) //infinite loop
{
for (k=0; k<20; k++)
{
output[k]= carrier[k] + ((amp*(baseband[k])*(carrier[k]/10)>>12));
output_left_sample(20*output[k]); //scale output
}
}
}

i have one problem:

Description Resource Path Location Type
#110 expression must have (pointer-to-) function type main.c /am line 24 C/C++ Problem

  • The symbol name output_left_sample appears three times.  The first time it is a function declaration ...

    samir elouaham said:
    void output_left_sample(float out_data);

    The second time it is a local array inside the function main ...

    samir elouaham said:
    float output_left_sample[20];

    This means that, within main, the name refers to the array, and not the function.

    The third time is an attempt to call the function ...

    samir elouaham said:
    output_left_sample(20*output[k]); //scale output

    At this point, though, language scoping rules say the name output_left_sample is not a function, but an array.  So the compiler complains that this is not correct usage of an array name.

    There are few ways to fix the problem.  Here are two fixes to consider.  Change the name of the array.  Or, change the name of the function.

    Thanks and regards,

    -George

  • thanks george
    I have 30 warninig, do these warninig present a problem?
  • That varies by project.  Sometimes, every diagnostic is a big deal.  Other times, not so much.

    Consider adding the compiler option --verbose_diagnostics.  This causes the compiler, for every diagnostic, to echo the associated source line, with a ^ character pointing out where on the source line the problem begins.  This often makes the cause of the problem much more clear.

    Thanks and regards,

    -George

  • hi
    the warning in my project are:
    Description Resource Path Location Type
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x000004c8, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x000004a0, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x0000058c, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x00000564, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x00000404, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x000003dc, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x00000478, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x00000434, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x0000060c, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x000005b4, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x0000065c, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x00000634, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/225.html">#225-D</a> function declared implicitly main.c /am line 26 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x00000070, section = ".text") c6713dskinit.c /am line 15 C/C++ Problem
    #16002-D build attribute vendor section TI missing in "../csl6713.lib<csl_irq.obj>": compatibility cannot be determined am C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x00000340, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #16002-D build attribute vendor section TI missing in "../csl6713.lib<csl_mcbsp.obj>": compatibility cannot be determined am C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x00000374, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x000002ac, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #16002-D build attribute vendor section TI missing in "../dsk6713bsl.lib<dsk6713.obj>": compatibility cannot be determined am C/C++ Problem
    #16002-D build attribute vendor section TI missing in "../dsk6713bsl.lib<dsk6713_aic23_opencodec.obj>": compatibility cannot be determined am C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x00000318, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x00000254, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #16002-D build attribute vendor section TI missing in "../dsk6713bsl.lib<dsk6713_aic23_registers.obj>": compatibility cannot be determined am C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x0000027c, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem
    #16002-D build attribute vendor section TI missing in "../dsk6713bsl.lib<dsk6713_aic23_setfreq.obj>": compatibility cannot be determined am C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x00000090, section = ".text") c6713dskinit.c /am line 17 C/C++ Problem
    #10015-D output file "am.out" cannot be loaded and run on a target system am C/C++ Problem
    #17009-D relocation type is static base-relative, but references symbol "_DSK6713_AIC23_codecdatahandle" defined in section ".far"; references to section ".far" are not relative to any static base, so this relocation cannot be performed (type = 'R_C60BASE' (80), file = "./c6713dskinit.obj", offset = 0x00000120, section = ".text") c6713dskinit.c /am line 19 C/C++ Problem



    wahts the problems?
  • You have to fix those warnings.  Your code won't run as is.  

    Please see this forum thread for a discussion of a very similar situation.

    However, since all these errors are related to the source file c6713dskinit.c ... I suspect this code comes from TI, and there is an example somewhere which shows how it is intended to be built.  If so, that is how you should build it.  To find this example, I recommend you start a new thread in the Processors forum.

    Thanks and regards,

    -George