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.

TMS320F28P550SJ: CLAsin() not working

Part Number: TMS320F28P550SJ
Other Parts Discussed in Thread: C2000WARE

Tool/software:

   PROJECT FILE:   4274.pwm_p55.zip

Dear Experts,

I currently migrating from F28379D to F28P55. The CLA is successfully being triggered by the ADCA1. Next, I am now trying to perform trigonometric operations in the CLA task. For instance, I am using CLAsin() to perform sine. But the function returns ZERO. I have included following .lib files provided in the C2000Ware_5_04_00_00 like I did for F28379D, but ZERO is returned by the CLAsin(). Please find the project file in the top.

  1. cla2_math_library_datarom_fpu32_eabi
  2. cla2_math_library_fpu32_eabi
  3. F28P55xCPU1_BootROM_Symbols_fpu32.lib

Please let me know where I am wrong.

Regards,

Rajesh.

  • Hi Rajesh,

    Do you get any compiler warnings when using these lib files? If so, can you screenshot them and show them here?

    Best Regards,

    Delaney

  • Hi Delaney,

    Thank you very much for responding to the query.

    Regarding the warnings, there are no compiler errors that are flagged I can see and I could only find advices.

    Since you asked about the warnings, there was a warning respect to CLA1mathTables that appeared in the warnings- "not defined in the linker file". After allocating memory by adding a line CLA1mathTables   : > RAMLS6 in the linker file, the warning disappeared and left with advice shown in the picture of the screenshot.

    Please let me know if I have made any mistake.

    Thanks and Regards,

    Rajesh.

  • Hi Rajeesh,

    On the F28P55x, the CLA math tables are hardcoded in the boot ROM so you don't need the cla2_math_library_fpu32_eabi.lib file. Removing this file should also take away this warning, the linker doesn't need to allocate any RAM space for the tables since they are already in the ROM. You can just include the cla2_math_library_datarom_fpu32_eabi.lib file and the F28P55xCPU1_BootROM_Symbols_fpu32.lib files in your project.

    Can you look in your .map file and see what address the CLAsin() function definition is being placed at? Also, did you make any modifications (besides the one you mentioned) to the CLA linker cmd file provided by C2000ware? If so, can you explain what was changed?

    Best Regards,

    Delaney

  • Hi Delaney!
    As per your advice, I have excluded cla2_math_library_fpu32_eabi.lib file from the build. After building, a bunch of errors flagged respect to the undefined datarom symbols. Please find the screenshot of the errors.

    Regards and Thanks,

    Rajesh.

  • Hi Rajesh,

    Can you verify that you have the CLA_MATH_TABLES_IN_ROM=1 predefined symbol in your project properties? And that you are using the CLA math version of the linker cmd file? For this, you can look inside your linker cmd file and check that memory allocations for the tables are not being done since the CLA_MATH_TABLES_IN_ROM symbol is defined, like the below:

    Best Regards,

    Delaney

  • Hi Delaney,

    I have included the snippet of code and also included variables in the main program, however the compiler flags the same errors. 



    Thanks,

    Rajesh

  • Hi Rajesh,

    Writing the tables to RAM should not be necessary on this device, it has the tables hardcoded into the ROM. You can remove all of the code you have circled. The datarom version of the lib file assumes it is looking for the tables in the ROM location. 

    I will test out this lib file myself to verify that it's working and see if I can replicate the error you're seeing.

    Best Regards,

    Delaney

  • Hi Delaney,

    I tried omitting the code and it ended up flagging same bunch of errors.

    Thanks,

    Rajesh.

  • Hi Rajesh,

    Have you taken a look at the CLA math users guide? It explains how to add CLA math support to your project and correctly configure your project based on if you are using the tables in ROM or loading them to LSRAM yourself. 

    8345.CLA-MATH-LIB-UG (3).pdf

    Best Regards,

    Delaney

  • Hi Delaney, 

    I believe that I followed the procedure as described in the CLA Math Doc and I could succesfully perform the CLAsin() operation for F28379D using ROM TABLES. But with F28P55, I couldn't get the expected results.

    I am not sure what Im missing.

    Thanks,

    Rajesh.

  • Hi Rajesh,

    Let me test it out myself tomorrow and get back to you. 

    Best Regards,

    Delaney

  • Hi Rajesh,

    It appears that the boot ROM symbols lib file provided by C2000ware for this device as a bug. Can you try switching to this one instead? I will make sure the lib gets updated for the next C2000ware release.

    F28P55x_CLADATROM_Symbols_fpu32.lib

    Please upvote this reply if it fixes your issue Slight smile

    Best Regards,

    Delaney

  • Hi Delaney,

    It is perfectly working and I would give you 100 UPVOTES if there was an option. At the same time I expect an UPVOTE for letting TI aware about the bug Slight smile