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.

TMS320F28P650SK: TMS320F28P650SK - CLA code copy to RAM

Part Number: TMS320F28P650SK
Other Parts Discussed in Thread: PMP23338, SYSCONFIG, C2000WARE

Tool/software:

Hi C2000 expert,

customer is asking some questions about CLA work in RAM.

Q1: customer is referring the PMP23338 demo code to develop a PFC. But the CLA has not been used in PMP23338 demo code. customer wants to ask how to copy the CLA code to RAM using code? eg, how to configure linker file(cmd)? how to use memcpy() function?


Q2; how to verify the CLA code has been copied to RAM successful through debug view window?

Q3: How to understand  ”CLA_MATH_TABLES_IN_ROM“?

thanks

  • Hi Bliss,

    Below are the answers to their questions:

    1. I would suggest they use the linker cmd files used in the CLA examples (28p65x_cla_ram_lnk_cpu1.cmd or 28p65x_cla_flash_lnk_cpu1.cmd in [C2000ware install]/device_support/f28p65x/common/cmd), as well as the Sysconfig generated C code from the CLA examples to see how the memcpy should be done. Another note: they only need to do the memcpy if using a flash build.

      

    2. To verify that the CLA program is copied over correctly for a flash build, they can:

    • Step over the memcpy lines of code
    • Switch the debugger context to the CLA
    • View the address of the LSRAM the CLA program was copied over to in the Memory Browser

    3. The CLA math tables on the F28P65x are hardcoded into the ROM. For the CLA math library examples, if they don't want to use the hardcoded ROM tables, they can change the CLA_MATH_TABLES_IN_ROM=1 predefined symbol to 0 which will evaluate the #if  !(CLA_MATH_TABLES_IN_ROM) conditions to true. There is more information in the CLA Math User guide section 4 Using the Tables in the CLA Data ROM that would be helpful for them to look at.

    Best Regards,

    Delaney

  • Hi Delaney,

    thank you for your response. It is helpful for me. May I ask additional question here?

    1, For the CLA math tables configuration selection between ROM hardcoded or not, is the ROM hard-coded or non-hard-coded a common choice? 

    2, for the "CLA Math User guide “, i would like to check with you if you are talking C28x Control Law Accelerator Math Library (ti.com)? if this is incorrect link, could you share the correct link with me?

     

    Best Regards

    Bliss 

  • Hi Bliss,

    In most cases if the tables are hardcoded into the ROM for a particular device, there's really no reason not to use them. They conserve LSRAM memory and are already fully set up (there is no need to configure anything in the linker cmd for them or copy anything over at runtime), so I would say it is the common choice.

    For the user guide, I recommend using the version linked here as it is the most recent revision. 

    Best Regards,

    Delaney

  • thanks Delaney. Your reply is very helpful.