14.1.3 Data Packet Format
The Data Packet Format is used in either direction (Host to Client or Client to Host) to transfer opaque data. A command frame is used either to inform the Client that a data packet is about to be sent or to request the Client to send a data packet to the Host. In the case of Host to Client, the Client sends a response after the command and each subsequent data frame. The format of a data packet is shown below.
To support DMA hardware, a large data transfer may be fragmented into multiple smaller Data Packets. This is controlled by the value of DATA_PACKET_SIZE which is agreed between the Host and the Client in software and is a fixed value such as 256B, 512B, 1KB (default), 2KB, 4KB, or 8KB. If a transfer has a length of m, which exceeds DATA_PACKET_SIZE, the sender must split it into multiple DATA_PACKET_SIZE as shown in Equation 1:
(m – (n-1)* DATA_PACKET_SIZE) -------------------------- Equation 1
Where,
1.. n-1 = length of the DATA_PACKET_SIZE
n = frame length
This is illustrated below.
- If DMA count <=
DATA_PACKET_SIZE:
The data packet is “DATA_Header + DMA count +optional CRC16“, that is no padding.
- If DMA count > DATA_PACKET_SIZE:
- If remaining data <
DATA_PACKET_SIZE, the last data packet is:
“DATA_Header + remaining data + optional CRC16 “, that is no padding.
Field | Size | Description |
---|---|---|
Data Start | 4 bits |
4’b1111 (Default) (Can be changed to any value by programming DATA_START_CTRL register) |
Packet Order | 4 bits |
4’b0001: First packet in this transaction 4’b0010: Neither the first or the last packet in this transaction 4’b0011: Last packet in this transaction 4’b1111: Reserved |
Data bytes | DATA_PACKET_SIZE | User data |
CRC16 | 2 bytes |
Optional data integrity field comprising a 16-bit CRC value encoded in two bytes. The most significant 8 bits are transmitted first in the frame. The CRC16 value is computed on data bytes only based on the polynomial: G(x) = X^16 + X^12 + X^5 + 1, seed value: 0xFFFF |