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.

TMS320F280049C: Problem with including CLAmath to my F280049C project

Part Number: TMS320F280049C

Hi,

I am budiling a project with a launchpad version o fF280049C.  The C28 codes and CLA codes runs well but after putting an inlcude for CLAmath.h in the .cla and/or a special .h file. I get alot of strange warnings.  A snapshot is below:

I have carefully read the CLA_MATH_LIB_UG.pdf document and followed all the instruction but the problem persist.  I have also checked the configuration of the code and it looks okay.

The needed library (cla2_math_library_fpu32_eabi.lib) has been added to the code.

Please what can be the problem and how do I go about solving it.

Thanks

  • and/or a special .h file.

    This looks like a syntax error somewhere in the file - it is possible it occurs before the #include of the CLAmath.h (possibly within this special .h file?).

  • Hi Lori,

    Thanks for the reply.  

    The code runs well when i do not incldue the CLAMath.h file.  But throws up these errors when I want to use the CLAMath.h file in a .h file.   The CLAMath is needed to do a sin calculation and the function would be called from the CLA task.

    Also when I include the CLAMath.h file in the .cla file, I get the errors.

    Thanks

  • Hi,

    More information to the issue.

    When I click on one of the error messages, I land in a "restricted" area of the CLAmath.h include file.  

    A snapshot is below:

    What can be the reason for this.

    Thanks

  • The CLA sin example project for this device does not throw an error. I still suspect a syntax error somewhere outside of the .h file. Missing ) perhaps. This is based on my previous experience. 

  • I land in a "restricted" area of the CLAmath.h include file

    I'm not sure - In the screenshot I only see line 290ish in a .cla file?

  • Hello,

    Thank you fo your reply. 

    I am taking the screen shoot again.   It is below:

    I am enclosing a copy of the .h file that uses the CLAmath.h so you could see it 

    cont_inv_dc2ac_c_2.h

    My .cla file is also included as a text file

    cont_charg.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /**
    * @File: cont_charg_dc2dc.cla
    * @Brief: cont_charg_dc2dc.cla
    * @Created on: May 6, 2021
    * @Author: pds ltd
    * @Project:
    * @Module Description:
    */
    /**< project based include files */
    #include "cont_charg_dc2dc_c.h"
    #include "cont_cla.h"
    #include "cont_pfc_c_2.h"
    #include "cont_inv_dc2ac_c_2.h"
    /**
    * @brief CLA task 1 for dc2dc of the charging circuit
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thanks

  • I have checked my build settings again and compared it with the snapshoot you sent.

    I observed that the exampleused a CLA0 type however, the F280049C launchpad has a CLA2 type.  I also ensured that the various libraries correspond with the CLA2 type. Can this be the fault?  Thanks

  • Above corrected.  I just ran the code with a CLA2 type for the F280049C

  • Above corrected.  I just ran the code with a CLA2 type for the F280049C

    Looks like I accidently compiled for another device. As you noted it doesn't impact the example.

    Is this a shared header file between the c28x and the CLA? If so can you try putting it in a dedicated header file (to the CLA) or in the .cla file itself. 

    I've noticed if I put these two into the shared .h file I do get some errors manifesting from lin.h... 

    But if I put them in the .cla file the errors go away

  • Hi Lori,

    Thanks for your reply.  

    I tried the suggestions but the problem still persisted.

    However, I got a work around which for me is strange and I would like to verify why.

    In my .cla file which i enclosed in the thread, the file #include "cont_pfc_c_2.h" contains inline function that is called by the .cla file.  When i completely removed this, the build works.  This is strange.  Is there a reason for this.

    Or what can I do about this as this would need me to do substaintial changes in my code.

    Thanks

  • Unfortunately I don't have enough information to figure out what the issue might be. You can try inspecting the output of the pre-processor by building with the option:

    • Preprocess the file using -ppo and review the generated file.pp
    •  or  --gen_preprocessor_listing.  This creates a listing file with extension .rl that you can inspect. 

    These are documented in www.ti.com/lit/spru514

    -Lori

  • Hello Lori,

    Thanks for the replies and sorry I have not updated you.  I was able to finally solve the problem.  The include now works.  The solution was not very obvious and was abit strange for me.  I had to add the #include "CLAmath.h" to a second .h file that was in the .cla file.  Then the build was successful.  However the CLAmath is not working as expected and I have opened a new issue on this.  The link is below:

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1288480/look-up-tables-of-the-cla-maths-not-copied-to-the-cla-data-rom

    Thanks