2.5.12. TAPOp_AccessDR_W

Writes data to a TAP data register (scan chain).


#include “tapop.h”

extern TAPOp_Error TAPOp_AccessDR_W(unsigned8 connectId, ScanData40 *TDIbits, unsigned8 TDIrev, unsigned8 len, unsigned8 WRoffset, ScanData40 *WRmask, 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.


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.


The connectId was not recognized.


The TAP controller was reset or is not in Run-Test/Idle.


Failed for one of the following reasons:

  • TDIbit = NULL

  • WRoffset >= len.


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 TAPOp_AccessIR. Data shifted out of the scan chain is discarded.

The TAP controller must be in Run-Test/Idle state before this 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 TAPOp_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