38.7.13 Protocol Status
Note:
- When a frame in CAN FD format has reached the data phase with BRS flag set, the next CAN event (error or valid frame) will be shown in PSR.DLEC bit field (PSR<10:8>) instead of LEC. An error in a fixed stuff bit of a CAN FD CRC sequence will be shown as a Form Error, not Stuff Error.
- The 'bus off' recovery sequence (see CAN Specification Rev. 2.0 or ISO 11898-1) cannot be shortened by setting or resetting CCCR.INIT bit (CCCR <0>). If the device goes 'bus off', it will set CCCR.INIT bit (CCCR <0>) of its own accord, stopping all bus activities. Once CCCR.INIT bit (CCCR <0>) has been cleared by the CPU, the device will wait for 129 occurrences of Bus Idle (129 * 11 consecutive recessive bits) before resuming normal operation. At the end of the'bus off' recovery sequence, the Error Management Counters will be reset. During the wait time after the resetting of CCCR.INIT bit (CCCR <0>), each time a sequence of 11 recessive bits is monitored, a Bit0 Error code is written to PSR.LEC bit field (PSR <2:0>). This enables the CPU to readily check the status of CAN bus (whether bus is stuck at dominant level or continuously disturbed). ECR.REC bit-field (ECR<14:8>) is used to count these sequences.
Symbol | Description | Symbol | Description | Symbol | Description |
---|---|---|---|---|---|
R | Readable bit | HC | Cleared by Hardware | (Grey cell) | Unimplemented |
W | Writable bit | HS | Set by Hardware | X | Bit is unknown at Reset |
K | Write to clear | S | Software settable bit | — | — |
Name: | PSR |
Offset: | 0x44 |
Reset: | 0x00000707 |
Property: | Read-only |
Bit | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | |
Access | |||||||||
Reset |
Bit | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | |
TDCV[6:0] | |||||||||
Access | R | R | R | R | R | R | R | ||
Reset | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Bit | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | |
PXE | RFDF | RBRS | RESI | DLEC[2:0] | |||||
Access | R | R | R | R | R | R | R | ||
Reset | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
BO | EW | EP | ACT[1:0] | LEC[2:0] | |||||
Access | R | R | R | R | R | R | R | R | |
Reset | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
Bits 22:16 – TDCV[6:0] Transmitter Delay Compensation Value
Value | Description |
---|---|
0x00 - 0x7F | Position of the secondary sample point, defined by the sum of the measured delay from CANx_TX to CANx_RX and TDCR.TDCO bit-field (TDCR <14:8>). The SSP position is, in the data phase, the number of mtq between the start of the transmitted bit and the secondary sample point. Valid values are 0 to 127 mtq. |
Bit 14 – PXE Protocol Exception Event
Value | Description |
---|---|
0 | No protocol exception event occurred since last read access. |
1 | Protocol exception event occurred. |
Bit 13 – RFDF Received a CAN FD Message
Value | Description |
---|---|
0 | Since this bit was reset by the CPU, no CAN FD message has been received. |
1 | Message in CAN FD format with FDF flag set has been received. This bit is set independent of acceptance filtering. |
Bit 12 – RBRS BRS flag of last received CAN FD Message
Value | Description |
---|---|
0 | Last received CAN FD message did not have its BRS flag set. |
1 | Last received CAN FD message had its BRS flag set. This bit is set together with RFDF, independent of acceptance filtering. |
Bit 11 – RESI ESI flag of last received CAN FD Message
Value | Description |
---|---|
0 | Last received CAN FD message did not have its ESI flag set. |
1 | Last received CAN FD message had its ESI flag set. |
Bits 10:8 – DLEC[2:0] Data Last Error Code
Bit 7 – BO 'bus off' Status
Value | Description |
---|---|
0 | The CAN is not 'bus off' state. |
1 | The CAN is in 'bus off' state. |
Bit 6 – EW Error Warning Status
Value | Description |
---|---|
0 | Both error counters are below the Error Warning limit of 96. |
1 | At least one of the error counter has reached the Error Warning limit of 96. |
Bit 5 – EP Error Passive
Value | Description |
---|---|
0 | The CAN is in the ‘error active’ state. It normally takes part in bus communication and sends an active error flag when an error has been detected. |
1 | The CAN is in the 'error passive' state. |
Bits 4:3 – ACT[1:0] Activity
Value | Name | Description |
---|---|---|
0x0 | SYNC | Node is synchronizing on CAN communication. |
0x1 | IDLE | Node is neither receiver nor transmitter. |
0x2 | RX | Node is operating as receiver. |
0x3 | TX | Node is operating as transmitter. |
Bits 2:0 – LEC[2:0] Last Error Code
The LEC indicates the type of the last error to occur on the CAN bus. This field will be cleared to ‘0’ when a message has been transferred (reception or transmission) without error.
This field is set on read access.
Value | Name | Description |
---|---|---|
0x0 | NONE | No Error: No error occurred since LEC has been reset by successful reception or transmission. |
0x1 | STUFF | Stuff Error: More than 5 equal bits in a sequence have occurred in a part of a received message where this is not allowed. |
0x2 | FORM | Form Error: A fixed format part of a received frame has the wrong format. |
0x3 | ACK | Ack Error: The message transmitted by the CAN was not acknowledged by another node. |
0x4 | BIT1 | Bit1 Error: During the transmission of a message (with the exception of the arbitration field), the device wanted to send a recessive level (bit of logical value ‘1’), but the monitored bus was dominant. |
0x5 | BIT0 | Bit0 Error: During the transmission of a message (or acknowledge bit, or active error flag, or overload flag), the device wanted to send a dominant level (data or identifier bit logical value ‘0’), but the monitored bus value was recessive. During 'bus off' recovery this status is set each time a sequence of 11 recessive bits have been monitored. This enables the CPU to monitor the proceeding of the 'bus off' recovery sequence (indicating the bus is not stuck at dominant or continuously disturbed). |
0x6 | CRC | CRC Error: The CRC checksum of a received message was incorrect. The CRC of an incoming message does not match with the CRC calculated from the received data. |
0x7 | NC | No Change: Any read access to the Protocol Status Register re-initializes the LEC to ‘7’. When the LEC shows the value ‘7’, no CAN bus event was detected since the last CPU read access to the Protocol Status Register. |