You are on page 1of 45

Senses for Safety.

Driver assistance systems help save lives.

CAN-FD Praveen Subramanian

( CAN with Flexible Data-Rate ) (ADAS –PD)

Chassis & Safety


www.continental-corporation.com Advanced Driver Assistance Systems
Prerequisite:
▪ Knowledge on CAN protocol (ISO 11898).
▪ Working experience with Vector Database files and CANOE.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 2
Agenda :

1 Overview
2 Introduction
3 Physical and Data Link Layer
4 Types of frames
5 Frame Formats
6 Bit timings
7 Example Configuration for Bit Timing
8 Transmission Duration
9 Bandwidth Utilization
10 Oscilloscope Images
11 Error Handling
12 Register Configuration
13 Changes involved in migration
14 CAN-FD in Diagnostics
15 CAN-FD in Flashing
16 Microcontroller support
17 Vector Hardware support
18 Sample CAN-FD DBC
19 CAN-FD demo
20 Questions

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 3
Overview
▪ Like the name suggests, CAN-FD can be considered as superset of Classical CAN protocol.

CAN CAN- FD

▪ Unlike Flexray or Ethernet, CAN-FD is not a protocol designed from ground


up.

▪ It includes almost all feature's of Classical CAN along with few additional
improvements .

▪ (e.g.) Windows 98 and Microsoft 10

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 4
Introduction

When?
▪ CAN-FD was invented by BOSCH in the year 2011.
▪ Saw its commercial use during 2012.

What ?
▪ CAN-FD switches between two baud-rates during frame transmission unlike Classical CAN
and other communication protocols which works with single baud rate.
▪ Arbitration baud rate Range ( <1mbps).
▪ Data rate Range (1mbps – 8 mbps).
▪ CAN-FD supports transmission of up to 64 bytes of data in contrast to Classical CAN which
can handle only 8 Data bytes.
▪ Follows ISO 11898-1
▪ Support for both 11 and 29 bit identifiers similar to Classical CAN.

Space for Sender Information 11 December 2018


Confidential Author, © Continental AG 5
Types (NON-ISO CAN-FD and ISO CAN-FD)

▪ BOSCH CAN-FD is generally referred to as NON-ISO CANFD.


▪ ISO made slight changes to the original CAN-FD making it more robust, This improved
version is referred to as ISO-CAN-FD.

▪ DIFFERENCES:
▪ The ISO CAN FD format includes a counter for the stuff bits that is also transmitted as part
of the frame. The CRC polynomial calculation is more robust in the ISO CAN FD than the
non-ISO CAN FD.

▪ NOTE:
▪ These protocols can’t intercommunicate with each other.

Space for Sender Information 11 December 2018


Confidential Aneesh Gopinathan, © Continental AG 6
Physical and Data Link Layer (Almost same as Classical CAN)

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 7
Physical Medium:
-

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 8
Continued…

▪ Transmission medium comprising of CAN-H and CAN-L twisted cables with terminating
resistance of 120ohms is identical to Classical CAN.
▪ Recessive and Dominant voltage levels are also carried forward from Classical CAN.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 9
Frame Types :

- All frame formats of Classical CAN with exception of Remote frame are supported.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 10
Data Frame Format (NON-ISO-CAN-FD and ISO-CAN-FD)

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 11
Data Frame Format (Classical CAN )

Recap on various bit fields

Fields Visible in CANOE trace window are :Frame ID,DLC,Data

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 12
Arbitration field

▪ Both share the same addressing for Standard and Extended formats.

▪ CAN FD removes the RTR bit and maintains an always dominant r1 bit.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 13
Control Field:

▪ CAN and CAN FD share the following bits:


▪ IDE, r0 and the DLC bits.

▪ CAN FD adds the following bits to the control field :


▪ EDL – Extended Data Length :Determines if CAN (dominant) or CAN FD (recessive).
(Also referred to as FDF –Flexible Data Field)
▪ BRS – Bit Rate Switch : Clock rate switches when BRS is recessive.
▪ ESI – Error State Indicator (error active/passive).

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 14
DLC Field:

▪ 4 bits used for both formats.


▪ CAN FD compatible with CAN at data lengths ≤ 7.
▪ CAN ignores 3 lsb if DLC = 8, CAN FD does not.
▪ For lengths ≥ 8, CAN FD uses the following DLCs:

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 15
Data Field:

▪ 0-8 bytes in CAN.


▪ 0-8, 12, 16, 20, 24, 32, 48, or 64 bytes in CAN FD.
▪ Bytes are transferred msb first.
▪ No data field if DLC = 0.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 16
CRC Field:

▪ Size of CRC differs based on CAN/CAN FD and length of DLC.


▪ 15 bits for CAN.
▪ 17 bits for CAN FD where data field ≤ 16 bytes.
▪ 21 bits for CAN FD where data field > 16 bytes.
▪ Preceding stuff bits are included in the CAN FD CRC calculation.
▪ CAN does not use stuff bits in the CRC calculation.
▪ CAN FD CRC delimiter is always transmitted as 1 bit, but due to phase shift between
nodes a transmitter accepts up to 2 bit times.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 17
ACK Field

▪ Slight difference in the format between CAN and CAN FD.


▪ CAN FD nodes recognize up to two bit times as a valid ACK.
▪ 1 extra bit time allowed to compensate for transceiver phase shift and bus propagation
delay due to the switch from a high data phase clock to a low arbitration phase clock.
▪ ACK Delimiter remains the same.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 18
End of Frame

▪ Frames are delimited by a group of 7 recessive bits similar to Classical CAN.


▪ Inter Frame Spacing of 3 bits is also carried forward from Classical CAN.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 19
Error Frame
▪ Same as Classical CAN
▪ Transmission occurs at arbitration baud rate

▪ Error flag comprises of 6 bits (Dominant or recessive based on error state ).


▪ Error Delimiter always consists of 8 recessive bits.
▪ Refer to Error Management for more info.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 20
Overload Frame

▪ Same as Classical CAN.


▪ Transmission occurs at arbitration baud rate .
▪ Format closely resembles Error frame .

▪ Overload Flag : comprises of 6 dominant fields.


▪ Overload Delimiter : consists of 8 recessive bits.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 21
Continued..

▪ There are three kinds of OVERLOAD conditions, which lead to the transmission of an
OVERLOAD FLAG:

▪ The internal conditions of a Receiver, which requires a delay of the next DATA FRAME or
REMOTE FRAME.
▪ Detection of a dominant bit at the first or second bit of INTERMISSION.
▪ If a CAN FD node samples a dominant bit at the eighth bit (the last bit) of an ERROR
DELIMITER or OVERLOAD DELIMITER, or if a CAN FD Receiver samples a dominant bit
at the last bit of END OF FRAME, it will start transmitting an OVERLOAD FRAME (not an
ERROR FRAME). The Error Counters will not be incremented.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 22
Bit Timing

▪ The concepts of Time Quantum and Sampling point are same as Classical CAN.
▪ Another set of hardcoded values are configured to accommodate for the additional
baud rate.
▪ NOTE: Sampling happens between Phase_Segment 1 and Phase_Segment2

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 23
› Length of Time Segments for the NOMINAL BIT RATE
▪ • SYNC_SEG(N) is 1 TIME QUANTUM(N) long.
▪ • PROP_SEG(N) is programmable to be 1,2,…,32 or more TIME QUANTA(N) long.
▪ • PHASE_SEG1(N) is programmable to be 1,2,…,32 or more TIME QUANTA(N) long.
▪ • PHASE_SEG2(N) is the maximum of PHASE_SEG1(N) and the INFORMATION
PROCESSING TIME

▪ • The INFORMATION PROCESSING TIME is less than or equal to 2 TIME QUANTA(N) long.

› Length of Time Segments for the DATA BIT RATE


▪ • SYNC_SEG(D) is 1 TIME QUANTUM(D) long.
▪ • PROP_SEG(D) is programmable to be 0,1,2,…,8 TIME QUANTA(D) long.
▪ • PHASE_SEG1(D) is programmable to be 1,2,…,8 TIME QUANTA(D) long.
▪ • PHASE_SEG2(D) is the maximum of PHASE_SEG1(D) and the INFORMATION
PROCESSING TIME

▪ • The INFORMATION PROCESSING TIME is less than or equal to 2 TIME QUANTA(D) long

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 24
Example Configuration

▪ NOMINAL BIT TIME configuration based on a


▪ Prescaler of m(N) = 2 and the time segments ,
PROP_SEG(N) = 6,
PHASE_SEG1(N) = 4,
PHASE_SEG2(N) = 4 combined with the

▪ DATA BIT TIME configuration based on a


▪ Prescaler of m(D) = 1 and the time segments
PROP_SEG(D) = 1,
PHASE_SEG1(D) = 4,
PHASE_SEG2(D) = 4,

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 25
Space for Sender Information 11 December 2018
Confidential Praveen Subramanian, © Continental AG 26
Transmission Duration for a single frame

▪ Table comparing transmission durations of Classical CAN frame with CAN-FD with varying
Lower and Higher Baud rate configurations.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 27
Bandwidth Utilization (Classical CAN vs CAN-FD)

▪ Classical CAN
▪ In most automotive applications, bandwidth utilization varies between 60-80% ,also bus load is
not allowed to exceed 90%.
▪ A typical Classical CAN frame with 11-bit identifier along with stuff bits has a size of about 16
bytes of data out of which only 8 bytes is used for effective data transmission.
▪ Hence for Classical CAN, the effective bandwidth used for data transmission comes down to
30-40%.

▪ CAN-FD
▪ For a CAN-FD frame with a 11-bit identifier ,we have 64 effective data bytes with same
overhangs of 16bytes.
▪ Hence Even with 60-80% of bandwidth utilization, more than 120% of the same can be used for
effective data transmission.
▪ There is a multifold increase in volume of data being transported as expected.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 28
Oscilloscope Images:

› Classical CAN

› CAN-FD

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 29
Error Handling:

▪ Error Handling is identical to Classical CAN.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 30
Continued..
▪ Transmit Error Counter and Receive Error Counter Increment/Decrement logic remains the
same as in Classical CAN
▪ Bus-Off and Error-Passive failures are also carried forward.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 31
Continued..

› Active Error Frame

› Passive Error Frame

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 32
Common Registers used in Classical CAN:

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 33
Register Configuration for CAN-FD

▪ All Classical CAN registers are carried forward for CAN-FD


▪ For Higher bit rate support, one additional copy of BTR register needs to be configured

▪ Some Optional Interface registers:


▪ • Double set of status registers to distinguish between messages and errors occurring
while operating in the first or in the second bit rate.
▪ • Dedicated error counter to compare error rates in the two operating modes.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 34
Bit Timing Register Configuration:

▪ Time segment (1and 2) are configured as mentioned in Bit Timing segment.


▪ Synchronization Jump Width:
▪ Valid programmed values are 0-3. The actual interpretation by the hardware of this value is
such that one more than the value programmed here is used.
▪ Baud Rate Prescaler
▪ The value by which the oscillator frequency is divided for generating the bit time quanta.
The bit time is built up from a multiple of this quanta. Valid values for the Baud Rate
Prescaler are[ 0 … 63 ]. The actual interpretation by the hardware of this value is such that
one more than the value programmed here is used.
▪ Note: With a module clock CAN_CLK of 8 MHz, the reset value of 0x2301 configures the
C_CAN for a bit rate of 500 kBit/s.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 35
Migration from Classical CAN to CAN-FD
(why CAN-FD can be preferred over Flexray, Ethernet)

▪ Physical transmission medium


▪ Physical transmission medium remains the same for CAN and CAN-FD.
Migration to Flexray/Ethernet requires replacement of existing medium.

▪ Hardware Changes
▪ Traditional trans receivers and Controllers must be upgraded to ones supporting CAN-FD.
▪ NOTE: All CAN-FD hardware's work as a hybrid setup supporting both Classical CAN and
CAN-FD, hence there is room for backward compatibility.
▪ For most modern Controllers and trans receivers supporting CAN-FD, the price gap when
compared to ones supporting Classical CAN is less ,same can’t be said about ones
supporting Flexray/Ethernet.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 36
Continued..

› Software Changes :
▪ Major reason for choosing CAN-FD for upgrade from CAN
would be savings in Software R&D cum Development costs.
▪ As shown in AUTOSAR BSW architecture ,both Classical CAN
and CAN-FD share a common slot due to minimal changes
and the fact that CAN-FD supports backward compatibility.
▪ Major changes with CAN-FD includes configuration of BRT2
register in MCAL layer and changes in packing and unpacking
of signals in COM layer.
▪ In case of Flexray and Ethernet, major overhaul of all functions
across MCAL, ECU abstraction and sessions layer must be
carried out further adding to development costs.
▪ Backward compatibility is not supported by Flexray/Ethernet.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 37
CAN-FD in Diagnostics:
› Diagnostics:
▪ CAN-FD is highly useful in diagnostics eliminating the need for flow control mechanism configured as a part of CAN-TP
in most cases.
▪ Almost all DID’s used in Read, Write and Routine services can be accommodated within 64 byte payload in a single
frame.

Example ( Reading 17 byte VIN Data )


- Classical CAN (With Flow Control)

Tx - 03 22 F1 90 (UDS service 22 using DID FI90)


Rx - 10 14 62 F1 90 11 12 13 (First Frame with positive response ) Time : (15-30) Milliseconds (Approx.)
Tx - 30 00 00 (Flow Control Frame) (5 Frames)
Rx - 21 21 22 23 24 25 26 27 (Consecutive Frame 1)
Rx - 22 31 32 33 34 35 36 37 (Consecutive Frame 2)

- CAN-FD

Tx - 03 22 F1 90 Time : (5-10) Milliseconds (Approx.)


Rx - 14 62 F1 90 11 12 13 21 22 23 24 25 26 27 22 31 32 33 34 35 36 37 (2 Frames)

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 38
CAN-FD in Flashing:
› Flashing:
▪ CAN-FD with Data baud rate of 8mbps can be configured for flashing large hex files (e.g.
Infotainment and instrument clusters)
▪ Reduces the duration of flashing by many folds.

Example : ( Consider a Hex file size of 10MB)

* Twice the Estimated time as only about 50% of time is spent in transmission of useful data.
NOTE : This is just a rough theoretical estimation.

Space for Sender Information 11 December 2018


Confidential Aneesh Gopinathan, © Continental AG 39
Microcontroller /Controller /Trans receiver Support:

Space for Sender Information 11 December 2018


Confidential Aneesh Gopinathan, © Continental AG 40
Vector Hardware Support:

› Almost all Vector hardware's currently available in market support CAN-FD.

› Examples:
▪ VN1610
▪ VN1611
▪ VN1630A
▪ VN1640A
▪ VN7600
▪ VN7610

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 41
CAN-FD Database file walkthrough

› DBC for MFC510:

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 42
CANOE Configuration Demo

› MFC510 cfg
▪ CAN-FD Configuration creation and demo with MFC510 SW.

› VECTOR cfg
▪ Sample Cfg for CAN-FD from VECTOR found in below path:
▪ C:\Users\Public\Documents\Vector\CANoe\10.0 (x64)\CANoe Sample
Configurations\CAN\CAN_FD.

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 43
Questions ?

› What happens when CAN_FD frames are


injected in Classical CAN network ?

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 44
Thank You for not sleeping:

Space for Sender Information 11 December 2018


Confidential Praveen Subramanian, © Continental AG 45

You might also like