931
32072H–AVR32–10/2012
AT32UC3A3
35.3.4.3
OCD mode
When a breakpoint triggers, the CPU enters OCD mode, and instructions are fetched from the
Debug Instruction OCD register. Each time this register is written by JTAG, the instruction is
executed, allowing the JTAG to execute CPU instructions directly. The JTAG master can e.g.
read out the register file by issuing mtdr instructions to the CPU, writing each register to the
Debug Communication Channel OCD registers.
35.3.4.4
monitor mode
Since the OCD registers are directly accessible by the CPU, it is possible to build a software-
based debugger that runs on the CPU itself. Setting the Monitor Mode bit in the Development
Control register causes the CPU to enter monitor mode instead of OCD mode when a breakpoint
triggers. Monitor mode is similar to OCD mode, except that instructions are fetched from the
debug exception vector in regular program memory, instead of issued by JTAG.
35.3.4.5
program counter monitoring
Normally, the CPU would need to be halted for a JTAG-based debugger to examine the current
PC value. However, the AT32UC3A3 provides a Debug Program Counter OCD register, where
the debugger can continuously read the current PC without affecting the CPU. This allows the
debugger to generate a simple statistic of the time spent in various areas of the code, easing
code optimization.
35.3.5
Memory Service Unit
The Memory Service Unit (MSU) is a block dedicated to test and debug functionality. It is con-
trolled through a dedicated set of registers addressed through the MEMORY_SERVICE JTAG
command.
35.3.5.1
Cyclic Redundancy Check (CRC)
The MSU can be used to automatically calculate the CRC of a block of data in memory. The
OCD will then read out each word in the specified memory block and report the CRC32-value in
an OCD register.
35.3.5.2
NanoTrace
The MSU additionally supports NanoTrace. This is an AVR32-specific feature, in which trace
data is output to memory instead of the AUX port. This allows the trace data to be extracted by
JTAG MEMORY_ACCESS, enabling trace features for JTAG-based debuggers. The user must
write MSU registers to configure the address and size of the memory block to be used for Nano-
Trace. The NanoTrace buffer can be anywhere in the physical address range, including internal
and external RAM, through an EBI, if present. This area may not be used by the application run-
ning on the CPU.
35.3.6
AUX-based Debug Features
Utilizing the Auxiliary (AUX) port gives access to a wide range of advanced debug features. Of
prime importance are the trace features, which allow an external debugger to receive continuous
information on the program execution in the CPU. Additionally, Event In and Event Out pins
allow external events to be correlated with the program flow.
plexed with I/O Controller lines, and must explicitly be enabled by writing OCD registers before
the debug session starts. The AUX port is mapped to two different locations, selectable by OCD
Registers, minimizing the chance that the AUX port will need to be shared with an application.