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: Errors when compiling code with SFO HRPWM functions

Part Number: C2000WARE


Hi,

I am trying to compile my code that uses the SFO function for high resolution pulse width modulation. To do this I used an example from C2000 Ware for the code, and added it to my main code. 

I then added the SFO_v8_fpu_lib_build_c28_driverlib.lib file from that same example into my directory, and now when compiling I am getting the following error: 

warning #10207-D: resolving index library "SFO_v8_fpu_lib_build_c28_driverlib.lib" to "SFO_v8_fpu_lib_build_c28_driverlib_eabi.lib", but "SFO_v8_fpu_lib_build_c28_driverlib_eabi.lib" was not found

undefined first referenced
symbol in file
--------- ----------------
SFO ./MPM_CPU1.obj

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "HV_MPM_CPU1.out" not built

>> Compilation failure
makefile:166: recipe for target 'HV_MPM_CPU1.out' failed
gmake[1]: *** [HV_MPM_CPU1.out] Error 1
makefile:162: recipe for target 'all' failed
gmake: *** [all] Error 2

**** Build Finished ****

i then decided that I will try and include the file instead that is included in the error/warning message, but that then gives me a new error message:

undefined first referenced
symbol in file
--------- ----------------
ePWM ../SFO_v8_fpu_lib_build_c28_driverlib_eabi.lib<SFO_v8_fpu_lib_build_c28_driverlib.obj>

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "HV_MPM_CPU1.out" not built

>> Compilation failure
makefile:166: recipe for target 'HV_MPM_CPU1.out' failed
gmake[1]: *** [HV_MPM_CPU1.out] Error 1
makefile:162: recipe for target 'all' failed
gmake: *** [all] Error 2

**** Build Finished ****

Which is an issue within the SFO.lib file itself - not sure if this is a bug or I am going wrong somewhere.

Please do assist if you can.


Regards,
Joel

  • Hi,

    Actually SFO_v8_fpu_lib_build_c28_driverlib.lib is an index library that can automatically pick up the Coff/eabi variant based on the compiler options for your application project. But you need to make sure SFO_v8_fpu_lib_build_c28_driverlib_eabi.lib and SFO_v8_fpu_lib_build_c28_driverlib_coff.lib are also placed in the same directory as SFO_v8_fpu_lib_build_c28_driverlib.lib to be detected by the index.

    If my reply answers your question please click on "This resolved my issue" button located at the bottom of my post.

    Regards

    Himanshu

  • Hi Himanshu,

    Yes, I have added the standard driverlib.lib file to my project, and I have included the path to all .lib files, in my project properties. Here is the location:

    Yet, I still get the errors that I have stated, unfortunately.

    Any other suggestions?

    Joel

  • Apparently, from the README file, I need to include 2. Variable Declarations:
    The application needs to declare below variables to provide EPWM instance
    addresses used in SFO lib and to capture calibration status & output.
    E.g. Uint16 status = SFO_INCOMPLETE;
    int MEP_ScaleFactor = 0; //scale factor value
    volatile struct EPWM_REGS *ePWM[] = {0, &EPwm1Regs, &EPwm2Regs};
     

    But I do not declare my EPWM registers using the driverlib, rather I use direct bitfield method. This also explain why the error is showing up as ePWM being undefined. How do I define it in my code so that the code runs, executes and updates the HRPWM using the SFO function if I do not use the driverlib functions for ePWM?... 

    Have included the original .lib file, and I am still getting warning #10207-D: resolving index library "SFO_v8_fpu_lib_build_c28_driverlib.lib" to "SFO_v8_fpu_lib_build_c28_driverlib_eabi.lib", but "SFO_v8_fpu_lib_build_c28_driverlib_eabi.lib" was not found, even though I am directly adding this original .lib file from the same directory that it is contained in the SFO C2000 examples. I am not sure why it is not finding the other files, since as I said, I have included the directory in my project properties settings.

  • Hi,

    If you are using the bitfield implementation for your drivers then you should make use of the bitfield based SFO calibration library "SFO_v8_fpu_lib_build_c28.lib". You can find more details about it inside the readme document and you can refer to the bitfield based HRPWM example present in the directory: C2000Ware_3_04_00_00\device_support\f28004x\examples\hrpwm

    If my reply answers your question please click on "This resolved my issue" button located at the bottom of my post.

    Regards

    Himanshu

  • Okay, tried that, and still getting an error that is very similar:

    <Linking>
    warning #10207-D: resolving index library "SFO_v8_fpu_lib_build_c28.lib" to "SFO_v8_fpu_lib_build_c28_coff.lib", but "SFO_v8_fpu_lib_build_c28_coff.lib" was not found

    undefined first referenced
    symbol in file
    --------- ----------------
    _SFO ./MPM_CPU1.obj

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "HV_MPM_CPU1.out" not built

    Same error, different files. Really confused here with this one.

    any more ideas, please? Thanks!

  • It seems that there is definitely some issue with the include paths for your project as the index library is not being able to resolve the correct library variant. As I suggested before, it would be best for you to start with the bitfield based HRPWM example "hrpwm_ex1_duty_sfo_v8" that is provided as part of the C2000Ware directory: C2000Ware_3_04_00_00\device_support\f28004x\examples\hrpwm

    This example should already have the right include paths and link the right library variant. Once this works for you, you can replace the main/source files for this project with your application and go from there.

    If my reply answers your question please click on "This resolved my issue" button located at the bottom of my post.

    Regards

    Himanshu

  • But I cannot use that example because the device is a different one - F28004 versus my F2837xD. I assume that the include paths are different. 

    All of my include paths in my example are carbon copies of the ones in that example, but with the device being different, yet still no luck. Oh well. I have literally followed the exact path that I have included in my file system and the files are all there.

    Maybe I could send my project, to see if there is an error in the include path in my system. I have followed the include path in my system and it checks out, hence all the confusion.

  • Here are the .lib files for my device, shown in my directory: 

    and here is the include path:

    The only thing I could imagine the issue being is that I include the /include document folder - but every single example does this, and doesn't include the path to the .lib files directly. I have followed the exact same procedure as the other examples, to no avail.

  • If you are using F2837xD then we also have the same HRPWM based example "hrpwm_duty_sfo_v8" available on F2837x in the bitfield format that also makes use of SFO. You can access the example here: C2000Ware_3_04_00_00\device_support\f2837xd\examples\cpu1\hrpwm_duty_sfo_v8

    Hope you can use the above example as a reference to figure out the include paths and linker files and resolve this issue.

    If my reply answers your question please click on "This resolved my issue" button located at the bottom of my post.

    Regards

    Himanshu