13-50 March, 2003 Developers Manual
Intel® 80200 Processor based on Intel® XScale Microarchitecture
Software Debug
13.15.2.3 Dynamic Debug Handler
On the Intel® 80200 processor, the debug handler and override vector tables reside in the 2 KB
mini instruction cache, separate from the main instruction cache. A “static” Debug Handler is
downloaded during reset. This is the base handler code, necessary to do common operations such
as handler entry/exit, parse commands from the debugger, read/write ARM registers, read/write
memory, etc.
Some functions may require large amounts of code or may not be used very often. As long as there
is space in the mini-instruction cache, these functions can be downloaded as part of the static
Debug Handler. However, if space is limited, the debug handler also has a dynamic capability that
allows a function to be downloaded when it is needed. There are three methods for implementing a
dynamic debug handler (using the mini instruction cache, main instruction cache, or external
memory). Each method has their limitations and advantages. Section 13.14.5, Dynamically
Loading IC After Reset describes how do dynamically load the mini or main instruction cache.
1. using the Mini IC
The static debug handler can support a command which can have functionality dynamically
mapped to it. This dynamic command does not have any specific functionality associated with
it until the debugger downloads a function into the mini instruction cache. When the debugger
sends the dynamic command to the handler, new functionality can be downloaded, or the
previously downloaded functionality can be used.
There are also variations in which the debug handler supports multiple dynamic commands,
each mapped to a different dynamic function; or a single dynamic command that can branch to
one of several downloaded dynamic functions based on a parameter passed by the debugger.
Debug Handlers that allow code to be dynamically downloaded into the mini instruction cache
must be carefully written to avoid inadvertently overwriting a critical piece of debug handler
code. Dynamic code is downloaded to the way pointed to by the round-robin pointer. Thus, it
is possible for critical debug handler code to be overwritten, if the pointer does not select the
expected way.
To avoid this problem, the debug handler should be written to avoid placing critical code in
either way of a set that is intended for dynamic code download. This allows code to be
downloaded into either way, and the only code that is overwritten is the previously
downloaded dynamic function. This method requires that space within the mini instruction
cache be allocated for dynamic download, limiting the space available for the static Debug
Handler. Also, the space available may not be suitable for a larger dynamic function.
Once downloaded, a dynamic function essentially becomes part of the Debug Handler. Since it
is in the mini instruction cache, it does not get overwritten by application code. It remains in
the cache until it is replaced by another dynamic function or the lines where it is downloaded
are invalidated.