0% found this document useful (0 votes)
103 views40 pages

CAN Bus Errors Explained - A Simple Intro (2022 - #1 Tutorial) - CSS Electronics

Uploaded by

Asna Syeda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views40 pages

CAN Bus Errors Explained - A Simple Intro (2022 - #1 Tutorial) - CSS Electronics

Uploaded by

Asna Syeda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

Products Software
Case Studies Docs
Guides Contact

CAN Bus Errors Explained - A Simple


Intro [2022]

a simple intro to

CAN errors
Need a practical intro to CAN bus errors?

In this tutorial you'll learn about the basics of CAN error handling, the 5 CAN bus
error types, the CAN error frame and CAN node error states.

To get practical, we'll also generate & record CAN errors in 6 experiments.

In this article
1. What are CAN bus errors?
2. The CAN error frame
3. 5 CAN error types
4. States & error counters
5. 6 practical experiments
6. LIN bus errors
7. CAN error logging use cases
https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 1/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

8. FAQ

Author: Martin Falch (updated May 2022)

Download as PDF

What are CAN bus errors?


As explained in our simple intro to CAN bus, the Controller Area Network is today
the de facto standard across automotives and industrial automation systems.

A core benefit is the robustness of CAN, making it ideal for safety critical
applications. Here, it is worth noting:

Error handling is vital to the robustness of CAN.

CAN bus errors can occur for several reasons - faulty cables, noise, incorrect
termination, malfunctioning CAN nodes etc. Identifying, classifying and resolving
such CAN errors is key to ensuring the continued performance of the overall CAN
system.

In particular, error handling identifies and rejects erroneous messages, enabling a


sender to re-transmit the message. Further, the process helps identify and
disconnect CAN nodes that consistently transmit erroneous messages.

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 2/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

How does CAN error handling work?


Error handling is a built-in part of the CAN standard and every CAN controller. In other
words, every CAN node handles fault identification and confinement identically. Below
we've made a simple illustrative example:

Active Error Flag Active Error Flag

6 bits 6 bits
TEC +8 REC+1 TEC-1 REC -1
1 1 3 1 3 1 3 1 3

1 0

2 2 Active Error Flag 2 2


Bit Error
6 bits
REC +1 REC -1

Example step-by-step +

The example references a number of concepts that we will detail shortly: Error frames,
error types, counters and states.

The CAN bus error frame


In the illustrative example, the CAN nodes 'raise Active Error Flags', thus creating an
'error frame' in response to detecting a CAN error.

To understand how this works, let us first look at a "normal" CAN frame (without
errors):

CAN bus bit stuffing


Notice that we highlighted 'bit stuffing' across the CAN frame.

Bit stuffing is a subtle, but vital part of the CAN standard. Basically it states that
whenever a CAN node sends five bits of the same logic level (dominant or recessive),
https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 3/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

it must send one bit of the opposite level. This extra bit is automatically removed by
the receiving CAN nodes. This process helps ensure continuous synchronisation of
the network.

As per the previous example, when CAN node 1 detects an error during the
transmission of a CAN message, it immediately transmits a sequence of 6 bits of the
same logic level - also referred to as raising an Active Error Flag.

Oscilloscope example +

Active Error Flags


As we just learned, such a sequence is a violation of the bit stuffing rule - aka a 'Bit
Stuffing Error'. Further, this error is visible to all CAN nodes on the network (in
contrast to the 'Bit Error' that resulted in this error flag being raised). Thus, the
raising of error flags can be seen as a way of "globalizing" the discovery of an error,
ensuring that every CAN node is informed.

Note that the other CAN nodes will see the Active Error Flag as a Bit Stuffing Error. In
response they also raise an Active Error Flag.

As we'll explain shortly, it is important to distinguish between the error flags. In


particular, the first error flag (from the 'discovering' node) is often referred to as a
'primary' Active Error Flag, while the error flags of subsequent 'reacting' nodes are
referred to as the 'secondary' Active Error Flag(s).

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 4/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

3 CAN error frame examples


Let's look at three example scenarios:

Example 1: 6 bits of error flags


Here, all CAN nodes simultaneously discover that an error exists in a CAN message
and raise their error flags at the same time.

The result is that the error flags all overlap and the total sequence of dominant bits
lasts for 6 bits in total. All CAN nodes will in this case consider themselves the
'discovering' CAN nodes.

Regarding simultaneous discovery +

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 5/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

Example 2: 12 bits of error flags


Here, CAN node 1 transmits a dominant bit, but reads it as recessive - meaning that
it discovers a Bit Error. It immediately transmits a sequence of 6 dominant bits.

The other nodes only discover the Bit Stuffing Error after the full 6 bits have been
read, after which they simultaneously raise their error flags, resulting in a
subsequent sequence of 6 dominant bits - i.e. 12 in total.

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 6/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

Example 3: 9 bits of error flags


Here, CAN node 1 has already transmitted a sequence of 3 dominant bits when it
discovers a Bit Error and begins sending 6 dominant bits.

Once halfway through the primary Active Error Flag, nodes 2 and 3 recognize the Bit
Stuffing Error (due to the 3 initial dominant bits being followed by another 3

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 7/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

dominant bits) and they begin raising their error flags. The result is that the
sequence of dominant bits from error flags becomes 9 bit long.

The above logic of raising error flags is reflected in what we call an 'active' CAN error
frame.

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 8/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

Note in particular how the secondary error flags raised by various nodes overlap
each other - and how the primary and secondary flags may overlap as well. The
result is that the dominant bit sequence from raised error flags may be 6 to 12 bits
long.

This sequence is always terminated by a sequence of 8 recessive bits, marking the


end of the error frame.

In practice, the active error frame may "begin" at different places in the erroneous
CAN frame, depending on when the error is discovered. The result, however, will be
the same: All nodes discard the erroneous CAN frame and the transmitting node can
attempt to re-transmit the failed message.

Passive Error Flags


If a CAN node has moved from its default 'active' state to a 'passive' state (more on this
shortly), it will only be able to raise so-called 'Passive Error Flags'. A Passive Error Flag is
a sequence of 6 recessive bits as seen below.

In this case it's relevant to distinguish between a Passive Error Flag raised by a
transmitting node and a receiving node.

Example 4: Transmitter is Error Passive


As shown in the illustration (Example 4), if a transmitter (such as CAN node 1 in our
example) raises a Passive Error Flag (e.g. in response to a Bit Error), this will
correspond to a consecutive sequence of 6 recessive bits.

This is in turn detected as a Bit Stuffing Error by all CAN nodes. Assuming the other
CAN nodes are still in their Error Active state, they will raise Active Error Flags of 6
dominant bits. In other words, a passive transmitter can still "communicate" that a
CAN frame is erroneous.

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 9/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

Example 5: Receiver is Error Passive


In contrast, if a receiver raises a Passive Error Flag this is in practice "invisible" to all
other CAN nodes on the bus (as any dominant bits win over the sequence of
recessive bits) - see also Example 5.

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 10/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

Effectively, this means that an Error Passive receiver no longer has the ability to
destroy frames transmitted by other CAN nodes.

CAN error types


Next, let us look at what errors may cause CAN nodes to raise error flags.

The CAN bus protocol specifies 5 CAN error types:

1. Bit Error [Transmitter]


2. Bit Stuffing Error [Receiver]
3. Form Error [Receiver]
4. ACK Error (Acknowledgement) [Transmitter]
5. CRC Error (Cyclic Redundancy Check) [Receiver]

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 11/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

We've already looked at Bit Errors and Bit Stuffing Errors briefly, both of which are
evaluated at the bit level. The remaining three CAN error types are evaluated at the
message level.

Below we detail each error type:

CAN bus error types

Node transmits a dominant/recessive bit,


1 Bit Error but reads back the opposite logical level

Bit Stuffing Node detects a sequence of 6 bits of the


2
Error same logical level between the SOF and CRC

Node detects a bit of an invalid logical level


3 Form Error in the SOF/EOF fields or ACK/CRC delimiters

Node transmits a CAN message, but the ACK


4 ACK Error slot is not made dominant by receiver(s)

Node calculates a CAN message CRC that


5 CRC Error differs from the transmitted CRC field value

#1 Bit Error
Every CAN node on the CAN bus will monitor the signal level at any given time -
which means that a transmitting CAN node also "reads back" every bit it transmits. If
the transmitter reads a different data bit level vs. what it transmitted, the
transmitter detects this as a Bit Error.

Exceptions +

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 12/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

#2 Bit Stuffing Error


As explained, bit stuffing is part of the CAN standard. It dictates that after every 5
consecutive bits of the same logical level, the 6th bit must be a complement. This is

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 13/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

required to ensure the on-going synchronization of the network by providing rising


edges. Further, it ensures that a stream of bits are not mis-interpreted as an error
frame or as the interframe space (7 bit recessive sequence) that marks the end of a
message. All CAN nodes automatically remove the extra bits.

If a sequence of 6 bits of the same logical level is observed on the bus within a CAN
message (between the SOF and CRC field), the receiver detects this as a Bit Stuffing
Error aka Stuff Error.

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 14/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

#3 Form Error
This message-level check utilises the fact that certain fields/bits in the CAN message
must always be of a certain logical level. Specifically the 1-bit SOF must be dominant,
while the entire 8-bit EOF field must be recessive. Further, the ACK and CRC
delimiters must be recessive. If a receiver finds that any of these are bits are of an
invalid logical level, the receiver detects this as a Form Error.

#4 ACK Error (Acknowledgement)

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 15/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

When a transmitter sends a CAN message, it will contain the ACK field
(Acknowledgement), in which the transmitter will transmit a recessive bit. All
listening CAN nodes are expected to send a dominant bit in this field to verify the
reception of the message (regardless of whether the nodes are interested in the
message or not). If the transmitter does not read a dominant bit in the ACK slot, the
transmitter detects this as an ACK Error.

#5 CRC Error (Cyclic Redundancy Check)

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 16/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

Every CAN message contains a Cyclic Redundancy Checksum field of 15 bits. Here,
the transmitter has calculated the CRC value and added it to the message. Every
receiving node will also calculate the CRC on their own. If the receiver's CRC
calculation does not match the transmitter's CRC, the receiver detects this as a CRC
Error.

CAN node states & error counters

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 17/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

As evident, CAN error handling helps destroy erroneous messages - and enables
CAN nodes to retry the transmission of erroneous messages.

This ensures that short-lived local disturbances (e.g. from noise) will not result in
invalid/lost data. Instead, the transmitter attempts to re-send the message. If it wins
arbitration (and there are no errors), the message is successfully sent.

However, what if errors are due to a systematic malfunction in a transmitting node?


This could trigger an endless loop of sending/destroying the same message -
jamming the CAN bus.

This is where CAN node states and error counters come in.

Hardware reset

Error
Active

Hardware reset or
REC > 127 or
host reset with
TEC > 127
128 x 11 recessive
bit waiting time
REC < 128 or
TEC < 128

Error Bus
Passive TEC > 255
Off

CAN node error tracking via state changes


TEC: Transmit Error Counter, REC: Receive Error Counter

In short, the purpose of CAN error tracking is to confine errors by gracefully reducing
the privileges of problematic CAN nodes.

Specifically, let's look at the three possible states:

1. Error Active: This is the default state of every CAN node, in which it is able to
transmit data and raise 'Active Error Flags' when detecting errors
2. Error Passive: In this state, the CAN node is still able to transmit data, but it now
raises 'Passive Error Flags' when detecting errors. Further, the CAN node now has
to wait for an extra 8 bits (aka Suspend Transmission Time) in addition to the 3 bit

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 18/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

intermission time before it can resume data transmission (to allow other CAN
nodes to take control of the bus)
3. Bus Off: In this state, the CAN node disconnects itself from the CAN bus and can
no longer transmit data or raise error flags

Every CAN controller keeps track of its own state and acts accordingly. CAN nodes shift
state depending on the value of their error counters. Specifically, every CAN node
keeps track on a Transmit Error Counter (TEC) and Receive Error Counter (REC):

A CAN node enters the Error Passive state if the REC or TEC exceed 127
A CAN node enters the Bus Off state if the TEC exceeds 255

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 19/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

How do the error counters change?


Before we get into the logic of how error counters are increased/reduced, let us
revisit the CAN error frame as well as the primary/secondary error flags.

As evident from the CAN error frame illustration, a CAN node that observes a
dominant bit after its own sequence of 6 dominant bits will know that it raised a
primary error flag. In this case, we can call this CAN node the 'discoverer' of the
error.

At first, it might sound positive to have a CAN node that repeatedly discovers errors
and reacts promptly by raising an error flag before other nodes. However, in
practice, the discoverer is typically also the culprit causing errors - and hence it is
punished more severely as per the overview.

CAN bus error counter logic

TEC +8 Transmitter raises primary error flag

REC +8 Receiver raises primary error flag

REC +1 Receiver raises secondary error flag

REC -1 Receiver successfully receives message

TEC -1 Transmitter successfully sends message

TEC: Transmit Error Counter, REC: Receive Error Counter

Details on TEC/REC counters +

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 20/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

CAN/LIN data & error logger


The CANedge1 lets you easily record data from 2 x CAN/LIN buses to an 8-32 GB SD
card - incl. support for logging CAN/LIN errors. Simply connect it to e.g. a car or truck
to start logging - and decode the data via free software/APIs.

Further, the CANedge2 adds WiFi, letting you auto-transfer data to your own server -
and update devices over-the-air.

learn about the canedge

Examples: Generating & logging error frames


We have now covered the theoretical basics of CAN errors and CAN error handling.
Next, let us look at generating and logging errors in practice. For this we will use a
couple of CANedge devices - and for some tests a PCAN-USB device.

Tip: Download the MF4 data for the tests to view the data in asammdf or CANalyzer.

download data →

Test #1: No CAN bus errors

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 21/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

As a benchmark, we start with a test involving no CAN bus errors. Here, a CANedge2
'transmitter' sends data to another CANedge2 'receiver' - and both log CAN bus
errors.

By loading the MF4 log file in the asammdf GUI we verify that no CAN errors
occurred during this test, which is to be expected.

Test #2: Removing the CAN bus terminal resistor


In this test, we remove the CAN termination in the middle of a log session. This
effectively corresponds to immediately setting the bit level to dominant. As a result,
the CANedge2 transmitter immediately starts logging Bit Errors (which occur when it
attempts to transmit a recessive bit, but reads a dominant bit). The CANedge2
Receiver logs Bit Stuffing Errors as it detects 6 consecutive dominant bits. These
errors are recorded until the termination is added again.

How relevant is this in practice? +

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 22/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 23/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

Transmitter Bit Errors

Receiver Bit Stuffing Errors

Test #3: Setting an incorrect baud rate


In this test we configure the CANedge receiver node to have a baud rate of 493.827K
vs. the baud rate of the transmitter of 500K. This is a fairly extreme difference and
results in ACK Errors for the transmitter and Bit Stuffing Errors for the receiver.

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 24/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

In more realistic scenarios, smaller differences in the baud rate configuration of


various nodes may cause intermittent error frames and thus message loss.

How relevant is this in practice? +

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 25/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 26/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

Transmitter ACK Error

Receiver Bit Stuffing Errors

Test #4: Removing the acknowledging CAN node


In this test, we use three CANedge units configured as follows:

CANedge1: Configured to acknowledge data


CANedge2 A: Configured in 'silent mode' (no acknowledgement)
CANedge2 B: Configured to transmit a CAN frame every 500 ms

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 27/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

In the default setup, data is transmitted by the CANedge2 B onto the CAN bus and
recorded with no errors. However, if we remove the CANedge1 from the bus there
are no longer any CAN nodes to acknowledge the frames sent by the transmitter.

As a result, the transmitter detects ACK Errors. In response, it increases its Transmit
Error Counter and raises Active Error Flags onto the CAN bus. These are in turn
recorded by CANedge2 A (which silently monitors the bus) as Form Errors.

Why does the CANedge record Form Errors? +

Why are there 16 error frames? +

How relevant is this in practice? +

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 28/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

Transmitter ACK Errors

Receiver Form Errors

Test #5: CAN frame collisions (no retransmission)


When setting up a CAN bus, it is key to avoid overlapping CAN IDs. Failing to do so
can result in frame collisions as two CAN nodes may both believe they've won the
arbitration - and hence start transmitting their frames at the same time.

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 29/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

To simulate this, we use the same setup as in test #4. In addition, we connect a
PCAN-USB device as a secondary transmitter.

The CANedge2 transmitter is now configured to output a single CAN frame every 10
ms with CAN ID 1 and a payload of eight 0xFF bytes. Further, we configure the
CANedge2 to disable retransmission of frames that were disrupted by errors. The
PCAN-USB outputs an identical CAN frame every 2 ms with the 1st byte of the
payload changed to 0xFE. The PCAN device has retransmissions enabled.

This setup quickly creates a frame collision, resulting in the CANedge and PCAN
transmitters detecting a Bit Error. In response to this, both raise an Active Error Flag,
which is detected as a Bit Stuffing Error by the CANedge receiver. The PCAN device
immediately attempts a retransmission and succeeds, while the CANedge waits with
further transmission until the next message is to be sent.

How relevant is this in practice? +

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 30/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 31/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

USB-to-CAN transmitter Bit Error

CANedge transmitter Bit Error

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 32/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

CANedge receiver Bit Stuffing Error

Test #6: CAN frame collisions (incl.


retransmission)
In this test, we use the same setup as before, but we now enable retransmissions on
the CANedge2 transmitter.

In this case, the frame collision results in a sequence of subsequent frame collisions as
both the CANedge2 and the PCAN-USB device attempt to re-transmit their disrupted
messages.

Due to the resulting Bit Errors, both raise a total of 16 Active Error Flags, which are
detected as Bit Stuffing Errors by the silent CANedge2 receiver. Both transmitters
then enter Error Passive mode and stop raising Active Error Flags, meaning none of
them can destroy CAN frames on the bus. As a result, one of the transmitters will
succeed in transmitting a full message, thus ending the retransmission frenzy - and
enabling both devices to resume transmission. However, this only lasts for a few
seconds before another collision occurs.

How relevant is this in practice? +

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 33/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

USB-to-CAN transmitter Bit Errors x 16

CANedge transmitter Bit Errors x 16

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 34/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

CANedge receiver Bit Stuffing Errors x 16

LIN bus errors


Similar to CAN bus errors, the LIN protocol also specifies a set of four error types,
which we outline briefly below. The CANedge supports both CAN/LIN error frame
logging.

#1 LIN Checksum Error +

#2 LIN Receive Error +

#3 LIN Synchronization Error +

#4 LIN Transmission Error +

Example use cases for CAN error frame


logging

CAN bus diagnostics in OEM prototype vehicles


An automotive OEM may have the need to record CAN error frames in the field
during late stage prototype testing. By deploying a CANedge, the OEM engineering

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 35/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

team will both be able to troubleshoot issues based on the actual CAN signals
(speed, RPM, temperatures) - as well as issues related with the lower layer CAN
communication in their prototype systems. This is particularly vital if the issues of
interest are intermittent and e.g. only happen once or twice per month. In such
scenarios, CAN bus interfaces are not well suited - and it becomes increasingly
relevant to have a cost-effective device to enable scalable deployments for faster
troubleshooting.

MF4
MF4
MF4

Remotely troubleshooting CAN errors in machinery


An OEM or aftermarket user may need to capture rare CAN error events in their
machines. To do so, they deploy a CANedge2 to record the CAN data and related
error frames - and automatically upload the data via WiFi to their own cloud server.
Here, errors are automatically identified and an alert is sent to the engineering team
to immediately allow for diagnosing and resolving the issue.

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 36/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

MF4

FAQ

Should one always log CAN errors? +

Does the CANedge support all CAN/LIN error types? +

Will a CANedge raise error flags? +

What information can be recorded regarding a CAN error? +

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 37/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

Is error handling a cybersecurity risk? +

For more intros, see our guides section - or download the 'Ultimate Guide' PDF.

Need to log CAN bus data & errors?


Get your CAN logger today!

buy now contact us →

Recommended for you

J1939
logger
CANedge

J1939 DATA LOGGER - SIMPLE TELEMATICS

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 38/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

OBD2
logger
CANedge/CLX000

OBD2 DATA LOGGER - LOG VEHICLE DATA EASILY

CANopen
logger
CANedge

CANOPEN DATA ANALYZER - EASILY ANALYZE MACHINES

Contact

CSS Electronics | VAT ID: DK36711949


Soeren Frichs Vej 38K (Office 35)

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 39/40
11/24/22, 3:50 PM CAN Bus Errors Explained - A Simple Intro [2022 | #1 Tutorial] – CSS Electronics

8230 Aabyhoej, Denmark

[email protected]
+45 91 25 25 63

Terms of Service

Returns and Refunds


Privacy Policy
About Us
CO2 Neutral Since 2015

Newsletter

Email address subscribe

© 2022, CSS Electronics

https://www.csselectronics.com/pages/can-bus-errors-intro-tutorial 40/40

You might also like