X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=doc%2Fopenocd.texi;h=8156de4d19b092da9ebe54b223e1cfeb755bb59c;hp=d80ef4921bae7bcecf7832d3b6436e009ed5bd5b;hb=40ac8d775375bd96b06a5a54cdd9829f60c8ebc4;hpb=4297209ac91d62ab509284c142273ec38ec8cfe3 diff --git a/doc/openocd.texi b/doc/openocd.texi index d80ef4921b..8156de4d19 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2428,12 +2428,18 @@ The TAP events currently defined are: @itemize @bullet @item @b{post-reset} @* The TAP has just completed a JTAG reset. -For the first such handler called, the tap is still -in the JTAG @sc{reset} state. +The tap may still be in the JTAG @sc{reset} state. +Handlers for these events might perform initialization sequences +such as issuing TCK cycles, TMS sequences to ensure +exit from the ARM SWD mode, and more. + Because the scan chain has not yet been verified, handlers for these events @emph{should not issue commands which scan the JTAG IR or DR registers} of any particular target. @b{NOTE:} As this is written (September 2009), nothing prevents such access. +@item @b{setup} +@* The scan chain has been reset and verified. +This handler may enable TAPs as needed. @item @b{tap-disable} @* The TAP needs to be disabled. This handler should implement @command{jtag tapdisable} @@ -2450,7 +2456,7 @@ contents to be accurate), you might: @example jtag configure CHIP.jrc -event post-reset @{ - echo "Reset done" + echo "JTAG Reset done" ... non-scan jtag operations to be done after reset @} @end example @@ -2493,20 +2499,30 @@ does include a kind of JTAG router functionality. In OpenOCD, tap enabling/disabling is invoked by the Tcl commands shown below, and is implemented using TAP event handlers. So for example, when defining a TAP for a CPU connected to -a JTAG router, you should define TAP event handlers using +a JTAG router, your @file{target.cfg} file +should define TAP event handlers using code that looks something like this: @example jtag configure CHIP.cpu -event tap-enable @{ - echo "Enabling CPU TAP" ... jtag operations using CHIP.jrc @} jtag configure CHIP.cpu -event tap-disable @{ - echo "Disabling CPU TAP" ... jtag operations using CHIP.jrc @} @end example +Then you might want that CPU's TAP enabled almost all the time: + +@example +jtag configure $CHIP.jrc -event setup "jtag tapenable $CHIP.cpu" +@end example + +Note how that particular setup event handler declaration +uses quotes to evaluate @code{$CHIP} when the event is configured. +Using brackets @{ @} would cause it to be evaluated later, +at runtime, when it might have a different value. + @deffn Command {jtag tapdisable} dotted.name If necessary, disables the tap by sending it a @option{tap-disable} event. @@ -4891,7 +4907,7 @@ Displays information about the current target's ETM. @end deffn @deffn Command {etm status} -Displays status of the current target's ETM: +Displays status of the current target's ETM and trace port driver: is the ETM idle, or is it collecting data? Did trace data overflow? Was it triggered? @@ -4904,19 +4920,43 @@ When the configuration changes, tracing is stopped and any buffered trace data is invalidated. @itemize -@item @var{type} ... one of +@item @var{type} ... describing how data accesses are traced, +when they pass any ViewData filtering that that was set up. +The value is one of @option{none} (save nothing), @option{data} (save data), @option{address} (save addresses), @option{all} (save data and addresses) @item @var{context_id_bits} ... 0, 8, 16, or 32 @item @var{cycle_accurate} ... @option{enable} or @option{disable} -@item @var{branch_output} ... @option{enable} or @option{disable} +cycle-accurate instruction tracing. +Before ETMv3, enabling this causes much extra data to be recorded. +@item @var{branch_output} ... @option{enable} or @option{disable}. +Disable this unless you need to try reconstructing the instruction +trace stream without an image of the code. @end itemize @end deffn -@deffn Command {etm trigger_percent} percent -@emph{Buggy and effectively a NOP ... @var{percent} from 2..100} +@deffn Command {etm trigger_percent} [percent] +This displays, or optionally changes, the trace port driver's +behavior after the ETM's configured @emph{trigger} event fires. +It controls how much more trace data is saved after the (single) +trace trigger becomes active. + +@itemize +@item The default corresponds to @emph{trace around} usage, +recording 50 percent data before the event and the rest +afterwards. +@item The minimum value of @var{percent} is 2 percent, +recording almost exclusively data before the trigger. +Such extreme @emph{trace before} usage can help figure out +what caused that event to happen. +@item The maximum value of @var{percent} is 100 percent, +recording data almost exclusively after the event. +This extreme @emph{trace after} usage might help sort out +how the event caused trouble. +@end itemize +@c REVISIT allow "break" too -- enter debug mode. @end deffn @subsection ETM Trace Operation @@ -5496,8 +5536,21 @@ If @var{value} is defined, first assigns that. @deffn Command {arm11 step_irq_enable} [value] Displays the value of the flag controlling whether IRQs are enabled during single stepping; -they is disabled by default. +they are disabled by default. +If @var{value} is defined, first assigns that. +@end deffn + +@deffn Command {arm11 vcr} [value] +@cindex vector_catch +Displays the value of the @emph{Vector Catch Register (VCR)}, +coprocessor 14 register 7. If @var{value} is defined, first assigns that. + +Vector Catch hardware provides dedicated breakpoints +for certain hardware events. +The specific bit values are core-specific (as in fact is using +coprocessor 14 register 7 itself) but all current ARM11 +cores @emph{except the ARM1176} use the same six bits. @end deffn @section ARMv7 Architecture