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

PD VDM Decoding Manual

Teledyne LeCroy, Copyright 2016

Scripting to Decode Power Delivery Vendor Defined Messages

USB Power Delivery VDM Scripts are preferred to be found in “PDScripts” folder under the root folder of scripts. Furthermore, they should be suffixed “.dec”, same as the other USB Script decoders, to be discovered by the software.

USB Power Delivery VDM Scripts are used to decode data in these vendor defined messages:

  • Unstructured Message (VDM_Type field of VDM Header is 0)

  • SVID Specific Commands (Command field of VDM Header is 16..31)

  • Extra Data Objects in Attention command

  • Response message of a Discover Modes command

USB Power Delivery VDM Scripts should set following global variables appropriately:

set OutputType = "< optional name >";
set ScriptFamily = "USBPD";
set PDDecoderVendorID = < vendor id >;

Example for USB Power Delivery DisplayPort Script:

set OutputType = "PD DisplayPort";
set ScriptFamily = "USBPD";
set PDDecoderVendorID = 0xFF01;

Since VDM Header data object will be decoded by the software according to predefined specification, the Power Delivery VDM Script can provide name and color data for "SVID Specific Commands" to be used in corresponding "Command" cell. Therefore, an information list should be defined globally in the Power Delivery VDM Script. Name of this information list should be “SVIDSpecificCommands” which provides name and color information for each "SVID Specific Command".

Example for USB Power Delivery DisplayPort Script:

set SVIDSpecificCommands =
[
  #[ command_value, “Name”,          Color            ]
   [ 0x10,          "DP Status",     RGB(137,117,209) ],
   [ 0x11,          "DP Configure",  RGB(183,135,226) ]
];

Script Usage

A USB Power Delivery VDM Script can be used in Packet, Transaction and Transfer decoding. Thus it is possible to display any cell in each layer of the Trace view.

The "Level" context field can be used in USB Power Delivery VDM Script to determine which level of decoding should be performed.

Note: The main entry function for USB Power Delivery VDM Scripts is ProcessData, the same as the other USB script decoders.

Example for USB Power Delivery DisplayPort Script:

ProcessData()
{
    if(in.Level == _PKT)
    {
       Call("ProcessPacket");
    }
    if(in.Level == _TRA)
    {
       Call("ProcessTransaction");
    }
    if(in.Level == _XFER)
    {
       Call("ProcessTransfer");
    }
    return Complete();
}

Available Context in Decoding functions

The following fields are available in decoding functions:

Note: Only in the case of Transfer layer, the context fields (except "Level" context field) are prefixed to distinguish between Initiator and Responder messages. The prefixes are “Init_” for initiator and “Resp_” for responder message. There is no prefix in the case of Packet and Transaction decoding.

in.Level: Indicates the decoding level

in.Header: 16-bit data containing PD message’s header data

in.DataObjectCount: Count of available data objects

in.OBJ_0: 32-bit data containing the first data object which is VDM Header

in.OBJ_1: 32-bit data containing the first data object

in.OBJ_[n-1]: 32-bit data containing the last data object (n == in.DataObjectCount)

The following fields of the VDM Header are provided separately for user convenience:

in.VendorId: The VendorId

in.IsStructured: The VDM_Type field which defines if the message is Structured VDM or Unstructured VDM

Structured VDMs

The following fields are only available for structured VDMs (in.IsStructured == 1):

in.Command: Command value

in.CommandType: Command type which can be the following values:

0: Initiator

1: Resp_ACK

2: Resp_NAK

3: Resp_BUSY

in.Version: VDM Version

Unstructured VDMs

The following field is only available in the case of unstructured VDMs (in.IsStructured == 0):

in.VDMHeaderData: 15-bit unstructured data of VDM Header

Examples

Decoding of DisplayPort Alt mode’s “Discover Mode” and “SVID specific commands” are provided alongside UsbSuite as an example.