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.

CLA Issue: Run from Flash using CLA Sine Cosine Table

Other Parts Discussed in Thread: TMS320F28035

Hi,

I am using TMS320F28035. I wrote my code in CLA.  I don't know how to properly load CLAmathTables to Flash then copy to the CLA Data SARAM as the it said in the document.

CLASinCosTable_type0.asm doesn't seem to be automatically loaded in data RAM.

Someone posted a similary question a long time ago, but nobody answered. Here is the link to that discussion

http://e2e.ti.com/support/microcontrollers/tms320c2000_32-bit_real-time_mcus/f/171/p/21215/82026.aspx#82026

 

It is urgent.

Thank you,

Max

 

 

  • Hi max,

    the CLA tables are placed in a section "CLAmathTables". in your linker command file define the following:

       CLA1mathTables    : LOAD = FLASHB,
                          RUN = CLARAM1,
                          LOAD_START(_Cla1mathTablesLoadStart),
                          LOAD_END(_Cla1mathTablesLoadEnd),
                          RUN_START(_Cla1mathTablesRunStart),
                          LOAD_SIZE(_Cla1mathTablesLoadSize),
                          PAGE = 1

    In your main file, before main(), you must declare these variables as follows:

    extern Uint16 Cla1mathTablesLoadStart;
    extern Uint16 Cla1mathTablesRunStart;
    extern Uint16 Cla1mathTablesLoadSize;

    In main()

    memcpy(&Cla1mathTablesRunStart, &Cla1mathTablesLoadStart, (Uint32)&Cla1mathTablesLoadSize);

    and you should be good to go

  • forgot to mention.....

    note that the RUN address is CLARAM1, which  is defined as

    CLARAM1     : origin = 0x008C00, length = 0x000400

    You need to give the CLA access to this memory in main():

       Cla1Regs.MMEMCFG.bit.RAM1E = 1;

  • Hi Vishal,

    Thank you for you reply.

    I did what you suggested, and it gave a compling error:

    " #169 argument of type "Uint32" is incompatible with parameter of type "Uint16"

     

    Thank you,

    Max

  • try this:

    memcpy((Uint32 *)&Cla1mathTablesRunStart, (Uint32 *)&Cla1mathTablesLoadStart, (Uint32)&Cla1mathTablesLoadSize);

  • Hi Vishal,

    I tried.

    It now gives me the same compiling error, but two of them this time.

     

    Thanks,

    Max