2.5.15. TAPOp_AnySequence_W

Performs a sequence of TCKs, with explicitly specified TMS and TDI inputs. TDO is ignored.

Syntax

#include “tapop.h”

extern TAPOp_Error TAPOp_AnySequence_W(unsigned8 connectId, unsigned8 numTCKs, unsigned32 *TDIbits, unsigned32 *TMSbits, unsigned8 deselect);

where:

connectId

Connection ID, as returned by TAPOp_OpenConnection.

numTCKs

The number of TCKs to perform (maximum255).

TDIbits

TDI data is read from here. This must not be NULL.

TMSbits

TMS data is read from here. This must not be NULL.

deselect

0 indicates that the connection to this TAP controller remains selected (excluding access to other TAP controller connections). Otherwise, the connection is deselected, giving other connections a chance to perform operations.

Return

The function returns:

TAPOp_NoError

No error.

TAPOp_UnableToSelect

Connection could not be made.

TAPOp_NoSuchConnection

The connectId was not recognized.

TAPOp_InBadTAPState

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

TAPOp_BadParameter

Failed for one of the following reasons:

  • TDIbits = NULL

  • TMSbits = NULL

  • numTCKs = 0.

TAPOp_RPC_Connection_Fail

The RPC connection was lost while processing this request.

TAPOp_AnySeqUsedBadPath

An Exit2-IR/DR to Shift-IR/DR transition was requested.

TAPOp_AnySeqWrongIRLength

The wrong number of Shift-IR TCKs was detected.

Usage

This function provides an interface to the virtual TAP controller in the Multi-ICE server. If there are actually several TAP controllers connected in series, the server deals with having to insert extra bits into the IR and DR scan chains transparently to the caller of this function. For this to work, however, some restrictions are imposed on what sequences can be performed. These restrictions are described in Restrictions.

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.

Note

When the connection is deselected, the TAP controller must be left in one of the states Select-DR-Scan or Run-Test/Idle. If this is not done:

  • this call to TAPOp_AnySequence_W returns the error TAPOp_InBadTAPState

  • the TAP controllers are reset and left in the state Run-Test/Idle

  • other connections on the same scan chain are forced to acknowledge the reset as if the call to TAPOp_AnySequence_W had passed through Test-Logic Reset (see below).

If another connection on the same Multi-ICE server resets the TAP controllers by calling TAPOp_AnySequence_W, TAPOp_AnySequence_RW, or TAPOp_TestResetSignal, all subsequent calls to TAPOp_AnySequence_W are rejected with the error TAPOp_InBadTAPState until the reset is acknowledged. As soon as the TAP controllers move from Test-Logic Reset to Run-Test/Idle the controllers are reset, and then:

  1. The Multi-ICE server places every TAP controller in the bypass mode selected by the last call to TAPOp_SetAutoBypassInstruction, or in the default bypass mode if no such call has been made.

  2. The SCSR for the connection that caused the reset is restored to select the chain that was active before the reset took place.

  3. The IR and SCSR for all the other connections are restored to their previous values as each connection is selected.

  4. The remainder of the control bits from a TAPOp_AnySequence call, or the next TAPOp call, are carried out.

After a TAP controller reset, API calls to other connections will fail if the function called is one of the following (either called directly or embedded in a macro):

  • ARMTAP_AccessDR_1Clk_W

  • ARMTAP_AccessDR_NoClk_W

  • ARMTAP_AccessDR_RW

  • ARMTAP_AccessDR_RW_And_Test

  • ARMTAP_AccessDR_W

  • ARMTAP_AccessIR

  • ARMTAP_AccessIR_1Clk

  • ARMTAP_AccessIR_nClks

  • ARMTAP_ClockARM

  • TAPOp_AccessDR_RW

  • TAPOp_AccessDR_W

  • TAPOp_AccessIR

  • TAPOp_AnySequence_RW

  • TAPOp_AnySequence_W

On detecting the error TAPOp_InBadTAPState, each connection must perform the following actions:

  1. Call TAPOp_ReadPrivateFlags. If the TAPOp_TestLogicReset flag is not set, the bad state error was caused by another problem. If it is set, the TAP controller was reset.

  2. Set TAPOp_TestLogicResetACK in the read flags and call TAPOp_WritePrivateFlags to acknowledge the reset.

  3. Restore any required state in the TAP controller logic. For example, on an ARM9 device, you must restore any breakpoints that were set.

  4. Retry the failed TAPOp call.

Example

This example demonstrates the use of TAPOp_AnySequence_W in changing the TAP state from Select-DR-Scan to Run-Test/Idle.

{
    ... declarations
    TMSbits = 0x6;   /* 0110b: Capture-DR, Exit-DR, Update-DR, Run-Test/Idle */
    TDIbits = 0;
    TAPCheck(TAPOp_AnySequence_W(connectId, 4, &TDIbits, &TMSbits, 1));

Restrictions

The following restrictions apply:

  • When shifting data into an IR or DR register, all the shifts (performed when the TAP controller start state is Shift-IR/DR) must occur together. After performing these shifts, Shift-IR/DR must not be left and then re-entered without going through Capture-IR/DR. If you do this, the server returns an error indicating that the transition Exit2-IR/DR to Shift-IR/DR was requested. You must code the client code to avoid this case.

  • The Multi-ICE server knows the length of the IR register. If the number of shifts into this register is not the same as the length according to the server, the server ignores the data shifted into IR, and instead puts in a BYPASS instruction, causing an error to be returned. This ensures that other TAP controllers cannot be accidentally put into strange states by a bug in this TAP controller client.

  • As a consequence of IR length checking, the data to be shifted into the IR must be in a single TAPOp_AnySequence_W call. It must not be split over two calls. This is necessary so that the call can ensure that the correct number of IR shifts are performed before processing any of them.

  • The number of shifts performed in Shift-DR must be the same as the length of the scan chain. If it is not, then in a multi-processor system the operation is undefined due to the insertion of extra TCKs by the server to bypass other TAP controllers.

  • If used in a macro, all 256 bits must be passed. Use fixed or variable unsigned32s. The value of numTCKs determine how many are actually used. For a single TAPOp_AnySequence_W call, a pointer to an array is passed.

See also

These TAPOp API functions provide similar or related functionality:

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