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.

What libraries shall I use?!

Other Parts Discussed in Thread: CONTROLSUITE

Hi all,

I'm using Piccolo TMS320F28069PU device and trying to use HRPWM peripheral. First of all, I've read all the proper documentation about this peripheral and have run the "hrpwm_prdup_sfo_v6" example from ControlSuite. In this case, it's all fine.

But I have problems while trying to compile my own code. Previously, I used ePWM (whithout high-resolution) and it worked perfectly. I copied some functions from the TI project example and included SFO_V6.h file and SFO_TI_Build_V6b_FPU.lib to my project. I also include rts2800_fpu32.lib But now an error apears:

  error:                            "unresolved symbols remain"

  undefined symbol:    _ePWM

  first reference in file: ../lib/SFO_TI_Build_V6b_FPU.lib<SFO_V6b.obj>

I couldn't finde the solution to this error.

Another question is: as I use 28069 device, which has floating-point unit, must I use only those libraries containing the "_FPU" ending? (like: rts2800_fpu32.lib, SFO_TI_Build_V6b_FPU.lib or IQmath_fpu32.lib)

Thanks,

Alex

  • Hello, Alex!

    Alex Segura said:

     I copied some functions from the TI project example 

    What are functions you have copied concretely and from where?

    Alex Segura said:

    and included SFO_V6.h file and SFO_TI_Build_V6b_FPU.lib to my project. I also include rts2800_fpu32.lib But now an error apears:

      error:                            "unresolved symbols remain"

      undefined symbol:    _ePWM

      first reference in file: ../lib/SFO_TI_Build_V6b_FPU.lib<SFO_V6b.obj>

    Oddly...I have tried the same and compiling was successful. Check please your project's settings below:

    Alex Segura said:

    Another question is: as I use 28069 device, which has floating-point unit, must I use only those libraries containing the "_FPU" ending? (like: rts2800_fpu32.lib, SFO_TI_Build_V6b_FPU.lib or IQmath_fpu32.lib)

    If you wouldn't like to use FPU then you may not include FPU libraries and work at fixed point mode. But FPU provides increasing performance for float point operations. Regarding IQmath_f32.lib: this build of the library can be linked with code built with the --float_support=fpu32 switch. This can be useful for mixing IQmath with native floating-point code on devices with the C28x+FPU.

    Regards,

    Igor

  • Many thanks for your time Igor,

    I've already reviewed the include files configuration and lib search path. It's all configured as your screenshots.

    I went back to my initial code and it compiled without problems. Then, I started to introduce the SFO() loop before the main(), which waits till SFO() is complete. I could check that the problem comes when I use the SFO() function. So I think it is something wrong with the corresponding library.

    The only thing I copied whas the error() function and the SFO() code:

    void error (void){
      ESTOP0;    // Stop here and handle error
    }
    
    // Before main loop:
    while(SFO_stat == SFO_INCOMPLETE){
      SFO_stat = SFO();
      if(SFO_stat == SFO_ERROR){
        error();
      }
    }
    
    // Inside main loop:
    SFO_stat = SFO();
    if(SFO_stat == SFO_ERROR){
        error();
      }

    Summarizing, SFO() calling is the source of the problem.


    What else can I do to try to fix it?

    Thanks a lot,

    Alex

  • Hi Alex!

    Alex Segura said:

    So I think it is something wrong with the corresponding library.

    This is unlikely. Anyway I suspect there is a problem of included header files. For example in the main file of example "hrpwm_prdup_sfo_v6"  (Example_2806xHRPWM_PrdUp_SFO_V6.c) there are two included header files (not only SFO_V6.h): 

    #include "DSP28x_Project.h" // DSP280xx Headerfile
    #include "SFO_V6.h"

    The first above header file contains important includes:

    #include "F2806x_Cla_typedefs.h"// F2806x CLA Type definitions
    #include "F2806x_Device.h" // F2806x Headerfile Include File
    #include "F2806x_Examples.h" // F2806x Examples Include File

    Check please this thing in your own source code.

    Regards,

    Igor

     

  • Hi Igor,

    I finally found what was missing! SFO() function needs MEP_ScaleFactor variable (which was already defined) and *ePWM[] structure (which I didn't define anywhere). This structure is needed inside the pre-compiled SFO() function.

    It would be nice if anyone could explain how does SFO() make its calculations to optimize the MEP length. It's not really explained in the Technical Reference document.

    Many thanks for your attention Igor,

    Alex

  • Hi Alex!

    Alex Segura said:

    It would be nice if anyone could explain how does SFO() make its calculations to optimize the MEP length. It's not really explained in the Technical Reference document.

    It seems it is not possible. This is proprietary TI information. You can refer to this thread

    http://e2e.ti.com/support/microcontrollers/c2000/f/171/p/32279/113074.aspx#113074

    Regards,

    Igor