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.

TMS320F28069: Using copy tables with CLA / Expanding CLA program memory / CLA memory optimization / Not enough CLA memory

Part Number: TMS320F28069

can someone please give the necessary lines for running a program in CLA with copy tables. 

There are two tasks. task 1 and task 8

both are mapped like follows. 

Fullscreen
1
2
3
4
5
6
UNION {
.Cla1Task1 : LOAD = FLASHE PAGE = 0, table (_task1_copy_table)
.Cla1Task8 : LOAD = FLASHE PAGE = 0, table (_task8_copy_table)
}run = RAML3 PAGE = 0
.ovly > FLASHE PAGE = 0
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

then i do the following

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
EALLOW;
Cla1Regs.MPISRCSEL1.bit.PERINT1SEL = CLA_INT1_NONE;
memcpy(&cla1Funcs_runstart, &cla1Funcs_loadstart, (Uint32) &cla1Funcs_loadsize);
Cla1Regs.MMEMCFG.all = CLA_PROG_ENABLE | CLARAM0_ENABLE | CLARAM1_ENABLE | CLARAM2_ENABLE | CLA_RAM1CPUE;
Cla1Regs.MCTL.bit.IACKE = 1;
Cla1Regs.MIER.all = 0x00FF;
EDIS;
copy_in(&task8_copy_table);
EALLOW;
Cla1Regs.MVECT8 = (Uint16) ((Uint32) &Cla1Task8 - (Uint32) &Cla1Prog_Start);
EDIS;
Cla1ForceTask8andWait();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

but nothing happens. Tasks doesn't run. What's wrong here. 

Can someone please provide the necessary steps here at least. 

Please Note that the CLA runs fine without this copy tables. I had to incorporate copy tables because of the program ram restrictions. 


  • Hi,

    Did it successfully copy the program from Flash to RAM? I do not see RUN address mentioned in the linker cmd file.

    Regards,

    Veena

  • Hi

    I was able to get the code working. run and start addresses mentioned in the linker which i didn't included here. 

    i will put the description below to help someone who faced the same issue of running out of CLA program memory. 

    The trick was, i had to reprogram the Cla1Regs.MMEMCFG.all bits each time before call copy_in. otherwise, c28 core doesn't have access to Cla program space and copy_in cannot copy the second potion of the program. . 
    Following code shows the steps i have followed. 

    task 8 is the first task which uses to initialize the cla variables. Task1 is the repeating task, which will be triggered somewhere in the code. 

    Cla1Regs.MVECT8 is configured as zero because, for some reason, compiler put that union section at the beginning of the CLA program space and then the rest of the CLA program (Cla1Prog) was placed after that, in the same memory area (RAML3) . Can you Shead a light why that happens. How can we configure, where the code sections are placed in the same memory section. 


    Linker code is also included here for the reference. 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    EALLOW;
    Cla1Regs.MPISRCSEL1.bit.PERINT1SEL = CLA_INT1_NONE;
    Cla1Regs.MPISRCSEL1.bit.PERINT8SEL = CLA_INT8_NONE;
    memcpy(&cla1Funcs_runstart, &cla1Funcs_loadstart, (Uint32) &cla1Funcs_loadsize);
    memcpy(&mathTablesRunStart, &mathTablesLoadStart, (Uint32) &mathTablesLoadSize); // load cla math tables for cla sine and cos functions
    EDIS;
    copy_in(&task8_copy_table);
    EALLOW;
    Cla1Regs.MVECT8 = 0;
    Cla1Regs.MPISRCSEL1.bit.PERINT8SEL = CLA_INT8_NONE;
    Cla1Regs.MIER.all = 0x00FF;
    Cla1Regs.MMEMCFG.all = CLA_PROG_ENABLE | CLARAM0_ENABLE | CLARAM1_ENABLE | CLARAM2_ENABLE | CLA_RAM1CPUE;
    Cla1Regs.MCTL.bit.IACKE = 1;
    EDIS;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    MEMORY
    {
    PAGE 0 : /* Program Memory */
    /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
    //RAML1 : origin = 0x008800, length = 0x000400 /* on-chip RAM block L1 */
    RAML3 : origin = 0x009000, length = 0x001000 /* CLA program ram
    OTP : origin = 0x3D7800, length = 0x000400 /* on-chip OTP */
    FLASHH : origin = 0x3D8000, length = 0x004000 /* on-chip FLASH */
    FLASHG : origin = 0x3DC000, length = 0x004000 /* on-chip FLASH */
    FLASHF : origin = 0x3E0000, length = 0x004000 /* on-chip FLASH */
    FLASHE : origin = 0x3E4000, length = 0x004000 /* on-chip FLASH */
    FLASHD : origin = 0x3E8000, length = 0x004000 /* on-chip FLASH */
    FLASHA : origin = 0x3EC000, length = 0x007F80 /* on-chip FLASH */
    //FLASHA : origin = 0x3F4000, length = 0x003F80 /* on-chip FLASH */
    CSM_RSVD : origin = 0x3F7F80, length = 0x000076 /* Part of FLASHA. Program with all 0x0000 when CSM is in use. */
    BEGIN : origin = 0x3F7FF6, length = 0x000002 /* Part of FLASHA. Used for "boot to Flash" bootloader mode. */
    CSM_PWL_P0 : origin = 0x3F7FF8, length = 0x000008 /* Part of FLASHA. CSM password locations in FLASHA */
    FPUTABLES : origin = 0x3FD860, length = 0x0006A0 /* FPU Tables in Boot ROM */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX