11.6.9 Error Capture Register

The CAN controller contains a dedicated Error Capture Register (ECR) that is used to perform additional CAN bus diagnostics. The ECR supports the following two different modes:

  • Free-running mode: In Free-running mode, the ECR displays the field and bit position within the current CAN frame.
  • Error-capture mode: In Error-capture mode, the ECR displays the bit position and type of the last captured CAN error.

In Error-capture mode, the ECR samples the field and bit position, when a CAN error is detected. In order to sample such an event, the ECR needs to be set by performing a write access to it. When the CAN is set to sample the event, the ECR only captures one error event. For successive error captures, the ECR needs to be set again. The following table provides the bits descriptions in the ECR register.

Table 11-26. ECR
Bit NumberNameReset ValueDescription
[31:17]Reserved0Reserved
[16:12]Field0This specifies the field of the ECR

0x00: Stopped
0x01: Synchronize
0x05: Interframe
0x06: Bus idle
0x07: Start of frame
0x08: Arbitration
0x09: Control
0x0A: Data
0x0B: CRC
0x0C: ACK
0x0D: End of frame
0x10: Error flag
0x11: Error echo
0x12: Error delimiter
0x18: Overload flag
0x19: Overload echo
0x1A: Overload delimiter
Others: N/A

[11:6]Bit_number0Bit number inside of field
5Rx_mode0When asserted, the CAN controller is the receiver.
4Tx_mode0When asserted, the CAN controller is the transmitter.
[3:1]Error_type0Specifies different error types

0: Arbitration loss
1: Bit error
2: Bit stuffing error
3: Acknowledge error
4: Form error
5: CRC error
Others: N/A

0Status0Status of the ECR register

0: The ECR register captured an error or is in free running mode.

1: The ECR register set to sample the event.