What is FlexRay

Micael Coutinho,autosarbswflexray

FlexRay is a high performance communication protocol in the rough automotive environment. Learn more about FlexRay here

We have already covered two of the most popular communication protocols in automotive vehicles, CAN and LIN, in CAN Protocol Overview (opens in a new tab), CAN Transceiver Protection (opens in a new tab) and What is LIN (opens in a new tab). Both these protocols have different purposes: LIN is cheaper and slower, making itself a great candidate for low priority functionalities, such as controlling the climatization and the windows of your car, while CAN is enough for the powertrain functions of your vehicle, where your data will come in fast enough to make it all work, so you are looking at ABS, airbags, powertrain, etc, while only using two wires and termination resistors. Both these options are cheap and reliable, but what options are you looking at if you need better performance? FlexRay is your starting point!

Let's look at FlexRay. What is it and why do we need it? As vehicles are getting smarter, with new advanced functionalities to increase autonomy, safety and improve the driving experience, CAN is starting to not be enough for all these new features coming in, when it comes to performance. The communication requirements of some applications, such as state of the art, high-performing powertrains and safety features, are starting to go past what CAN provides us, also creating the need to scale up the number of CAN networks in newer vehicles.

This is the space where FlexRay is creeping in, to meet these demands, and why the FlexRay consortium was created (although dismantled in 2009 to become the ISO-17458-1 and ISO-17458-5 standards). As a curiosity, the first production vehicles incorporating FlexRay were 2006's BMW X5 and 2008's BMW 7 Series. Nowadays, cars such as the BMW 1 series, Audi A4 and Mercedes-Benz C-Class already make use of FlexRay.

Now that we got the history lesson out of the way, let's take a look at the nitty-gritty. Its premise is to deliver high performance in a rough environment, at a cheap price. The hardware connection is pretty much straightforward after seeing the CAN bus. It's comprised of an unshielded twisted pair of cables, one or two pairs, depending on the configuration, which can be of single or dual channel, where the dual channel configuration can improve fault-tolerance and bandwidth, of a maximum of 10Mbps (but the cost increases, of course). The same tactic of twisting the pairs is used as in CAN to reduce noise on the differential signal. Aside from the twisted pair, FlexRay can also include two cables, for power and ground, which is used to power small modules, such as microcontrollers or transceivers. Aside from the cables, there are termination resistors at both ends, for the same reason as CAN, where the resistor values sit around 80 and 110 ohms.

Regarding network topology, one of the differentiating factors in comparison to other networks, there are a few options:

FlexRay network topologies, side by side { w: 977, h: 333 }

FlexRay network topologies, side by side

Now, let's look at the internals of a FlexRay network. It's a time-triggered protocol, with predictable data timings, like in LIN, and data coming in dynamically such as in CAN. This is achieved by defining static and dynamic frames, where a predefined communication cycle allocates space for all the static frames and a zone for dynamic frames. All the nodes in the network must know how the communication cycle is defined before communicating.

The network one-up's the CAN mechanism to check if the bus is free by using TDMA (Time Division Multiple Access), allowing for faster data-rates than CAN. But that's another set of parameters to be configured exactly the same way within all the ECUs in the network.

As you can see, with the importance of keeping the configuration exactly the same across all ECUs, the FlexRay committee defined a standard format just to share these parameters, called FIBEX (Field Bus EXchange Format), for easy parameter-sharing.

Now, let's look at the FlexRay communication cycle up close. Its duration is fixed, from 1 to 5 ms, usually. It contains 4 parts:

FlexRay communication cycle { w: 292, h: 111 }

FlexRay communication cycle

Lastly, let's see what a FlexRay frame contains. It contains the expected 3 parts of a regular communication protocol frame: header, payload and trailer. From the header:

Regarding the payload, this can be from 0 to 254 bytes, which is way more than CAN. Two optional parameters are available:

Lastly, the trailer contains 3 bytes of CRC.

FlexRay message format { w: 821, h: 88 }

FlexRay message format

Alright, now that we gave you the theory behind FlexRay, we hope you can understand the uses for each of the 3 most popular automotive communication protocols. Make sure to subscribe to our newsletter, so you don't miss a thing!

Author: Micael Coutinho (opens in a new tab)

References:

© AutosarToday —@LinkedIn