FlexRay Protocol

FlexRay Protocol

FlexRay Protocol Tutorial

The FlexRay is a deterministic, fault-tolerant, and high-speed automotive networking communication system protocol developed by the FlexRay Consortium to control the automotive ECU’s. The deterministic terminology is used here for Time-division multiple access technologies. Whereas the CAN protocol is used Frequency division multiple access technology.

It is standardized in ISO174518-1 to ISO17458-5 for use in different industries. It is faster and reliable than CAN protocol, but due to its expensive, most of the OEM’s are not preferring to use it. but still, in some module, some of the OEM’s are using for high-speed communication. FlexRay is having a maximum of 10 Mbps speed whereas the CAN is having a maximum of 1mbps only. Basically the FlexRay is used in Power Train Module, Safety suspension, Adaptive Cruise Control, etc. This technical article will provide a full fletch of flexray protocol tutorial from basic to deep understanding.

History Of FlexRay Protocol

The FlexRay protocol was design to make a faster and more deterministic standardized networking communication protocol. The first prototype was first developed by the FlexRay consortium team in the year of 1999. later in 2004, the first protocol released for application use and it was limited in the SAE group. But now it is a part of ISO standards under ISO174518-1 to ISO17458-5. This protocol was first used in the BMW X5 E70 vehicles in the year 2006. But the real implementation and application of FlexRay protocol were started in 2008 with new BMW-7 series called F01.

The FlexRay protocol was first made by 7 team members including some automotive OEM and chip manufacturers aims to reach the fast, deterministic, and reliable standard. They are:

  1. BMW AG
  2. Volkswagen AG
  3. Daimler AG
  4. General Motors
  5. Robert Bosch GmbH
  6. NXP Semiconductors
  7. Freescale Semiconductor

Later there are 28 premium associates and more than 60 associate members have been added in the end of 2009. Including members, the protocol also being improved a lot in each release as defined below:

VersionDateChanges done
FlexRay-2.030th June 2004It was the first public release under ISO
FlexRay-2.1May 2005SDL process has been restructured
FlexRay-2.0 Rev ADecember 2005Use of SDL Priority input.
Introduction of a new “a” class variables.
A timer replaced by a counter.
Extension of SDL color coding.
FlexRay-3.0December 20091. Fatal protocol error fixed for the dynamic segment.
The simultaneous switch-off of TxEN and TxD disabled.
2. A node can be configured for transmission of messages for a period of time after the reception.
3. The bus idle detection mechanism changed into a time duration instead of a bit duration.
4. Two new synchronization methods TT-E and TT-L were added to the existing TT-D method.
5. Precision formulas improvement.
6. micro-tick distribution error fixed.
7. Removal of 100 ns micro-tick
8. internal controller delays are now part of the propagation delay
9. The ranges for external clock correction parameters were increased.
10. The maximum transmission duration aligned with the EPL specification document.
11. An optimized constraint for static slot size.
FlexRay-3.0October 20101. In TT-E mode, the time measurement initialization for clock synchronization was added.
2. The distinction between the internal and external signals for TxD, TxEN, and RxD was being added.
FlexRay protocol Release revision version

Why FlexRay Protocol needed?

  • It uses the X-by-wire technique steer-by-wire, brake-by-wire, etc.
  • The hydraulic steering and braking system is being replaced by the electronic ECU with sensors and actuators.
  • The CAN is not supported by real-time capabilities because of the arbitration method.

Features Of The FlexRay Protocol

  • High-Speed Data rate: Highspeed datarate up to 10 Mbps with full-duplex networking communication.
  • More Topology Support: It supports passive bus, active star, and hybrid topology instead of bus topology only for CAN protocol.
  • Bus Operation: The bus operates time cycles as a Static segment and Dynamic Segment.
  • Real-Time Communication: Like arbitration technology in CAN, in FlexRay the TDMA technology used for real-time communication.
  • Communication Traffic: FlexRay can work in both the Half-Duplex and Full-Duplex communication methods.
  • Serial Type: It can work in both Synchronous and asynchronous frame transfer.
  • Latency: It guarantees the frame latency and jitter during the synchronous data transfer.
  • Frame Priority: It can prioritize frames during the asynchronous data transfer.
  • Synchronization: The FlexRay has multi-master clock synchronization ability.
  • Error & Signalling: It has also error detection and signaling ability like CAN protocol.

Difference between the FlexRay CAN and LIN Protocol

SchedulerIt is Scalable and Event-DrivenIt is Scalable, Deterministic, Slave Autobaud Detection(lower accuracy clock for slaves)It is Time Driven, Deterministic, Redundant, Fault-Tolerant and Global Time Base
Medium Access ControlIt uses Multi-Master CSMA-CR methodIt is Single Master multi slave.Multi-Master Hybrid TDMA
Bit CodingNRZ and bit stuffingNRZNRZ
Nodes4-20 nodes depending on bus length and type of topology1 master,up to 15 slaves4-22 nodes, depending on the bus length and type of topology
TopologyIt supports only Bus TopologyIt also supports only Bus TopologyIt supports passive bus, active start, and hyvrid topology
Typical Bus Speed (bits/sec)33 Kbps to 500 Kbps typical 1 Mbps Capable at 40 meter of bus lengthLow: up to 20 Kbps2.5 Mbps to 10 Mbps
Data & Frame Size0-8 bytes payload 47 bits overhead (std ID) 67 bits overhead (ext ID). In CAN-FD it is 64 bytesIt has 1-8 bytes payload 44 bits overheadIt has 0-254 bytes payload 64 bits overhead
Bus utilization efficiency(excluding idle time)It has 1-byte payload:15% std
8-byte payload:58% std
1-byte payload:11% ext
8-byte payload:49% ext
It has
1 byte payload :15%
8 byte payload :52%
It has 8-byte payload:50%
254-byte payload:97%
Physical MediaIt can be Single or dual wire having 5VIt has Single wire and 12vIt can use Twisted pair, even if don’t consider money then you can also use optical fiber
Industry Acceptance(NA)It Startedin 1990’s and
Wide Acceptance in late 1990’s
It was Started in mid-1990’s
Wide Acceptance was early 2000’s
It is having Limited deployment in NA wide acceptance in Europe
MCU SupportCAN peripheral Standard UART or UART extensionsFlexRay Peripheral
ApplicationsIt is used in sharing of data between ECU’sIt is used in Sensor or actuator Interface to a master ECU (doors,mirrors,windows,motors….)It is using where a High-speed data sharing, distributed control, safety-critical systems needed
CAN LIN FlexRay Protocol differentiation

FlexRay Protocol Physical Layer Structure

The FlexRay protocol has its own physical layer like CAN protocol. It has been designed and improved in each release. Since the FlexRay Protocol works on deterministic or nothing but the real-time scheduler method, the nodes are connected on the FlexRay network does not arbitrate. For that reason, the FlexRay communication controller guarantees collision-free bus access during the normal bus operation. The physical layer is basically having two parts that are FlrxRay BUS Driver and Network nothing but the bus cable.

FlexRay BUS Driver (Transceiver)

The FlexRay physical network mostly running the same as the CAN network. But it is having its own unique hardware design for its high data rate and deterministic and some other features. FlexRay transmission medium is also working on the differential voltage level. The main purpose of this drive is to convert from microcontroller voltage level to FlexRay protocol bus voltage level and vice versa.

The FlexRay bus is having consists of two lines called BUS Plus (BP) and BUS Minus (BM). The Flexray driver is a full-duplex transceiver. That means it has two 2-wire buses that mean it can transmit and receive at a time which was not available in CAN protocol. Even there are other advantages is that we can say it can run on double speed nothing but the 20 Mbps data rate due to its full-duplex feature. For this reason, the FlexRay protocol electrical physical layer specification defines 4 bus levels that can be assigned either to the recessive or dominant bus level. BUS Plus (BP) and BUS Minus (BM) are nothing but the terminologies used in FlexRay which is the same as CAN-High and CAN-Low in CAN bus. You can see below with the FlexRay bus voltage level with different modes.

FlexRay bus voltage level
FlexRay Protocol BUS Voltage Level
  • FlexRay Recessive: The bus recessive state means both the BP and BM will be having 2.5 voltage.
  • FlexRay Dominant: The bus dominant means the BP will be 3.5 voltage and BM will be 1.5 voltage.
  • FlexRay Idle State: The bus idle state valid bus level lies in between the 1.8 voltage to 3.2 voltage.
  • FlexRay LPM Mode: In Low Power Mode, the bus stays in idle state nothing but the BP and BM is 2.5 voltage. It means the differential voltage is 0 volt. But the real-time bus level valid state lies in between the -0.2 volt to +0.2 volt.

FlexRay Physical Layer Differential voltage

When the FlexRay controller sends a logical-1 or high, the BP will be 3.5 voltage and the BM will be 1.5 voltage. The resulting output is BP-BM nothing but the 3.5 – 1.5 is 2 voltage. When the FlexRay controller sends a Logical-0 or low, the BP will be 1.5 voltage and the BM will be 3.5 voltage. The resulting output is BP-BM is nothing but the 1.5 – 3.5 is -2 voltage. The FlexRay bus is also working on the same NRZ technology like CAN protocol.

FlexRay BUS

The transmission medium or the FlexRay network is an unshielded twisted pair cable like CAN protocol. It also needs a termination resistor for the prevention of noise and magnetic interference. Mostly to satisfy the maximum power transform theorem for a network, we need to terminate the network so that the input impedance will be equal to the output impedance. It is having 3 different topologies on which FlexRay Protocol can work. These are explained below:

FlexRay Passive BUS Topology

This is basically a normal BUS topology same as CAN bus. In this topology, a single node can be connected to one or more channels at a time. Here in this image, it is shown how it is connecting with two-channel.

FlexRay Protocol

FlexRay Active STAR Topology

The FlexRay active star topology is free of closed rings. Any signal will receive by any node, It will send all the connected nodes in the network. A single node can be connected to a maximum of two-star couplers.

FlexRay HYBRID Topology

The Hybrid Topology is the combination of passive topology and active star topology. Whenever there will be a different multiple topologies FlexRay network will be in a vehicle, then there will be this kind of Hybrid Flexray network that will be there for gateway the signals.

How does FlexRay Protocol Work?

The FlexRay protocol has 3 main modules that are interfacing with each other for successfully data transfer on the network bus. These are Host Controller, FlexRay Communication Controller, and FlexRay Transceiver or driver and Bus Guardian.

FlexRay Protocol
FlexRay Protocol Working Principle

FlexRay Host Controller

The main objective of this module is to run the application software. As per the requirement it will send or receive the data to or from the FlexRay communication controller. It also used to controll the different operating modes or power control of FlexRay Communication controller and transceiver or driver module.

FlexRay Communication Controller

  • It is used to interface the FlexRay bus data with the Host controller.
  • Transmission and reception of message processing.
  • It is also used for clock synchronization.

Controller Host Interface

  • It is used to interface between the host and controller to control the command and message interface.
  • It ls responsible to handle the configuration and status data.
  • To handle the message buffers for transmission and reception of data frames.

Protocol Operation Control

The main objectives of this module is to respond the host commands and protocol conditions as per the application software. It also responsible to control or change the different operation modes of core processes.

Clock Synchronization

The main objective of this module is to synchronize the clock. This is having 3 different sub-parts such as the Generation of micro-tick, clock synchronization, and clock-synchronization startup. The micro-tick is the smallest synchronized time unit.

Media Access Control (FlexRay Transmission)

The purpose of this module is to assemble and generate the message header and schedule the bus to write access.

Frame and Symbol Processing (FlexRay Reception)

The purpose of this module is to handle the reception of any message from the bus. It also performs the timing and error checks like CRC for data validation.

Ecoding or Decoding Processes (Read/Write)

This module is used to encode the transmission messages and decode the reception messages. Encoding or decoding is done on each bit and each bit is 8-times on the bus. This module integrates the CRC code into each FlexRay frame before it transmits on the bus. Even it also validates the CRC for each FlexRay frame cycle.

FlexRay frame Scheduler

The FlexRay protocol uses the Time Division Multiple Access nothing but the TDMA method for frame cycle scheduling. Generally it is called as time triggered frame cycle. This module fixes the time for writing or sending of cycle onto the bus.

FlexRay Protocol Communication Channel

FlexRay uses the communication cycle for data communication on the bus. This cycle is divided into 4 different segments. These are Static Segment, Dynamic segment, Symbol Window, and Network Idle Time.

FlexRay Protocol
FlexRay Communication Cycle

FlexRay Static Segment

FlexRay Channel static segment
FlexRay Communication Channel Static Segment
  • The static segment is the first segment of a FlexRay communication cycle.
  • Each static segment divided into multiple time slots.
  • A single slot has a fixed length of time and an Identifier that is assigned to a specific control unit.
  • This segment is having guaranteed latency for its hard real-time feature.
  • The static segment has no delays and collisions.
  • A single node can be allocated to the multiple slots by its slot Identifier.
  • A very good example of a static segment is an airbag deployment that needs hard real-time.

FlexRay Dynamic Segment

FlexRay Dynamic Segment
FlexRay Communication Channel Dynamic Segment
  • The Dynamic Segment is the second segment of a FlexRay communication cycle.
  • Each dynamic segment is also having multiple numbers of slots.
  • Each slot having a unique identifier.
  • If any event will occur and it will match with the corresponding slots Identifier of that control unit, then it will allow sending data.
  • If it has a longer message that has to be sent in the same cycle, then the next node time slot should move backward.
  • The best example of the application of this segment is the Wiper.

FlexRay Symbol Window Segment

The symbol segment is basically having some internal control information to start the network.

FlexRay Network Idle Time Segment

The purpose of the Network Idle Time Segment is to synchronize the clocks. Then it will schedule each slot defined in the static segment. Each slot corresponding to a data frame from a defined node. A frame can hold up to 254 bytes of data.

FlexRay Clock Synchronization

Since the FlexRay uses the guided media for data transmission, due to temperature change, voltage changes, or the FlexRay controller oscillator tolerance will have a great negative influence on the clock accuracy.

FlexRay Protocol Message Frame Format

A FlexRay Protocol is having only data frame. Each data frame is having consists of 3 segments shown in below figure. The Flexray Protocol Frame Format is explained well for the data frame.

FlexRay Protocol Data Frame
FlexRay Protocol Data Frame Format

Header Segment

The header segment is the first section of a Flexray message. Each header section is having 5 fields. These are the Control field, Frame ID, Payload Length, CRC header, and cycle count.

Control Signal

The Control signal is the first field in each data frame. It is having 5 bit fields. Each bit is having a control signal status for the start of a new data frame send. These are:

  • Reserved Bit.
  • Payload preamble Indicator.
  • Null frame Indicator.
  • Sync frame indicator.
  • Startup frame Indicator.

Frame Identifier

The frame identifier is nothing but an unique identifier for each FlexRay data frame. It is same as the CAN identifier.

Payload Length

The Payload length is the 3rd field of the header section. it is a 7-bit field that defines how many bytes of data are getting transmitted in that corresponding data frame. It is the same as the DLC field of the CAN protocol.

Header CRC

The header CRC is the 4th field in the Header segment. It is an 11-bit CRC data. It is used to validate the valid data on the receiver side. The header CRC calculated by using the polynomial method. To calculate the CRC, it will take the input as the Null frame Indicator, Sync frame indicator, Startup frame Indicator, frame Identifier, and Payload length.

Cycle Count

The main objective of this field is to keep the number of cycle has been sent.

Payload Segment

The payload segment is nothing but the data field of FlexRay data frame. It can have from 0-254 bytes of data. Where as in CAN protocol it was having only 8 bytes and in CAN-FD it is having 64-bytes of data.

Trailer Segment

The Trailer segment is the 3rd or last section of any FlexRay data frame. It is a 3-byte or 24-bits of CRC trailer. It is calculated over the payload and header sections of that data frame. This mostly used by the receiving node for 2nd time to confine the successful receiving of the data frame without any error.

FlexRay Protocol Operating Modes

Like CAN or other protocols, FlexRay protocol is also operating in different modes. These modes are defined for power consumption and proper operation of FlexRay network. In FlexRay, it is called as Protocol Operation Control nothing but POC. This POC process sets the operating modes of frame and symbol processing for each communication channel. It has 3 operating modes such as:

  1. STANDBY Mode: This mode used to halt the execution of the frame and symbol processing processes.
  2. STARTUP Mode: This mode is used to start the execution of the frame and symbol processing processes. But it does not any CHI except for decoded wake up patterns.
  3. RUN Mode: In this mode, it will run the execution of frame and symbol processing processes including the CHI update also takes place.

Notify of
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Scroll to Top