2.5.5. ARMTAP_AccessDR_W

Writes data to a TAP data register (scan chain) and then clock the ARM core nClks times.


#include “tapop.h”

extern TAPOp_Error ARMTAP_AccessDR_W(unsigned8 connectId, ScanData40 *TDIbits, unsigned8 TDIrev, unsigned8 len, unsigned8 WRoffset, ScanData40 *WRmask, unsigned8 nClks, unsigned8 deselect);



Connection ID, as returned by TAPOp_OpenConnection.


A pointer to up to 40 bits of data to be writtento the scan chain data register. This must not be NULL.


A flag determining the bit order of the data:


Write LSB of TDIbits first (normal mode).


Write MSB of TDIbits first (reversed mode).

To write less than 40 bits of data using reversed mode you must set WRmask with bits set in the high-order end of the mask, not the low-order end.


Length of the selected data register (scan chain).


Offset of the selected data register (scan chain) where you start writing data. The rest of the scan chain is recirculated so that whatever data appears on TDO is written to TDI during the scan.

To write all 40 bits, you can set WRmask to NULL when using direct TAPOp calls. When defining macros, you must always specify the mask in full.


A 40-bit mask that determines which bits are written to the data register (scan chain) during a scan:

  • if 1 then the bit is written

  • if 0 then the bit is recirculated, so that whatever comes out of the TDO pin is put back into TDI during the scan.

To write all 40 bits, you can set WRmask to NULL when using direct TAPOp calls.


The number of ARM processor DCLKs to be generated. This is the number of transitions out of Run-Test/Idle that are made. If 0, Run-Test/Idle is avoided altogether. The value of nClks is range checked:

0 <= nClks <= 31


If 0, the connection to this TAP controller remains selected. This excludes access to this TAP controller from other Multi-ICE server connections. Otherwise the connection is deselected, giving other connections a chance to perform operations.


The function returns:


No error.


Connection could not be made. You must try again later.


The connectId was not recognized.


The TAP controller was reset or is not in Select-DR-Scan.


Failed because of one of the following:

  • TDIbits = NULL

  • len = 0

  • WRoffset >= len

  • nClks > 31.


The RPC connection was lost while processing this request.


The call attempts to select the connection. If this cannot be done (for example, because another TAP controller is being accessed), the call fails with a TAPOp_UnableToSelect error.

The data to write to the core is read from TDIbits and sent with the write mask and offset to the Multi-ICE interface unit. It is transferred to the scan chain that was selected by the last call to ARMTAP_AccessIR_nClks. If the value of nClks is nonzero, data written to the scan chain is clocked into the core with one or more cycles of DCLK. Data shifted out of the scan chain is always discarded.

The TAP controller must be in JTAG state Select-DR-Scan before the function is used, and is left in this state after the function has been performed.

If another connection on the same Multi-ICE server resets the TAP controllers by calling TAPOp_AnySequence_W, or TAPOp_AnySequence_RW, or TAPOp_TestResetSignal, all subsequent calls to ARMTAP_AccessDR_W are rejected with the error TAPOp_InBadTAPState until the reset is acknowledged. See TAPOp_AnySequence_W for more details.

See also

These TAPOp API functions provide similar or related functionality:

Copyright © 1998-2002 ARM Limited. All rights reserved.ARM DUI 0154B