当前位置:网站首页>Hongke share | bring you a comprehensive understanding of "can bus error" (I) -- can bus error and error frame
Hongke share | bring you a comprehensive understanding of "can bus error" (I) -- can bus error and error frame
2022-07-29 06:41:00 【Hongke Industrial Communication Division】
In this series of articles , We will give you a detailed introduction to CAN Knowledge about bus errors , Include CAN The basic concept of bus error 、CAN Type of bus error 、CAN Error frame and CAN Node error status , And generate and record through the actual application test CAN error .
1. What is? CAN Bus error ?
Controller area network (Controller Area Network, CAN) It is an important standard for today's automotive and industrial automation systems . Reliability is CAN One of the core advantages of bus protocol , This makes it an ideal choice for safety critical applications . But here's the thing , Error handling right CAN Is critical to the robustness of .
CAN Bus errors can occur for many reasons , Such as cable failure 、 noise 、 Mismatched terminal resistance 、CAN Node failure, etc. . distinguish 、 Classify and solve such CAN The mistake is to ensure that the whole CAN The key to the persistent performance of the system . Error handling can identify and reject wrong information , Enable the sender to retransmit information . Besides , This process helps to identify and disconnect the continuous transmission of error messages CAN node .
Error handling is CAN Standards and each CAN The built-in part of the controller . let me put it another way , Every CAN Nodes deal with fault identification and limitation in the same way . Below we make a simple illustrative example :
Examples of specific steps :
- CAN node 1 To transmit a message to CAN Bus , And read every bit it sends In doing so , It finds that the bit that sends dominance is read as recessive
- This is a “ Bit error ”, node 1 An active error flag is raised to notify other nodes actually , This means that nodes 1 take 6 A sequence of dominant bits is sent to the bus
- In turn, ,6 Dominant bits are considered by other nodes “ Bit fill error ” As a response , node 2 and 3 At the same time, an active error flag is raised The sequence of error flags caused by this constitutes “CAN Wrong frame ” Part of
- CAN node 1, transmitter , Put it “ Send error counter ”(TEC) increase 8 CAN node 2 and 3 Put it “ Receive error counter ”(REC) increase 1
- CAN node 1 Automatically retransmit messages result , node 1 Put it TEC Reduce 1, node 2 and 3 Put it REC Reduce 1
2. CAN Wrong frame
In the example above ,CAN node “ Raise the active error flag ”, Thus create “ Wrong frame ” In response to detected CAN error .
To understand how it works , Let's first look at one “ normal ” Of CAN frame ( There is no mistake ):
Please note that , We highlighted CAN In the frame “ Bitfill ”. Bit padding is CAN A subtle but important part of the standard . Basically it stipulates , whenever CAN The node sends the same logic level ( Explicit or implicit ) Five bit hour , It must send a bit of the opposite level . receive CAN The node will automatically delete this extra bit . This process helps ensure continuous synchronization of the network .
According to the previous example , When CAN node 1 stay CAN When an error is detected during message transmission , It will immediately transmit the same logic level 6 Bit sequence - Also known as the trigger activity error flag .
As mentioned earlier , Such a sequence violates the bit filling rule —— Also known as “ Bit fill error ”. Besides , This error affects all on the network CAN Nodes are visible ( And the... That caused this error flag to appear “ Bit error ” contrary ). therefore , The increase in error flags can be seen as a “ Overall ” The way of error detection , Be sure to inform everyone CAN node .
Please note that , other CAN The node treats the active error flag as a bit fill error . As a response , They also cause an active error flag .
As we will explain later , It is important to distinguish between error flags . especially , The first error flag ( come from “ Find out ” node ) Usually called “ The main ” Active error flag , And later “ reaction ” The error flag of the node is called “ secondary ” Active error flag (s).
3. CAN Example of error frame
Example 1:6 Bit error flag
In this example , all CAN Nodes are found at the same time CAN There is an error in the message and an error flag is sent at the same time .
The result is that all error markers overlap and the total sequence of dominant bits lasts 6 position . under these circumstances , all CAN Nodes see themselves as “ Find out ”CAN node .
At the same time, it is found that this type of error frame is not very common in practice . however , It may be due to a format error ( for example CRC Delimiters are explicit rather than implicit ) or CAN The transmitter is writing CRC Occurs when a bit error is encountered during the field .
Example 2:12 Bit error flag
In this example ,CAN node 1 Transmit dominant bit , But read it as implicit - This means that it finds a bit error . It sends immediately 6 A sequence of dominant bits . Other nodes are only reading the complete 6 Bit filling error is found after bit , Then they raise the error flag at the same time , So as to produce subsequent 6 Dominant bit sequences - That is total 12 individual .
Example 3:9 Bit error flag
In this example , When CAN node 1 Bit error found and start sending 6 Dominant position , It has been sent 3 Dominant bit sequences . Once the main activity passes half the error flag , node 2 and 3 Identification bit filling error ( because 3 An initial dominant position is followed by another 3 A dominant bit ) And start raising their error flags . The result is that the dominant bit sequence from the error flag becomes 9 Bit length .

The above logic that causes the error flag is reflected in what we call “ Activities ”CAN In error frame . Pay special attention to how the secondary error flags caused by each node overlap each other —— And how the primary and secondary signs may overlap . The result is that the sequence of primary bits from which the error flag is raised may be 6 To 12 Bit length .
The sequence always starts with 8 A recessive bit sequence terminates , Marks the end of the error frame . actually , The active error frame may be in error CAN Different positions in the frame “ Start ”, It depends on when errors are found . However , The result will be the same : All nodes discard the wrong CAN frame , The sending node can try to resend the failed message .
4. Passive error flag
If CAN The node has changed from its default “ Activities ” State transition to “ passive ” state , Then it will only cause the so-called “ Passive error flag ”. The passive error flag is 6 A sequence of recessive bits . under these circumstances , It is relevant to distinguish between passive error flags caused by the sending node and the receiving node .
Example 4: The transmitter is a passive error
As shown in the figure , If the transmitter ( For example, in our example CAN node 1) Trigger passive error flags ( For example, response bit error ), This will correspond to 6 A continuous sequence of recessive bits . This is all CAN Node detected as bit fill error . Suppose other CAN The node is still in its error active state , They will trigger 6 Active error flag of dominant bits . In other words , Passive transmitters can still “ convey ”CAN The frame is wrong .
Example 5: The receiver is a passive error
contrary , If the receiver generates a passive error flag , This is actually true for all others on the bus CAN node “ invisible ”( Because any dominant bit is better than the recessive bit sequence ). actually , This means that the wrong passive receiver no longer has the ability to destroy others CAN The ability of a node to transmit frames .
边栏推荐
- 基于FPGA的IIR型滤波器设计
- 3、 Wide area communication network
- FPGA - odd even frequency division and decimal frequency division code routine
- 解决分频模块modelsim下仿真输出为stx的错误
- Noi online 2022 popular group problem solving & personal understanding
- What if the 80443 port of the website server has been maliciously attacked?
- What is DNS amplification attack
- 2022 summer second day information competition learning achievement sharing 1
- 如何在开发板上使用sftp命令访问sftp-server
- Clickhouse failed to import CSV without error but no data
猜你喜欢

Why are the job requirements for software testing in 2022 getting higher and higher? Is there any secret in it?

day02_基本语法

Design and simulation code of 4-bit subtracter based on FPGA

On defect description style

Circular linked list and bidirectional linked list

day04_ array

day12_ Multithreading

Sequence list and linked list

Floating point multiplication and division of vivado IP core floating point

华为交换机CE12808导入导出配置文件
随机推荐
day09_ Static & Final & code block & abstract class & Interface & internal class
5、 Wireless communication network
FIR filter design (2) -- vivado calls IP core to design FIR filter
浅谈缺陷描写样式
关于DDoS的几个误区
三、广域通信网
Circular linked list and bidirectional linked list
Understand the great changes of network security in five years
Conversion of fixed-point number to floating-point number of vivado IP core
注解(Annotation)
MerkleTree 构建QT实现UI
IGMP protocol software development experiment
Vivado IP核之RAM Block Memery Generator
Right value reference and mobile construction
Idea practical shortcut key novice must see
Network Security Learning (I)
Hog+svm for pedestrian detection
FPGA里两个数的大小直接进行比较就可以吗?
钓鱼邮件处置
Vivado IP核之浮点数加减法 Floating-point