首页 > 其他分享 >[智能网联汽车] CAN Log 文件 - ASC文件格式 [转]

[智能网联汽车] CAN Log 文件 - ASC文件格式 [转]

时间:2024-07-16 19:40:53浏览次数:12  
标签:Status status 00 Log chip 智能网 CANFD 文件格式 error

0 引言


因工作研究需要,担心精华内容丢失。故全文转载,转载自:图文详解CAN Log文件 - ASC文件格式 - CSDN


  • Vector提供了两种记录数据格式的格式规范:BLFASC

  • 在Vector提供的CAN_LOG_TRIGGER_ASC_Format.pdf文件中,规定了CANoe/CANalyzer ASC记录中CANLogTrigger event的格式。

1 CAN Log文件 -- ASC文件格式

1.1 Header

一个ASCII格式的日志文件以一个header开始。header包含关于日志文件的一般信息。

Format

date <WeekDay> <Month> <Date> <Fulltime> <Year>

base <hex |dec> timestamps <absolute |relative>

<”” |no> internal events logged

Example

date Wed Apr 16 09:21:13.159 am 2014

base hex timestamps absolute

internal events logged

base:表示记录的数值是hex十六进制或dec十进制的符号。

timestamps:表示时间戳absolute绝对写入测量的开始时间还是relative相对于前一个事件。

internal:events logged表示是否记录了内部事件。

1.2 版本编号

从CANalyzer/CANoe v7.0开始,版本号以注释的形式写在Header之后:

Format Since v7.0

// version <major>.<minor>.<patch>

Example

// version 8.2.1

<major>.<minor>表示CANalyzer/CANoe的版本号

<patch>表示CANalyzer/CANoe主版本中的修改版本(如服务包中的修改)。

1.3 经典CAN网络中的描述

该部分列出了CANoe/CANalyzer ASC记录中的所有CAN event。

1.3.1 经典CAN Standard标准帧的描述

Format since v8.0

<Time> <Channel> <ID> <Dir> d <DLC> <D0> <D1>...<D8> Length = <MessageDuration> BitCount = <MessageLength> ID = <IDnum> <MessageFlags>

Example

0.003040 1 123 Tx d 2 00 00 Length = 768000 BitCount = 67 ID = 291

ID:表示 CAN ID 的十六进制值;

Length:表示发送/接收该Frame/Message占据总线的时间,单位纳秒;

BitCount:表示发送/接收该Frame/Message由多少各Bit构成;

IDnum:表示CAN ID的十进制值。

举例:

date Mon Apr 10 02:24:54.471 pm 2023
base hex  timestamps absolute
internal events logged
// version 11.0.0
   0.036886 CAN 1 Status:chip status error active
   0.036886 CAN 2 Status:chip status error active
   0.101317 1  211             Tx   d 8 00 00 00 00 00 00 00 00  Length = 242015 BitCount = 124 ID = 529
   0.201267 1  211             Tx   d 8 00 00 00 00 00 00 00 00  Length = 242015 BitCount = 124 ID = 529
   0.301361 1  211             Tx   d 8 00 00 00 00 00 00 00 00  Length = 242015 BitCount = 124 ID = 529
   0.401419 1  211             Tx   d 8 00 00 00 00 00 00 00 00  Length = 242015 BitCount = 124 ID = 529

1.3.2 经典CAN Extended扩展帧的描述

Format since v8.0

<Time> <Channel> <ID>x <Dir> d <DLC> <D0> <D1>...<D8> Length = <MessageDuration> BitCount = <MessageLength> ID = <IDnum>x <MessageFlags>

Example

4.876870 1 54C5638x Tx d 8 00 00 00 00 00 00 00 00 Length = 1704000 BitCount = 145 ID = 88888888x

经典CAN标准帧的差异: ID和IDnum后带字符x。

举例:

date Mon Apr 10 02:28:37.439 pm 2023
base hex  timestamps absolute
internal events logged
// version 11.0.0
   0.021151 CAN 1 Status:chip status error active
   0.021151 CAN 2 Status:chip status error active
   0.101557 1  211x            Tx   d 8 00 00 00 00 00 00 00 00  Length = 290015 BitCount = 148 ID = 529x
   0.201483 1  211x            Tx   d 8 00 00 00 00 00 00 00 00  Length = 290015 BitCount = 148 ID = 529x
   0.301437 1  211x            Tx   d 8 00 00 00 00 00 00 00 00  Length = 290015 BitCount = 148 ID = 529x
   0.401151 1  211x            Tx   d 8 00 00 00 00 00 00 00 00  Length = 290015 BitCount = 148 ID = 529x

1.3.3 CAN Remote远程帧的描述

Format since v8.5

<Time> <Channel> <ID> <Dir> r <DLC> Length = <MessageDuration> BitCount = <MessageLength> ID = <IDnum>x

Example

2.5010 1 200 Tx r 8 Length = 1704000 BitCount = 145 ID = 88888888x

经典CAN**标准 **/ 扩展帧的差异:没有<D0> <D1>...<D8>

举例:

date Mon Apr 10 02:31:19.810 pm 2023
base hex  timestamps absolute
internal events logged
// version 11.0.0
   0.041478 CAN 1 Status:chip status error active
   0.041478 CAN 2 Status:chip status error active
   0.101079 1  211             Tx   r 8  Length = 88015 BitCount = 47 ID = 529
   0.101219 1  211x            Tx   r 8  Length = 134015 BitCount = 70 ID = 529x
   0.200845 1  211x            Tx   r 8  Length = 134015 BitCount = 70 ID = 529x
   0.200939 1  211             Tx   r 8  Length = 88015 BitCount = 47 ID = 529

1.3.4 CAN Error错误帧的描述

CAN Error Frame

Format since v7.5

Interfaces with CAN-Core:

<Time> <Channel> ErrorFrame Flags = <flags> CodeExt = <codeExt> Code = <code> ID = <ID> DLC = <DLC> Position = <Position> Length = <Length>

Flags

定义参数Code, CodeExt, ID, DLC, Position和Length的有效性的Bit field。Bit含义:

0:SJA 1000 ECC是有效的

1:矢量CAN核心错误代码有效

2:矢量CAN核心错误位置有效

3:矢量CAN核心帧长度(ns)有效

Code

Vector CAN-Core的Bit含义:

Bit 0-5:

0: Bit Error

1: Form Error

2: Stuff Error

3: Other Error

4: CRC Error

5: Ack-Del-Error

7: Ack-Error

Bit 6-7:

0: RX-NAK-Error

1: TX-NAK-Error

2: RX-Error

3: TX-Error

CodeExtExtended error flags

Bit 0-4:Segment (only SJA1000)

Bit 5:Direction, 1=RX

Bit 6-11:Error Code

0 Bit Error

1 Form Error

2 Stuff Error

3 Other Error

4 CRC Error

5 ACK- DEL Error

7 ACK Error

Bit 12-13:Extended Direction

0 RX NAK

1 TX NAK

2 RX

3 TX

Bit 14:1 =错误帧由应用程序发送

备注

1 只对带有Vector CAN-Core的接口有效(CANcardXLe, VN7600, VN16xx, VN89xx和其他)。

2 ID、DLC和data field的有效性取决于干扰的类型和位置。

例如: 如果信息在ID- field受到干扰,那么只有ID的第一个Bit可能有效,但DLC和data field无效。错误位置不是干扰的位置。

例如: 如果错误位置位于CRC-field,那么信息可能在任何其他field受到干扰,错误的CRC是该干扰的结果。

Examples

1.592186 2 ErrorFrame Flags = 0xe CodeExt = 0x20a2 Code = 0x82 ID = 0 DLC = 0 Position = 5 Length = 11300

CAN Error Event

Format

<Time> CAN <Channel> Status:<Error>

<Time> CAN <Channel> Status:<Error> - TxErr: <TxCount> RxErr: <RxCount>

TxCount

transmit error count寄存器的值

RxCount

receive error count寄存器的值

Example

0.0006 CAN 2 Status:chip status error active

2137.317027 CAN 2 Status:chip status error active - TxErr: 8 RxErr: 0

举例:

date Mon Apr 10 02:33:32.536 pm 2023
base hex  timestamps absolute
internal events logged
// version 11.0.0
   0.014704 CAN 1 Status:chip status error active
   0.014704 CAN 2 Status:chip status error active
   0.100641 CAN 1 Status:chip status error active  - TxErr: 8 RxErr: 0
   0.100642 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.100901 CAN 1 Status:chip status error active  - TxErr: 16 RxErr: 0
   0.100902 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.101161 CAN 1 Status:chip status error active  - TxErr: 24 RxErr: 0
   0.101162 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.101421 CAN 1 Status:chip status error active  - TxErr: 32 RxErr: 0
   0.101422 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.101681 CAN 1 Status:chip status error active  - TxErr: 40 RxErr: 0
   0.101682 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.101941 CAN 1 Status:chip status error active  - TxErr: 48 RxErr: 0
   0.101942 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.102201 CAN 1 Status:chip status error active  - TxErr: 56 RxErr: 0
   0.102202 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.102461 CAN 1 Status:chip status error active  - TxErr: 64 RxErr: 0
   0.102462 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.102721 CAN 1 Status:chip status error active  - TxErr: 72 RxErr: 0
   0.102722 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.102981 CAN 1 Status:chip status error active  - TxErr: 80 RxErr: 0
   0.102982 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.103241 CAN 1 Status:chip status error active  - TxErr: 88 RxErr: 0
   0.103242 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.103501 CAN 1 Status:chip status warning level - TxErr: 96 RxErr: 0
   0.103502 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.103761 CAN 1 Status:chip status warning level - TxErr: 104 RxErr: 0
   0.103762 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.104021 CAN 1 Status:chip status warning level - TxErr: 112 RxErr: 0
   0.104022 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.104281 CAN 1 Status:chip status warning level - TxErr: 120 RxErr: 0
   0.104282 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   0.104541 CAN 1 Status:chip status error passive - TxErr: 128 RxErr: 0
   0.104542 1  ErrorFrame	Flags = 0xfffe	CodeExt = 0x31d9	Code = 0xc7	ID = 0x211	DLC = 8	Position = 99	Length = 226015	Data = 0  0  0  0  0  0  0  0
   1.014705 CAN 1 Status:chip status error passive - TxErr: 128 RxErr: 0
   1.014705 CAN 2 Status:chip status error active
   2.014705 CAN 1 Status:chip status error passive - TxErr: 128 RxErr: 0
   2.014705 CAN 2 Status:chip status error active
   3.014705 CAN 1 Status:chip status error passive - TxErr: 128 RxErr: 0
   3.014705 CAN 2 Status:chip status error active
   4.014706 CAN 1 Status:chip status error passive - TxErr: 128 RxErr: 0
   4.014706 CAN 2 Status:chip status error active
   5.014706 CAN 1 Status:chip status error passive - TxErr: 128 RxErr: 0
   5.014706 CAN 2 Status:chip status error active

1.4 CANFD网络中的描述

该部分列出了CANoe/CANalyzer ASC记录中的所有经典CAN event和CAN FD channel上的CAN FD event。

1.4.1 经典CAN Standard标准帧的描述

Format since v8.1

<Time> CANFD <Channel> <Dir> <ID> <SymbolicName> <BRS> <ESI> <DLC> <DataLength> <D1> … <D8> <MessageDuration> <MessageLength> <Flags> <CRC> <BitTimingConfArb> <BitTimingConfData> <BitTimingConfExtArb> <BitTimingConfExtData>

Example

0.105364 CANFD 1 Tx 1 0 0 1 1 01 112000 59 200040 39b5 46500250 460a0250 20011736 20010205

ID:表示CANID的十六进制值;

BRS:表示CANFD Frame的BRS位;

ESI:表示CANFD Frame的DEI位;

DLC:表示CANFD Frame的控制段DTC;

DataLength:message的有效长度,以字节为单位。

MessageDuration:表示发送/接收该Frame/Message占据总线的时间,单位纳秒;

MessageLength:表示发送/接收该Frame/Message由多少各Bit构成;

Flags:Bit含义

  • Bit 0: Reserved, must be 0
  • Bit 1: Reserved, for internal use
  • Bit 2: 1=NERR (1=single wire on low speed CAN)
  • Bit 3: 1=High voltage wake up
  • Bit 4: 1=Remote frame (only CAN)
  • Bit 5: Reserved, must be 0
  • Bit 6: 1= Tx Acknowledge
  • Bit 7: 1= Tx Request
  • Bit 8: Reserved, must be 0
  • Bit 9: SRR (CAN FD)
  • Bit 10: R0
  • Bit 11: R1
  • Bit 12: FDF bit 0: CAN frame 1: CAN FD frame
  • Bit 13: BRS bit (CAN FD)
  • Bit 14: ESI bit (CAN FD)
  • Bit 15: Reserved, must be 0
  • Bit 16: Reserved, must be 0
  • Bit 17: 1= Frame is part ofa burst
  • Bit 18: Single shot mode: Frame could not be transmitted
  • Bit 19: Single shot mode: If bit 18 set to 1, then this bit reports the reason.0 = arbitration lost 1=frame disturbed
  • Bit 20: Reserved, for internal use
  • Bit 21: Reserved, for internal use
  • Bit 22 -31: Reserved, must be 0

CRC:message的校验和;

  • Bit 0 – 20: CRC
  • Bit 21 – 26: Reserved for internal use
  • Bit 27 – 29: Stuff count field
  • Bit 30: Stuff count field parity
  • Bit 31: ISO format. 如果设置为1,那么该报文是CAN FD ISO格式,并且stuff count是有效的.

BitTimingConfArbBitTimingConfData:指的是用于仲裁和数据段的bit timing参数。这些段可以解释为32位长的bit field。

  • Bit 0-7: Quartz Frequency in kHz
  • Bit 8-15: Prescaler
  • Bit 16-23: BTL Cycles
  • Bit 24-31: Sampling Point

BitTimingConfExtArbBitTimingConfExtData:bit timing存储在该段中。如果bit timing不能以旧格式存储,那么将被设置为0。

  • Bit 0 – 7: TSEG1-1
  • Bit 8 – 15: TSEG2-1
  • Bit 16 – 27: Prescaler
  • Bit 28 – 31: Quartz Frequency (enumeration). Supported values: 0: 16 MHz, 1: 32 MHz, 2: 80 MHz

举例:

date Mon Apr 10 02:38:41.859 pm 2023
base hex  timestamps absolute
internal events logged
// version 11.0.0
   0.038849 CAN 1 Status:chip status error active
   0.038849 CAN 2 Status:chip status error active
   0.100980 CANFD   1 Tx        211                                   0 0 8  8 00 00 00 00 00 00 00 00   242015  124   200040     2a8f 50a00150 46280150 20001f7e 20000b1a
   0.200978 CANFD   1 Tx        211                                   0 0 8  8 00 00 00 00 00 00 00 00   242015  124   200040     2a8f 50a00150 46280150 20001f7e 20000b1a
   0.301134 CANFD   1 Tx        211                                   0 0 8  8 00 00 00 00 00 00 00 00   242015  124   200040     2a8f 50a00150 46280150 20001f7e 20000b1a
   0.400976 CANFD   1 Tx        211                                   0 0 8  8 00 00 00 00 00 00 00 00   242015  124   200040     2a8f 50a00150 46280150 20001f7e 20000b1a

1.4.2 经典CAN Extended扩展帧的描述

Format since v8.1

<Time> CANFD <Channel> <Dir> <ID> <SymbolicName> <BRS> <ESI> <DLC> <DataLength> <D1> … <D8> <MessageDuration> <MessageLength> <Flags> <CRC> <BitTimingConfArb> <BitTimingConfData> <BitTimingConfData> <BitTimingConfExtArb> <BitTimingConfExtData>

Example

0.100995 CANFD 2 Rx 10001x 0 0 1 1 01 156000 82 200000 149a 46500250 460a0250 20011736 20010205

各字段的解释详见“1.4.1 经典CAN Standard标准帧的描述”。

举例:

date Mon Apr 10 02:42:26.030 pm 2023
base hex  timestamps absolute
internal events logged
// version 11.0.0
   0.035889 CAN 1 Status:chip status error active
   0.035889 CAN 2 Status:chip status error active
   0.100829 CANFD   1 Tx        211x                                  0 0 8  8 00 00 00 00 00 00 00 00   290015  148   200040      37b 50a00150 46280150 20001f7e 20000b1a
   0.200893 CANFD   1 Tx        211x                                  0 0 8  8 00 00 00 00 00 00 00 00   290015  148   200040      37b 50a00150 46280150 20001f7e 20000b1a
   0.300831 CANFD   1 Tx        211x                                  0 0 8  8 00 00 00 00 00 00 00 00   290015  148   200040      37b 50a00150 46280150 20001f7e 20000b1a
   0.400909 CANFD   1 Tx        211x                                  0 0 8  8 00 00 00 00 00 00 00 00   290015  148   200040      37b 50a00150 46280150 20001f7e 20000b1a

1.4.3 CANFD Standard标准帧的描述

Format since v8.1

<Time> CANFD <Channel> <Dir> <ID> <SymbolicName> <BRS> <ESI> <DLC> <DataLength> <D1> … <D64> <MessageDuration> <MessageLength> <Flags> <CRC> <BitTimingConfArb> <BitTimingConfData> <BitTimingConfExtArb> <BitTimingConfExtData>

Example

0.151061 CANFD 1 Tx 2 0 0 2 2 02 03 150000 78 301040 10151 46500250 460a0250 20011736 20010205

各字段的解释详见“1.4.1 经典CAN Standard标准帧的描述”。

举例:

date Mon Apr 10 02:48:53.277 pm 2023
base hex  timestamps absolute
internal events logged
// version 11.0.0
   0.046804 CAN 1 Status:chip status error active
   0.046804 CAN 2 Status:chip status error active
   0.100836 CANFD   1 Tx        211                                   1 0 8  8 00 00 00 00 00 00 00 00   107015  139   303040 f801828f 50a00150 46280150 20001f7e 20000b1a
   0.200741 CANFD   1 Tx        211                                   1 0 8  8 00 00 00 00 00 00 00 00   107015  139   303040 f801828f 50a00150 46280150 20001f7e 20000b1a
   0.300714 CANFD   1 Tx        211                                   1 0 8  8 00 00 00 00 00 00 00 00   107015  139   303040 f801828f 50a00150 46280150 20001f7e 20000b1a
   0.400735 CANFD   1 Tx        211                                   1 0 8  8 00 00 00 00 00 00 00 00   107015  139   303040 f801828f 50a00150 46280150 20001f7e 20000b1a

1.4.4 CANFD Extended扩展帧的描述

Format since v8.1

<Time> CANFD <Channel> <Dir> <ID> <SymbolicName> <BRS> <ESI> <DLC> <DataLength> <D1> … <D64> <MessageDuration> <MessageLength> <Flags> <CRC> <BitTimingConfArb> <BitTimingConfData> <BitTimingConfExtArb> <BitTimingConfExtData>

Example

0.105537 CANFD 2 Rx 10001x 0 0 1 1 01 174015 91 301000 bfd9 46500250 460a0250 20011736 20010205

各字段的解释详见“1.4.1 经典CAN Standard标准帧的描述”。

举例:

date Mon Apr 10 02:49:57.722 pm 2023
base hex  timestamps absolute
internal events logged
// version 11.0.0
   0.018020 CAN 1 Status:chip status error active
   0.018020 CAN 2 Status:chip status error active
   0.100571 CANFD   1 Tx        211x                                  1 0 8  8 00 00 00 00 00 00 00 00   151015  161   303040 80016b85 50a00150 46280150 20001f7e 20000b1a
   0.200634 CANFD   1 Tx        211x                                  1 0 8  8 00 00 00 00 00 00 00 00   151015  161   303040 80016b85 50a00150 46280150 20001f7e 20000b1a
   0.300783 CANFD   1 Tx        211x                                  1 0 8  8 00 00 00 00 00 00 00 00   151015  161   303040 80016b85 50a00150 46280150 20001f7e 20000b1a
   0.400604 CANFD   1 Tx        211x                                  1 0 8  8 00 00 00 00 00 00 00 00   151015  161   303040 80016b85 50a00150 46280150 20001f7e 20000b1a

1.4.5 CAN Remote远程帧的描述

Format

<Time> CANFD <Channel> <Dir> <ID> <SymbolicName> <BRS> <ESI> <DLC> <DataLength> <MessageDuration> <MessageLength> <Flags> <CRC> <BitTimingConfArb> <BitTimingConfData> <BitTimingConfData> <BitTimingConfExtArb> <BitTimingConfExtData>

Example

0.300981 CANFD 1 Tx 50005x 0 0 5 0 140000 73 200050 7a60 46500250 460a0250 20011736 20010205

各字段的解释详见“1.4.1 经典CAN Standard标准帧的描述”。

举例:

date Mon Apr 10 02:52:19.883 pm 2023
base hex  timestamps absolute
internal events logged
// version 11.0.0
   0.026889 CAN 1 Status:chip status error active
   0.026889 CAN 2 Status:chip status error active
   0.101047 CANFD   1 Tx        211                                   0 0 8  0    88015   47   200050     2c3a 50a00150 46280150 20001f7e 20000b1a
   0.101187 CANFD   1 Tx        211x                                  0 0 8  0   134015   70   220050     6a2a 50a00150 46280150 20001f7e 20000b1a
   0.201045 CANFD   1 Tx        211x                                  0 0 8  0   134015   70   200050     6a2a 50a00150 46280150 20001f7e 20000b1a
   0.201139 CANFD   1 Tx        211                                   0 0 8  0    88015   47   220050     2c3a 50a00150 46280150 20001f7e 20000b1a

1.4.6 CAN Error错误帧的描述

CAN FD Error Frame

Format

<Time> CANFD <Channel> <Dir> ErrorFrame <ErrorText> <flags> <code> <codeExt> <Phase> <Position> <ID> <BRS> <ESI> <DLC> <DataLength> <D1> … <D64> <MessageDuration> <extFlags> <CRC> <BitTimingConfArb> <BitTimingConfData> <BitTimingConfExtArb> <BitTimingConfExtData> <extFlags>:

extFlags(Extended error flags):

Bit 0:0: FDF is 0 (CAN Error Frame);1: FDF is 1 (CAN FD Error Frame)

Bit 1:0: BRS is 0;1: BRS is 1

Bit 2:0: ESI is 0;1: ESI is 1

Bit 3:0: Error in Arbitration Phase;1: Error in Data Phase

Bit 4:0: Error is on a CAN channel;1: Error is on a CAN FD channel

all others:reserved, must be set to 0

Example:

Classic

CAN

0.051203 CANFD 1 Rx ErrorFrame Stuff Error fffe 82 20a2 Arb.5 0 0 0 0 0 11984 10 0 46500250 460a0250 20011736 20010205

Example:

CAN FD

10.006898 CANFD 1 Tx ErrorFrame Not Acknowledge error, dominant error flag fffe c7 31ca Arb.556 44 0 0 f 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1331984 11 0 46500250 460a0250 20011736 20010205

各字段的解释详见“1.4.1 经典CAN Standard标准帧的描述”。

举例:

date Mon Apr 10 02:55:04.694 pm 2023
base hex  timestamps absolute
internal events logged
// version 11.0.0
   0.036456 CAN 1 Status:chip status error active
   0.036456 CAN 2 Status:chip status error active
   0.100770 CAN 1 Status:chip status error active  - TxErr: 8 RxErr: 0
   0.100770 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.100897 CAN 1 Status:chip status error active  - TxErr: 16 RxErr: 0
   0.100897 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.101024 CAN 1 Status:chip status error active  - TxErr: 24 RxErr: 0
   0.101024 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.101151 CAN 1 Status:chip status error active  - TxErr: 32 RxErr: 0
   0.101151 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.101278 CAN 1 Status:chip status error active  - TxErr: 40 RxErr: 0
   0.101278 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.101405 CAN 1 Status:chip status error active  - TxErr: 48 RxErr: 0
   0.101405 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.101532 CAN 1 Status:chip status error active  - TxErr: 56 RxErr: 0
   0.101532 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.101659 CAN 1 Status:chip status error active  - TxErr: 64 RxErr: 0
   0.101659 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.101786 CAN 1 Status:chip status error active  - TxErr: 72 RxErr: 0
   0.101786 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.101913 CAN 1 Status:chip status error active  - TxErr: 80 RxErr: 0
   0.101913 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.102040 CAN 1 Status:chip status error active  - TxErr: 88 RxErr: 0
   0.102040 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.102167 CAN 1 Status:chip status warning level - TxErr: 96 RxErr: 0
   0.102167 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.102294 CAN 1 Status:chip status warning level - TxErr: 104 RxErr: 0
   0.102294 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.102421 CAN 1 Status:chip status warning level - TxErr: 112 RxErr: 0
   0.102421 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.102548 CAN 1 Status:chip status warning level - TxErr: 120 RxErr: 0
   0.102548 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   0.102675 CAN 1 Status:chip status error passive - TxErr: 128 RxErr: 0
   0.102675 CANFD   1 Tx   ErrorFrame Not Acknowledge error, dominant error flag       fffe c7     31da Arb. 109      211  1 0 8  8 00 00 00 00 00 00 00 00    93015       13 f8000000 50a00150 46280150 20001f7e 20000b1a
   1.036456 CAN 1 Status:chip status error passive - TxErr: 128 RxErr: 0
   1.036456 CAN 2 Status:chip status error active
   2.036457 CAN 1 Status:chip status error passive - TxErr: 128 RxErr: 0
   2.036457 CAN 2 Status:chip status error active
   3.036457 CAN 1 Status:chip status error passive - TxErr: 128 RxErr: 0
   3.036457 CAN 2 Status:chip status error active

1.5 换行

换行是用CR+LF表示的编码。

2 小结:如何分辨CAN Log文件中的“标准帧”和“扩展帧”

2.1 经典CAN网络中的标准帧和扩展帧

经典CAN网络中的标准帧和扩展帧的差异:

  • 经典CAN标准帧的ID和IDnum字段后不带字符x;
  • 经典CAN扩展帧的ID和IDnum字段后带字符x。

举例:

date Mon Apr 10 04:24:18.233 pm 2023
base hex  timestamps absolute
internal events logged
// version 11.0.0
   0.028996 CAN 1 Status:chip status error active
   0.028996 CAN 2 Status:chip status error active
   0.101449 1  211             Tx   d 8 00 00 00 00 00 00 00 00  Length = 242015 BitCount = 124 ID = 529
   0.101745 1  211x            Tx   d 8 00 00 00 00 00 00 00 00  Length = 290015 BitCount = 148 ID = 529x
   0.201469 1  211x            Tx   d 8 00 00 00 00 00 00 00 00  Length = 290015 BitCount = 148 ID = 529x
   0.201717 1  211             Tx   d 8 00 00 00 00 00 00 00 00  Length = 242015 BitCount = 124 ID = 529

2.2 CANFD网络中的标准帧和扩展帧

CANFD网络中,可能同时存在:经典CAN标准帧经典CAN扩展帧CANFD标准帧CANFD**扩展帧。

  • 经典CAN/CANFD标准帧的ID字段后不带字符x;
  • 经典CAN/CANFD扩展帧的ID字段后带字符x;
  • Flags字段的的Bit 12: FDF bit,其0表示经典CAN frame;1表示CAN FD frame

举例:

date Mon Apr 10 03:28:33.279 pm 2023
base hex  timestamps absolute
internal events logged
// version 11.0.0
   0.008330 CAN 1 Status:chip status error active
   0.008330 CAN 2 Status:chip status error active
   0.100736 CANFD   1 Tx        211                                   1 0 8  8 00 00 00 00 00 00 00 00   107015  139   303040 f801828f 50a00150 46280150 20001f7e 20000b1a
   0.100893 CANFD   1 Tx        211x                                  1 0 8  8 00 00 00 00 00 00 00 00   151015  161   323040 80016b85 50a00150 46280150 20001f7e 20000b1a
   0.101141 CANFD   1 Tx        211                                   0 0 8  8 00 00 00 00 00 00 00 00   242015  124   220040     2a8f 50a00150 46280150 20001f7e 20000b1a
   0.101437 CANFD   1 Tx        211x                                  0 0 8  8 00 00 00 00 00 00 00 00   290015  148   220040      37b 50a00150 46280150 20001f7e 20000b1a

X 参考文献

标签:Status,status,00,Log,chip,智能网,CANFD,文件格式,error
From: https://www.cnblogs.com/johnnyzen/p/18305983

相关文章

  • Linux系统搭建轻量级个人博客VanBlog并一键发布公网远程访问
    文章目录前言1.Linux本地部署2.VanBlog简单使用3.安装内网穿透4.创建公网地址5.创建固定公网地址前言今天和大家分享如何在LinuxUbuntu系统搭建一款轻量级个人博客VanBlog,并结合cpolar内网穿透软件生成公网地址,轻松实现随时随地远程访问本地部署的站点。无需......
  • LogRotate 切割 Nginx 日志
     发布于 2023-12-0410:20:327140举报文章被收录于专栏:码农UP2U一直以来做日志切割都是使用shell+crontab来搞,shell脚本可以在网上找到各种版本的,改改就用了,懒省事。这样的做法很传统,却忽略了系统的给我们提供的优秀的工具——logrotate。......
  • blog 收藏
    数学质数表高斯消元数论、数学—常见定理、结论、性质汇总一文搞懂裴蜀、扩欧、乘法逆元、中国剩余定理隔板法题型整理斐波那契数列的性质整理欧拉函数多项式计数杂谈杂项在线O(1)逆元数据结构链剖分fhqLCT总结概念LCT总结应用线段树字符串SAM随机化退火图......
  • log4cpp的安装及使用
    目录前言安装使用示例代码配置文件编译链接输出前言本文的操作均在ubuntu20.04下进行安装本文仅介绍从源码编译安装log4cpp的过程。①在开始编译前,首先要确保系统中安装了g++,make,autoconf和libtool②下载log4cpp源码下载log4cpp的特定版本并解压,以1.1.3为例:wgethttp://so......
  • 博客园被百度搜索降权一事的来龙去脉分析 —— 百度减少收录cnblogs博文
    相关事情:蜘蛛的依旧疯狂与园子的新畅想:尝试放出被屏蔽的百度蜘蛛网段再次尝试放出被屏蔽的百度蜘蛛网段面对百度的无期徒刑,幸好还有微软的必应百度搜索引擎是国内搜索引擎的一哥,平时素来霸道,到时也是对谁都霸道的那种。cnblogs虽然是技术博客中的顶流,但是由于没有很好的......
  • mysql备份还原——binlog查看工具之show binlog的使用
    (4.8)mysql备份还原——binlog查看工具之mysqlbinlog及showbinlog的使用关键词:showbinlog,mysqlbinlog查看,二进制文件查看,binlog查看工具,binlog查看方法 0、使用showmasterstatus; 使用它可以直接查看binlog日志信息;总结:指定文件:showbinlogeventsin'b......
  • logging模块切割日志时:另一个程序正在使用此文件,进程无法访问。
    使用:  concurrent-log-handlerGITHUB:  https://github.com/Preston-Landers/concurrent-log-handler安装: pipinstallconcurrent-log-handlerimportloggingfromconcurrent_log_handlerimportConcurrentRotatingFileHandlerlogger=logging.getLogger(__name_......
  • Camstar TraceLog
      用户:AAAA   ......
  • springboot使用logback日志出现LOG_PATH_IS_UNDEFINED文件夹的问题
    logback现在基本上已经成为springboot日志框架中使用最多的日志实现,在使用中与各中间件集成的一些注意事项记录如下 一SpringBoot中logback读取application.properties(application.yml)中的属性其中使用的时候发现了一个问题,就是如果使用的lobback配置文件的名称是logb......
  • 基于EF Core存储的Serilog持久化服务
    前言Serilog是.NET上的一个原生结构化高性能日志库,这个库能实现一些比内置库更高度的定制。日志持久化是其中一个非常重要的功能,生产环境通常很难挂接调试器或者某些bug的触发条件很奇怪。为了在脱离调试环境的情况下尽可能保留更多线索来辅助解决生产问题,持久化的日志就显得很......