24.4.5.8 Packet Error Check

The Packet Error Check feature enables the generation and validation of an 8-bit CRC on the data stream between the Controller and the Target for reliable communication. The transmitter always inserts an extra PEC byte at the end of the data stream, and the receiver validates it. The PEC is applicable for SDR CCC, IBI and SDR private transfers.

The PEC feature is enabled by programming the I3CxCNTRL[PEC] register bit after receiving a DEVCTRL CCC (treated as a vendor-specific Write transfer).

The PEC is a CRC-8 value calculated on all the message bytes except for START, REPEATED START, STOP conditions or T-bits, ACK and NACK, and Address header (7’h7E followed by W=0) bits. The polynomial for CRC-8 calculation is ‘X8 + X2 + X1 + 1’. The PEC byte is supported only for SDR Transfers and is not applicable for HDR Transfers. Figure 24-44 to Figure 24-48 show the inclusion of the PEC byte for different types of transfers.

Figure 24-44. Broadcast CCC with PEC Byte
Figure 24-45. Directed CCC Write with PEC Byte
Figure 24-46. Directed CCC Read with PEC Byte
Figure 24-47. Private Write Transfer with PEC Byte
Figure 24-48. Private Read Transfer with PEC Byte

When PEC is enabled:

Controller READ and IBI Transfers: The Target generates a PEC byte and appends it at the end of the transfers.

Controller Write Transfers: The Target validates the PEC byte received at the end of Controller Write Transfers. If the received PEC byte for the write transfer does not match the internally generated PEC byte based on the data received from the Controller, then the Target generates an I3CxINTSTA[TRANSERR] interrupt and indicates it as a ‘PEC Error’ in Response Status (I3CxRESPQUE) in the case of a vendor-specific CCC transfer. For the internally decoded CCCs and Private Write transfers, the controller is expected to issue a GETSTATUS CCC to recover from the PEC Error.

The PEC feature mandates both the Controller and the Target to pre-agree on the transfer length. During a PEC-enabled transfer, there always exists an extra one byte of data (PEC byte) between START/RESTART and the following RESTART/STOP. The Target enters the PEC state to append the PEC byte after the completion of the prescribed data length mentioned in the DATA_LENGTH field of the Transmit Command.