#include "DSP28x_Project.h"
#include <stdio.h>
#include <string.h>
#define CPU_CLK 150e6
#define PWM_CLK 10e3
#define SP CPU_CLK/(2*PWM_CLK)
void InitePwm1Gpio(void)
{
EALLOW;
GpioCtrlRegs.GPAPUD.bit.GPIO0=0;
GpioCtrlRegs.GPAPUD.bit.GPIO1=0;
GpioCtrlRegs.GPAMUX1.bit.GPIO0=1;
GpioCtrlRegs.GPAMUX1.bit.GPIO1=1;
EDIS;
}
void EPwmSetup()
{
InitEPwm1Gpio();
InitEPwm2Gpio();
EPwm1Regs.TBSTS.all=0;
EPwm1Regs.TBPHS.half.TBPHS=0;
EPwm1Regs.TBCTR=0;
EPwm1Regs.CMPCTL.all=0x50;
EPwm1Regs.CMPA.half.CMPA=SP/2;
EPwm1Regs.CMPB=0;
EPwm1Regs.AQCTLA.all=0x60;
EPwm1Regs.AQCTLB.all=0;
EPwm1Regs.AQSFRC.all=0;
EPwm1Regs.AQCSFRC.all=0;
EPwm1Regs.DBCTL.all=0;
EPwm1Regs.DBRED=0;
EPwm1Regs.DBFED=0;
EPwm1Regs.TZSEL.all=0;
EPwm1Regs.TZCTL.all=0;
EPwm1Regs.TZEINT.all=0;
EPwm1Regs.TZFLG.all=0;
EPwm1Regs.TZCLR.all=0;
EPwm1Regs.TZFRC.all=0;
EPwm1Regs.ETSEL.all=0;
EPwm1Regs.ETFLG.all=0;
EPwm1Regs.ETCLR.all=0;
EPwm1Regs.ETFRC.all=0;
EPwm1Regs.PCCTL.all=0;
EPwm1Regs.TBCTL.all=0x201E;
EPwm1Regs.TBPRD=SP;
}
程序如上,console窗口显示的问题如下:
undefined first referenced
symbol in file
——— —————-
_main F:\BaiduNetdiskDownload\CCS9\ccs\tools\compiler\ti-cgt-c2000_18.12.4.LTS\lib\rts2800_fpu32.lib<args_main.c.obj>
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "kaihuanPWM.out" not built
>> Compilation failure
makefile:178: recipe for target 'kaihuanPWM.out' failed
gmake[1]: *** [kaihuanPWM.out] Error 1
makefile:174: recipe for target 'all' failed
gmake: *** [all] Error 2
一共是4个错误,都没找到解决方法。
Susan Yang:
请给出完整工程。您的main函数呢?
error #10234-D: unresolved symbols remain 一般是缺少路径或者定义
user6414721:
回复 Susan Yang:
这就是完整的程序,我只是用28335中的ePWM模块产生一个PWM脉冲。
user6414721:
回复 Susan Yang:
关键问题是我不知道哪里缺少路径或定义,能不能麻烦您指点下