CLA Initialization Code Example
#include "F2837xD_Cla_typedefs.h"
#include “F2837xD_Device.h"
extern interrupt void Cla1Task1();
extern interrupt void Cla1Task2();
extern interrupt void Cla1Task8();
Lab.h
#include "Lab.h"
// Initialize CLA task interrupt vectors
Cla1Regs.MVECT1 = (uint16_t)(&Cla1Task1);
Cla1Regs.MVECT2 = (uint16_t)(&Cla1Task2);
Cla1Regs.MVECT7 = (uint16_t)(&Cla1Task7);
Cla1Regs.MVECT8 = (uint16_t)(&Cla1Task8);
Cla.c
Defines data types and
special registers
specific to the CLA
Defines register bit
field structures
CLA task prototypes
are prefixed with the
‘interrupt’ keyword
CLA task symbols are
visible to all C28x CPU
and CLA code
Type-1 CLAs MVECT registers accept full 16-bit task addresses as opposed to offsets used on older Type-0 CLAs
CLA Code Debugging
1.
Insert a breakpoint in the CLA code
Insert a MDEBUGSTOP instruction(s) in the code where desired then rebuild/reload
In C code, can use __mdebugstop() intrinsic, or asm(“ MDEBUGSTOP”)
When the debugger is not connected, the MDEBUGSTOP acts like an MNOP
2.
Connect to the CLA target in CCS
This enables CLA breakpoints
3.
Run the CPU target
CLA task will trigger (via peripheral interrupt or software)
CLA executes instructions until MDEBUGSTOP is hit
4.
Load the code symbols into the CLA context in CCS
This allows source-level debug
Needs to be done only once per debug session unless the .out file changes
5.
Debug the CLA code
Can single-step the code, or run to the next MDEBUGSTOP or to the end of the task
If another task is pending, it will start at the end of the previous task
6.
Disconnect the CLA target to disable CLA breakpoints, if desired
The CLA and CPU are debugged from the same JTAG port
You can halt, single-step, and run the CLA independent of the CPU
A CLA single step execute one pipeline cycle, whereas a CPU single
step executes one instruction (and flushes the pipeline)