As the demand for automotive safety, reliability, and comfort increases, the amount of automotive electronics also is increasing, creating the need for high-speed control in power train and by-wire systems. Automotive manufacturers require new protocols that offer higher bandwidth, flexibility, andperhaps most importantdeterministic behavior. The FlexRay serial communication protocol supports such in-vehicle communication infrastructure requirements and enables high-speed control applications.
The FlexRay protocol was developed by companies including BMW, Bosch, DaimlerChrysler, Freescale, GM, Philips, and Volkswagen. Its architecture delivers communication rates up to 10 Mbits/sec along with the significant advantage of deterministic behavior. The protocol includes a dual-redundant channel and uses scalable static and dynamic message transmission that deliver guaranteed message latency time. In addition, a system based on FlexRay can be programmed for synchronous and asynchronous transmission that provides higher flexibility compared with the Controller Area Network (CAN) protocol, which affords asynchronous transmission only. In addition, the protocol supports clock synchronization via a global time base, collision-free bus access, message-oriented addressing via identifiers, and scalable system fault-tolerance using either single or dual channels.
View a full size image
The FlexRay frame is divided into three segments: Header, Payload, and Trailer. The header section includes the Frame ID, Payload Length, Header CRC, and Cycle Count. The Frame ID identifies a frame and is used for prioritizing event-triggered frames. The Payload Length contains the number of words that are transferred in the frame. The Header CRC is used to detect errors during the transfer. The Cycle Count contains the value of a counter that advances incrementally each time a Communication Cycle starts. The payload section contains the data transferred by the frame. The length of the FlexRay payload or data frame is up to 127 words (254 bytes). The trailer segment consists of three 8-bit CRCs to detect errors.
The major challenge for designers starting with FlexRay is to write a communication driver. FlexRay’s underlying time-triggered approach requires several planning steps in the control design phase, more than are required with the more familiar procedure for the CAN interface. These requirements include advanced planning for task configuration and message scheduling.
For example, an automotive system based on the CAN bus, message scheduling is performed by implicitly assigning messages a priority via message identifiers. The higher the priority, the more likely the message is to get on the bus. However, to use FlexRay as a communication system, the messages must be scheduled relative to the planned sequence of application tasks. Each message is therefore assigned an exclusive transmission slot within the communication cycle. This results in a static, deterministic schedule for messages and tasks that are computed offline.
Another challenge for the designer is to test the FlexRay systems. This requires an appropriate prototyping environment. For instance, a FlexRay-based engine control system needs to simulate engine speed, process crankshaft signals, and generate output signals for ignition and injection systems. This generates the need for appropriate tools, and powerful prototyping systems able to handle the dynamics of the FlexRay protocol.
Evaluation kit helps out
Many semiconductor vendors are working on FlexRay controller development and will integrate FlexRay with a 32-bit microcontroller. To get developers started now on FlexRay-based systems, Fujitsu offers an FPGA-based development evaluation kit which provides a multifunctional evaluation board for the Fujitsu 32-bit Flash microcontroller (MB91F369G) as a host controller. It includes a CPU board, FlexRay main board, and daughterboard (hosted on the main board) with an Fujitsu FPGA-based FlexRay controller as a target. The daughterboard is hosted on the FlexRay main board and can be used as a standalone FlexRay controller, which can be interfaced to any CPU using an external bus interface.
The kit can be used for software development and testing using the integrated Softune Workbench development environment, with monitor debugger, or together with the emulator system. These tools enable the designer to start FlexRay system evaluation.
To get started with the kit, designers first should become familiar with the FlexRay IP-module, the E-RAY specification (discussed below) and the evaluation board hardware that comes with it. By being familiar with the kit’s capability the designer will be able to resolve issues such as hardware integration that can arise when hooking up the hardware while working with the kit.
After familiarization, the boards can be connected together with the appropriate sockets provided on each board. As soon as power is turn on to the FlexRay main board (which provides power to the other boards as well) pre-program sample software on the microcontroller will start running, and FlexRay bus activity can be observed using an oscilloscope or any FlexRay bus analyzer tool. In order to reprogram the microcontroller or to edit or debug the program, the evaluation kit requires a PC, or compatible hardware, with an RS232 port. This requires downloading the Fujitsu free utility software and Fujitsu proprietary software development environment (Softune Workbench) which enables designers to edit, compile, build, and debug the program.