Tool/software: Code Composer Studio
I realise that there are other posts already regarding this, but none of the bugs mentioned there are present in this case (or not to my knowledge).
I have one of these devices running with two tasks in the CLA. When the JTAG emulator is connected and I run in debug mode, everything is fine. However, if I power cycle the target board (emulator still plugged in), the CPU boots properly but the CLA tasks do not run. If I program the device with release code (no emulation), the CPU runs, but not the CLA. If I setup interrupts to fire after a CLA task finishes, those interrupts run OK, but the CLA has clearly not executed its code properly. I know this from debugging with various LEDs on the target board.
The clock to the CLA is enabled in the InitSysCtrl() function, enclosed by EALLOW and EDIS: SysCtrlRegs.PCLKCR3.bit.CLA1ENCLK = 1;
Are there any special settings required in the project configurations to allow the CLA to run in standalone? I am at a loss to know what to do, any suggestions would be gratefully appreciated.
Many thanks in advance.
In the linker CMD file:
{
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
RAML3 : origin = 0x009000, length = 0x001000 /* on-chip RAM block L3. Used for CLA Program RAM. */
RAML8 : origin = 0x012000, length = 0x002000 /* on-chip RAM block L8. Used for ramfuncs code. */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */
RAML1 : origin = 0x008800, length = 0x000400 /* on-chip RAM block L1. Used for CLA Data RAM 0. */
RAML2 : origin = 0x008C00, length = 0x000400 /* on-chip RAM block L2. Used for CLA Data RAM 1. */
.
CLA1_MSGRAMHIGH : origin = 0x001500, length = 0x000080
}
{
RUN = RAML3,
LOAD_START(_Cla1funcsLoadStart),
LOAD_END(_Cla1funcsLoadEnd),
RUN_START(_Cla1funcsRunStart),
LOAD_SIZE(_Cla1funcsLoadSize),
PAGE = 0
CpuToCla1MsgRAM : > CLA1_MSGRAMHIGH, PAGE = 1
Cla1DataRam1 : > RAML2, PAGE = 1
Cla1DataRam2 : > RAML0, PAGE = 1
{ *.obj(CLAscratch)
. += CLA_SCRATCHPAD_SIZE;
*.obj(CLAscratch_end) } > RAML1,
PAGE = 1
Cla1Regs.MVECT1 = (Uint16)((Uint32)&Cla1Task1 - (Uint32)&Cla1Prog_Start);
Cla1Regs.MVECT2 = (Uint16)((Uint32)&Cla1Task2 - (Uint32)&Cla1Prog_Start);
Cla1Regs.MVECT3 = (Uint16)((Uint32)&Cla1Task3 - (Uint32)&Cla1Prog_Start);
Cla1Regs.MVECT4 = (Uint16)((Uint32)&Cla1Task4 - (Uint32)&Cla1Prog_Start);
Cla1Regs.MVECT5 = (Uint16)((Uint32)&Cla1Task5 - (Uint32)&Cla1Prog_Start);
Cla1Regs.MVECT6 = (Uint16)((Uint32)&Cla1Task6 - (Uint32)&Cla1Prog_Start);
Cla1Regs.MVECT7 = (Uint16)((Uint32)&Cla1Task7 - (Uint32)&Cla1Prog_Start);
Cla1Regs.MVECT8 = (Uint16)((Uint32)&Cla1Task8 - (Uint32)&Cla1Prog_Start);
asm(" RPT #3 || NOP");
asm(" RPT #3 || NOP");
Cla1Regs.MPISRCSEL1.bit.PERINT2SEL = CLA_INT2_ADCINT2;
Cla1Regs.MPISRCSEL1.bit.PERINT8SEL = 0b1111;
Cla1Regs.MIER.all = 0x00FF;