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.

unresolved symbol error



dear all,

i am trying to generate a PWM & its complement with Dead Band. a closed loop control should be applied on it for correction. However i have encountered the following problems. i am using Code Composer Studio v6 with digital power library support. please help.

Error View:

Compiler Include:

my source code:

#include "DSP28x_Project.h"
#include "PWMDRV_ComplPairDB_Settings.h"
#include "F2802x_EPwm_defines.h"
#include "DPlib.h"
#include "IQmathLib.h"


//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// FUNCTION PROTOTYPES
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

// -------------------------------- FRAMEWORK --------------------------------------
void DeviceInit(void);
#ifdef FLASH
void InitFlash();
#endif

// Declare terminal pointers for Boost channel 1
extern volatile long *ADCDRV_1ch_Rlt1;
extern volatile long *CNTL_2P2Z_Fdbk1;
extern volatile long *CNTL_2P2Z_Ref1;
extern volatile long *CNTL_2P2Z_Coef1;
extern volatile long *CNTL_2P2Z_Out1;
extern volatile long *PWMDRV_ComplPairDB_Duty1;


#pragma DATA_SECTION(CNTL_2P2Z_CoefStruct1, "CNTL_2P2Z_Coef");
struct CNTL_2P2Z_CoefStruct CNTL_2P2Z_CoefStruct1;

// ---------------------------------- USER -----------------------------------------
void ADC_SOC_CNF(int ChSel, int Trigsel, int ACQPS, int IntChSel, int Mode);
void PWM_ComplPairDB_CNF(int16 n, Uint16 period, int16 mode, int16 phase);
void PWM_ComplPairDB_UpdateDB(int16 n, int16 dbRED, int16 dbFED);

// C address variables for use with ASM module terminals
long Ref=0; // used as address for Vin
long Fdbk=0; // used as address for Iref1
long Out=0; // used as address for Uout1


//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// VARIABLE DECLARATIONS - CCS WatchWindow / GUI support
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// ---------------------------------- USER -----------------------------------------
int16 FlashID=0x5055;

// Used to indirectly access all EPWM modules
volatile struct EPWM_REGS *ePWM[] =
{ &EPwm1Regs, //intentional: (ePWM[0] not used)
&EPwm1Regs,
&EPwm2Regs,
&EPwm3Regs,
&EPwm4Regs
};
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// MAIN CODE - starts here
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

void main(void)
{
//=================================================================================
// INITIALISATION - General
//=================================================================================

//-------------------------------- FRAMEWORK --------------------------------------

DeviceInit(); // Device Life support & GPIO

// Only used if running from FLASH
// Note that the variable FLASH is defined by the build configuration
#ifdef FLASH
// Copy time critical code and Flash setup code to RAM
// The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart
// symbols are created by the linker. Refer to the linker files.
// memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);

// Call Flash Initialization to setup flash waitstates
// This function must reside in RAM
InitFlash(); // Call the flash wrapper init function
#endif //(FLASH)


// ---------------------------------- USER -----------------------------------------

// 2 pole / 2 Zero compensator coefficients (B2, B1, B0, A2, A1) are mapped to the
// simpler 3 coefficients P, I, D to allow for trial & error intuitive tuning via
// CCS WatchWindow or GUI Sliders. Note: User can modify if needed and assign full
// set of 5 coef.

// Boost channel 1 2P2Z Coefficient init
CNTL_2P2Z_CoefStruct1.b2 = _IQ26(0.05);
CNTL_2P2Z_CoefStruct1.b1 = _IQ26(-0.20);
CNTL_2P2Z_CoefStruct1.b0 = _IQ26(0.20);
CNTL_2P2Z_CoefStruct1.a2 = _IQ26(0.0);
CNTL_2P2Z_CoefStruct1.a1 = _IQ26(1.0);
CNTL_2P2Z_CoefStruct1.max = _IQ24(0.7);
CNTL_2P2Z_CoefStruct1.min = _IQ24(0.0);

Ref=_IQ24(0.0);
Fdbk=_IQ24(0.0);
Out=_IQ24(0.0);

// ---------------------------------- USER -----------------------------------------
//#define prd 1200 // 1200 Period count = 50 KHz @ 60 MHz
//#define prd 600 // 600 Period count = 100 KHz @ 60 MHz
//#define prd 300 // 300 Period count = 200 KHz @ 60 MHz
//#define prd 200 // 200 Period count = 300 KHz @ 60 MHz
//#define prd 150 // 150 Period count = 400 KHz @ 60 MHz

//void ADC_SOC_CNF(int ChSel, int Trigsel, int ACQPS, int IntChSel, int Mode);
ADC_SOC_CNF(2,5,1,16,0);

//void PWM_ComplPairDB_CNF(int16 n, int16 period, int16 mode, int16 phase);
PWM_ComplPairDB_CNF(3, 1200, 0, 400); // 1200 Period count = 50 KHz @ 60 MHz
//void PWM_ComplPairDB_CNF(int16 n, int16 DBRed, int16 DBFed);
PWM_ComplPairDB_UpdateDB(3,5,4);

// Configure ePWMs to generate ADC SOC pulses
EPwm1Regs.ETSEL.bit.SOCAEN = 1; // Enable ePWM1 SOCA pulse
EPwm1Regs.ETSEL.bit.SOCASEL = ET_CTR_PRD; // SOCA from ePWM1 Zero event
EPwm1Regs.ETPS.bit.SOCAPRD = ET_3RD; // Trigger ePWM1 SOCA on every 3rd event

DPL_Init(); // DPL ASM ISR init

//----------------------------------------------------------------------
// Boost 1 connections
ADCDRV_1ch_Rlt1 = &Fdbk;
CNTL_2P2Z_Fdbk1 = &Fdbk;
CNTL_2P2Z_Ref1 = &Ref;
CNTL_2P2Z_Coef1 = &CNTL_2P2Z_CoefStruct1.b2; // point to first coeff of 1st loop
CNTL_2P2Z_Out1 = &Out; // point to 2P2Z Uout1
PWMDRV_ComplPairDB_Duty1 = &Out;


//=================================================================================
// INTERRUPT & ISR INITIALISATION (best to run this section after other initialisation)
//=================================================================================
EALLOW;
PieVectTable.EPWM1_INT = &DPL_ISR; // Map Interrupt
EDIS;
PieCtrlRegs.PIEIER3.bit.INTx1 = 1; // PIE level enable, Grp3 / Int1

// Configure ISR trigger
EPwm1Regs.ETSEL.bit.INTSEL = ET_CTR_PRD; // INT on Period event
EPwm1Regs.ETSEL.bit.INTEN = 1; // Enable INT
EPwm1Regs.ETPS.bit.INTPRD = ET_3RD; // Generate ISR INT on every 3rd event

// Enable Peripheral, global Ints and higher priority real-time debug events:
IER |= M_INT3; // Enable CPU INT3 connected to EPWM1-6 INTs:
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM

//=================================================================================
// BACKGROUND (BG) LOOP
//=================================================================================

//--------------------------------- FRAMEWORK -------------------------------------
while(1);

} //END MAIN CODE