v10.50 v10.55 Alpha v10.54 Alpha v10.53 Alpha v10.52 Alpha v10.51 Alpha
v10.50 v10.55 Alpha v10.54 Alpha v10.53 Alpha v10.52 Alpha v10.51 Alpha

Prepare Wait Packet Instruction

This instruction tells the Voyager USB 3.2 Exerciser to prepare to wait for incoming packets.

Note: Even when no specific fields are checked in the packets to wait for, the USB 3.2 Link partner may sometimes send a response faster than it takes for the Voyager USB 3.2 Exerciser to get to the next WaitPacket instruction. In such cases, the Voyager USB 3.2 Exerciser should prepare for incoming Rx packets before processing the next WaitPacket instruction. Otherwise, Rx packets will be lost and WaitPacket will block forever. The PrepareWaitPkt instruction explicitly tells the Voyager USB 3.2 Exerciser when it should start such preparations, so that no Rx packets are lost and the next WaitPacket instruction executes normally.

Note: The WaitPacket instruction also has an implicit way to indicate that the Voyager USB 3.2 Exerciser should prepare for incoming Rx packets at the time it executes the previous Send Packet instruction. See Wait Packet Instruction for more details.

PrepareWaitPkt [( pkt_type, pkt_sub_type, ep_num, dev_addr, ep_dir, stream_id )]

Parameters

pkt_type

Type of the packets [TP, DP, or ITP] for which to wait (defined in gen_constants.ginc)

pkt_sub_type

Subtype of the packets for which to wait (applicable only to TP; defined in Main_Tp_Pkt_templates.ginc)

ep_num

Endpoint number of the packets for which to wait

dev_addr

Device address for the packets for which to wait

ep_dir

Endpoint direction for the packets for which to wait

stream_id

Stream ID for the packets for which to wait

A “don’t care” value of USB3_ANY (defined in gen_constants.ginc) can be used for any one of the parameters.

Example

Set Mode = HOST # Set ‘Host’ mode.

Main
{
# Prepare to wait for a data packet on the specified endpoint.
PrepareWaitPkt( USB3_TYPE_DP, USB3_ANY, 3 )

Send TP_ACK
    {
        DevAddr = 1
        Endp    = 3
        dir     = HOST_TO_DEVICE
        NumP    = 1
    }
# Wait for Data packet from device.
WaitPacket 
}