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.

C2000WARE: PMSM3—3 code

Part Number: C2000WARE

Hi there,

我下载了sprc178的程序f2812 PMSM - C2000Tm︎ 微控制器论坛 - C2000 微控制器 - E2ETm 设计支持 (ti.com)  (PMSM3_3).

该项目运行在CCS 7.4,0

我在导入程序后遇到了这个错误

>> Compilation failure
makefile:150: recipe for target 'C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3_281x_CCS3x/../../../../../../../../DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3.out' failed

 undefined                      first referenced                                              
  symbol                            in file                                                   
 ---------                      ----------------                                              
 _DLOG_4CH_init                 C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _DLOG_4CH_update               C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _F281X_EV1_DRIVE_Init          C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _F281X_EV1_DRIVE_Update        C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _F281X_EV1_PWM_Init            C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _F281X_EV1_PWM_Update          C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _F281X_EV2_Resolver_PWM_Init   C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _F281X_EV2_Resolver_PWM_Update C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _F281X_adc04b_drv_init         C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _F281X_adc04b_drv_read         C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _clarke_calc                   C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _ipark_calc                    C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _park_calc                     C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _pid_reg3_calc                 C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _rampgen_calc                  C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _rmp_cntl_calc                 C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
 _svgendq_calc                  C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3_281x_CCS3x/../../../../../../../../DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3.out" not built
gmake[1]: *** [C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3_281x_CCS3x/../../../../../../../../DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3.out] Error 1
gmake: *** [all] Error 2
makefile:146: recipe for target 'all' failed

**** Build Finished ****

根据这个问题,不确定应该添加哪个库。

看看我的文件搜索路径

Thanks in advance

  • 您好,谢谢您的回复

    刚才我按照您的评论加入了库,但事实上我是少加入了.c文件才导致的这个情况,我加入之后错误减少了一些,但是还是存在一些错误

    >> Compilation failure
    makefile:161: recipe for target 'C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3_281x_CCS3x/../../../../../../../../DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3.out' failed
    
     undefined                      first referenced                                              
      symbol                            in file                                                   
     ---------                      ----------------                                              
     _DLOG_4CH_init                 C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
     _DLOG_4CH_update               C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
     _F281X_EV1_DRIVE_Init          C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
     _F281X_EV1_DRIVE_Update        C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
     _F281X_EV1_PWM_Init            C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
     _F281X_EV1_PWM_Update          C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
     _F281X_EV2_Resolver_PWM_Init   C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
     _F281X_EV2_Resolver_PWM_Update C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
     _F281X_adc04b_drv_init         C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
     _F281X_adc04b_drv_read         C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
     _svgendq_calc                  C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/pmsm3_3.obj
    
    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3_281x_CCS3x/../../../../../../../../DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3.out" not built
    gmake[1]: *** [C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3_281x_CCS3x/../../../../../../../../DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3.out] Error 1
    gmake: *** [all] Error 2
    makefile:157: recipe for target 'all' failed
    
    **** Build Finished ****

  • 您好

    我上述的问题已经解决了,但是又有一个新的问题,在f281xadc04b.c中

    #define DELAY_US(A)  DSP28x_usDelay(((((long double) A * 1000.0L) / (long double)CPU_CLOCK_SPEED) - 9.0L) / 5.0L)
    
    extern void DSP28x_usDelay(unsigned long Count);

    编译就会报错

    >> Compilation failure
    makefile:182: recipe for target 'C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3_281x_CCS3x/../../../../../../../../DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3.out' failed
    
     undefined       first referenced                                                  
      symbol             in file                                                       
     ---------       ----------------                                                  
     _DSP28x_usDelay C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/obj/f281xadc04b.obj
    
    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3_281x_CCS3x/../../../../../../../../DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3.out" not built
    gmake[1]: *** [C:/tidcs/DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3_281x_CCS3x/../../../../../../../../DMC/c28/v32x/sys/PMSM3_3_281x/cIQmath/build/pmsm3_3.out] Error 1
    makefile:178: recipe for target 'all' failed
    gmake: *** [all] Error 2

    但是在281xileg_vdc.c、f281xadc04u.c、f281xileg.c也是相同的代码,就不会报错,请问这是什么原因