How to Use CXPI Controller in Traveo II Family
www.cypress.com Document Number: 002-24283 Rev. *B 9
The following are the error reporting interrupts:
▪
TX_BIT_ERROR: HW sets this field to '1', when a transmitted "cxpi_tx_out" value does not match with a received
"cxpi_rx_in" value.
▪
RX_CRC_ERROR: HW sets this field to '1', when received CRC does not match with the CRC computed from
header and response.
▪
RX_HEADER_PARITY_ERROR: HW sets this field to '1', when the received PID field or PType field has a parity
error.
▪
RX_DATA_LENGTH_ERROR: HW sets this field to '1, when the received message frame's data fields are not
equal to the value specified in DLC (for normal frame) or DLCEXT (for long frame).
If the received message frame's data fields are greater than the value specified in DLC, it may result in
RX_CRC_ERROR error before RX_DATA_LENGTH_ERROR.
▪
TX_DATA_LENGTH_ERROR: HW sets this field to '1, when the transmitted message frame's data fields are not
equal to the value specified in DLC (for normal frame) or DLCEXT (for long frame).
▪
RX_OVERFLOW_ERROR: HW sets this field to '1', when the RX data is overwritten by HW before the SW reads
from it.
▪
TX_OVERFLOW_ERROR: HW sets this field to '1', when the TX data is overwritten by SW before the HW reads
from it to transmit on to the CXPI bus.
▪
RX_UNDERFLOW_ERROR: HW sets this field to '1', when RX FIFO is empty and SW reads from it.
▪
TX_UNDERFLOW_ERROR: HW sets this field to '1', when TX FIFO is empty and HW reads from it
▪
RX_FRAME_ERROR: HW sets this field to '1', when the stop bit of a byte frame is incorrect.
▪
TX_FRAME_ERROR: HW sets this field to '1', when the stop bit of a byte frame is incorrect.
3.4 PID Arbitration
An arbitration is done to avoid collisions between different nodes during PID field transmission. The arbitration loss is
determined through a mismatch between the transmitted header and the received header.
CXPI controller provides an automated retransmission feature, that is, the command for requesting header transmission
CMD.TX_HEADER is not cleared after losing arbitration but retained as ‘1’ to trigger the retransmission. The register
field CTL2.RETRY predefines the maximum number of PID retransmissions, whereas STATUS.RETRIES_COUNT
shows the number of retries. When the number of retransmissions exceeds CTL2.RETRY, the flag
INTR.TX_HEADER_ARB_LOST is set.
The following scenario explains the operation of software and hardware at arbitration loss:
(1) Software sets {C.IFS, C.TXH, C.RXH, C.TXR, C.RXR} = {‘1’, ‘1’, ‘1’, ‘1’, ‘1’} to request both header and response
transmission or sets {C.IFS, C.TXH, C.RXH, C.TXR, C.RXR} = {‘1’, ‘1’, ‘1’, ‘0’, ‘1’} to request header transmission
and enable response reception.
(2) Hardware transmits header and it detects lost arbitration. Hardware stops transmitting and receives the “winning”
header. Hardware notifies software that it has received PID by setting INTR.RX_HEADER_PID_DONE = ‘1’. If the
number of header transmission does not exceed CTL2.RETRY, CMD.TX_HEADER is not cleared but kept as ‘1’,
else, hardware notifies software by setting INTR.TX_HEADER_ARB_LOST flag and clears the TX_HEADER and
TX_RESPONSE command (if TX_RESPONSE is set).
CMD.TX_RESPONSE=1 has higher priority over CMD.RX_RESPONSE=1 when arbitration is “won”. However, if
arbitration is “lost”, then CMD.RX_RESPONSE has higher priority over CMD.TX_RESPONSE.
Note: There is a possibility that hardware receives a header while waiting for IFS. In this case, CMD.TX_HEADER
is cleared by hardware and INTR.TX_HEADER_ARB_LOST is not set. Software can check these two bits to
distinguish with arbitration lost case.
(3) Software reads the received header and determines the next step.
If the received PID indicates that the node that lost arbitration should receive the response.
CMD.RX_RESPONSE is set in advance, so software does nothing but wait for INTR.RX_RESPONSE_DONE
flag. After that, if arbitration lost count does not exceed the maximum number of retries defined by CTL2.RETRY,
hardware will continue to transmit the previous header.
The transmission happens after fulfilling IFS only if software sets IFS_WAIT.