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/TMS320F28377S: Problem in build the sine wave generation program

Part Number: TMS320F28377S
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: Code Composer Studio

Sir

         I am new user of 320f28377s lauchpad with CCS 7.1.0. I am trying to run Sinewave generation program which is given in controlsuite example. But when I am initializing the program it is showing some errors which is shown as below: I am unable to find the reason of error. Please help me to solve my problem

 

 description resource path location type #10010 errors encountered during linking; "buffdac_square_cpu01.out" not built buffdac_square_cpu01 c/c++ problem #10234-d unresolved symbols remain buffdac_square_cpu01 c/c++ problem gmake: *** [all] error 2 buffdac_square_cpu01 c/c++ problem gmake[1]: *** [buffdac_square_cpu01.out] error 1 buffdac_square_cpu01 c/c++ problem unresolved symbol _analogsubsysregs, first referenced in ./f2837xs_sysctrl.obj buffdac_square_cpu01 c/c++ problem unresolved symbol _clkcfgregs, first referenced in ./f2837xs_sysctrl.obj buffdac_square_cpu01 c/c++ problem unresolved symbol _configcputimer, first referenced in ./buffdac_square_cpu01.obj buffdac_square_cpu01 c/c++ problem unresolved symbol _cpusysregs, first referenced in ./f2837xs_sysctrl.obj buffdac_square_cpu01 c/c++ problem unresolved symbol _cputimer0, first referenced in ./buffdac_square_cpu01.obj buffdac_square_cpu01 c/c++ problem unresolved symbol _cputimer0regs, first referenced in ./buffdac_square_cpu01.obj buffdac_square_cpu01 c/c++ problem unresolved symbol _cputimer1regs, first referenced in ./buffdac_square_cpu01.obj buffdac_square_cpu01 c/c++ problem unresolved symbol _cputimer2regs, first referenced in ./f2837xs_sysctrl.obj buffdac_square_cpu01 c/c++ problem unresolved symbol _dacaregs, first referenced in ./buffdac_square_cpu01.obj buffdac_square_cpu01 c/c++ problem unresolved symbol _dacbregs, first referenced in ./buffdac_square_cpu01.obj buffdac_square_cpu01 c/c++ problem unresolved symbol _daccregs, first referenced in ./buffdac_square_cpu01.obj buffdac_square_cpu01 c/c++ problem unresolved symbol _dcsmz1regs, first referenced in ./f2837xs_sysctrl.obj buffdac_square_cpu01 c/c++ problem unresolved symbol _dcsmz2regs, first referenced in ./f2837xs_sysctrl.obj buffdac_square_cpu01 c/c++ problem unresolved symbol _devcfgregs, first referenced in ./f2837xs_gpio.obj buffdac_square_cpu.

  • Hello

    Did you exclude the F2837xS_GlobalVariableDefs.c from the example? Running the example as is, I don't see your errors except if I exclude that source file.

    Best regards
    Chris
  • Query on DSPboard.docxThank You Sir for your reply. It is great help for me. I applied the changes as you told and it reduces the no. of errors but my code is still showing errors during building of program. I am sending the errors status after including the F2837xS_GlobalVariableDefs.c. I am attaching the snapshot of attached and included files in my code.

     errors are given as below:

    Description         Resource             Path       Location               Type

    #10010 errors encountered during linking; "sin.out" not built      sin          C/C++ Problem

    <a href="processors.wiki.ti.com/.../10234"> unresolved symbols remain                sin                                         C/C++ Problem

    gmake: *** [all] Error 2 sin                                                       C/C++ Problem

    gmake[1]: *** [sin.out] Error 1  sin                                         C/C++ Problem

    unresolved symbol _SGENTI_1_calc, first referenced in ./main.obj          sin                                         C/C++ Problem

    As I am still in learning phase, I am unable to find out the reasons of those errors. Hope you will help me to solve these problems.

  • Hi Kumar !

    You should define _SGENT_1_calc ....... And also try to add your include options F2837xS_Headers_nonBIOS.cmd folder.....

    By !
  • Dear Sir

              

            Thank you for your valuable suggestions Christopher Chiarella and eeddii iiiiii . I have made both changes in my code but still I am getting the same errors. I have included the F2837xS_Headers_nonBIOS.cmd folder and defined the _SGENT_1_calc. 

    I am attaching the status of error message. 

     

    My entire code is here below:

    //###########################################################################

     

    //

    // Included Files

    //

    #include "F28x_Project.h"

    #include "sgen.h"         // Signal Generation Headerfile

     

    //

    // Defines

    //

    #define DLOG_SIZE             1024

    #define REFERENCE_VDAC        0

    #define REFERENCE_VREF        1

    #define LOW_THD_SINE          0

    #define HIGH_PRECISION_SINE   1

    #define DACA                  1

    #define DACB                  2

    #define DACC                  3

    #define SINEWAVE_TYPE         LOW_THD_SINE

    #define REFERENCE             REFERENCE_VDAC

    #define CPUFREQ_MHZ           200

    #define DAC_NUM               DACA

     

    //

    // Globals

    //

    Uint16 DataLog[DLOG_SIZE];

    #pragma DATA_SECTION(DataLog, "DLOG");

    volatile struct DAC_REGS* DAC_PTR[4] = {0x0,&DacaRegs,&DacbRegs,&DaccRegs};

    Uint32 samplingFreq_hz = 200000;

    Uint32 outputFreq_hz = 1000;

    Uint32 maxOutputFreq_hz = 5000;

    float waveformGain = 0.8003; // Range 0.0 -> 1.0

    float waveformOffset = 0;    // Range -1.0 -> 1.0

     

    #if SINEWAVE_TYPE==LOW_THD_SINE //initialize sine wave type

    SGENTI_1 sgen = SGENTI_1_DEFAULTS;

    #elif SINEWAVE_TYPE==HIGH_PRECISION_SINE

    SGENHP_1 sgen = SGENHP_1_DEFAULTS;

    #endif

     

    Uint16 sgen_out = 0;

    Uint16 ndx = 0;

    float freqResolution_hz = 0;

    float cpuPeriod_us = 0;

    Uint32 interruptCycles = 0;

    float interruptDuration_us = 0;

    float samplingPeriod_us = 0;

    Uint16 maxOutput_lsb = 0;

    Uint16 minOutput_lsb = 0;

    Uint16 pk_to_pk_lsb = 0;

     

    //

    // Function Prototypes

    //

    static inline void dlog(Uint16 value);

    static inline void setFreq(void);

    static inline void setGain(void);

    static inline void setOffset(void);

    static inline Uint16 getMax(void);

    static inline Uint16 getMin(void);

    void configureDAC(Uint16 dac_num);

    void configureWaveform(void);

    interrupt void cpu_timer0_isr(void);

     

    //

    // Main

    //

    void main(void)

    {

    //

    // Initialize System Control:

    // PLL, WatchDog, enable Peripheral Clocks

    // This example function is found in the F2837xS_SysCtrl.c file.

    //

        InitSysCtrl();

     

    //

    // Disable CPU interrupts

    //

        DINT;

     

    //

    // Initialize the PIE control registers to their default state.

    // The default state is all PIE interrupts disabled and flags are cleared.

    // This function is found in the F2837xS_PieCtrl.c file.

    //

        InitPieCtrl();

     

    //

    // Clear all interrupts and initialize PIE vector table:

    //

        IER = 0x0000;

        IFR = 0x0000;

        InitPieVectTable();

     

    //

    // Map Cpu Timer0 interrupt function to the PIE vector table

    //

        EALLOW;

        PieVectTable.TIMER0_INT = &cpu_timer0_isr;

        EDIS;

     

    //

    // Initialize variables

    //

        cpuPeriod_us = (1.0/CPUFREQ_MHZ);

        samplingPeriod_us = (1000000.0/samplingFreq_hz);

     

    //

    // Initialize datalog

    //

        for(ndx=0; ndx<DLOG_SIZE; ndx++)

        {

            DataLog[ndx] = 0;

        }

        ndx = 0;

     

    //

    // Configure DAC

    //

        configureDAC(DAC_NUM);

     

    //

    // Configure Waveform

    //

        configureWaveform();

     

    //

    // Initialize Cpu Timers

    //

        InitCpuTimers();

     

    //

    // Configure Cpu Timer0 to interrupt at specified sampling frequency

    //

        ConfigCpuTimer(&CpuTimer0, CPUFREQ_MHZ, 1000000.0/samplingFreq_hz);

     

    //

    // Start Cpu Timer0

    //

        CpuTimer0Regs.TCR.all = 0x4000;

     

    //

    // Enable interrupt

    //

        IER |= M_INT1;

        PieCtrlRegs.PIEIER1.bit.INTx7 = 1;

        EINT;

        ERTM;

     

        while(1)

        {

            setFreq();   // Set Output Frequency and Max Output Frequency

            setGain();   // Set Magnitude of Waveform

            setOffset(); // Set Offset of Waveform

            maxOutput_lsb = getMax();

            minOutput_lsb = getMin();

            pk_to_pk_lsb = maxOutput_lsb - minOutput_lsb;

        }

    }

     

    //

    // dlog - Circular DataLog. DataLog[0] contains the next index to

    //        be overwritten

    //

    static inline void dlog(Uint16 value)

    {

        DataLog[ndx] = value;

        if(++ndx == DLOG_SIZE)

        {

            ndx = 0;

        }

        DataLog[0] = ndx;

    }

     

    //

    // setFreq - Set the SINE frequency in SGEN

    //

    static inline void setFreq(void)

    {

    #if SINEWAVE_TYPE==LOW_THD_SINE

        //

        // Range(Q0) = 0x0000 -> 0x7FFF, step_max(Q0) =

        // (Max_Freq_hz*0x10000)/Sampling_Freq_hz

        //

        sgen.step_max = (maxOutputFreq_hz*0x10000)/samplingFreq_hz;

     

        //

        // Range(Q15) = 0x0000 -> 0x7FFF, freq(Q15) =

        // (Required_Freq_hz/Max_Freq_hz)*0x8000

        //

        sgen.freq = ((float)outputFreq_hz/maxOutputFreq_hz)*0x8000;

    #elif SINEWAVE_TYPE==HIGH_PRECISION_SINE

        //

        // Range(Q0) = 0x00000000 -> 0x7FFFFFFF, step_max(Q0) =

        // (Max_Freq_hz*0x100000000)/Sampling_Freq_hz

        //

        sgen.step_max = (maxOutputFreq_hz*0x100000000)/samplingFreq_hz;

     

        //

        // Range(Q31) = 0x00000000 -> 0x7FFFFFFF, freq(Q31) =

        // (Required_Freq_hz/Max_Freq_hz)*0x80000000

        //

        sgen.freq = ((float)outputFreq_hz/maxOutputFreq_hz)*0x80000000;

    #endif

     

        freqResolution_hz = (float)maxOutputFreq_hz/sgen.step_max;

    }

     

    //

    // setGain - Set the gain in SGEN

    //

    static inline void setGain(void)

    {

        sgen.gain = waveformGain * 0x7FFF;   // Range(Q15) = 0x0000 -> 0x7FFF

    }

     

    //

    // setOffset - Set the offset in SGEN

    //

    static inline void setOffset(void)

    {

        sgen.offset = waveformOffset * 0x7FFF; // Range(Q15) = 0x8000 -> 0x7FFF

    }

     

    //

    // getMax - Get the max value in the data log

    //

    static inline Uint16 getMax(void)

    {

        Uint16 index = 0;

        Uint16 tempMax = 0;

     

        for(index=1; index<DLOG_SIZE; index++)

        {

            if(tempMax<DataLog[index])

            {

                tempMax = DataLog[index];

            }

        }

     

        return tempMax;

    }

     

    //

    // getMin - Get the min value in the data log

    //

    static inline Uint16 getMin(void)

    {

        Uint16 index = 0;

        Uint16 tempMin = 0xFFFF;

     

        for(index=1; index<DLOG_SIZE; index++)

        {

            if(tempMin>DataLog[index])

            {

                tempMin = DataLog[index];

            }

        }

     

        return tempMin;

    }

     

    //

    // configureDAC - Enable and configure the requested DAC module

    //

    void configureDAC(Uint16 dac_num)

    {

        EALLOW;

     

        DAC_PTR[dac_num]->DACCTL.bit.DACREFSEL = REFERENCE;

        DAC_PTR[dac_num]->DACOUTEN.bit.DACOUTEN = 1;

        DAC_PTR[dac_num]->DACVALS.all = 0;

     

        DELAY_US(10); // Delay for buffered DAC to power up

     

        EDIS;

    }

     

    //

    // configureWaveform - Configure the SINE waveform

    //

    void configureWaveform(void)

    {

        sgen.alpha = 0; // Range(16) = 0x0000 -> 0xFFFF

        setFreq();

        setGain();

        setOffset();

    }

     

    //

    // cpu_timer0_isr - Timer ISR that writes the sine value to DAC, log the sine

    //                  value, compute the next sine value, and calculate interrupt

    //                  duration

    //

    interrupt void cpu_timer0_isr(void)

    {

        //

        // Start Cpu Timer1 to indicate begin of interrupt

        //

        CpuTimer1Regs.TCR.all = 0x0000;

     

        //

        // Write current sine value to buffered DAC

        //

        DAC_PTR[DAC_NUM]->DACVALS.all = sgen_out;

     

        //

        // Log current sine value

        //

        dlog(sgen_out);

     

        //

        // Compute next sine value

        //

        sgen.calc(&sgen);

     

        //

        // Scale next sine value

        //

        sgen_out = (sgen.out + 32768) >> 4;

     

        //

        // Acknowledge this interrupt to receive more interrupts from group 1

        //

        PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;

     

        //

        // Stop Cpu Timer1 to indicate end of interrupt

        //

        CpuTimer1Regs.TCR.all = 0x0010;

     

        //

        // Calculate interrupt duration in cycles

        //

        interruptCycles = 0xFFFFFFFFUL - CpuTimer1Regs.TIM.all;

     

        //

        // Calculate interrupt duration in micro seconds

        //

        interruptDuration_us = cpuPeriod_us * interruptCycles;

     

        //

        // Reload Cpu Timer1

        //

        CpuTimer1Regs.TCR.all = 0x0030;

    }

     

    //

    // End of file

    //

     

  • Make sure you are including the SGEN library or source required for that symbol be defined. Also use the CCS console window to get more details on the error and make sure to do a rebuild, not just build.

    Best regards
    Chris
  • Thank you very much for your reply and suggestion Christopher Chiarella

    1. I have included Sgen library that is shown in the snapshot of listed included library of Sin code which I have attached in my previous mail.

    2.I read that gmake error comes several times if antivirus protection is running on PC. I have disabled antivirus still I am getting same errors.

    One of my observations about the code is that

    3.  All the example in control suite those are running successfully on my 28377s Launchpad showing CPU1_RAM file in lisited files of code. I am running adc_SOC_epwm example and it is running successfully. While I am building this program there is option of CPU RAM and CPU Flash in drop down menu in build option. I am attaching the snapshot as given below:

    4. But when I am building my Sin code there is no option of CPU RAM and CPU Flash in build option.  Even CPU1_RAM is not listed in the Sin code file list. I am attaching the snapshot as given below:

    5. Is it source of errors?

    6. I think my Sin code is not going in the memory of Launchpad. It is my observation about code. Please give your insight on the problem so that I can solve it. 

  • You are included the SGEN header folder, but are you linking in the actually ".lib" file in your project properties? Either that or you can copy directly into the project explorer area with the other source files.

    Make sure you are following the firmware user guide in controlSUITE for F2837xS for setting up the pre-define value to set the correct launchpad clocks.

    The build configurations are configurable and for the device support examples we typically create one for RAM and Flash. Debug and Release could be anything. Debug doesn't necessary mean RAM. If you look at the flash build config in the project properties, you'll see some predefine values setup which make it load to flash.

    Best regards
    Chris