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