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.

TMS320F28377D: Do you need to manually assign memory to CLA for F2837xD C2000 devices?

Part Number: TMS320F28377D


Hi,

I am debugging my project, and my code is getting stuck at a function which allocates memory to the CLA for data and program sections. The function code is below:

void CLA_configClaMemory(void)
{
// From F28377D reset no memory resources are allocated to CLA so it needs to be done here
EALLOW;

// Set CPU1 <=> CLA1 message RAMs
MemCfgRegs.MSGxINIT.bit.INIT_CLA1TOCPU = 1; // Initialise CLA1ToCPUMsgRAM
while(MemCfgRegs.MSGxINITDONE.bit.INITDONE_CLA1TOCPU != 1) {}; // Wait until done

MemCfgRegs.MSGxINIT.bit.INIT_CPUTOCLA1 = 1; // Initialise CPUToCLA1MsgRAM
while(MemCfgRegs.MSGxINITDONE.bit.INITDONE_CPUTOCLA1 != 1) {}; // Wait until done

// Set up program and data memory blocks for use by CLA1
MemCfgRegs.LSxMSEL.bit.MSEL_LS4 = 1; // Allocate LS4 RAM to CLA1
MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS4 = 1; // Set LS4 as program memory

MemCfgRegs.LSxMSEL.bit.MSEL_LS5 = 1; // Allocate LS5 RAM to CLA1
MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS5 = 1; // Set LS5 as program memory

MemCfgRegs.LSxMSEL.bit.MSEL_LS0 = 1; // Allocate LS0 RAM to CLA1
MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS0 = 0; // Set LS0 as data memory

MemCfgRegs.LSxMSEL.bit.MSEL_LS1 = 1; // Allocate LS1 RAM to CLA1
MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS1 = 0; // Set LS1 as data memory

EDIS;
}

Obviously, the code is getting stuck in the while() loops when attempting to allocate memory to the CLA. I am not sure which of these is causing the issue - I will probably check that out now.

Any ideas for why it may be getting stuck in this loop? It is a requierement to manually assign memory for the CLA, correct?


Best wishes,
Joel

  • It seems to be getting stuck on this small piece of code:

    debugBefore = 1;
    MemCfgRegs.LSxMSEL.bit.MSEL_LS5 = 1; // Allocate LS5 RAM to CLA1
    MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS5 = 1; // Set LS5 as program memory
    debugAfter = 1;

    Note: initially debugBefore and debugAfter are both 0, and I place them around the code as such to see where the code is getting stuck. My output here is debugBefore = 1 and debugAfter = 0, so clearly this section of code is causing the problem! Do you notice anything wrong!?

    Joel

  • here's my CLA sections in linker file: 

    /* CLA sections added by JMH */
    Cla1Prog : > RAMLS4, PAGE = 0
    CLADataLS0 : > RAMLS0, PAGE = 0
    CLADataLS1 : > RAMLS1, PAGE = 0

    Cla1ToCpuMsgRAM : > CLA1_MSGRAMLOW, PAGE = 1
    CpuToCla1MsgRAM : > CLA1_MSGRAMHIGH, PAGE = 1

    Cpu1ToCpu2RAM : > CPU1TOCPU2RAM, PAGE = 1
    Cpu2ToCpu1RAM : > CPU2TOCPU1RAM, PAGE = 1

    CLAscratch :
    { *.obj(CLAscratch)
    . += CLA_SCRATCHPAD_SIZE;
    *.obj(CLAscratch_end) } > RAMLS1, PAGE = 0

    .scratchpad : > RAMLS1, PAGE = 0
    .bss_cla : > RAMLS1, PAGE = 0
    .const_cla : > RAMLS1, PAGE = 0

    Is it because I have not actually gave anything to LS5, since Ive used LS4. This would make sense, since it did not get stuck at LS4 code...

  • Hi Joel,

    Would you be able to post the full linker command file? Is the LS5 being allocated to something for use by the C28?

    Thanks,

    Ashwini