4.
Single-step the CLA code
Once halted, the user can single-step the CLA code. The behavior of a CLA single-step is different than the
main C28x. When issuing a CLA single-step, the pipeline is clocked only one cycle and then again frozen.
On the C28x CPU, the pipeline is flushed for each single-step.
You can also run to the next MDEBUGSTOP or to the end of the task. If another task is pending, it will
automatically start when you run to the end of the task.
Note
A CLA fetch has higher priority than CPU debug reads. For this reason, it is possible for the CLA
to permanently block CPU debug accesses if the CLA is executing in a loop. This might occur
when initially developing CLA code due to a bug that causes an infinite loop. To avoid locking up
the main CPU, the program memory will return all 0x0000 for CPU debug reads when the CLA is
running. When the CLA is halted or idle then normal CPU debug read and write access to CLA
program memory can be performed.
If the CLA gets caught in an infinite loop, you can use a soft or hard reset to exit the condition. A
debugger reset will also exit the condition.
There are special cases that can occur when single-stepping a task such that the program counter, MPC,
reaches the MSTOP instruction at the end of the task.
•
MPC halts at or after the MSTOP with a task already pending
If you are single-stepping or halted in "task A" and "task B" comes in before the MPC reaches the
MSTOP, then "task B" will start if you continue to step through the MSTOP instruction. Basically if "task B"
is pending before the MPC reaches MSTOP in "task A" then there is no issue in "task B" starting and no
special action is required.
•
MPC halts at or after the MSTOP with no task pending
In this case you have single-stepped or halted in "task A" and the MPC has reached the MSTOP with no
tasks pending. If "task B" comes in at this point, it will be flagged in the MIFR register but it may or may
not start if you continue to single-step through the MSTOP instruction of "task A."
It depends on exactly when the new task comes in. To reliably start "task B" perform a soft reset and
reconfigure the MIER bits. Once this is done, you can start single-stepping "task B."
This case can be handled slightly differently if there is control over when "task B" comes in (for example,
using the IACK instruction to start the task). In this case you have single-stepped or halted in "task A" and
the MPC has reached the MSTOP with no tasks pending. Before forcing "task B," run free to force the
CLA out of the debug state. Once this is done you can force "task B" and continue debugging.
5.
Disable CLA breakpoints, if desired
In the Code Composer Studio™ IDE, you can disable the CLA breakpoints by disconnecting the CLA core in
the debug perspective. Make sure to first issue a run or reset; otherwise, the CLA will be halted and no other
tasks will start.
10.4.4 CLA Illegal Opcode Behavior
If the CLA fetches an opcode that does not correspond to a legal instruction, it will behave as follows:
• The CLA will halt with the illegal opcode in the D2 phase of the pipeline as if it were a breakpoint. This will
occur whether CLA breakpoints are enabled or not.
• The CLA will issue the task-specific interrupt to the PIE.
• The MIRUN bit for the task will remain set.
Further single-stepping is ignored once execution halts due to an illegal op-code. To exit this situation, issue
either a soft or hard reset of the CLA as described in
Control Law Accelerator (CLA)
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
TMS320x2806x Microcontrollers
581
Copyright © 2022 Texas Instruments Incorporated
Summary of Contents for TMS320 2806 Series
Page 2: ......