The present invention refers to one of a number of nodes of a communication system. The nodes are connected to a communication media for transmitting data among the nodes. Said one node comprises a communication controller, across which the node is connected to the communication media, and a bus guardian for controlling access of the communication controller to the communication media.
Furthermore, the invention refers to a method for monitoring a synchronized clock signal from a communication controller of a node making part of a number of nodes of a communication system. The nodes are connected to a communication media for transmitting data among the nodes. Said node comprises a communication controller, across which the node is connected to the communication media, and a bus guardian for controlling access of the communication controller to the communication media.
Finally, the invention refers to a computer program, which is able to run on a computer, in particular on a microprocessor.
Various types of communication systems are known in the art. Generally, they comprise a communication media, which for example is a data bus. Various nodes are connected to the communication media. Each node comprises a host controller, a communication controller, a bus driver and a bus guardian. Data can be transmitted across the communication system according to various protocols. An example of such a protocol is TTCAN (Time Triggered Controller Area Network) for time triggered communication systems.
Data transmission can be effected in communication cycles, which comprise various time slots assigned to the nodes of the communication system. Each node can send data across the communication media within the timeslot assigned to the node. Which timeslots are assigned to which nodes is part of a communication media access scheme. If a node wants to transmit data, the data is brought into a format specified in the protocol used. Formatting the data is effected by the communication controller of the node. The formatted data is forwarded from the communication controller to the bus driver, which translates the formatted data into electrical signals which then are applied to the communication media within the timeslots assigned to the node. The bus guardian serves for controlling access of the communication controller to the communication media.
An essential feature of such a communication system is time consistency of the nodes. This means that data transmission within the communication system is based on a uniform time scheme, i.e. the nodes of the communication system have to be synchronized to the same global time basis. Preferably, the global time basis is not an arbitrary (perhaps external) notion of time. Rather the global time basis is determined according to the clock signals from the nodes of the communication system.
A node starts the transmission of its data messages when its local view of a global time reaches a predefined value. This value can be calculated from the identifier of the data messages. A second (receiving) node expects the transmission of this message when his local view of the global time reaches the same predefined value. By measuring the difference between the actual arrival time and the expected arrival time the receiving node can measure the global time distance to the other controller.
It is known in the state of the art to effect a synchronization of the nodes based on a correction of differences in offset of the clocks. This means that from time to time, for example in every communication cycle, the actual times of the clocks are measured. Depending on the measured clock times, offset correction values for each clock are determined and the clocks are synchronized based on the determined offset correction values, i.e. the offset correction value is added to the actual time of the clocks.
A scheduler of the bus guardian may be directly clocked with a corrected (or synchronized) clock signal, the so called macrotick signal, from the communication controller and, therefore, a failing clock synchronization at the communication controller or a missing macrotick signal must be detected by the bus guardian. The bus guardian may supervise all signals from the communication controller that are used to synchronize the bus guardian.
It is known from the state of the art to monitor clock signals from communication controllers of nodes in communication systems using signals which are generated by oscillators of the bus guardian and, therefore, have a higher accuracy than the clock signal to be monitored. The aim is to have at hand a signal generated by the oscillator with an accuracy as high as possible, in order to allow a high accuracy monitoring of the clock signal to be monitored. However, the use of oscillators for generating the signals used for monitoring the clock signal in a bus guardian of a node in a communication system is inefficient and expensive.
In automotive applications it is an important aspect that the communication system is robust against disturbances typically inside vehicles and that it can be realized at a reduced cost. Further, it is important that at least large deviations of the clock signal from the nominal clock signal, such as would be caused by a crystal that is oscillating at a different harmonic or a frequency divider inside the communication controller that is operating at an incorrect ratio, are detected and the appropriate measures are taken.
Therefore, it is an object of the present invention to provide a cheap but nevertheless reliable way for monitoring the synchronized clock signal of a node of a communication system and in particular for detecting deviations of the synchronized clock signal.
To solve this object according to the present invention a node of the above-mentioned kind is suggested, characterized in that a synchronized clock signal from the communication controller is made available to the bus guardian, and that the bus guardian comprises means for monitoring the synchronized clock signal using a bus guardian internal clock signal, which is generated by means of an electronic circuit and which is less accurate than the synchronized clock signal to be monitored.
According to the present invention it is suggested to effect a clock signal monitoring using an internal clock signal having a lower accuracy than the clock signal to be monitored. Of course, according to the present invention only a coarse monitoring of the synchronized clock signal can be achieved. But the achievable accuracy is accurate enough in order to determine larger deviations of the monitored clock signal from a nominal signal and is for example +/−50%. Large deviations may be caused by a crystal that is oscillating at a different harmonic or a frequency divider inside the communication controller that is operating at an incorrect ratio. These defects of the communication controller can be reliably detected with the present invention.
The bus guardian comprises an electronic circuit for monitoring the received synchronized clock signal. This has the advantage that the bus guardian does not need its own oscillator for generating a reference signal and for monitoring the synchronized clock signal. Other than an oscillator which serves for creating a reference signal with as high a precision as possible, the electronic circuit is much simpler and cheaper and serves for roughly monitoring the macroticks received from the communication controller.
For each controller there are four potentially different time units:
The bit time is only important for bit representation. The clock tick is the physical basis for other units but of no relevance for the logical time representation. The microtick is a fixed multiple of the clock tick. It is the smallest unit for time (difference) measurements. The length of the macroticks is influenced by the drift of oscillators. A macrotick comprises a number of microticks. The macrotick signal is the synchronized clock signal to be monitored.
The network (i.e. communication system) wide global time is measured in macroticks. Each communication cycle has the same integer number of macroticks. The macroticks within a communication cycle are numbered (Macrotick_Count). The cycles are numbered (Cycle_Count). The global time is a pair (Cycle_Count, Macrotick_Count). The clock signal comprises a certain number of macroticks. The number of microticks in a macrotick can be corrected in order to correct the clock signal.
For example, for rate correction of a clock, the rate correction value can be multiplied with the actual clock time. For offset correction of the clock, the offset correction value can be added to the actual clock time. Of course the correction values for a clock can be integrated in a single correction term for that clock. The rate and the offset correction values are calculated during network idle time (NIT) of the communication cycle, but not necessarily in every cycle. The offset correction is performed within that cycle, too. The rate correction is performed during the following one or more communication cycles. Preferably, the rate correction is performed during the following two cycles. For the rate correction, the calculated rate correction value is (preferably evenly) distributed on the macroticks of the following cycles and considered when generating the macroticks. This leads to a clear separation between time measurement and calculation of the correction values on the one hand and performing the correction on the other hand.
The means for synchronizing the clock correct differences in offset of the clock as well as differences in rate of the clock. For the offset and the rate correction, the clocks are not altered to align the with some canonical notion of time. Rather the clocks are aligned with each other so that they have a common notion of time. It is possible that the clocks are consistent with each other and still not progress at the same speed as an external reference clock.
According to a preferred embodiment of the present invention it is suggested that an additional clock signal from the communication controller is made available to the bus guardian, and that the bus guardian comprises means for monitoring the synchronized clock signal using the additional clock signal and means for monitoring the additional clock signal using the bus guardian internal clock signal. The additional clock signal is the bus guardian tick signal which is derived directly from the communication controller's clock signal. So the bus guardian has access to the clock signal and to the synchronized clock signal. The bus guardian tick signal is used for monitoring the synchronized clock signal. The bus guardian tick signal is monitored by means of the bus guardian internal clock signal (so called local clock CLK of the bus guardian).
It is suggested that the means for monitoring the additional clock signal (bus guardian tick signal) count the number of internal clock signal periods (periods of the local clock of the bus guardian) during a configurable number of additional clock signal periods (periods of the bus guardian tick signal) and determine whether the number of counted internal clock signal periods is within a configurable tolerance window. The local clock of the bus guardian is used as a reference for monitoring the bus guardian tick signal. The principle operation of the bus guardian tick monitoring is to measure the period of the bus guardian tick signal by counting the number of local clock periods during a predefined number of bus guardian tick periods.
Measurement over a configurable number of periods allows to adjust the measurement period to the required precision. Further, the precision of the local clock signal depends on the configuration of the clock source, which may be an internal RC-oscillator or an external clock signal.
Furthermore, it is suggested that the means for monitoring the synchronized clock signal count the number of additional clock signal periods during a configurable number of synchronized clock signal periods and determine whether the number of counted additional clock signal periods is within a configurable tolerance window. The additional clock signal is used as a reference signal. Preferably, the ratio of the number of macrotick periods and the number of bus guardian periods within a predefined time limit is calculated (T_MT/T_BGT).
According to another preferred embodiment of the present invention it is suggested that the means for monitoring the additional clock signal count the number of internal clock signal periods (local clock periods) during multiple additional clock signal periods (bus guardian tick periods). Preferably, the means for monitoring the synchronized clock signal count the number of additional clock signal periods (bus guardian tick periods) during multiple synchronized clock signal periods. By counting the number of local clock periods or bus guardian tick periods respectively over multiple periods of the bus guardian tick or the synchronized clock signal respectively, the precision of the monitoring can be improved.
Preferably, the means for monitoring the additional clock signal and/or the means for monitoring the synchronized clock signal respectively comprise a watchdog. Finally, it is suggested that the bus guardian internal clock signal is generated by means of a resonant circuit comprising at least a resistance and a capacity. Of course, by means of this RC-circuit the bus guardian tick signal cannot be monitored with such a high precision as it would be possible if the bus guardian had its own oscillator. However, the monitoring can be effected with a precision high enough for reliably detecting errors in the synchronized clock signal of the controller and to react accordingly.
Furthermore, the above-mentioned object is achieved by a method of the above-mentioned kind, characterized in that the synchronized clock signal is monitored using a bus guardian internal clock signal, which is generated by means of an electronic circuit and which is less accurate than the synchronized clock signal to be monitored.
According to a preferred embodiment of the invention it is suggested that an additional clock signal from the communication controller is made available to the bus guardian, that the synchronized clock signal is monitored using the additional clock signal and that the additional clock signal is monitored using the bus guardian internal clock signal.
It is suggested that for monitoring the additional clock signal the number of internal clock signal periods during a configurable number of additional clock signal periods is counted and it is determined whether the number of counted internal clock signal periods is within a configurable tolerance window.
Preferably, for monitoring the synchronized clock signal the number of additional clock signal periods during a configurable number of synchronized clock signal periods is counted and it is determined whether the number of counted additional clock signal periods is within a configurable tolerance window.
Finally, the above-mentioned object is achieved by a computer program of the above-mentioned kind, characterized in that the computer program is programmed in order to execute a method according to the present invention.
According to a preferred embodiment it is suggested that the computer program is stored on a read-only-memory (ROM), on a random-access-memory (RAM) or on a flash-memory.
The bus guardian is provided with a further clock signal referred to as bus guardian (BG) tick signal, which is a multiple of the clock tick of the communication controller. The BG tick signal is monitored by means of the RC-oscillator circuit in the bus guardian. By using the RC-circuit, the BG tick signal can be monitored independently from the communication controller. The macrotick signal of the communication controller, i.e. the aligned clock signal, is a multiple of the BG tick signal. The macrotick signal is monitored in the bus guardian using the BG tick signal.
These and other features, aspects and advantages of the present invention will become better understood with reference to the following detailed description, appended claims, and accompanying drawings, wherein:
The present invention refers to a dependable automotive network. Throughout the following description the following structure is followed: at the beginning of each chapter (section) the requirements for this topic are defined, afterwards more detailed descriptions are provided. In the description UPPER CASE letters are used to denote constants. All constants used in the document are listed at the end of the description.
Objectives
The objectives pursued in the development of the dependable automotive network are the following:
The objectives of the static segment are the following:
The objectives of the dynamic segment are the following:
The global requirements are the following:
The communication protocol for the dependable automotive network according to the present invention has the following properties:
The FlexRay protocol can be divided into various layers of a layer architecture comprising the following layers:
Two implementations for the communication controller 102 are possible, one configuration of a communication controller 102 that sends and receives on two redundant physical channels, and a second configuration which is solely connected to one physical channel.
Topology
Frame Transfer
In FlexRay media access occurs within a communication cycle. Within one communication cycle FlexRay offers the choice of two media access schemes. These are a static time division multiple access (TDMA) scheme, and a dynamic mini-slotting based scheme. Communication in the communication system 106 is done in a communication cycle consisting of a static segment and a dynamic segment, where each of the segments may be empty. The first frame ID in a system with a static segment is ID number 1 (see
The sending slots are used deterministically (in a pre-defined time divisional multiple access (TDMA) strategy) in the static segment. In the dynamic segment there can be differences in the phase on the two channels (see
To guarantee the consistency of the clock synchronization only nodes 100 can participate that send frames, which are received by all other nodes (e.g., node A, C and E in
The following constraints should be respected in the communication system 106 according to the present invention:
Considering the FlexRay protocol as described in the previous part of the description the communication scheme of networked FlexRay nodes can be briefly characterized as follows:
The transmission of frames must be subdivided into 3 phases:
Throughout the document the following notation is used:
Data transfer in FlexRay is done in cycles, called communication cycles.
The following refers to the FlexRay frame format.
In
The following refers to the byteflight frame format (see
In
The following refers to frame scheduling and multiplexing of sending slots.
The following refers to frame and bit coding.
The following refers to the optical physical layer.
The following refers to the electrical physical layer.
The following refers to frame timing.
The following refers to the start-up of the communication system.
The following refers to shut-down of the communication system.
The following refers to clock synchronization of the nodes in the communication system.
Comment:
The proper synchronization of the individual clocks of the communication controllers is a pre-requisite for the TDMA communication scheme.
The following description refers to the FlexRay clock synchronization mechanism (based on the Fault-Tolerant Midpoint algorithm).
Pure Dynamic System
The following refers to the principle of operation.
Obtaining the Time Values
The following refers to the synchronization algorithm.
The following refers to the external synchronization
The following part of the description explains the hardware-related requirements for a FlexRay system.
General Requirements
Regarding the communication hardware, a distributed system of FlexRay nodes must offer some properties when being designed by using active stars and passive busses:
Each node must adhere to the following requirements (see
Each active star must adhere to the following requirements (see
The communication system according to the present invention can be used in almost any environment. However, preferably it is used in vehicles of any kind, in particular in safety critical applications in the automotive sector. In that case the communication system has to fulfill the following automotive constraints:
Typical values are given in the following table 1:
This part of the description summarizes the requirements on the communication controller and the bus driver to run an ECU in several modes.
Sleep (voltage regulator(s) not active, communication not possible)
The following refers to the Communication Controller:
The bus driver has to support several states or operating modes:
In the dynamic segment the bus guardian grants all controllers access to the bus.
The following refers to the interfaces provided within a node of the communication system: The interfaces between the single modules (host, controller, bus driver, bus guardian, and power supply) have to be agreed upon among the suppliers according to the general requirements defined in this document.
Communication ControllerHost Interface (CHI)
General Requirements
The following refers to the error handling.
The communication system and its components shall offer adequate error management mechanisms to deal with faults arising from the following levels:
The communication system furthermore shall offer diagnosis information to the host computer with respect to controller, bus (channel), and incoming/outgoing link failures.
Requirements
The communication controller shall detect the following list of errors:
The following faults have at least to be detected by the communication controller:
In the following part of the description the constants for a number of design parameters defined throughout the document are set to actual values. The values mentioned are examples and can be replaced by almost any desired value.
Table 3 shows Communication Network Constants (Min/Max).
Glossary
In the following glossary some of the terms used for description of the present invention are defined.
The following is a description of the notation used for variables, constants and parameters in this document.
Pseudocode Conventions
To specify functions and algorithms short code pieces are used. The pseudocode is loosely based on the programming language used by MATLAB. The following table 5 outlines some of the pseudocode conventions (functions and elements).
Bus Topology
A FlexRay communication system 106 can also be a single bus. In this case, all nodes 100 are connected to this bus.
Star Topology
Valid Star Network Configurations
A FlexRay communication system can be built as a multiple star topology. Similar to the bus topology, the multiple-star topology can support redundant communication channels. Each network channel must be free of closed rings, and the number of star couplers must be between 1 and cStarCouplersMax, inclusive, if there are sequentially connected (cascaded) star couplers. The total number of star couplers may be more than cStarCouplersMax if there are branches in the network. Each network line connecting a node to the star coupler or between two star couplers represents a properly terminated point-to-point connection. The incoming signal received by the star coupler is actively driven to all communication nodes.
The configuration of a single redundant star network is shown in
Note that it is also possible to have a redundant channel configuration with cascaded stars. An example of such a configuration is
Star Coupler Behavior and Protocol Impact
In addition to topologies that are composed either entirely of a bus topology or entirely of a star topology, it is possible to have hybrid topologies that are a mixture of bus and star configurations. The FlexRay system supports such hybrid topologies as long as the limits applicable to each individual topology are not exceeded. For example, the limit of cStarCouplersMax cascaded star couplers also limits the number of cascaded star couplers in a hybrid topology.
There are a large number of possible hybrid topologies, but only two representative topologies are shown here.
A fundamentally different type of hybrid topology is shown in
Communication Cycle
The communication cycle is the fundamental element of the media access scheme within FlexRay. It is defined by means of a timing hierarchy.
Timing Hierarchy
The timing hierarchy consists of four timing hierarchy levels as shown in
The highest level, the communication cycle level, defines the communication cycle. It contains the static segment, the dynamic segment, the symbol window and the network idle time (NIT). Within the static segment a static time division multiple access scheme is used to arbitrate transmissions. Within the dynamic segment a dynamic mini-slotting based scheme is used to arbitrate transmissions. The symbol window is a communication period in which one symbol out of a defined set of symbols can be transmitted on the network. The static segment, the dynamic segment and the symbol window form the network communication time (NCT), a period during which network wide communication takes place. The network idle time defines a communication-free period that concludes each communication cycle.
The next lower level, the arbitration grid level, contains the arbitration grid that forms the backbone of FlexRay media arbitration. In the static segment the arbitration grid consists of consecutive time intervals, called static slots, in the dynamic segment the arbitration grid consists of consecutive time intervals, called minislots.
The arbitration grid level builds on the macrotick level that is defined by the macrotick. The macrotick is specified further on. Specific macrotick boundaries are called action points. These are dedicated instants at which transmissions shall start (in the static segment, dynamic segment and symbol window) and shall end (only in the dynamic segment).
The lowest level in the hierarchy is defined by the microtick that is covered further on.
Communication Cycle Execution
The following specifies the communication cycle for the time-triggered distributed (TT-D) mode and for the time-triggered master-controlled (TT-M) mode. The communication cycle for the event-triggered (ET) mode is specified futher on. The communication cycle for the byteflight mode is covered in the byteflight specification.
In both the TT-D mode and the TT-M mode the synchronized time triggers the execution of the communication cycle based on a periodically recurring principle with a period that consists of a constant number of macroticks.
The communication cycles are numbered from 1 to cCycleMax. Each node shall maintain a cycle counter vCycle that shall hold the number of the current communication cycle. Initialization of the cycle counter is specified further on.
In the TT-D mode the static segment must contain at least two static slots (at least two frames must be sent with the sync bit set). The dynamic segment may exist optionally as well as the symbol window. Media access test, however, can only be performed if the symbol window exists.
In the TT-M mode the static segment must contain exactly one static slot (In this slot a frame must be sent with the sync bit set). In this mode the dynamic segment must exist, while existence of the symbol window remains optional.
Table 6 summarizes the protocol modes and the possible configurations of the communication cycle.
As described above, the FlexRay protocol supports clusters with a single communication channel (channel A only) or with dual communication channels (channel A and channel B). In the case of a dual channel cluster the channels are synchronized to one another. In the dual channel case nodes may be connected to either one or both of the communication channels. These topology options may be combined freely with the communication cycle.
Network Communication Time
Arbitration within the network communication time is performed by means of unique frame priorities and a slot counting scheme.
Arbitration assumes that unique frame priorities, referred to as frame identifiers, have been assigned to the frames among the nodes for each channel (The frame identifiers may either be assigned by an off-line configuration tool or during run-time using an application based assignment strategy. Note that in all cases the uniqueness of the frame identifiers per channel must be maintained to ensure collision-free arbitration). The frame identifiers shall range from 1 to cSlotIDMax. The frame identifier determines in which segment and when within the respective segment a frame shall be sent.
Each node shall maintain a slot counter vSlotCounter[ch] for each of the two respective channels. In the operation phase the slot counters shall be initialized with 1 at the start of each communication cycle. Initialization in the startup phase is specified further on.
Static Segment
Within the static segment a static time division multiple access scheme shall be applied to arbitrate transmissions. In this segment all communication slots are of equal, statically configured duration and all frames are of equal, statically configured length.
Structure
The static segment shall consist of gNumberOfStaticSlots static slots of equal duration. The number of static slots gNumberOfStaticSlots is a global constant for a given cluster and may range between 1 and cSlotIDMax.
In any given node one static slot pSyncSlot may be configured to contain a synchronization frame, a special type of frame required for synchronization within the cluster. psyncSlot is a node specific value that equals the number of the static slot in which the sync frame shall be transmitted.
In slot 1 the node transmits a frame on channel A and a frame on channel B. In slot 2 the node transmits a frame only on channel A (An equivalent pattern is also possible in which a node transmits a frame on channel B and no frame on channel A. Different nodes can share a static slot across both channels as described above). In slot 3 no frame is transmitted on either channel.
Transmission Condition
In the static segment the condition whether a frame shall be transmitted or not differs depending on the current protocol phase.
In the startup phase a frame shall be transmitted on a channel
In the operation phase a frame shall be transmitted on a channel
The frame shall be assembled as follows:
All static slots shall consist of an equal number of gdStaticSlot macroticks. The number of macroticks per static slot gdStaticSlot is a global constant for a given cluster and may range between 2 and TBD.
Each static slot contains an action point that shall be offset from the start of the slot by gdActionPointOffset macroticks. Frame transmission shall start at the action point of the respective static slot. The number of macroticks within the action point offset gdActionPointOffset is a global constant for a given cluster and may range between 1 and TBD.
Appropriate configuration of the static slot length must assure that the frame and the communication separator fit within the static slot.
At the end of every static slot the slot counter for channel A vSlotCounter[A] and the slot counter for channel B vSlotCounter[A] shall be incremented by one (Note that this also holds for the last static slot within the static segment).
Configuration
The static slot length gdStaticSlot shall be chosen such that the static slot accommodates not only the transmission of the frame but also the channel idle detection latency under worst-case assumptions (The parameter gdStaticSlot shall be determined by an off-line configuration tool). The formula for determining this parameter and respective constraints are specified further on. The formula for determining the parameter gdActionPointOffset and respective constraints are specified further on, too.
Dynamic Segment
Within the dynamic segment a dynamic mini-slotting based scheme shall be used to arbitrate transmissions. In this segment the duration of communication slots may vary in duration in order to accommodate frames of different length.
Structure
The dynamic segment shall consist of gNumberOfMiniSlots minislots of equal duration. The number of minislots gNumberOfMiniSlots is a global constant for a given cluster and may range between 0 and tbd.
The dynamic segment also consists of a set of consecutive dynamic slots that contain one or multiple minislots. The duration of a dynamic slot depends on whether or not communication, i.e. frame transmission or reception, takes place. The duration of a dynamic slot shall be established on a per channel basis.
The condition of whether or not communication takes place shall be evaluated at the end of every minislot:
Details of how the duration of a dynamic slot is determined for frame transmissions are specified in the subsequent subsection. Details of how this is determined in the case of frame reception are specified further on.
As shown in the figure the media access on the two communication channels does not occur in lock step. Both communication channels do share, however, the same arbitration grid.
Transmission Condition
In the dynamic segment the condition that determine whether a frame shall be transmitted or not depend on the current protocol phase.
In the startup phase no frames shall be transmitted on either channel.
In the operation phase a frame shall be transmitted on a channel
The frame shall be assembled as follows:
Timing within the dynamic segment is based on minislots. Each minislot shall contain an equal number of gdMinislot macroticks. The number of macroticks per minislot gdMinislot is a global constant for a given cluster and may range between 2 and tbd.
Each minislot contains an action point that shall be offset from the start of the minislot by gdMsActionPointOffset macroticks. The number of macroticks within the minislot action point offset gdMsActionPointOffset is a global constant for a given cluster and may range between 1 and tbd.
Frame transmission shall start at the minislot action point of the first minislot of the respective dynamic slot. In the dynamic segment frame transmission shall also end at a minislot action point. If the frame does not end at a minislot action point by virtue of its data length, then the transmitter shall extend the transmission using the dynamic trailing sequence (DTS) as described further on. The DTS prevents premature idle detection by the receivers.
In contrast to a static slot the dynamic slot distinguishes between the transmission phase and the dynamic slot idle phase. The transmission phase ranges from the start of the dynamic slot to the last minislot, in which the transmission terminates. The dynamic slot idle phase concludes the dynamic slot. The dynamic slot idle phase is defined as a communication-free phase that succeeds the transmission phase in each dynamic slot. It is required to account for the communication channel idle detection latency and to process the frame by the receivers.
The start of the dynamic segment requires particular attention. The first action point in the dynamic segment shall occur after max(gdActionPointOffset, gdMsActionPointOffset) macroticks after the end of the static segment.
The two possible cases are illustrated in
Each node shall perform slot counter housekeeping on a per channel basis. At the end of every dynamic slot the respective slot counter vSlotCounter[ch] shall be incremented by one until either
Once one of these conditions is met the respective slot counter shall be set to zero and further increments shall be suspended for the respective communication cycle.
The arbitration procedure assures that all fault-free receivers agree implicitly on the dynamic slot in which the transmission starts. Further, all fault-free receivers also agree implicitly on the minislot in which slot counting is resumed. As a result, the slot counter of all fault-free receivers matches the slot counter of the fault-free transmitter and the frame identifier contained in the frame.
Configuration
Constraints concerning the configuration of the dynamic segment are specified further on.
Symbol Window
Within the symbol window a single symbol may be sent, i.e. either a normal symbol, an alarm symbol, a medium access test symbol or no symbol at all shall be sent. In general, arbitration among different senders is not provided by the protocol for the symbol window. If arbitration among multiple senders is required for the symbol window it has to be performed by means of a higher-level protocol.
Structure
The symbol window shall consist of a fixed number of gdSymbolWindow macroticks. The number of macroticks per symbol window gdSymbolWindow is a global constant for a given cluster and may range between 0 and TBD.
Transmission Condition
As in the two communication segments the condition whether a symbol shall be transmitted or not differs depending on the current protocol phase.
In the startup phase no symbol shall be transmitted on either channel.
In the operation phase a symbol shall be transmitted on a channel
Details specifying when a symbol is released for transmission are specified further on.
Transmission Timing
The symbol window contains an action point that shall be offset from the start of the slot by gdActionPointOffset macroticks. Symbol transmission shall start at the action point within the symbol window (see
Configuration
Constraints concerning the configuration of the symbol window are specified further on.
Network Idle Time
Within the network idle time the clock correction terms shall be calculated and the offset correction term shall be applied in one or multiple macroticks. Details of the clock synchronization process are described further on.
The network idle time shall also serve as a phase to perform implementation specific cluster cycle related tasks.
The network idle time shall contain gdNIT macroticks. The number of macroticks within the network idle time gdNIT is a global constant for a given cluster and may range between 1 and TBD.
Constraints on the duration of the network idle time are specified further on.
Coding and Decoding
The following describes the coding and decoding methods used by the FlexRay system.
Since the FlexRay protocol is independent from the underlying physical layer, the following describes the coding and decoding rules of the interface signals as seen by the communication controller (i.e., TxENn, TxDn and RxDn, nε{A, B} in
In general, there are several non-ideal conditions (for example, clock oscillator differences, electrical characteristics of the transmission media and transceivers, etc.) that can cause variations of signal timing or introduce anomalies/glitches into the communication bit stream. The coding and decoding mechanisms described below are intended to be robust against such effects.
FlexRay uses a Non-Return to Zero (NRZ) signaling method for coding and decoding of frames and symbols.
Bit Stream Coding with NRZ
This section specifies the mechanisms used to encode the logical frames and symbols into a bit stream for transmission and how the transmitting node presents this bit stream to the Bus Driver for communication onto the network. The sender shall start the transmission of a frame or symbol by setting the TxENn signal to logical “0”. The sender shall stop the transmission of a frame or symbol by setting the TxENn and the TxDn signals to logical “1”.
The logical frame is described further on.
Frame Coding
Frame coding transforms logical frames to a continuous bit stream by the following steps:
Each byte sequence shall begin with a Byte Start Sequence (BSS). The BSS consists of a logical “1” bit followed by a logical “0” bit. A byte sequence consists of a BSS followed by eight data bits from the logical frame.
Transmission of the data bits within a byte sequence shall be such that the most significant bit of the data is transmitted first with the remaining bits of the data being transmitted in decreasing order of significance. This is shown in
The purpose of the BSS is to provide bit stream timing information to receiving devices. The signal edge between the first and the second bit of the BSS is used to realign the bit timing of the receiver (i.e., bit clock resynchronization).
Transmission Start Sequence (TSS)
The Transmission Start Sequence (TSS) is inserted into the bit stream before the first byte sequence. The TSS consists of a continuous logical “0” level. The duration of the TSS shall be configurable between 1 to 15 nominal bit times.
Frame End Sequence (FES)
The Frame End Sequence (FES) is appended to the bit stream following the final byte sequence. The FES is a two bit sequence consisting of a logical “0” bit followed by a logical “1” bit.
Dynamic Trailing Sequence (DTS)
A dynamic trailing sequence (DTS) shall be transmitted immediately after the FES of a frame that is transmitted in the dynamic segment of a communication cycle.
The purpose of this sequence is to indicate the exact point in time of the minislot action point.
The DTS starts with a variable number of consecutive logical “0”s. The DTS length is greater or equal to 1 bit. The DTS is concluded with the transmission of a logical “1” bit. Note that the granularity of the length of the “0” portion of the DTS is microticks rather than bits. In general, the trailing “0” to “1” transition is not synchronous to a bit cell boundary.
Entire Bit Stream for a Frame in the Static Segment
At the completion of the FES the transmitting node shall set the TxENn signal to logical one.
Entire Bit Stream for a Frame in the Dynamic Segment
At the minislot action point the TxDn output shall switch to logical “1” level, while TxENn shall switch to logical “1” one bit duration gdBit after the action point (This ensures that there is a duration of gdBit in which the TxDn output is at logical one prior to the transition of TxENn to logical one. This is required for the stability of certain types of physical layers.).
Symbol Coding
The FlexRay communications protocol defines six symbols; each of which is represented by specific bit pattern:
The bit stream of each symbol is described in the following sections.
Status Normal Symbol (SNS)
The Status Normal Symbol shall be transmitted starting with the Transmission Start Sequence (TSS) followed by 2 gdBit times at a logical “1” level, 30 gdBit times at a logical “0” level, and a final gdBit time at a logical “1” level as shown in
Status Alarm Symbol (SAS)
The Status Alarm Symbol shall be transmitted starting with the Transmission Start Sequence (TSS), followed by 2 gdBit times at a logical “1” level, 20 gdBit times at a logical “0” level, and a final gdBit time at a logical “1” level as shown in
Collision Avoidance Symbol (CAS)
The Collision Avoidance Symbol shall be transmitted starting with the Transmission Start Sequence (TSS), followed by 30 gdBit times at a logical “0” level as is shown in
Media Access Test Symbol (MTS)
The Media Access Test Symbol (MTS) shall be encoded in the same manner as the CAS symbol described above.
Event Indication Symbol (EIS)
The Event Indication Symbol (EIS) shall be encoded in the same manner as the SNS symbol described above.
Wake-Up Symbol (WUS)
At the TxD output the Wake-Up Symbol shall be transmitted starting with a configurable number of gdBit times at a logical “0” level (gdWakeupSymbolTxLow) followed by a configurable number of gdBit times at a logical “1” level (gdWakeupSymbolTxIdle).
At the TxENn output the WUS shall be transmitted identically to the TxD line, i.e., starting with a configurable number of gdBit times at a logical “0” level (gdWakeupSymbolTxLow) followed by a configurable number of gdBit times at a logical “1” level (gdWakeupSymbolTxIdle).
The Wake-up symbol shall be repeated for a configurable number of times (gWakeupPattern). The minimum number of repetitions is 2. The configuration parameters for the WUS are described more detail below. An example with a sequence of two WUS's is shown in
Bit Stream Decoding with NRZ
This section specifies the mechanisms used to perform bit stream decoding, including the relevant parameter limits and configuration parameters with this function. The decoding function interprets the bit stream observed at the RxDn inputs of the CC.
The block diagram in
The bit stream decoding processes bit streams present on the physical media, extracts logical frame and symbol information, and passes this information to the FlexRay protocol engine. The following steps are performed:
The bit stream decoding processes of the individual channels on a multiple channel FlexRay node operate independently from one another. Specifically, the bit clock alignment, edge detection, sample voting, frame decoding, and symbol detection processes on the individual channels must be capable of independent operation.
Bit Clock Alignment
The Bit Clock Alignment function (BCA) synchronizes the local bit clock used for bit sampling and voting to the received bit stream at the RxDn input.
Edge Detection Window Control
The edge detection window determines the time window in which the next edge for bit clock alignment is expected. This window is set during frame reception around the expected logical “1” to “0” transition between the two bits of the next BSS.
Initial Edge Detection Window Determination
The initialization of the BCA is started as soon as channel idle is detected at RxDn (and signaled to the BCA via the decoder unit).
The initialization of the BCA is performed through the following steps:
After channel idle the BCA waits for a falling edge that is potentially the start of a frame (TSS). In order to filter out glitches, a continuous number of pVotingSamples samples are taken for majority voting to validate the occurrence of the edge (see
If the majority of pVotingSamples consecutive samples is logical “0”, a valid falling edge has been detected.
Start of BSS Detection
After detecting a valid falling edge the BCA waits for a rising edge that is potentially the start of a BSS. In order to filter out glitches, a continuous number of pVotingSamples samples are taken for majority voting to validate the occurrence of the edge (see
If the majority of pVotingSamples consecutive samples is logical “1”, a valid rising edge has been detected.
Falling Edge Detection in the Middle of the BSS
After detecting a valid rising edge the BCA waits for a falling edge that is potentially the middle of a BSS. In order to filter out glitches, a continuous number of pVotingSamples samples are taken for majority voting to validate the occurrence of the edge (see
If the majority of pVotingSamples consecutive samples are logical “0”, a valid falling edge has been detected.
Alignment of Bit Stream
After detecting a valid falling edge the bit clock is aligned to the bit stream as seen in
The first sample of the next bit is determined by the central sample of the voting window.
First Edge Detection Window Determination
The falling edge of the next BSS is expected 10*pSamplesPerBit samples after the falling edge of the current BSS. The bit time window is placed symmetrically around the expected edge in the next BSS with a size of 6 samples, i.e., the next edge detection window is set from three samples before to three samples after that expected falling edge (see
Bit Clock Alignment
During the edge detection window, the number of samples that equal logical “0” is counted as vEdgeLowSamples. Three cases have to be distinguished:
In this case, the bit clock alignment is assumed to be correct. The falling edge is detected at the expected falling edge (see
In this case, the bit clock has to be aligned by −1 sample point (see
In this case, the bit clock has to be aligned by +1 sample (see
In general, shifting the bit start time is limited to plus or minus one sample point.
If there is no falling edge detected during the edge detection window (i.e., all samples have the same value), the resynchronization of the next bit sampling is performed according to the following rules
This condition does not constitute a coding error.
Edge Detection Window Determination During Frame Reception
The next edge detection window is determined from the aligned bit clock of the current detected falling edge. The falling edge of the next BSS is expected 10*pSamplesPerBit after the current detected falling edge. The bit time window is placed symmetrically around the expected edge in the next BSS, i.e., the next edge detection window is set from three samples before to three samples after that expected falling edge (see
Bit Sampling and Voting
The bit sampling and voting function decides whether the current bit value is to be considered as logical “1” or as logical “0”. This determination shall be performed on the signals RXDA and RXDB.
Initial Bit Start Determination
After initialization of the CC, the BSD unit starts bit sampling immediately, i.e., the local bit clock is started immediately and the bit stream is sampled with this (unaligned) bit clock. The first bit is assumed to start with the first sample. Bit clock alignment starts independently as described above. The number of samples of a bit is configured by the parameter pSamplesPerBit. pSamplesPerBit can be either 8 or 10. Each consecutive bit is assumed to start pSamplesPerBit after it's predecessor bit.
Resynchronization of Bit Sampling
Once the bit clock alignment is activated, bit sampling is resynchronized to the received bit stream by using the aligned bit clock. The resynchronization of the bit sampling is only performed at the falling edges in the BSS. In general, the first sample of the next bit shall be set to the sample following the falling edge detected by the BCA. This mechanism is illustrated in
After bit clock alignment bit sampling is performed without resynchronization for the next ten bits, i.e., until the falling edge of the next BSS.
Bit Value Voting
The number of samples to be considered for majority voting shall be odd. It is recommended to center the voting window on the supposed center of the bit cell.
The sample voting process defines a “window” of samples that are used to make the determination of the value of a received bit. This window is characterized by two parameters, pVotingOffset and pVotingSamples. An example with pVotingOffset=3 and pVotingSamples=5 is shown for the case of pSamplesPerBit=10 in
The parameter pVotingOffset specifies the offset between the 1st sample of the bit and the start of the voting window. This offset defines the first sample of the bit that will be considered for the voting. Specifically, the first sample considered for voting is the sample after the first pVotingOffset samples of the bit (i.e., voting starts after pVotingOffset samples have been “skipped”).
The pVotingSamples parameter specifies the number of samples in the voting window. The window is defined by taking pVotingSamples consecutive samples starting with the sample indicated by pVotingOffset.
The bit value shall be determined by majority voting over the samples within the voting window (This implies that the number of samples within the voting window, pVotingSamples, must be odd.), i.e., if a majority of samples within the voting window have logical value “0”, the output value of the sampled bit shall be “0”; if a majority of samples within the voting window have logical value “1” the output value of the sampled bit shall be “1”.
Note the voting window and the bit sampling shall be resynchronized with every edge between the two bits of the Byte Start Sequence (BSS). This is the only edge to be used for the resynchronization.
Frame and Symbol Decoding
Note that due to certain effects on the physical transmission medium (e.g., optical transmission, truncation due to connection setup in the star coupler, etc.), it is possible that the TSS seen at the RxDn input may be shorter or longer than the TSS that was transmitted. All receivers shall accept Transmission Start Sequences with any duration in the range of 1 to 16 bit times (inclusive).
A valid start of frame or symbol shall be considered when the following conditions are met:
Note: for glitch filtering and bit start time alignment at start of frame and/or symbol see the bit clock alignment section in this chapter.
Frame Decoding
The frame coding status shall be “valid coding”, if the following conditions are met:
Once the decoder unit detects an FES instead of an expected BSS, the BCA function is deactivated until channel idle is detected.
SNS Decoding
The detection of an SNS symbol shall be considered as “valid coding” if the following conditions are met:
The detection of an SAS symbol shall be considered as “valid coding” if the following conditions are met:
The detection of an EIS symbol shall be considered as “valid coding” if the same conditions are met as for SNS decoding (see above).
CAS Decoding
The detection of a CAS symbol shall be considered as “valid coding” if the following condition is met:
The detection of an MTS symbol shall be considered as “valid coding” if the same condition is met as for CAS decoding (see above).
WUS Decoding
The detection of a WUS symbol shall be considered as “valid coding” if the following condition is met:
The channel idle detection function is located in the decoder, using the input from the sampling and voting unit. The channel idle detection function is always active, including, for example during ongoing frame and/or symbol detection. When the CC is in low power mode and/or in the CC configuration state, then channel idle detection support is not performed.
Upon exiting the CC configuration state and/or the CC low power mode, the channel shall initially be assumed to be busy (i.e. not idle). The behavior is also required when an undefined communication element is detected.
The channel shall be considered to be idle as soon as 12 consecutive bits with the data value logical ‘1’ have been detected.
Presence of glitches while the channel is idle does not establish a coding error condition and there shall be no re-start of the channel idle detection timer. The channel idle detection counter shall be re-started when a logical “1” to “0” transition was detected where the associated bit voting result was “0”.
If the next start of frame or symbol is detected earlier than after successful channel idle detection then this establishes a channel idle condition violation (but not a coding error) and shall be signaled to the host.
Coding Error Signaling
After a frame or symbol start is detected, i.e., if a transition from channel idle to logical “0” is observed at RxDn and none of the conditions described in section 0 hold, the coding status shall be “invalid coding”.
After a valid frame or symbol is received, the CC shall perform the channel idle check. If the consecutive 12 bits after end of frame or symbol are not logical “1” a “channel idle coding violation” shall be signaled to the host.
Device is in Sleep Mode
As soon as a logical “0” condition is detected, this condition shall be captured and be considered as a potential start of a wakeup symbol. If the wakeup condition is verified as “valid”, then the appropriate startup actions shall be performed (see below), otherwise the device shall continue to stay in sleep mode.
Configuration Parameters
In order to be able to support a suitable set of different bit rates without having to modify the oscillator frequency, the number of samples per bit pSamplesPerBit shall be configurable to either 8 or 10. In addition, a scalable oscillator clock period multiplier should typically be provided. At a minimum, the node shall support clock period multiplier settings (prescaler settings) of 1, 2, 4, 8, and 16. The supported bit rates depend on the oscillator frequency that is used, the prescaler setting, and the samples per bit setting.
The following Table 7 gives an example of supported bit rates with a 12.5 ns oscillator period (e.g. f_osc=80 MHz nominal.).
Overview
The following describes the supported frame formats used by the FlexRay protocol and gives an overview. Then the description focuses on the frame formats.
The FlexRay protocol supports two distinct frame formats:
All controllers in a cluster must be configured to use the same frame format. Specifically, a system in which some controllers use the FlexRay frame format while other controllers use the byteflight frame format is not a valid system configuration.
The FlexRay frame format may be used for systems in time-triggered distributed mode (TT-D mode), in time-triggered master-controlled mode (TT-M mode), or event-triggered mode (ET mode).
The byteflight frame format may only be used in systems operating in byteflight mode (BF mode).
Both frame formats contain a header segment, a payload segment and a trailer segment, each of which contains specific fields. These are described for the FlexRay and byteflight frame formats, and illustrated, respectively, in
FlexRay Frame Format
An overview of the FlexRay frame format is given in
FlexRay Header Segment
The FlexRay header segment consists of 5 bytes that contain several distinct fields; a reserved bit, a Network Management Indication Bit, a Null Frame Indication Bit, a Sync Bit, a Frame ID field, a Payload Length field, a Header CRC field, and a Cycle Counter field. These fields are described in detail in the following sections.
Within the header segment the fields shall be transmitted in the order indicated in
Reserved Bit (1 bit—fReservedBit)
This field consists of one bit that is reserved for future protocol use. This bit shall not be used by the application.
This field indicates whether an optional network management vector is contained within the payload section of the frame.
The Null Frame Indication bit fNullFrameIndicationBit indicates whether the current frame is a “null frame”, i.e., a frame that contains no usable data in the payload segment of the frame. (The Null frame indication bit indicates only whether valid data was available to the communications controller at the time the frame was sent. A Null Frame Indication Bit set to 1 means that received data in the payload segment is not valid. If the bit is set to 0 the data in the payload segment is valid from the transmitting communication controller's point of view. The receiver may have to do several other checks to decide whether the data is actually valid.)
Further information on null frames may be found below.
Sync Bit (1 bit—fSyncBit)
The sync bit fSyncBit determines whether the frame is to be used for various aspects of system synchronization.
Examples of protocol mechanisms that make use of the Sync Bit include clock synchronization (described further on) and startup (described further on). In all cases, the condition fSyncBit=1 is only one of several conditions necessary for the frame to be used in the various synchronization mechanisms.
All frames transmitted in the dynamic segment (if present) shall be sent with fSyncBit=0.
If a node transmits a given frame on more than one channel it shall set fSyncBit to the same value on each channel.
A node shall not transmit a frame with fSyncBit=1 in more than one slot of a given communication cycle. If a node does transmit frames with fSyncBit=1, it shall do so in the same slot of every communication cycle.
A node shall only transmit a frame with fSyncBit=1 in a given slot of a communication cycle if it is configured to transmit on all configured channels for that slot (This implies that nodes transmitting frames with fSyncBit=1 on dual channel systems must transmit that frame on both channels of the system. Single channel systems implicitly meet this requirement—all frames are transmitted on all configured channels.).
Frame ID (12 bits—fFrameID)
This field contains the Frame Identifier for the frame. Each frame that may be transmitted in a cluster has a frame ID fFrameID assigned.
The frame ID fFrameID is a unique number per communication channel per communication cycle and defines the slot in which the frame is transmitted.
Valid values for fFrameID range from 1 to 4095 (In binary: from (0000 0000 0001)2 to (1111 1111 1111)2) during the protocol operation phase (POP). The Frame ID 0 is an invalid Frame ID.
The Frame ID field shall be transmitted such that the most significant bit of fFrameID is transmitted first with the remaining bits of fFrameID being transmitted in decreasing order of significance.
Payload Length (7 bits—fPayloadLength)
The Payload Length field consists of a single parameter, fPayloadLength, that is related to the number of bytes contained in the payload segment of the frame. Specifically, fPayloadLength indicates the number of bytes in the payload segment divided by two. For example, a frame that contains a payload segment consisting of 72 bytes would be sent with fPayloadLength=36. A detailed definition of the contents of the payload segment of a FlexRay frame can be found below.
The payload length field does not include the number of bytes within the header and the trailer segments of the FlexRay frame.
The maximum payload length is cPayloadLengthMax, which corresponds to a payload segment containing 2*cPayloadLengthMax bytes. The payload field shall be less than or equal to the maximum payload length: fPayloadLength≦cPayloadLengthMax.
The payload length shall be fixed for all frames in the static segment of a communication cycle. For these frames the payload length field shall be transmitted with fPayloadLength=gPayloadLengthStatic.
The payload length fPayloadLength may be different for different frames in the dynamic segment of a communication cycle. In addition, the payload length of a specific dynamic segment frame may vary from cycle to cycle. Finally, the payload lengths of a specific dynamic segment frame may be different on each configured channel. All dynamic segment frames, however, shall have 0≦fPayloadLength≦cPayloadLengthMax.
The Payload Length field shall be transmitted such that the most significant bit of fPayloadLength is transmitted first with the remaining bits of fPayloadLength being transmitted in decreasing order of significance.
Header CRC (11 bits—fHeaderCRC)
The Header CRC field contains a Cyclic Redundancy Check code (CRC) computed over the Sync Bit, Frame ID, and Payload Length fields of the frame.
The CRC is computed in the same manner on all configured channels. The CRC polynomial shall be
x11+x9+x8+x7+x2+1=(x+1)(x5+x3+1)(x5+x4+x3+x+1)
This 11 bit CRC polynomial generates a (31,20) BCH code that has a minimum Hamming distance of 6. The codeword consists of the data to be protected and the CRC. In this application, this CRC protects exactly 20 bits of data (1 bit sync+12 bits frame ID+7 bits payload length=20 bits). This polynomial was obtained from T. Wadayama, Average Distortion of Some Cyclic Codes, web site available at http://vega.c.oka-pu.jp/˜wadayama/distortion.html, and its properties were verified using the techniques described in P. Koopman, “32-bit Cyclic Redundancy Codes for Internet Applications,” Proceedings of the International Conference on Dependable Systems and Networks (DSN 2002), Washington D.C., June 2002, pp. 459-468. The initialization vector of the register used to generate the header CRC shall be (1A)HEX.
With respect to the computation of fHeaderCRC, the Sync Bit, the Frame ID and the Payload Length fields shall be fed into the CRC generator in network order, specifically the Sync Bit shall be shifted in first, followed by the most significant bit of the Frame ID field, followed by subsequent bits of the Frame ID, followed by the most significant bit of the Payload Length field, and followed by subsequent bits of the Payload Length field.
The Header CRC field shall be transmitted such that the most significant bit of fHeaderCRC is transmitted first with the remaining bits of fHeaderCRC being transmitted in decreasing order of significance.
A detailed description of how to generate or verify the Header CRC is given further on.
Cycle Counter (6 bits—fCycleCount)
The Cycle Counter field indicates the transmitting node's view of the cycle counter vCycle at the time of frame transmission.
The Cycle Counter field shall be set to fCycleCount=vCycle before transmitting a frame.
The Cycle Counter field shall be transmitted such that the most significant bit of fCycleCount is transmitted first with the remaining bits of fCycleCount being transmitted in decreasing order of significance.
FlexRay Payload Segment
The FlexRay payload segment contains 0 to 254 bytes (0 to 127 two-byte-words) of data written by the host.
Because of the limitations imposed on the representation of the length of the payload segment by the Payload Length field (fPayloadLength) of the header segment, the FlexRay Payload Segment shall consist of an even number of bytes. (The length of the payload segment indicated by fPayloadLength correlates with the number of bytes that are sent on the communication channel. It does not necessarily define the number of bytes used by the application in the payload section. The data provided by the application may be shorter than the payload section. A padding function in the communication controller fills the “missing” bytes if the configured transmit buffer is smaller than the configured payload length.)
Note that the frame CRC described below has a Hamming distance of six for payload lengths up to 248 bytes. For payload lengths greater than 248 bytes the CRC only provides a Hamming distance of four.
The first two bytes of the FlexRay payload segment may optionally be used as a message ID field, allowing receiving nodes to filter or steer data based on the contents of this field.
The subsequent bytes of the payload segment may optionally be used as network management vector. The length of the network management vector is configured by gNetworkManagementVectorLength during CC_SoftReset and cannot be changed during the protocol startup phase (PSP) or during the protocol operation phase (POP). gNetworkManagementVectorLength can be configured between 0 and 12 bytes, inclusive. The network management indication bit in the frame header indicates whether the payload section contains the network management vector (Frames that contain network management data are not restricted to containing only network management data—the other bytes in the payload section may be used to convey additional, non-Network Management data.).
If the optional message ID field is not used the network management vector (if present) starts with the first byte of the payload section.
The individual bytes within the Payload Segment shall be transmitted such that the most significant bit of the byte is transmitted first with the remaining bits of the byte being transmitted in decreasing order of significance.
FlexRay Trailer Segment
The FlexRay trailer segment contains a single field, a 24-bit CRC for the frame.
Frame CRC (24 bits—fFrameCRC)
The Frame CRC field contains a Cyclic Redundancy Check code (CRC) computed over the Header and Payload segments of the frame. The computation includes all fields in these segments (This includes the header CRC, as well as any Communication Controller-generated “padding” bytes that may be included in the Payload segment.).
The CRC is computed using the same generator polynomial on both channels. The CRC polynomial shall be
x24+x22x20+x19+x18+x16+x14+x13+x11+x10+x8+x7+x6+x3+x+1=(x+1)2(x11+x9+x8+x7+x5+x3+x2+x+1)(x11+x9+x8+x7+x6+x3+1)
This 24-bit CRC polynomial generates a code that has a minimum Hamming distance of 6 for codewords up to 2048 bits in length and a minimum Hamming distance of 4 for codewords up to 4094 bits in length. The codeword consists of all frame data and the CRC. This corresponds to H=6 protection for FlexRay frames with payload lengths up to 248 bytes and H=4 protection for longer payload lengths. This polynomial was obtained from G. Castagnoli, S. Brauer, and M. Herrmann, “Optimization of Cyclic Redundancy-Check Codes with 24 and 32 Parity Bits,” IEEE Trans. Commun., vol. 41, pp. 883-892, June 1993., and its properties were verified using the techniques described in P. Koopman, “32-bit Cyclic Redundancy Codes for Internet Applications,” Proceedings of the International Conference on Dependable Systems and Networks (DSN 2002), Washington D.C., June 2002, pp. 459-468.
The generation process of the CRC differs slightly depending on which channel the frame is being transmitted (Different initialization vectors are defined to prevent a node from communicating if it has crossed channels, connection of a single channel node to the wrong channel, or shorted channels (both controller channels connected to the same physical channel).):
With respect to the computation of fFrameCRC, the frame fields shall be fed into the CRC generator in network order (that is, the first thing into the generator is the most significant bit of the Reserved Bit field, and the last thing into the generator is the least significant bit of the last byte of the Payload Segment).
The Frame CRC field shall be transmitted such that the most significant bit of fFrameCRC is transmitted first with the remaining bits of fFrameCRC being transmitted in decreasing order of significance.
A detailed description of how to generate or verify the Frame CRC is given further on.
Null Frames
Under certain conditions a transmitting node may send a “null frame” which is a frame that contains no valid data in the payload segment. Such a frame is sent when a transmitter is configured to send in a given slot and channel of the static segment but is not in possession of valid data at the time when transmission of that slot is scheduled to begin. This could be caused by the host locking a transmit buffer and not releasing it before transmission time, or by a transmitter being configured for cycle counter filtering (see further on) and the current cycle counter does not match the filter. Additionally, a transmitting controller may indicate a null frame if the host has not successfully updated the data since the last scheduled transmission. This behavior is optional (see further on). The transmitter indicates a null frame by setting fNullFrameIndicationBit=1.
A Null Frame consists of
Null frames shall only be sent in the static segment, hence the payload length is defined by gPayloadLengthStatic.
The payload segment of a Null Frame shall be ignored by the receiver (The receiver uses the data in the Payload Segment for the Frame CRC checking process, but otherwise ignores the data.) but other fields of the frame may contain useful data (For example, the clock synchronization algorithm may make use of the arrival time of null frames with the Sync Bit field set to 1 (provided all other criteria for that frame's acceptance are met).).
byteflight Frame Format
An overview of the byteflight frame format is given in
byteflight Header Segment
The byteflight header segment consists of 2 bytes that contain several distinct fields; the Frame ID, a field of reserved bits, and the frame length. These fields are described in detail in the following sections.
Within the header segment the fields shall be transmitted in the order indicated in
Frame ID (8 bits—fBfFrameID)
This field contains the Frame Identifier for the frame. Each frame that may be transmitted in a cluster has a frame ID fBfFrameID assigned.
The frame ID fBfFrameID is a unique number per communication cycle and defines the minislot in which the frame is transmitted.
Valid values for fBfFrameID range from (0000 0001)2 to (1111 1111)2.
The Frame ID field shall be transmitted such that the most significant bit of fBfFrameID is transmitted first with the remaining bits of fBfFrameID being transmitted in decreasing order of significance.
Special Application Bits (4 bits—fBfSpecialApplBits)
This field consists of four bits that may are used by the application.
The fBfSpecialApplBits field shall be transmitted such that the most significant bit of fBfSpecialApplBits is transmitted first with the remaining bits of fBfSpecialApplBits being transmitted in decreasing order of significance.
The fBfSpecialApplBits field in the transmitting node is written by the host (The four special application bits are written by the host of the transmitting node. The communication controllers on all nodes (transmitter and receiver) treat these bits as application data.).
Frame Length (4 bits—fBfFrameLength)
The Frame Length consists of a single parameter, fBfFrameLength, which indicates the number of data bytes that are contained in the payload segment of the frame.
The frame length field does not include the number of bytes within the header and the trailer segment of the byteflight frame.
The shortest possible length is 0 bytes (fBfFrameLength=(0000)2), the longest length is 12 bytes (fBfFrameLength=(1100)2). A frame which is received with fBfFrameLength greater than 12 shall be treated as an error.
The Frame Length field shall be transmitted such that the most significant bit of fBfFrameLength is transmitted first with the remaining bits of fBfFrameLength being transmitted in decreasing order of significance.
byteflight Payload Segment
The byteflight payload segment consists of 0 to 12 bytes of data written by the host.
The individual bytes within the Payload Segment shall be transmitted such that the most significant bit of the byte is transmitted first with the remaining bits of the byte being transmitted in decreasing order of significance.
byteflight Trailer Segment
The byteflight trailer segment consists of 2 bytes that contain two distinct fields; a Frame CRC and the Frame Completion Bit. These fields are described in detail in the following sections.
Within the trailer segment the fields shall be transmitted in the order indicated in
Frame CRC (15 bits—fBfFrameCRC)
The Frame CRC field contains a Cyclic Redundancy Check code (CRC) computed over the Header and Payload segments of the frame. The computation includes all fields in these segments.
The CRC generator polynomial shall be
x15+x14+x10+x8+x7+x4+x3+1
This is the same polynomial as used in the CAN protocol as defined in ISO/DIS 11898-1:1999, Road vehicles—Controller area network (CAN)—Part 1: Data Link Layer and Physical Signaling, International Standards Organization, 1999. It is optimized for code words of up to 127 bits.
The initialization vector of the byteflight Frame CRC shall be (00)Hex.
With respect to the computation of fBfFrameCRC, the frame fields shall be fed into the CRC generator in network order (that is, the first thing into the generator is the most significant bit of the Frame ID field, and the last thing into the generator is the least significant bit of the last byte of the Payload Segment).
The Frame CRC field shall be transmitted such that the most significant bit of fBfFrameCRC is transmitted first with the remaining bits of fBfFrameCRC being transmitted in decreasing order of significance.
A detailed description of how to generate or verify the Frame CRC is given below.
Frame Completion Bit (1 bit—fBfFCB)
The Frame Completion Bit, fBfFCB, is a single bit whose sole purpose is to allow the byteflight frame to end on a byte boundary.
The Frame Completion Bit field shall be transmitted with fBfFCB=0.
Dependencies
Message ID (Optional, 16 bits—fMessageID)
The first two bytes of the payload segment of the FlexRay frame format can be used as receiver filterable data called Message ID.
The Frame CRC calculation is done inside the communication controller before transmission or after reception of a frame. It is part of the frame transmission process or the frame reception process, respectively.
The variable vCheckCRC_x denotes the result of the check of the consistency of a frame and its CRC for the respective communication channel. The calculation may be described by the following pseudocode.
The values of the protocol constants cCrcSize, cCrcInit_x, and cCrcPolynomial depend on the frame format used, i.e. the FlexRay or byteflight frame format. For the FlexRay frame format the value of cCrcInit_x also depends on the channel that is used to transmit the frame:
Short Description: Initialize the CRC shift register with the appropriate initialization value. As long as bits (vNextBit_x) from the header or payload segment of the frame are available the while-loop is executed. The number of bits available in the payload segment is derived from the payload length field. The bits (Transmitters use the bit sequence that will be fed into the coding algorithm, including any controller generated padding bits. Receivers use the decoded sequence as received from the decoding algorithm (i.e., after the removal of any coding sequences (e.g. Byte Start Sequences, Frame Start Sequences, etc.)).) of the header and payload segments are fed into the CRC register by using the variable vNextBit_x, bit by bit, in network order, e.g., for the FlexRay frame format the first bit used as vNextBit_x is the Reserved Bit field, and the last bit used is the least significant bit of the last byte of the Payload Segment.
The following comparison is only done in the receiver.
Header CRC Calculation
Among its other uses, the Header CRC field of a FlexRay frame is intended to provide protection against improper modification of the Sync Bit field by a faulty communication controller (CC). The CC that is responsible for transmitting a particular frame shall not compute the Header CRC field for that frame. Rather, the CC shall be configured with the appropriate Header CRC for a given frame by the host. This makes it unlikely that a fault in the CC that causes the value of a Sync Bit to change would result in a frame that is accepted by other nodes in the network because the CRC would not match. Removing the capability of the transmitter to generate the CRC minimizes the possibility that a message that results from a CC fault would have a proper header CRC.
The CC that is responsible for the reception of a frame shall perform the CRC computations required to check the correctness of the Header CRC field relative to the other information that is received in the frame.
The variable vCheckHeaderCRC_x denotes the result of the check for the respective communication channel. The check may be described by the following pseudocode.
The value of the protocol constants cHCrcSize, cHCrcInit, and cHCrcPolynomial are defined as follows:
FlexRay Header CRC Calculation:
Short description: Initialize the CRC shift register with the appropriate initialization value. As long as bits (vHNextBit_x) from the Sync Bit, Frame ID and Payload Length fields of the frame are available the while-loop is executed. The number of bits available is fixed (at 20) by to the frame format definition. The bits of the indicated fields are fed into the CRC register by using the variable vHNextBit_x, bit by bit, in network order, i.e., the Sync Bit followed by the most significant bit of the Frame ID field followed by subsequent bits of the Frame ID, followed by the most significant bit of the Payload Length field, and followed by subsequent bits of the Payload Length field. Transmitters use the bit sequence that will be fed into the coding algorithm. Receivers use the decoded sequence as received from the decoding algorithm (i.e., after the removal of any coding sequences, etc.).
The same procedure is used as described in Procedure 1 except starting with:
The following comparison is only done in the receiver:
The following covers the frame processing, and in particular frame reception procedure of the FlexRay protocol.
Overview
The protocol engine related frame processing consists of three steps: The first step is called frame decoding. In this step frame decoding takes place. Frame decoding shall occur according to the decoding rules specified above. The next step is called the frame reception. In this step the syntactical correctness of the frame is assured. The last step is called frame acceptance. In this step the protocol specific data that is contained in the header of each frame such as the cycle count is checked against reference values.
Frame Reception
Frame reception specifies how the syntactical correctness of a frame is established.
Syntactical Correctness
In general a frame is considered syntactically correct if no coding violations are detected during the reception of the frame, the header CRC is valid, the frame CRC is valid, and the number of bytes received corresponds to the frame length that is contained in the frame header.
Thus a frame shall be considered as syntactically correct when all of the following conditions are met:
The error-free reception of five frame header bytes, i.e. condition 1 of a syntactically correct frame is met, is considered to be a successful-header reception (S_SuccessfulHeaderReception).
A syntactically correct frame is considered to be a correct frame (S_CorrectFrame).
Frame Reception State Diagram
FR_Idle State
The reception state machine shall remain in the FR_Idle state as long as the channel is idle. In this state the node waits for the start of a reception, which occurs once the channel becomes active. The start of a reception shall cause a transition to the FR_Active state.
FR_Active State
Frame reception occurs in the FR_Active state. Hereby the syntactical correctness of a frame shall be established. The occurrence of a S_HeaderCodingError, S_InvalidHeaderCRCError, S_FrameCodingError, S_InvalidFrameCRCError shall cause a transition to the FR_Abort state.
The detection of idle at the end of a syntactically correct frame shall cause a transition to the FR_Idle state.
FR_Abort State
The reception state machine shall remain in the FR_Abort state until the channel idle state is reached on the respective channel. Once the channel idle state is reached the reception state shall change to FR_Ready.
FR_SoftReset State
The reception state machine shall remain in the FR_SoftReset state as long as the communication controller is in the CC_SoftReset state and the respective communication channel is not in the idle state.
Frame Acceptance
Frame acceptance differs depending on the current protocol phase. Whether a frame is accepted in a specific phase or not depends on the outcome of a number of checks.
FlexRay distinguishes between the startup acceptance criteria, the static segment acceptance criteria and the dynamic segment acceptance criteria.
Startup Acceptance Criteria
The startup acceptance criteria are applied when the node is in the integration path of the startup phase.
Thus a frame shall be considered compliant with the startup acceptance criteria when all of the following conditions are met that are applied to a correct frame:
A frame that complies with the startup acceptance criteria is considered to be a valid-startup frame (S_ValidStartupFrame).
If the cycle count value included in the header of a valid-startup frame is even then the frame is considered to be a valid-even-startup frame (S_ValidEvenStartupFrame).
If the cycle count value included in the header of a valid-startup frame is odd then the frame is considered to be a valid-odd-startup frame (S_ValidOddStartupFrame).
Static Segment Acceptance Criteria
The static segment acceptance criteria are applied when the node is operating in the static segment prior to having the schedule in place.
A frame shall be considered compliant with the static segment acceptance criteria when all of the following conditions are met that are applied to a correct frame:
A frame that complies with the static segment acceptance criteria is considered to be a valid-static frame (S_ValidStaticFrame).
Dynamic Segment Acceptance Criteria
The dynamic segment acceptance criteria are applied when the node is operating in the dynamic segment.
A frame shall be considered compliant with the dynamic segment acceptance criteria when all of the following conditions are met that are applied to a correct frame:
A frame that complies with the dynamic segment acceptance criteria is considered to be a valid-dynamic frame (S_ValidDynamicFrame).
Clock Synchronization
Introduction
In a distributed communication system every node has its own clock. Due to temperature fluctuations, voltage fluctuations, and production tolerances of the timing source (e.g. oscillator), the internal time base diverges between the nodes after a short time, even if all internal time bases of the nodes are started concurrently.
A basic assumption for a time-triggered system is that every node in the cluster has practically the same view of time and this common global view of time is used as the local time base for each node. In this context, “the same” means that the differences between any two nodes' views of the global time are bounded to a specified tolerance limit and that the maximum value for this difference is known as the precision.
The primary task of the clock synchronization function is to ensure the time differences between the nodes of a cluster stay within the precision.
Two types of time differences between nodes can be distinguished:
To synchronize the local time base of different nodes, methods are known for offset correction and for rate correction. In FlexRay a combination of both methods is used.
Clock Synchronization Modes
FlexRay supports both time-triggered and event-triggered clock synchronization. This chapter describes the time-triggered modes. Further on it is described how the event-triggered mode works. The appropriate clock synchronization mode should be chosen based upon the requirements of the applications to be supported by the cluster. The cluster must then be configured accordingly. Table 9 illustrates the cluster configuration conditions for the various clock synchronization modes.
FlexRay supports two modes for performing time-triggered clock synchronization.
Single-Master Clock Synchronization
With Single Master Clock Synchronization, each node individually synchronizes itself to the cluster by observing the timing of transmitted sync frames from the clock sync master.
With Distributed Clock Synchronization, each node individually synchronizes itself to the cluster by observing the timing of transmitted sync frames from other nodes. A fault-tolerant algorithm is used.
The time representation and the principles of the (distributed) clock synchronization are described in detail below.
Differences Between Distributed and Single Master Clock Synchronization
In both modes (single-master and distributed clock synchronization) the same clock synchronization algorithm is used. Differences between both modes exist
The following tables list the relevant differences for the error signaling.
Time Representation
Local Time Representation
At the beginning of the first communication cycle the “local time variables” shall be initialized (see Procedure 2).
The initialization of the first three values differs if the node reintegrates into a running cluster (see Chapter “Wakeup, Startup and Reintegration”).
The duration of one cycle shall be an integer number of a macroticks. The number of macroticks per cycle is intended to be identical in all nodes in a cluster (see
The following example only addresses the distribution of microticks over the macroticks comprising the cycle. The more complete solution must also deal with offset corrections and is described in Procedure 10.
[vMicrotick, vMacrotick]=IncrementMacrotickCounter(vMicroPerMacroCorr, vMicrotick, vMacrotick)
Notes on the above Procedure:
In a FlexRay node activities, including communication, shall be based on the concept global time, even though each individual node maintains its own view of it. It is the clock synchronism mechanism that differentiates the FlexRay cluster from other node collections with independent clock mechanisms. The global time is a vector of two values, the cycle (cycle counter) and the macrotick counter (cycle time).
General Concepts
The clock synchronization can be realized with four processes called measurement, calculation, offset correction, and rate correction. The offset correction, measurement, and calculation processes are performed sequentially. Rate correction is performed in parallel to the other three.
Time Measurement
Every node shall measure and store, by channel, the time differences vMeasureChx (in microticks) between the expected and the observed arrival time of all sync frames received during the static segment. Difference observations are marked as invalid until the frame is received completely and has passed the required validity checks.
The following procedure shall be executed during normal operation following the reception of each frame in the static segment.
The technique used for the calculation of the correction terms is a fault-tolerant midpoint algorithm (FTA/FTM). The algorithm works as follows (see
GThe value of n is adapted dynamically to the number of values in the sorted list.
HThe largest and the smallest of the remaining values are averaged for the calculation of the midpoint value. The resulting value is assumed to represent the node's deviation from the global time base and serves as the correction term (see
7. The offset correction value shall be determined by applying the FTA/FTM to the list of measured time differences.
Calculation of the Rate Correction Value
7. To prevent cluster drift that can result from an accumulation of rounding errors the rate correction term actually used is not the ideal rate correction, but a slight modification of this term towards the configuration value. The modification term is a positive integer pClusterDriftDamping that is part of node's static configuration.
During normal operation, two independent clusters can drift significantly (e.g., by the damping factor of each cluster). If synchronous operation is desired across the two clusters, external synchronization is necessary; even though the nodes within each cluster are synchronized. This can be accomplished with the synchronous application of host-deduced rate and offset correction terms to both clusters.
External clock synchronization is an optional feature of a FlexRay controller that means is not required for any controller to meet protocol conformance. However, if this feature is used in a cluster all nodes in this cluster should support this feature in order to make it useful.
Before applying them, the calculated correction values shall be checked against pre-configured limits. These limits define two regions that are referred to as the “red” and “green” regions, where the colors reflect the acceptability of the calculated value (see
If correction values are in the green region, the node is fully synchronized. No further actions are necessary.
If one of the correction values is in the red region, the node is out of synchronization. This corresponds to an error condition. Information on the handling of this situation is specified further on in the text.
The correction value is in the red region if
Once calculated, the correction terms shall be used to modify the local clock in a manner that synchronizes it more closely with the global clock. This shall be accomplished by using the correction terms to adjust the number of microticks in each macrotick.
The rate correction term shall be uniformly distributed over the entire cycle (see
Procedure Notes:
pMicroPerMacroMin is the minimum length of a macrotick in microticks.
Clock Synchronization Parameters
The following parameters are specific to clock synchronization
Wakeup, Startup, and Reintegration
Introduction
This section describes the FlexRay wakeup and startup mechanisms. Before the startup can be performed, the cluster has to be awake, so the wakeup has to be completed before startup can commence.
First a simplified description of both processes is given. The intent of these descriptions is to provide an overview of the process to facilitate a basic understanding. The technical details are intentionally deferred to later in the chapter.
Afterwards, the wakeup is described in more detail. Two examples are provided to give insights into the combined effort of the Hosts and communication controllers of the cluster in performing the wakeup.
After the wakeup section, the startup is described, first for FlexRay cluster in one of the time-triggered protocol modes, then for FlexRay cluster using the byteflight protocol mode or the event-triggered protocol mode extension.
FlexRay Wakeup and Startup—A Functional Description
This section explains the principal workings of the FlexRay wakeup and startup procedure using high-level flow charts and textual description. Later in this chapter the wakeup and startup processes are defined using state machines, giving an exact definition of those details that were left intentionally out of this section.
Wakeup
The protocol defines a wakeup pattern that, if sent over the bus without error, causes all other nodes to wake up. The communication controller provides the Host a procedure to transmit this pattern on its channels. To limit the dangers of disturbing ongoing communication, the communication controller is only allowed to transmit this pattern on one of its possibly two connected channels at a time.
The Host initiates the wakeup process, whereupon the communication controller monitors its channels for meaningful communication consisting of frames, wakeup symbols, or CAS symbols. The result of this monitoring determines further wakeup behavior. If nothing meaningful is received, the wakeup pattern is transmitted; otherwise the communication controller aborts the wakeup attempt with an error message to the Host. The transmission of the wakeup pattern is aborted if a collision is sensed during the transmission. In this case the communication controller monitors the channel(s) again to determine the reason for the collision.
The FlexRay protocol does not support partial networks, i.e., networks in which some nodes are awake and some nodes are asleep. This implies that the wakeup process attempts to wake all nodes on all available channels before startup is initiated. It also implies that a cluster that is already communicating is already fully awake and does not require any further wakeup procedures.
Wakeup Channel Monitoring
The ‘Wakeup channel monitoring’ phase ensures that no ongoing communication is disturbed by the transmission of the wakeup pattern. A listen time is defined, during which the communication controller tries to detect meaningful communication on its connected channels.
If frames are received, the wakeup is immediately aborted. A ‘received frame’ within this context is considered to have occurred if the S_SuccessfulHeaderReception event occurs for one of the configured channels. Since other nodes are already communicating with one another, no wakeup is necessary (whoever initiated the cluster startup ensured that all available channels are awake). The same applies if a wakeup symbol is received on the channel that the communication controller is attempting to awaken.
The reception of a CAS symbol prolongs the listen phase. As is described in the following sections, a frame can be expected to follow soon after the CAS if it really was a CAS symbol and not noise, so the reception of that frame is relied upon to trigger the abort. This reduces the sensitivity of the process to noise because noise perceived as a CAS symbol does not abort the process. When the listen phase is over, the communication controller waits for at least one channel to become idle. This reduces the risk of interrupting communication that is just received. It cannot be required that both channels in a two-channel system be idle since then a faulty, noisy channel could prevent the system wakeup. Most symbols and frames, especially during the startup phase where communication is more sparse and thereby more easily overlooked than during later phases, occur on both channels at the same time. E.g. the CAS symbol is transmitted simultaneously on both channels. Requiring at least one channel to be idle prevents the wakeup from beginning to transmit while such a symbol is received on both channels but before it is recognized. The communication controller allows only a predefined number of attempts to transmit the wakeup pattern. If this number is exceeded, the wakeup process is aborted.
Wakeup Pattern Transmission
If such a collision is sensed, the communication controller returns to the ‘channel monitoring’ phase. There, a collision with another wakeup pattern can be verified and signaled to the Host. After successful transmission of the wakeup pattern or the abort of the wakeup attempt, the communication controller returns to its reset state and awaits instructions from the Host.
FlexRay Startup—Time-Triggered Protocol Mode
Startup assumes all nodes in the cluster are awake (at least in the error-free case). Only nodes connected to all available channels may be configured as sync nodes (which are allowed to start up the cluster). Thus, in the absence of faults, the transmissions of a sync node are visible to every node in the cluster.
Startup establishes a global timing scheme that—within certain bounds—is the same within all nodes in the cluster. The ability to calculate the proper point in time for transmitting and/or receiving each frame relies on it. Also, the clock synchronization algorithm relies on this basic timing scheme so that all nodes can apply clock correction terms simultaneously (at the end of odd-numbered cycles).
The maximum clock drift that can occur between any two nodes in the cluster within one cycle has to be known in order to configure the necessary listen timeouts.
Until a node enters the protocol operation phase that succeeds the protocol startup phase (see below), its message buffers do not need to be updated. No data frame transmission and reception is possible before that time.
Each correctly configured node begins the startup process (after finishing the wakeup process for coldstart capable nodes) by entering the ‘channel monitoring and selection of startup path’ phase. Each node that is allowed to start up the cluster monitors its connected channels and participates in the process of selecting the initiator of the coldstart process. This process is designed to eliminate all but one sync node, which then assumes the responsibility for performing the coldstart. This coldstart initiator traverses the right path in
All other nodes passively wait for the selected node to initiate communication. The reception of a sync frame with an even cycle counter (indicated by S_ValidEvenStartupFrame) causes them to enter the integration path shown on the left of
After the designated check has been successful, the node enters normal operation and is allowed to transmit data frames.
Channel Monitoring and Selection of Startup Path
The sync nodes that are allowed to start up the cluster wait for their listen time-out to expire. A received frame (S_SuccessfulHeaderReception) or CAS symbol (S_CASReception) prolongs the time-out. When the time-out expires, the node enters the coldstart path. In case no activity at all is detected, a special timeout expires and thereby enables a fast startup.
Selection of ColdStart Initiator
Several nodes may enter the selection phase nearly simultaneously and transmit their CAS symbol at nearly the same time. This situation is resolved by requiring nodes in this phase to reenter the monitoring phase if they receive a sync frame or a CAS symbol. Due to the unambiguous assignment of slots to the various nodes, all nodes but one (usually the one the earliest slot) will leave this phase after at most three cycles (clock oscillator deviations may require a second or third cycle for collision resolution).
After three cycles the node enters the ‘Communication established’ check.
Check on Successfully Established Communication
At the end of each cycle it reviews the sync frames it has received during the current cycle. If it has received more sync frames that do not fit into its communication schedule than sync frames that do, it aborts the startup and reenters the monitoring phase. This behavior prevents the creation of several cliques with disagreeing perceptions of time.
At the end of each odd cycle, the coldstart initiator performs additional tests. If at least one pair of sync frames has been received, it performs the clock synchronization using these pairs (see Chapter “Clock Synchronization”). If the resulting correction values are outside specified bounds, it aborts the coldstart and reenters the monitoring phase. If the values are within the specified bounds, and at least one pair of sync frames has been received, it enters normal operation mode. This ensures that at least two sync nodes agree upon the timing schedule before any data frames may be transmitted. It enables stable clock synchronization for the two nodes and all other nodes that subsequently integrate into the now established communication.
A counter observes how many cycles the coldstart initiator spends in the coldstart path. If too many cycles pass without this node entering the normal operation mode, startup is aborted and the node may not again try to start up the cluster. This prevents faulty nodes from persistently disturbing the startup.
Initial Synchronization
If this reference node has been the reference node in a previous unsuccessful integration attempt, it is not selected and another sync frame is awaited. If no sync frame from another node is received within a specified amount of time, the previously unsuccessful reference node is given another chance.
The integrating node sets its own cycle counter to the value received in the sync frame and awaits the sync frame of the reference node in the following odd cycle. Using this pair of frames, the integrating node corrects its clock towards the timing of the transmitter of these frames. If no sync frame with an odd cycle counter follows the even-numbered frame that triggered the integration attempt, the node aborts the integration.
Check on Successful Integration
At the end of each cycle, it determines if the majority of the observed sync frames are consistent with the timing scheme it has derived. If not, it declares its integration attempt failed and reenters the monitoring phase. Note that it tries to select another sync node as reference node for the ensuing new integration attempt as described above.
At the end of each odd cycle, it performs the offset clock correction as described in Chapter “Clock Synchronization”. The calculated clock correction terms for offset and rate are compared to specified boundaries. The boundaries for the offset correction are more relaxed during the first time the correction is performed after entering this check phase. If either rate or offset correction value is outside the defined boundaries the integrating node aborts the integration attempt and reenters the monitoring phase.
Also at the end of each odd cycle, the node counts the number of slots where it has received even/odd cycle pairs of sync frames. If no pairs have been received the node aborts the integration attempt because sync frames should have been received from the reference node if nothing else. If more than one pair has been received, the node enters the normal operation mode. If the integrating node is allowed to transmit sync frames itself and one pair of sync frames has been received, it also enters normal operation. In normal operation, i.e. during protocol operation phase, the node is allowed to transmit data and sync frames (if not configured otherwise).
Wakeup and Startup Modes—Global Structure
From the CC_SoftReset state, the host shall be able to initiate the cluster wakeup via the transition G1 (see
In the time-triggered protocol modes mode, i.e., the time-triggered distributed (TT-D) mode and the time-triggered master-controlled (TT-M) mode, a startup mechanism based on sync frames shall be triggered by the transition G2.
For FlexRay clusters running in TT-D mode a fault-tolerant, distributed startup shall be performed. In TT-M mode a master controlled startup shall be performed, but still all mechanisms build on a time-triggered communication cycle.
For the byteflight (BF) protocol mode and the event-triggered (ET) protocol mode the necessary startup machine transition (G3, G4 or G5, G6 respectively) depends on whether a node is configured as a master node or not.
For the event-triggered protocol mode, the startup behavior is described further on.
Transitions W1 and W5 are described in Table 13 and transition A1 is described in Table 14.
Cluster Wakeup
This section describes the wake-up path preceding the communication startup.
Any node entering startup that has coldstart capability shall first execute the wakeup procedure. Otherwise it cannot be ensured, that the cluster is awake (or at least that the wakeup has been triggered) before the node begins the startup procedure.
The Host completely controls the wake-up procedure. The communication controller provides the Host the ability to transmit a special wake-up pattern (see above) on each of its available channels. It ensures that ongoing communication on this channel is not disturbed. The communication controller cannot guarantee that all Nodes connected to this channel wake up due to the transmission of the wakeup pattern (For example, the transmission unit of the bus driver might be defective.), since these nodes cannot give feedback until the startup phase. The Host has to be aware of possible failures of the wakeup and act accordingly.
The wakeup procedure enables single-channel devices in a two-channel system to trigger the wakeup, by only transmitting the wakeup pattern on the single channel to which they are connected. Another node then assumes the responsibility for waking the other channel. Any node that has coldstart capability must wake both channels before entering startup. Any node without coldstart capability connected to two channels must wake both channels, if it wants to wake up the cluster.
The wakeup procedure tolerates any number of nodes simultaneously trying to wake up a single channel and resolves this situation such that only one node transmits the pattern. Additionally the wakeup pattern is collision resilient, so even in the presence of one faulty node also transmitting a wakeup pattern, the wakeup can be assured.
Waking One Channel
The wakeup of the FlexRay system has to be initialized by a Host. The Host of a Node may command its communication controller to send a Tx-wakeup pattern on channel vWakeupChannel, while the communication controller itself is in the CC_SoftReset state. The communication controller then enters its wakeup mode and tries to transmit a Tx-wakeup pattern on the configured channel. Finally, it signals back the status of the wakeup attempt to the Host (refer to the wakeup status vector further on in the text).
The wakeup mode of the communication controller involves three states:
The structure of the Communication Controller Wakeup State Machine is shown in
The CC_SoftReset state is part of the overall protocol state diagram. Only in the CC_SoftReset state can the Host configure the communication controller and initialize wakeup on channel vWakeupChannel (G1). After the wakeup, the communication controller returns into the CC_SoftReset state and signals to the Host the result of the wakeup attempt:
The parameter gWakeupMax defines the maximum number of wakeup attempts allowed. The parameter vWakeupChannel defines the channel that the communication controller shall wake.
CC_WakeupListen State
The purpose of this state is to ensure that the transmission of the Tx-wakeup pattern does not disturb existing communication on channel vWakeupChannel.
The counter vWakeupCount is set to zero upon transition G1 from the CC_SoftReset to the CC_WakeupListen state.
Two timers are defined:
Both timers are set to zero upon entering the CC_WakeupListen state.
The vdWakeup timer expires upon reaching gdCycle+gdMaxDrift (one cycle length plus a safety margin). The vdWakeupNoise timer expires upon reaching the amount of time, during which the cluster is able to keep the clock synchronization within the maximum specified tolerance band.
The vdWakeup timer is reset, whenever activity is received on either channel.
The vdWakeupNoise timer is reset, whenever a valid CAS symbol is received on any channel (S_CASReception occurred). A CAS symbol is—depending on the bitrate—rather short, so noise could be misinterpreted as a CAS symbol. To prevent an abort of the wakeup procedure due to noise, only the counter is reset when a CAS symbol is received. Only the frame following the CAS symbol will trigger the abort. Furthermore, it could be difficult to distinguish a CAS symbol from the first portion of a Tx-wakeup pattern.
If the communication controller receives a frame header without coding violation on any channel (indicated by S_SuccessfulHeaderReception), it reenters the CC_SoftReset state and sets the vWakeupFrameHeaderReceived flag (W1). A communication controller must not transmit a Tx-wakeup pattern when ongoing communication is detected. The reception of a frame header without a coding violation is sufficiently robust for the detection of ongoing communication.
If the communication controller receives a valid Rx-wakeup symbol on channel vWakeupChannel, it reenters the CC_SoftReset state and sets the vWakeupSymbolReceived flag (W1). (The detection shall be more relaxed than the rigid definition of the Rx-wakeup symbol to take topology effects, collisions and different clock speeds into account.) An Rx-wakeup symbol on the other channel (if available) is ignored.
If either of the timers expires and (vWakeupCount<gWakeupMax) and at least one channel is in idle state, the communication controller enters the CC_WakeupSend state (W2). All meaningful communication during startup is transmitted on both channels at the same time. By requiring one channel to be idle, it is ensured that no such transmission is interrupted by the transmission of the CAS symbol (within the uncertainty of the transmission delay). It cannot be required that both channels were idle, since one channel could be defective and noisy thereby preventing any wakeup and startup attempt.
If either of the timers expires and (vWakeupCount==gWakeupMax) and at least one channel is in idle state, the communication controller reenters CC_SoftReset and sets vWakeupFailed in the wakeup status vector (W1). The wakeup is only aborted after reaching the maximal number of tries when a timer expires. This gives the communication controller time to listen to the network for ongoing communication or wakeup patterns after it stepped back from the CC_WakeupSend state.
CC_WakeupSend State
In this state, the communication controller transmits the Tx-wakeup pattern on the configured channel and checks for collisions.
Upon entering the CC_WakeupSend state, vWakeupCount is increased by one.
The Tx-wakeup pattern as described above is sent on the channel vWakeupChannel.
During the idle phases of the Tx-wakeup pattern, the communication controller listens for activity on the bus. If the communication controller receives more than gdWakeupMaxCollision of continuous ‘active low’ during an idle phase (This check is described in detail above and the occurrence of this event is signaled by S_CheckWakeupCollision.), it immediately steps back into the CC_WakeupListen state (W6). Without this listening and aborting, not all collisions would lead to recognizable wakeup symbols (remember that the Tx-wakeup pattern itself is only resilient against collisions of up to two such patterns). The smaller pdWakeupMaxCollision is, the better the collision detection gets, but the EMC robustness degrades. A lower bound on the value might be the equivalent to 400 ns for a 10 Mbit/s system.
After a complete, non-aborted transmission of the Tx-wakeup pattern, the communication controller reenters the CC_SoftReset state and sets the vWakeupComplete flag in the wakeup status vector (W5).
Wakeup Application Notes
Since the Host is closely involved in the wakeup of the FlexRay cluster, in this section the required Host behavior is described. The Host has to coordinate the bus guardian and the communication controller wakeup modes. It has to coordinate the wakeup of a two channels and to decide whether, or not, to wake a specific channel.
Bus Guardian
In systems that have a bus guardian installed, the Host has to command the appropriate bus guardian to enter its wakeup mode before it commands the communication controller to perform a wakeup. After the communication controller returns to the CC_SoftReset state, the bus guardian must be commanded to leave its wakeup mode.
Nodes with Coldstart Capability
Each node that is configured to perform a coldstart must perform a wakeup as described above before continuing with startup. For two-channel clusters it is generally advisable to use the procedure described below.
For FlexRay clusters in TT-D mode this includes all sync nodes that are not configured in a listen only mode. For FlexRay clusters in TT-M mode this includes the Master Node.
Actions of the Host to Initialize the Wakeup
A Host that wants to perform a wakeup of the cluster has first to check its bus driver(s) to see if they have received Rx-wakeup patterns. If the bus driver of a channel did not receive an Rx-wakeup pattern, the Host must try to wake this channel.
Each communication controller that is configured with coldstart capability relies upon its Host to have awakened the cluster prior to letting it enter the startup phase. Only the Host can ensure that the wakeup phase is completed before any startup attempt is performed.
The Host must not wake channels whose bus drivers have received an Rx-wakeup symbol unless startup is not possible without an additional wakeup of those channels. This is done to speed up the wakeup process and to limit the amount of traffic on the channels; thereby, the number of collisions during this phase is reduced.
The Host has to command the bus guardian (if available) of the channel vWakeupChannel to enter its wakeup mode. Then the Host uses the procedure described above to initialize a wakeup of channel vWakeupChannel. The communication controller may return several different status conditions that are described in the following section. Before evaluating these conditions, the Host must command the bus guardian of channel vWakeupChannel to leave its wakeup mode. If the Host does not cause the BG to leave its wakeup mode (BG_WakeUp), the BG leaves it after a fixed, non-configurable amount of time and enters the BG_FailSilent mode.
Reactions of the Host to the Status Flags Signaled by the Communication Controller
This section defines the various status conditions that the communication controller can return to the Host as outcomes of its wakeup attempt and the recommended reactions of the Host. These conditions are generally mutually exclusive, but in two-channel systems an Rx-wakeup symbol could be received on channel vWakeupChannel while a valid frame header is received on the opposite channel at the same time. The wakeup still fulfills its function when the exit conditions are given a precedence and are thereby made mutually exclusive (highest to lowest priority): Transmission complete, a frame header without coding violation has been received, an Rx-wakeup symbol has been received, the allowed number of wakeups has been exceeded.
A Frame Header without Coding Violation has Been Received
When a frame header without coding violation is received by the communication controller on either available channel during CC_WakeupListen, the communication controller aborts the wakeup, even if channel vWakeupChannel is still silent.
The Host must not configure the communication controller to perform additional wakeup attempts, since this may disturb ongoing communication. Instead, it shall configure the communication controller to enter the start-up to integrate into the already running cluster.
An Rx-wakeup Symbol has Been Received
The communication controller has received an Rx-wakeup symbol on channel vWakeupChannel during its CC_WakeupListen state. This means, that another Node is already waking this channel. To prevent collisions of Tx-wakeup patterns on channel vWakeupChannel, the communication controller aborts the wakeup.
If another channel is available that is not already awake, the Host shall configure the communication controller to wake this channel. Otherwise, it shall configure the communication controller to enter startup.
The Transmission has Been Completed
The communication controller has transmitted the complete Tx-wakeup pattern on channel vWakeupChannel.
If another channel is available that is not already awake, the Host shall configure the communication controller to wake this channel. Otherwise, it shall configure the communication controller to enter startup.
The Allowed Number of Wakeup Attempts has Been Exceeded
The communication controller was not able to transmit a complete Tx-wakeup pattern because each of its gWakeupMax attempts to transmit it resulted in at least gdWakeupMaxCollision occurrences of continuous ‘active low’ during an idle phase of the pattern. Two possible reasons for this are heavy EMC disturbances on the bus or a babbling node. One cause, not responsible for this abort, is the collision with another Tx-wakeup pattern. Such a collision can be recognized after reentering the CC_WakeupListen state and would be signaled by setting the flag vWakeupSymbolReceived.
Since no complete Tx-wakeup pattern has been transmitted, it cannot be assumed that all nodes have received an Rx-wakeup symbol. The Host may use the retransmission procedure described below.
Waking Two Channels
This section describes how the Host can wake both channels of a two-channel system.
It is forbidden for a communication controller to send a Tx-wakeup pattern on both channels at the same time. (This rule was established to ensure that an erroneous communication controller couldn't disturb ongoing communication by transmitting wakeup patterns on both channels at the same time.) So, if it is necessary to wake both channels, the host must wake them one at a time. The Host can use the procedure for sending a Tx-wakeup pattern on one channel (see above) twice—once for the first channel and after that for the second channel.
For an example of this procedure, see below.
Retransmission of Wakeup Symbols
Some events may prevent a cluster wakeup by a Tx-wakeup pattern without the transmitting communication controller being able to immediately detect it (E.g. an erroneous star that needs significantly more time to start up and to be able to forward messages.). After a defined amount of time, the Host can detect such an error when the cluster does not start up after wakeup as expected, or the Host's own communication controller's attempt to start up the cluster fails.
The Host may then perform a retransmission of the Tx-wakeup pattern. It has to command the bus guardian (if available) of the chosen channel into its wakeup mode. The communication controller has to be brought into the CC_SoftReset state; then the procedure described above can be used to transmit a Tx-wakeup pattern on channel vWakeupChannel. Afterwards, the bus guardian must be commanded to leave its wakeup mode.
Note that this may disturb ongoing communication of other nodes if the node performing the wakeup procedure experiences an incoming link failure.
Transition to Startup
It may be several hundred milliseconds (depending on the hardware used) before all nodes and stars are completely awakened and configured. To perform a startup in the FlexRay time-triggered distributed protocol mode, at least two sync-Nodes are needed. A node is called a sync node if the host has set pSyncNode in the host interface. For a non-sync node, pSyncNode is set to false. The configuration parameter can only be set or cleared in the CC_SoftReset state. The transmission of more than one sync frame by a node within one cycle has to be prevented by the communication controller. For this protocol mode, sync-Nodes shall generally not enter the CC_StartupListen state immediately after performing the wakeup unless the vColdStartInhibit flag is set. A communication controller without the vColdStartInhibit flag set will try to start up the cluster, but may fail, since no other communication controller may be ready to join the communication before the coldstart initiator aborts the startup attempt because it has reached the maximum number of cold start attempts allowed. (This scenario will still result in a successful start-up, as long as some of the other sync nodes are configured to initialize the start-up. The node that has woken the network and failed to start-up will still join the communication started by another node.) The Host must clear this flag after sufficient time has passed to allow the other nodes in the cluster to awaken.
Transmission of Wakeup Symbols During Normal Operation
During normal operation, the Host can set the payload of frames that it transmits to a pattern that mimics two consecutive Tx-wakeup symbols (This applies only for NRZ coding defined above). Note that since the wakeup symbol has a fixed length, the number of bits necessary to construct a payload that is equivalent to two such wakeup symbols depends on the bit rate of the system. It may not be feasible to construct such a payload for every combination of allowed bit rate and static slot length (especially short ones). However, in this case it may still be possible to construct a dynamic frame with this payload if the dynamic segment is sufficiently long to allow it. Depending on the system configuration, it may even be possible to use two consecutive static frames.
This section describes in more detail the Host-communication controller interaction for the wakeup in two typical situations. Firstly, it is described, how one Host wakes both channels of a two-channel system. Secondly, it is described, how one node connected to only one channel of a two-channel system wakes this channel and how a sync node (connected to both channels) wakes the other channel.
Since also the transition between wakeup and startup is described, the examples may be more readily understood with a prior understanding of FlexRay startup, which is described in subsequent sections.
Two Channel Wakeup by One Node
This section describes a FlexRay system with two channels configured and operating in time-triggered distributed protocol mode. It is described how one sync-node first wakes the cluster and then performs the startup.
See below for details on the startup procedure.
Wakeup Forwarding by One Node
This section describes a FlexRay system with two channels configured and operating in time-triggered distributed protocol mode. It is described, how first a non-sync node connected to only one channel wakes its channel, and how then a sync node forwards the Tx-wakeup pattern to the opposite channel and initiates the communication.
Since some other Node had already awakened channel B, Host 2 assumes that other Nodes are already awake and initialized. It clears the vColdStartInhibit flag and commands CC 2 to enter the CC_StartupListen state.
See below for detailed information on the startup procedure.
Communication Startup and Reintegration
Corresponding to the supported protocol modes, three different mechanisms for communication startup are specified. Clusters operating in the time-triggered distributed (TT-D) mode follow a fault-tolerant, distributed startup strategy; for the time-triggered master-controlled (TT-M) mode this is reduced to a master controlled system behavior (refer to transitions indicated by prefix ‘S’; see
The cluster wake-up must precede the communication startup in order to ensure that all mechanisms defined for the startup work properly. After initial wake-up the whole network behaves like a broadcast medium.
Startup—Time-Triggered Protocol Mode (TT-D and TT-M)
In general, a node may enter communication (i.e., the CC_NormalOperation state) via the coldstart path (CC_ColdStartICW and CC_ColdStartVCW state sequence) initiating the schedule synchronization, or via the integration path (CC_InitSync and CC_IntegrationVCW state sequence) integrating into an existing communication schedule. Only sync nodes are allowed to enter via the coldstart path, and they have to check in advance whether there is already channel activity, or not (see below).
In order to establish a global media access schedule, the initial synchronization of the periodic TDMA schedule must be coordinated among all connected communication nodes. Since any sync node is permitted to initiate schedule synchronization, simultaneously started and conflicting attempts by different sync nodes must be resolved. Each node initially transmits a Collision Avoidance Symbol (CAS, see above) specifically for this purpose, before initiating the periodic schedule. This symbol represents a kind of arbiter, which is used to resolve initial collisions of nodes simultaneously attempting to set up the communication schedule.
Both non-sync nodes and sync nodes start passive integration via the integration path as soon as they receive sync frames from which to derive the TDMA schedule information. During integration the node has to adapt its own clock to the global clock (rate and offset) and has to make its cycle time consistent with the global schedule observable at the network. Afterwards, these settings are checked for consistency with all available network nodes. Only if these checks are passed, can the node leave the integration phase and actively participate in communication.
Several modes are supported that restrict the node's ability to communicate or to initiate startup actively (see below). These modes are configurable by the host and are explained within in their respective sections.
Startup Timeouts
A sync node shall maintain two different timers supporting two timeout values, vdStartup and vdStartupNoise. The expiration of either of these timers causes the node to leave the initial sensing phase (CC_StartupListen state) with the intention of starting up communication. Even though the following description is based on the assumption that these timers increment their values (starting with a reset value of zero), it is allowable for the implementation to choose another realization (e.g. counter decrement).
The node local listen-timeout vdStartup shall have the same length (gdStartup) for each node in the system that is configured to send an initial CAS during startup (sync node). The upper bound gdStartup limits the listen time used by a node to determine if there is already communication between other nodes or at least one sync node actively requesting the integration of others.
Due to the initial clock drift between the set of nodes that are already actively communicating (transmitting sync frames), and the node that is attempting to integrate, the listen-timeout must consider the maximum accumulated drift over the length of one cycle. Therefore the time-out interval gdStartup shall be constrained by the following inequality (gdStartup is derived internally from the configuration parameters gdCycle and gdMaxDrift. In addition, the upper boundary for the listen timeout, vdStartupNoise, is a multiple of gdStartup and is configurable using the parameter gStartupNoise.):
gdStartup≧gdCycle+gdMaxDrift
The maximum allowable drift between any two clocks in the network is an important system parameter and is known at design time. This ‘worst case’ period has to be covered by configuring gdMaxDrift (unit: macroticks) accordingly.
While counting is based on macrotick granularity, the reset of the timer vdStartup shall be performed asynchronously to the macrotick clock. The timer vdStartup shall be reset (vdStartup=0) upon entering the CC_StartupListen state.
Further reset conditions for the timer vdStartup are defined as follows (see also
Once the listen-timeout vdStartup expires (vdStartup=gdStartup), neither an overflow nor a cyclic restart of the timer shall be performed. The status has to be kept for further processing by the startup state machine (see Table 14).
At the same time the listen-timeout vdStartup is started for the first time (transition from CC_SoftReset to the CC_StartupListen state), a second timeout vdStartupNoise shall be started with vdStartupNoise=0. This additional timeout is used to improve reliability of the startup procedure in the presence of noise.
While counting is based on macrotick granularity, the reset of the timer vdStartupNoise shall be performed asynchronously to the macrotick clock. The timer vdStartupNoise shall be reset upon entering the CC_StartupListen state.
Further reset conditions for the timer vdStartupNoise and its behavior are defined as follows (see also
Once the listen-timeout vdStartupNoise expires (vdStartupNoise=gStartupNoise*gdStartup), neither an overflow nor a cyclic restart of the timer shall be performed. The status has to be kept for further processing by the startup state machine (see Table 13).
Since the timeout vdStartupNoise won't be reset if channel activity is sensed (see
Listen-Only Mode
A FlexRay node shall support a listen-only mode. In listen-only mode, the node shall be able to receive all frames after successful integration to the running communication; i.e. the node is fully synchronized and performs the clock synchronization in order to keep this status. In comparison to the normal operation mode (CC_NormalOperation state) the node does not actively participate in communication, i.e. neither symbols nor frames are transmitted.
Setting vListenOnly to true while in the CC_SoftReset state configures the listen-only mode. vListenOnly cannot be set to true after leaving the CC_SoftReset state, but can be cleared at any time.
This mode supports communication diagnosis (‘monitoring’) as well as dedicated wake-up strategies, which require host interaction (vListenOnly subsequently cleared) in order to actively participate in communication after wake-up.
In listen-only mode, sync nodes behave like non-sync nodes during startup. Specifically, this applies to the prerequisites for transitioning from CC_IntegrationVCW to CC_PassiveOperation. Passing the validation check requires that at least two different sync nodes are already synchronized and able to communicate. Please refer to the description of the validation check described below.
ColdStart-Inhibit Mode
A FlexRay node shall support a coldstart inhibit mode. In coldstart inhibit mode the node shall be prevented from initializing the TDMA communication schedule. If the host has set vColdStartInhibit, the node shall not be allowed to initialize the cluster communication after having checked on existing communication, i.e. entering the coldstart path is prohibited. The node shall be allowed to integrate to a running cluster or to acknowledge another node, which initially tries to start the cluster communication.
Coldstart inhibit mode vColdStartInhibit can be set in the CC_SoftReset state only. vColdStartInhibit cannot be set after leaving the CC_SoftReset state, but can be cleared at any time. vColdStartInhibit can be mapped to the gColdStartMax configuration parameter, which utilizes the zero value to keep the node from starting the network on its own initiative (refer to the chapter “host interface”). It has to be checked whether the parameter gColdStartMax can be accessed during run time, i.e., after leaving CC_SoftReset state, as this is required for the “coldstart inhibit” function.).
Once the node is synchronized, vColdStartInhibit shall not restrict the node's ability to receive frames or to transmit frames.
Startup State Diagram—Time-Triggered Protocol Mode (TT-D and TT-M)
CC_StartupListen State
A FlexRay node shall enter the CC_StartupListen state from the CC_SoftReset state when the communication controller is ready to attempt communication startup or enter a running network. If the communication controller is capable of initiating a startup attempt, the Host shall first ensure that the cluster is awake before letting the communication controller enter the CC_StartupListen state.
When entering the CC_StartupListen state from CC_SoftReset or re-entering from any other state of the startup state machine other than the CC_StartupListen state itself, sync nodes shall (re-)start their listen-timeout vdStartup and their listen-timeout with noise vdStartupNoise (see above).
The global cluster constant gColdStartMax defines the number of cycles a node shall be permitted to attempt a coldstart, i.e. the number of cycles a node may reside in coldstart path. Once vColdStartCount is equal to gColdStartMax the node shall not enter the coldstart path (This could be achieved by preventing the restart of the listen-timeouts vdStartup and vdStartupNoise.). vColdStartCount is only reset upon entering the CC_StartupListen state from the CC_SoftReset state.
Non-sync nodes shall not enter the coldstart path, because these nodes are not allowed to initiate communication on their own. This could be achieved by several means, e.g. for non-sync nodes gColdStartMax is configured to zero, or the listen-timeouts vdStartup and vdStartupNoise are not maintained.
Upon the reception of an S_ValidEvenStartupFrame the integration path shall be entered via the CC_InitSync state. Furthermore, vRefSync must be zero (see strategy defined in order to prevent a node from repetitively choosing a faulty node as a reference). fFrameID shall be stored to vRefSync, in order to store the identifier of the reference frame, and thereby a representation of the corresponding sync node for further processing (see below).
If at least one of the channels is in channel idle state, at least one of the listen-timeouts vdStartup or vdStartupNoise has expired and the entry condition to the integration path is not fulfilled, the node shall enter the CC_ColdStartICW state.
A node that failed to integrate to the reference node that was selected to derive initial rate and offset information, shall not utilize the same node for an integration attempt during the next communication cycle. Therefore, a node shall maintain a history of reference nodes it has attempted to use in order to avoid repetitive selection of the same reference node. It must be ensured that a node in the CC_StartupListen state selects a sync node different from the former reference node if present.
If an integration attempt fails with a selected reference node the reference node shall not be permanently excluded from the list of potential reference nodes. Due to a transient disturbance the integration might have failed even though the reference node operated fault-free (A corrupted sync frame might prevent the transition in CC_InitSync state or CC_IntegrationVCW state). Therefore, the following strategy shall be applied after an integration attempt has failed (see below).
In TT-M mode, a non-sync node shall not perform the above-defined strategy. In TT-M mode, a single sync node, i.e. the master exists. All non-sync nodes and their synchronization are fully dependent on the master node. Therefore, this node is never excluded as a potential reference. When entering the CC_StartupListen state from any other state, vRefSync is cleared (i.e., set to zero).
When re-entering the CC_StartupListen state from any state, the rate correction value shall be reinitialized with pMicroOverheadperCycleNom.
CC_ColdStartICW (Initial Check Window) State
Only sync nodes shall be allowed to enter the coldstart path via the CC_ColdStartICW state. The phase, for which a sync node is in the CC_ColdStartICW state, shall be used for the following purposes:
In the CC_ColdStartICW state, a sync node shall transmit an initial CAS symbol and shall then transmit its configured sync frame periodically to enable the startup of the entire network. By starting the first communication cycle after CAS transmission, the cycle counter is initialized to zero; thus the first sync frame is transmitted with fCycleCount equal to zero.
By transmitting the CAS symbol, other sync nodes are prevented from entering the coldstart path. If more than a single sync node transmits the CAS symbol simultaneously, those nodes all enter the CC_ColdStartICW state simultaneously. However, their cycle timing is inherently synchronized so this scenario is resolvable during the next cycles while in CC_ColdStartICW state.
The reception of a valid CAS symbol (S_CASReception occurred) or a frame header (indicated by S_SuccessfulHeaderReception) on any channel shall cause the node to re-enter CC_StartupListen state immediately.
In the CC_ColdStartICW state a node shall not transmit normal data frames, which are frames without sync bit set.
A node shall remain in the CC_ColdStartICW state for a certain period determined by the initial coldstart phase (gdInitialColdStartPhase). A timer vdInitialColdStartPhase shall be reset and started, when CC_ColdStartICW is entered. This timer shall cover the initial slot used for CAS transmission as well as three complete communication cycles (refer to the definition of gdInitialColdStartPhase in the following part of the description). Thereby, gdInitialColdStartPhase determines the time a node stays in the CC_ColdStartICW state before entering CC_ColdStartVCW.
Upon the transition into another state the timer vdInitialColdStartPhase shall be stopped.
A node in time-triggered distributed (TT-D) mode with an “incoming link failure” shall stop transmission after a predefined interval of time. Thereby other sync nodes are enabled to take over responsibility of starting the communication for the cluster.
For this feature the additional counter vColdStartCount shall be maintained.
A node in time-triggered master-controlled (TT-M) mode shall not maintain the vColdStartCount counter.
CC_ColdStartVCW (Validation Check Window) State
In the CC_ColdStartVCW state, the node shall maintain periodic transmission of its sync frame on cycle basis—but no other frames shall be scheduled for transmission. In addition, the node shall perform a validation check at the end of each cycle in order to assess the network image perceived for the current cycle. Depending on the result of the validation check, the node
This list applies for sync nodes in time-triggered distributed (TT-D) mode. For FlexRay clusters operating in time-triggered master-controlled (TT-M) mode, the coldstart initiator is the only node configured to send sync frames. Therefore, this node shall not wait for any response and shall perform the transition into the CC_NormalOperation state at the end of the cycle.
By transmitting the sync frame, the coldstart initiator requests other nodes to join into the given communication schedule. Once these nodes (At a minimum, the joining of one further sync node is required for TT-D protocol mode.) become active, the coldstart initiator shall leave the coldstart path by entering normal operation, i.e. the protocol operation phase (POP). In order to transfer a coldstart initiator in TT-D mode into the CC_NormalOperation state, the response of other active nodes must pass certain validation criteria. The term ‘response’ and the validation check rules are described in detail below.
Two different mechanisms shall contribute to the validation check.
To prepare for the validation check, the node shall observe and assess the communication over one cycle. Two event counters per channel (vValidSyncCount[ch] and vInvalidSyncCount[ch]) shall be administrated in order to support decision-making. In accordance with the static segment acceptance criteria (refer to Chapter ‘Frame Processing’ above), a clear distinction between several possible cases can be made for each slot. These slot scenarios shall be judged and counters shall be incremented according to the following rules:
The validation check counters shall be initialized for all configured pChannel channels upon each new cycle start as follows:
The node shall consider itself to operate correctly and shall therefore initialize the counters vValidSyncCount[ch] accordingly (pre-set to one).
The validation check shall be passed, if vValidSyncCount[ch] is greater than vInvalidSyncCount[ch] for all configured channels. The transition to CC_NormalOperation shall be only permitted, if the check is passed with vValidSyncCount[ch]>1 on at least one of the pChannel channels.
With the transition to CC_ColdStartVCW and with each new cycle start in CC_ColdStartVCW, the variable vColdStartCount shall be incremented by one. At the end of each cycle, vColdStartCount shall be compared to the allowed maximum gColdStartMax. If vColdStartCount is equal to gColdStartMax, the node shall re-enter the CC_StartupListen state.
In CC_ColdStartVCW, the node shall execute the global clock synchronization for offset and rate according to the regular rules. CC_ColdStartVCW is the latest point in time the clock synchronization including measurement and correction phase has to be active. The node could perform clock synchronization already in the ColdStartICW state. This might be advantageous for the TT-M protocol mode and the establishment of the two-cycle based rate measurement phase. According to the definition of the regular rate measurement phase, all sync frames shall be registered and pair-wise (sync frames with same frame identifier) evaluated for clock synchronization. The offset measurement phase shall be applied in accordance to the regular scheme, too. This means that for each cycle with an odd cycle counter value the related sync frames shall be used to determine next offset correction term. The sync frames received from nodes that have integrated upon the coldstart attempt are delayed by two times the overall (network) propagation delay. This has to be considered for the setting of the offset correction term boundary (anyway).
The node in the CC_ColdStartVCW state requires at least one additional matching pair of sync frames suitable for rate measurement (same frame identifier, consecutive occurrence in ‘even/odd’ cycle order), in order to fulfill one of the necessary prerequisites for entering CC_NormalOperation. Upon reception of two valid, matching frames (S_ValidStaticFrame) in even/odd cycle order, the node in CC_ColdStartVCW shall increment the counter vSyncPairs. As long as the node does not receive a response, it performs the clock correction based on one “pair of matching sync” frames, namely its own transmissions (this is taken into account by using the value 0 as ‘measurement sample’). The introduction of vSyncPairs is done in order to ease the description of several distinctions to be made in the specification. As an auxiliary variable, it is not required that this parameter is used for an implementation of a FlexRay protocol controller. With the beginning of each rate measurement phase in CC_ColdStartVCW state, the counter vSyncPairs shall be reset to zero.
In addition to the prerequisite that necessary sets of measurement samples are available (vSyncPairs is greater than zero), the quality of the resulting correction terms for clock synchronization shall be assessed. The node is only permitted to execute transition into the CC_NormalOperation state if the correction terms for both rate and offset are within the configured limits
If one of the correction terms violates the limit settings, the node shall re-enter the CC_StartupListen state.
CC_InitSync State
A node shall enter CC_InitSync after having received an S_ValidEvenStartupFrame on one of the configured pChannel channels in the CC_StartupListen state. In the CC_InitSync state, the node shall not schedule any transmission.
The node variable vRefSync shall contain the frame identifier of the sync frame that has been used to enter the integration path. The sync node corresponding to this reference frame is called the reference node.
In the CC_InitSync state an initial rate correction value shall be determined in order to adjust the local macrotick timing to the timing given by the reference node (referred to as “rate adoption”). To accomplish this, the time between the initial occurrence of the reference frame and its next occurrence is measured and the difference from the nominal cycle length shall be applied as the rate correction term.
In order to improve robustness of the entire integration process against temporary disturbances, the reception of S_ValidStartupFrame is tracked for each channel separately. That means that if the initial sync frame has been received on channel A and the next sync frame on this channel is missing, the node shall remain in the CC_InitSync state if the rate adoption can still be based on the other channel, i.e. on channel B. This requires the correct reception of a valid pair of S_ValidStartupFrame (starting with S_ValidEvenStartupFrame) on the second channel. In no case a pair of frames shall be constituted out of measurements picked from different channels, i.e. cross-channel measurement is prohibited.
The node shall administer means to ensure that a transition back into the CC_StartupListen state is performed, if
In essence, the captured initial rate correction value must not exceed a configured limit, which is given by pRateCorrectionInitOut.
Once a valid rate correction term has become available, the node shall run with the corrected rate (direct application of the correction term).
Furthermore, S_ValidOddStartupFrame shall be used to determine the nominal schedule position.
This operation shall be based on the received identifier fFrameID. The node shall set its local cycle time accordingly, i.e., it shall synchronize the micro- and macrotick counters to the first BSS (falling edge) of the received sync frame. The cycle counter value fCycleCount of the received sync frame shall be extracted and used to initialize the local cycle counter.
In this manner, the local schedule is established according to the information derived from the reference node. The node shall follow the local schedule until the end of the current cycle without transmitting actively.
Any further reception shall be ignored and neither rate nor offset measurements shall be performed. At the end of the cycle, the node shall transit into CC_IntegrationVCW state.
CC_IntegrationVCW State
In the CC_IntegrationVCW state, the node shall not schedule any transmission.
In CC_IntegrationVCW the node shall confirm the settings copied from the reference node with the overall network communication scheme. For this purpose the node shall perform a cycle-based validation check similar to the check defined for the CC_ColdStartVCW state (see above). Since the node still behaves passively, the initialization of the administered counters differs from that for a node in CC_ColdStartVCW (which transmits a sync frame and thus participates actively in the validation check).
The validation check counters shall be initialized for all configured pChannel channels upon each new cycle start as follows:
Counter increment shall be performed according to the following rules:
The validation check shall be considered to be passed if vValidSyncCount[ch] is greater than vInvalidSyncCount[ch] for all channels except those for which vValidSyncCount[ch]==vInvalidSyncCount[ch]==0. If both the vInvalidSyncCount and the vValidSyncCount are equal to zero for all configured channels, the validation check fails.
The transition into CC_NormalOperation can only take place if the validation check has been passed, but additionally further conditions must be satisfied (see clock correction term assessment and next paragraphs, respectively). The validation check shall run concurrently with these additional checks until the validation check itself fails or a state transition due to another condition is executed.
When the node enters CC_IntegrationVCW, a regular measurement phase for the next rate correction term shall be started. According to the definition of the regular rate measurement phase, all sync frames shall be registered and pair-wise (sync frames with same frame identifier) evaluated for clock synchronization. The offset measurement phase shall be applied in accordance to the regular scheme, too. This means that for each cycle with an odd cycle counter value the related sync frames are used to determine next offset correction term.
An integrating sync node requires at least one matching pair of sync frames suitable for rate measurement (same frame identifier, consecutive occurrence in ‘even/odd’ order) in order to fulfill one of the necessary prerequisites to enter CC_NormalOperation state. Using this pair of sync frames, the node can acknowledge an existing node in CC_ColdStartVCW or simply integrate to a synchronized cluster. The number of matching pairs of sync frames shall be accumulated in vSyncPairs.
The counter vSyncPairs shall be evaluated at the end of an odd cycle.
With the beginning of each rate measurement phase in the CC_IntegrationVCW state, the variable vSyncPairs shall be reset to zero.
In addition to the prerequisite that necessary sets of measurement samples are available (vSyncPairs is large enough, see above), the quality of the resulting correction terms for clock synchronization must be acceptable. A node shall be allowed to join active communication (transition into the CC_NormalOperation state), only if the correction terms for both rate and offset are within the configured limits
If one of the correction terms violates the limit settings, the node has to re-enter CC_StartupListen.
The only exception to this rule is for the first time an offset correction value is available in the CC_IntegrationVCW state. In this special case the correction value vOffsetCorrection may exceed the configured limit pOffsetCorrectionOut, which is applied during regular clock synchronization. The initial offset correction value shall be compared against the limit pOffsetCorrectionInitOut.
If this more relaxed requirement can be met, the node shall remain in the CC_IntegrationVCW state, but shall not transit into the CC_NormalOperation state.
After the application of the initial offset correction term (and the check against the pOffsetCorrectionInitOut limit) in the CC_IntegrationVCW state, the next offset correction term has to meet the regular pOffsetCorrectionOut limit. That means the described exception is only made once, i.e., when the first offset correction term is available.
In order to ensure proper processing, a flag vOffsetOut shall be set to true once the initial offset correction term check has been performed. The introduction of vOffsetOut is done in order to ease the description in the specification. As an auxiliary variable it is not required that this parameter is used for an implementation of a FlexRay protocol controller. This flag shall be always evaluated, if a new offset correction term should be checked against the configured limit settings. The flag vOffsetOut is initialized to false, if CC_IntegrationVCW is entered from the CC_InitSync state.
The combination of all these checks ensures that the node only becomes an active transmitter if the local time base (including the cycle counter and the clock synchronization parameters) is consistent with the global time as represented by the majority of active sync nodes in the system.
CC_NormalOperation State
As soon as the node that transmitted the first CAS symbol (resolving the potential access conflict and entering startup via coldstart path) and one additional node have entered the CC_NormalOperation state, the startup phase is finished for a cluster in TT-D protocol mode.
In TT-M protocol mode, the single sync node enters the CC_NormalOperation state without any communication counterpart. This is due to its master role in the time-triggered master-controlled mode.
In the CC_NormalOperation state, all configured messages will be scheduled for transmission. This includes all data frames as well as the sync frame.
CC_PassiveOperation State
In the CC_PassiveOperation state a node shall not transmit any of its configured frames.
Nevertheless, the node shall not stop all activities—it shall perform clock synchronization based on the received sync frames, the reception of messages and the full support of the host interface.
In addition, the CC_PassiveOperation state is used to support the ‘listen only’ protocol feature, where nodes are fully synchronized and receive all available frames (including receive buffer update), but shall not transmit anything. This mode shall be indicated by vListenOnly, which can be set by the host in the CC_SoftReset state only. As soon as the host clears vListenOnly, the CC_NormalOperation state shall be entered at the beginning of the next cycle.
Startup—Byteflight Protocol Mode (BF)
For a detailed description of the byteflight protocol mode, please refer to M. Peller, J. Berwanger, and R. Greissbach, byteflight Specification, version 0.5, BMW Corporation 1999, available at http://www.byteflight.com.
Startup State Diagram—Byteflight Protocol Mode (BF)
CC_SendSymbol State
A single node that has been configured as sync master (pMaster is set) shall send a status symbol. With the end of the transmission the timers (of the receiver unit) shall be started according to the definitions in the byteflight specification (see M. Peller, J. Berwanger, and R. Greissbach, byteflight Specification, version 0.5, BMW Corporation 1999, available at http://www.byteflight.com) and the node shall enter the CC_byteflightMaster state.
When a node enters the CC_SendSymbol state while a frame reception is ongoing the reception process is stopped.
CC_byteflightMaster State
A node shall send and receive messages in the CC_byteflightMaster state according to its configuration. Upon entering the CC_byteflightMaster state, i.e. after the transmission of the status symbol, the startup phase is completed. The master node does not need any acknowledgement from other nodes.
CC_byteflightListen State
All slave nodes (pMaster is false) shall wait in the CC_byteflightListen state for the reception of a valid status symbol. All configured pChannels channels shall be independently monitored. The transition into CC_byteflightSlave and therefore the synchronization of both channels to the master shall be done on reception of the first valid status symbol. After initialization of the wait timers, all configured channels shall operate asynchronously with respect to the required frame mini-slotting on each of the pChannels channels.
CC_byteflightSlave State
Slave nodes shall synchronize to a valid status symbol and transmit and receive messages in the CC_byteflightSlave state according to their configuration.
CC_byteflightPassive State
In CC_byteflightPassive a node shall not transmit any of its configured frames. The node shall not stop all activities, but shall continue performing synchronization to status symbols (via the CC_byteflightListen state) and the reception of messages.
The CC_byteflightPassive state is used to support the ‘listen only’ protocol feature, where the node shall be fully synchronized and shall receive all available frames (including receive buffer update), but shall not transmit anything. This mode shall be indicated by vListenOnly, which can be set by the host in the CC_SoftReset state only. As soon as the host clears vListenOnly, the CC_byteflightSlave state shall be entered with beginning of the next cycle.
Since the communication controller performs the transition to CC_byteflightListen state with every communication cycle, it is still synchronized to the master node. Therefore, the node is allowed to directly re-enter CC_byteflightSlave from CC_byteflightListen (at the beginning of the next cycle), if the host sets vListenOnly to false.
Startup—Event-Triggered Protocol Mode (ET)
The node's behavior during startup is described further on in the description.
Startup Examples—Time-Triggered Protocol Mode (TT-D)
For all startup sequences described in this chapter the assumption is made that the correction terms for clock synchronization exactly match the limit settings of the quality assessment criterion (see above). Therefore, the node is allowed to proceed directly into normal operation (CC_NormalOperation state) after having performed the offset measurement, correction phase, and regular rate measurement phase the first time.
Startup without Collisions
The scenario illustrated in
Node A enters CC_ColdStartICW and transmits the initial CAS before any other node. Triggered by the related channel activity, node B restarts its listen-timeout vdStartup. On the reception of the CAS symbol, the listen-timeout vdStartupNoise is restarted. With the first sync frame (fFrameId=3) is sent by node A all other nodes enter CC_InitSync. At this point Node A becomes the reference node (vSyncRef=3) and the measurement phase for initial rate correction term is started. The next occurrence of node A's sync frame stops the rate measurement phase. Nodes B and C directly determine and apply the rate correction term to their local clock rate (i.e. to their local macrotick generation unit). In addition, the actual schedule position is determined based on the reference frame ID, and the micro- and macrotick timers are synchronized using the falling edge of the leading BSS of the received sync frame.
Nodes B and C follow the current schedule until cycle end and then transition into the CC_IntegrationVCW state. Still these nodes behave passively, i.e., they do not participate the communication schedule with their own frames. After one complete rate measurement period (2 cycles) and the corresponding offset measurement and correction phase (during the second cycle), the sync node B is allowed to enter normal operation. The validation checks evaluated in the CC_IntegrationVCW state are passed because on the reception of the reference sync frame vValidSyncCount[ch] is incremented, while vInvalidSyncCount[ch] remains unchanged. Consequently, with the start of next cycle, node B enters CC_NormalOperation and starts to transmit messages according to its configuration. On reception of the sync frame pair sent by another node (node B), which is synchronized to its own, the node that initially sent the CAS (node A) then enters CC_NormalOperation at the start of next communication cycle (after a whole rate measurement period has been concluded). In CC_NormalOperation all configured frames are scheduled for transmission. As soon as the node that initially sent the CAS and one other node have entered the CC_NormalOperation state, the startup phase is concluded.
Node C enters CC_NormalOperation in the same cycle as node A, as soon as it performs the regular rate measurement phase based on 2 (or more) pairs of corresponding sync frames.
Startup with Initial Collision
Startup with Nodes Failed Due to the Validation Check
While nodes B and C are in the CC_IntegrationVCW state the reception of the sync frame transmitted by the reference node fails at both nodes. Thus, the validation check at both nodes fails, too. At the end of this cycle both nodes have to re-enter the CC_StartupListen state. Since vRefSync is different from 0 (vRefSync=3), the first sync frame from the former reference node (node A) is ignored. Because no other sync frame occurs during gdCycleWithHistory, vRefSync is cleared at the end of this cycle. With the next occurrence of the sync frame sent by node A (vRefSync is set to 3 again), node B and C start another integration attempt. Via the integration path, both nodes finally synchronize on timing of node A. Meanwhile, Node A remains in the CC_ColdStartVCW state for the entire period because it does not detect a valid response.
Requirements for Hardware States
Introduction
This chapter describes the HW states whose support is required by the CC, BG, electrical and optical BD, and the active star. Additionally, some desirable optional transitions are described. The state names are prefixed with a two/three-letter acronym corresponding to the hardware component to which the state pertains (i.e., CC, BG, BDe or BDo). State transition names contain one of two prefixes as follows:
The remainder of this chapter consists of sections corresponding to each of the FlexRay hardware components. Each of these sections consists of two subsections; a descriptive overview of the component's states followed by a more formal behavioral description in the form of a state diagram accompanied by a table detailing the transitions in the diagram.
Voltage Levels
The following overview describes the CC behavior in various states. Conditions for entering and exiting these states are described in the table following the subsequent state diagram.
Support for monitoring of the voltage levels (brown-out detection) is only required for stand-alone controllers. This allows monitoring to be done by external monitoring hardware.
CC_PowerOff State
The following overview describes the electrical BD behavior in various states. Conditions for entering and exiting these states are described in the table following the subsequent state diagram.
Support for monitoring of the junction temperature is optional.
BDe_PowerOff State
The following overview describes the optical BD behavior in various states. Conditions for entering and exiting these states are described in the table following the subsequent state diagram.
BDo_PowerOff State
The constants BDo_U1, BDo_U2 and BDo_t1 are product specific and have to be defined in the BD product specification.
HW States of the BG
Overview
The following overview describes the BG behavior in various states. Conditions for entering and exiting these states are described in the table following the subsequent state diagram.
Support for monitoring of the voltage levels (brown-out detection) is only required for stand-alone controllers, whereas the monitoring can also be done by an external monitoring hardware.
BG_PowerOff State
An explicit shutdown support for the BG is not required.
BG State Diagram
The following overview describes the Active Star behavior in various states. Conditions for entering and exiting these states are described in the table following the subsequent state diagram.
ST_PowerOff State
The constants ST_U1, ST_U2 and ST_tS1 are product specific and have to be defined in the star product specification.
Error Signaling and Error Handling
Error Signaling
This chapter describes the error signaling mechanisms of FlexRay protocol. These mechanisms are intended to enable the host application or any other higher level software to learn about the presence of unexpected protocol conditions. In some cases, the host may want to take particular action when being notified of certain types of errors. This protocol specification, however, makes no requirement for the host application to react to any of the error conditions described in this chapter.
Error signaling refers to the presentation of filtered and/or unfiltered protocol error condition information from the Communication Controller to the host.
Frame Reception and Validation
Several error signaling mechanisms described in this chapter make use of the status of the reception process of various frames by the frame processing portion of the protocol engine. Refer to the above description for the details of these mechanisms and the signals they provide to the Error Signaling/Error Handling mechanisms.
Symbol Reception and Validation
Several error signaling mechanisms described in this chapter make rely on the detection of various protocol symbols by the symbol processing portion of the protocol engine. Refer to the above description for the details of these mechanisms and the signals they provide to the Error Signaling/Error Handling mechanisms.
Error Signals and Error Counters
This section describes the error signals and error counters of the FlexRay Protocol. Error signals are used to indicate a detected fault to the host. Error counters are used to count faults, and information related to the number of faults is passed on to the host. In all cases the error counters are not allowed to be incremented past their maximum value, i.e., the counters shall not “wrap around” back to zero, but rather shall remain at their maximum value.
Table 21 and Table 22 list the error signals and error counters of the FlexRay protocol. The following sections provide detailed descriptions of the various signals and counters.
Frame Status and Error Information (FSEI)
A FlexRay Communications Controller shall provide a classification of the slot status per channel for each slot that is booked to receive a frame. A slot is booked to receive a frame if a filter (concerning frame ID, cycle counter and channel—see the following description) for this slot is set.
Table 23 lists the possible status and error information for a booked slot. The determination of these statuses is based on the presence or absence of certain frame reception status signals as defined in the sections above.
Transmission Conflict is Only detected if the node tries to send a frame while it receives. The error signal belongs to the slot ID of the sent frame. If a receive buffer is configured to use the “pick first valid” style of channel filtering (see below), the following additional information on the status of the channel that was not selected for payload storage shall be summarized in the FSEI:
S_InvalidDTSError applies only during frame reception in the dynamic segment. Each slot booked to receive a frame has a corresponding FSEI. The FSEI shall be reset to zero when the CC performs the state transition L5 or L6 of the HW state machine (see the previous chapter). The FSEI's shall begin to be updated once a CC successfully passed the protocol startup phase (see above).
The FSEI is always updated once the receive frame processing is finished (see above). The received data content shall only be provided to the data storage corresponding to the booked slot if none of the above listed error information was set (if channel filter “pick first valid” is configured, at least one channel's FSEI lists no error information). In all other cases, only the current FSEI shall be provided to the data storage.
It shall be possible during configuration of the CC to define a subset of the FSEI components [Byte Coding/CRC Error, Slot Mismatch, Cycle Counter Mismatch, Length Mismatch, Null Frame, Empty Slot, Transmission Conflict, Receive Error on Second Channel, Empty Slot on Second Channel] to be the trigger condition for an interrupt to the host. This subset applies to all booked slots.
Channel Status and Error Information (CSEI)
A FlexRay Communications Controller shall provide an accumulated classification of the slot status of all frames received on a given channel. This implies that a FlexRay CC that supports communication on two channels shall provide two such sets of information. The Channel Status and Error Information (CSEI) summarizes the status of all frames received on the communication channel, including those frames which are not booked and therefore have no corresponding data or status storage in the CHI. Table 25 lists the contents of the CSEI and describes the mapping of the frame and symbol processing status symbols described above.
S_InvalidDTSError applies only during frame reception in the dynamic segment. The CSEI is readable by the host via the Controller Host Interface (CHI). All components of the CSEI shall be reset (for example, all components set to zero) when the CC performs the state transition L5 or L6 of the HW state machine (see above). The components of the CSEI shall begin to be updated once a CC successfully passes the protocol startup phase (see above).
The components of the CSEI are updated upon the completion of the frame processing of each communication slot (see Chapter ‘Frame Processing’). The components of the CSEI shall also be updated at the completion of symbol processing (see Chapter ‘Symbol Processing’).
If a CSEI component is already set due to an earlier update, the component shall remain set. This allows the CSEI to report the aggregate status of all frames on the communication channel. All components of the CSEI shall be reset by a host read operation.
It shall be possible during configuration of the CC to define a subset of the CSEI components [Byte Coding Error/CRC Error, Slot Mismatch, Cycle Counter Mismatch, Length Mismatch, Unaccepted Symbol] to be the trigger condition for an interrupt to the host. This subset applies to all channels.
Coldstart Count Maximum Signal (CCMS)
The Coldstart Count Maximum Signal (CCMS) shall be set to indicate that the CC has reached the maximum number of allowed coldstart retries (see specification of coldstart in Chapter ‘Wakeup, Startup, and Reintegration’). The CCMS follows the value of vCCMS. CCMS shall be reset to zero when the CC performs the state transition L5 or L6 of the HW state machine (see Chapter ‘Requirements for Hardware States’). The CCMS is set to one only during protocol startup phase if vCCMS was set (see Chapter ‘Wakeup, Startup, and Reintegration’). Once set to one, the CCMS remains set until the CC performs the state transition L5 or L6 of the HW state machine next time.
Clock Related Error Signals and Counters
Startup Majority Missed Signal (SMMS)
The Startup Majority Missed Signal (SMMS) shall be set to indicate that the CC has received a set of sync frames during startup that did not result in a majority of the sync frames agreeing with the local view of the system time (see Chapter ‘Wakeup, Startup, and Reintegration’). The SMMS follows the value of vSMMS. The SMMS shall be reset to zero when the CC performs the state transition L5 or L6 of the HW state machine (see Chapter ‘Requirements for Hardware States’). The SMMS is set to one if vSMMS was set in protocol startup phase.
Once set to one, the SSMS remains set until the host clears this signal.
Missing Rate Correction Signal (MRCS)
The Missing Rate Correction Signal (MRCS) indicates the inability to calculate a clock synchronization rate correction value due to the lack of any matching pairs of sync frames in the even and odd communication cycles. The MRCS follows the value of vMRCS. MRCS shall be set if vMRCS was set by the clock synchronization mechanism (see Chapter ‘Clock Synchronization’). In the dynamic media access mode the set condition is given if the node has not received an even and an odd reference frame. Since the reference frame provides all timing information in a system operating in the dynamic media access mode, the node providing the reference frame in such a system will never indicate an MRCS error.
The signal shall remain set to one until the clock synchronization algorithm is able to compute a valid rate correction term and therefore resets vMRCS.
The MRCS shall be set to zero when the CC performs the state transition L5 or L6 of the HW state machine (see Chapter ‘Requirements for Hardware States’).
During protocol startup phase MRCS shall be set to one if the signal vMRCS was set by startup (see Chapter ‘Wakeup, Startup, and Reintegration’). For non-sync nodes and for a sync node in listen-only mode this signal indicates that a second pair of matching sync frames is missing. The MRCS remains set to one until the host clears this signal or the protocol startup phase was passed successfully.
It shall be possible during configuration of the CC to define that MRCS is a trigger of an interrupt to the host.
Missing Offset Correction Signal (MOCS)
The Missing Offset Correction Signal (MOCS) indicates the inability to calculate an offset correction value due to a lack of sync frames in an odd communication cycle by the clock synchronization mechanism (see Chapter ‘Clock Synchronization’). The MOCS follows the value of vMOCS. MOCS shall be set if vMOCS was set by the clock synchronization mechanism (see Chapter ‘Clock Synchronization’). In the dynamic media access mode this occurs if the node does not receive a reference frame in an odd cycle. The node providing the reference frame will never indicate an MOCS error.
The signal remains set to one until the clock synchronization algorithm can compute a valid offset correction term and therefore resets vMOCS.
The MOCS shall be set to zero when the CC performs the state transition L5 or L6 of the HW state machine (see Chapter ‘Requirements for Hardware States’).
During protocol startup phase, the MOCS shall remain at its initial value. No update of this signal is possible until the node successfully exits protocol startup phase.
It shall be possible during configuration of the CC to define that MOCS is a trigger of an interrupt to the host.
Clock Correction Limit Reached (CCLR)
The Clock Correction Limit Reached (CCLR) indicates an inability to apply a clock synchronization rate or offset correction because the computed correction has exceeded the limiting values. The CCLR follows the value of vCCLR. The CCLR shall be set to one if the limit checks on the rate and offset correction values indicate either or both of these parameters are in the red region and vCCLR was set (see Section 0). The CCLR signal shall remain set to one until the node is able to compute rate and offset correction terms that are both in the green area and therefore the clock synchronization mechanism resets vCCLR to zero. The CCLR error signal shall also be set to zero when the CC performs the state transition L5 or L6 of the HW state machine (see Chapter ‘Requirements for Hardware States’).
Note that the red/green region determinations are performed after taking into account any external clock corrections provided by the host (see Section ‘External Clock Synchronization (Optional)’). Because of this, the vCCLR is based on the aggregate of the internal and external clock correction terms (if any). As a result, a system that would not normally experience CCLR due to internal clock synchronization (for example, the reference node in a system operating in the dynamic media access node) may still experience such errors as a result of external rate correction.
During protocol startup phase, the CCLR will be set to one if the vCCLR is set during protocol startup phase (see Chapter ‘Wakeup, Startup, and Reintegration’). CCLR signal remains set to one until the CC can compute valid rate and offset correction values and the protocol startup phase was passed successfully and therefore vCCLR was reset to zero (see Chapter ‘Wakeup, Startup, and Reintegration’). CCLR can be reset to zero by the host before the end of protocol startup phase was reached.
It shall be possible during configuration of the CC to define that CCLR is a trigger of an interrupt to the host.
Clock Correction Failed Counter (CCFC)
The Clock Correction Failed Counter (CCFC, range [0..15]) allows the host to monitor the duration of the inability of a node to compute clock correction terms after the CC passed protocol startup phase. t shall be incremented by one at the end of any odd communication cycle where either MOCS or MRCS is set. The CCFC shall be reset to zero at the end of an odd communication cycle if neither the MOCS nor the MRCS are active. The CCFC stops incrementing at 15 (i.e., incrementing the counter at its maximum value shall not cause it to “wraparound” back to zero). The CCFC shall be reset to zero when the CC performs the state transition L5 or L6 of the HW state machine (see Chapter ‘Requirements for Hardware States’).
Summary
The following tables summarize the conditions and applicability of the various clock-related error signals and counters
Bus Guardian Schedule Monitor Error (BGME)
The Bus Guardian Schedule Monitor Error (BGME) is used to signal that the CC has detected that the static segment transmission pattern enforced by the bus guardian does not match the static segment transmission pattern configured into the communication controller. The BGME follows the value of the vBgsmError parameter defined in the description of the BG Schedule Monitoring (see Section ‘BG Schedule Monitoring Service’).
The BGME shall be set to zero when the CC performs the state transition L5 or L6 of the HW state machine (see Chapter ‘Requirements for Hardware States’). The BGME shall be set to one whenever vBgsmError=TRUE (see specification in Chapter ‘Bus Guardian Interface’). (For the behavior during protocol startup phase, please refer to Chapter ‘Bus Guardian Interface’ as well).
BGME shall be set to zero as soon as the host acknowledges the BG schedule mismatch by an active acknowledgement via the signal vBgsmErrorAck (see Chapter ‘Bus Guardian Interface’).
Certain systems do not make use of the BG Schedule monitoring service. There is no requirement for the CC to provide a mechanism to allow this service to be disabled—non-applicable results must be ignored by the host.
It shall be possible during configuration of the CC to define that BGME is a trigger of an interrupt to the host.
Error Signals Related to SOC/ILLPIF (byteflight Mode)
The following error signals may be used to allow the host to monitor the status of the periodic SOC symbol and to detect the occurrence of illegal pulses instead of SOC symbols for systems operating in the byteflight media access mode.
In byteflight mode the byteflight master CC controls the communication schedule by its SOC symbol and therefore the following error signals are not applicable to a node operating as the byteflight master.
SOC Early
This error signal shall be set if the end of a correct SOC (symbol passed the check set “ValidSOC”) occurs before gdCycleMin. This error signal is reset by a host read operation.
SOC Lost
This error signal shall be set if the end of a valid SOC does not occur before gdCycleMax (no symbol passed the check set “ValidSOC” before gdCycleMax). This error signal is reset by a host read operation.
Illegal Pulse Error (ILLPIF)
This error signal shall be set if either of the following conditions are met
This error signal is reset by a host read operation.
Error Handling
Error handling denotes the behavior of the lower protocol layers when irregular protocol conditions have been detected. Depending on the nature and duration of the error condition, the protocol controller enters certain states to deal with such conditions. In some cases, higher layer program command activity is required for the protocol controller to resume normal operation.
The error handling concept described in this document is intended to ensure communication between non-affected nodes can be maintained in the presence of a lower layer protocol error in a single node. It is also intended to maintain communication when a host behaves in a non-optimal way in the absence of an error in the local lower layer protocol.
Protocol Error States
The error handling mechanisms described here are aimed maintaining communication as long as possible even in the presence of errors.
The error handling is based on three error states with an associated fault hypothesis and an associated strategy for the next steps (behavior) of the CC (see Table 30). These error states correspond to a traffic light model [green, yellow, red].
Overview of Transitions in the FlexRay Error State Machine
The following sections and tables summarize the required relations between the error signals, the values of the error counters and the transitions within the protocol error states [green, yellow, red]. The states reflect the FlexRay error handling based on the three-state fault hypothesis of the protocol. Section ‘Error Handling for TT-D and TT-M Protocol Modes’ covers the transitions during protocol operation for the Time-Triggered Distributed Protocol Mode and Time-Triggered Master-Controlled Protocol Mode, and section ‘Error Handling for Protocol Operation in byteflight Protocol Mode’ covers the transitions during protocol operation in the byteflight Protocol Mode.
Error Handling for TT-D and TT-M Protocol Modes
This section describes the central error handling mechanism for FlexRay nodes operating in the static, mixed, and dynamic media access modes. The protocol error state is set to green when the CC performs the state transition L5 or L6 of the HW state machine (see Chapter ‘Requirements for Hardware States’), independent of the configured FlexRay mode (static, dynamic, or mixed).
If the CCFC value is less than gMaxWithoutClockCorrectionPassive (range [1..7]) then the error state shall be in green state, unless some other error causes a yellow or red state.
If the CCFC becomes equal to gMaxWithoutClockCorrectionPassive the fault hypothesis of yellow state shall be assumed (unless some other condition would cause the error state to be red). The clock correction might not work correctly and therefore the CC shall not send any frames. It is possible that also the BG is not synchronized to the cluster's schedule. As long as CCFC does not reach gMaxWithoutClockCorrectionFatal (range [≧gMaxWithoutClockCorrectionPassive . . . 15]) the CC remains in the yellow error state. If CCFC becomes reset again (see section 0), the green state shall become active, unless some other error causes a yellow or red state. The CC was able to resynchronize and is fully operational.
If the CCFC becomes equal to gMaxWithoutClockCorrectionFatal the fault hypothesis of the red state shall be assumed. The CC was not able to resynchronize to the cluster. The CC shall only be reset by its host. The parameter gMaxWithoutClockCorrectionFatal is considered to be a user-defined threshold that is used to control the change of fault hypothesis and sets the threshold of when to change from yellow state into red state. If the node is configured with gMaxWithoutClockCorrectionPassive=gMaxWithoutClockCorrectionFatal then the node shall enter the red state as soon as the CCFC equals their common value. This configuration may be desirable for certain types of systems.
If the CCLR is set (see section 0) the CC shall immediately enter the red protocol error state. The CC shall remain in the red state until the host resets the CC.
During protocol startup phase the CCLR shall not influence the error handling mechanism.
The transitions described above are used in all FlexRay media access modes. The dynamic mode has some special situations, however. In the dynamic mode only one static slot with the purpose of sending the reference frame is defined and therefore the system operates in a master/slave configuration. All CCs acting as slaves in the cluster have to accept the reference frame and its content as the sole data source for their clock synchronization algorithms. This results in a clock synchronization algorithm that is based upon the receipt of just one sync frame (see Chapter ‘Clock Synchronization’). The mechanism itself, including rate and offset correction calculation, can deal with this (i.e., the single sync node case is just a special case of the general clock synchronization algorithm). Therefore nodes operating in the dynamic media access mode shall use the same clock synchronization error handling mechanisms as would be used in the other media access modes. An MRCS on such a system means that the even and/or odd reference frame was missing and no rate correction value could be calculated. An MOCS means that no odd reference frame was received and no offset correction term could be calculated. The CCFC shall be incremented according its specification in section ‘Clock Correction Failed Counter (CCFC)’, and therefore the error state machine shall follow the behavior defined above. Special attention shall be given to the configuration of the values for gMaxWithoutClockCorrectionPassive and gMaxWithoutClockCorrectionFatal. As defined, a slave will stop sending any data frame as soon as it enters the yellow state.
The same is true for the limit checks at the slaves. If the reference frame deviates too much from the slave's local view of the global time and invalid correction activity (in rate and/or offset) becomes necessary, the CCLR signal shall be set and the protocol error state machine shall move into the red state.
As the master CC controls the timing of the complete cluster by its reference frame no error handling activity concerning CCFC shall influence the master CC during normal operation (see Chapter ‘Clock Synchronization’). The error handling of the master node shall only be influenced by the CCLR signal if external clock synchronization is applied. The external rate and/or offset correction values might result in a limit violation of the rate and offset correction values (see Chapter ‘Clock Synchronization’).
Table 31 summarizes the transitions for the static, mixed and dynamic media access modes.
Error Handling for Protocol Operation in byteflight Protocol Mode
This section describes the central error handling mechanism for byteflight mode.
Each time the host gives the “clear command” while the CC is in configuration state the protocol error state is set to green. By the definition of in the byteflight specification (see M. Peller, J. Berwanger, and R. Greissbach, byteflight Specification, version 0.5, BMW Corporation 1999, available at http://www.byteflight.com), the reception of an SOC is always the trigger to start a new communication cycle and the CC starts operation (protocol startup phase is finished).
If a communication cycle is still ongoing and an SOC is received (SOC before gdCycleMin), a new communication cycle has to be started (the master sent the SOC and therefore has to be accepted by all nodes). The CC remains in the green state.
If a communication cycle is already finished and the next SOC is missing (gdCycleMax has passed), the CC does not start a new communication cycle until the SOC is detected. Within that time, the CC remains passive (yellow state).
If an ILLPIF is detected instead of an SOC (between gdCycleMin and gdCycleMax) or even during an ongoing communication cycle, the CC enters the yellow state. The detection of an SOC causes the CC to switch into green state anyway.
Table 32 summarizes the transitions for byteflight mode.
Protocol Error State Signal
The host shall have the possibility to read the current protocol error state (PESS, range [Green, Yellow, Red]) at any time.
It shall be possible during configuration of the CC to define that a change within PESS is a trigger of an interrupt to the host.
Controller Host Interface
Introduction
Purpose and Scope
The purpose of this chapter is to describe the conceptual structure and required functions and properties of the controller host interface that handles the control and data flow between the host processor and FlexRay controller protocol engine.
The scope of is chapter reaches from the host processor interface to the protocol engine interface. FlexRay protocol functions are not described.
Definitions, Acronyms and Abbreviations
This chapter and the following Chapter contain a number of requirements but also introductions, comments, explanations, etc. All requirements are documented in following format:
CHI elements—are the seven elements of the CHI: Host processor interface, control data handling, status data handling, message data handling, configuration data handling, CHI services, protocol engine interface.
Configuration data—is used to program a FlexRay communication controller in order to communicate with other FlexRay controllers. Configuration data has a constant impact on the behavior of protocol implementation during NormalOperation unless changed by the host. This characteristic distinguishes the configuration data from the control data that has only temporal impact during NormalOperation. Moreover the host processor is the only source for configuration data.
Controller state—is the superset of protocol state and other states of the controller which are not determined by the protocol state machine (e.g. HardReset state, Configuration, Standby, etc.)
Interrupt—is an event triggered by a FlexRay controller and propagated to the host processor by a dedicated communication link in order to indicate that a specific condition has become true in the FlexRay controller. Note that in interrupts are generated by the CHI element Host interrupt service but its propagation to the host processor is controlled by the CHI element Status data handling.
Message memory—is memory that contains information contained in a received frame or a frame that was or will be transmitted.
Message status memory—is memory that contains status information about a received or transmitted frame.
Message control field—is a field the host can use to control the use of a message memory.
Message data—is a subset of data contained a FlexRay frame. It does not include FrameID nor FrameCRC. It includes the following data: ReservedBits, NMIndicationBit, PayloadLength, HeaderCRC, CycleCount, FData[0..254].
NormalOperation—is the state where the controller can participate in or initiate the cluster communication by receiving or transmitting frames. This state includes the listen-only mode.
Status data—is all kind of data the controller determines without interaction with the host by receiving information from the FlexRay Physical Layer or Bus Guardian or by controller internal mechanisms.
Slot-channel tuples—determine the allocation of transmission bandwidth on a specific channel and slot for transmission in the static segment. This is necessary as two controllers may share a single slot—one for each channel.
Data blocks—are sets of data bytes which belong together, namely the fNMVector, fData, fFrameID, fHeaderCRC, vStatusVector, vInterruptStatusVector.
Static frame—is a frame with fFrameID smaller or equal to gNumberOfStaticSlots.
Dynamic frame—is a frame with fFrameID larger than gNumberOfStaticSlots.
Application requirements—a set of requirements determined by a concrete application or a group of similar applications.
CC Configuration state—a state where the host can configure the FlexRay controller. Neither transmission nor reception is possible during this state. This state is not left unless the host explicitly requests the FlexRay controller to exit it.
HardReset state—the state entered automatically by the FlexRay controller after power has been turned on or after activation of a dedicated hard reset trigger. After initialization of registers and memories with default values the FlexRay controller automatically transits to the CC configuration state.
Controller state—is the combination of the protocol state with all states of state machines operating in parallel in a controller implementation.
Passive state—a state where the FlexRay controller does not transmit any data but keeps receiving data. It also continues to perform the clock synchronization.
Freeze state—a state where the FlexRay controller does neither transmit nor receive data, clock synchronization is stopped and all data accessible for host through the CHI remains constant unless a change is performed by host itself.
Overview of the CHI
Conceptual Architecture
The controller host interface (CHI) manages the data and control flow between the host processor and the FlexRay protocol engine.
Conceptually the CHI consists of seven CHI constituent components. These are the host processor interface and the protocol engine interface, the four data handling units—status data handling, control data handling, message data handling and configuration data handling—, and the CHI services. Note that the hardware architecture of a controller implementation can be quite different than this conceptual architecture.
Host Processor Interface
The host processor interface provides the host processor with control means and gives it access to data held in the four CHI data handling units. In general, FlexRay does not enforce a particular way of how this interface is realized. It can be realized in different ways, for example, as a parallel processor bus or as serial communication link such as SPI.
Configuration Data Handling
The configuration data handling unit contains the functions and memory required to handle and store the communication controller related configuration data. The configuration data written by the host processor is used to derive all configuration parameters required by the protocol engine. The protocol engine has to use protocol parameters as provided by this CHI element. The configuration data handling unit may also conduct sanity checks of the configuration data.
FlexRay distinguishes between two subsets of configuration data:
Note that configuration data has a constant impact on the behavior of protocol implementation during NormalOperation unless changed by the host. This characteristic distinguishes constant as well as variable configuration data from control data that has only temporal impact during NormalOperation. Moreover, the host processor is the only source for configuration data, but control data may be affected by the protocol engine as well (e.g., interrupt indicators are set by the protocol engine but reset by the host).
Control Data Handling
This CHI element processes control commands from the host processor. This CHI element also handles control commands for other CHI elements, e.g. for CHI services.
Status Data Handling
This CHI element collects status data from the protocol engine and CHI services, processes it and provides it to the host processor on request. It handles status data of messages. It propagates interrupt requests triggered by the Host interrupt service to the host processor interface. It contains memory to store status data.
Message Data Handling
This CHI element transfers message data and provides it to the host processor interface as well as to the protocol engine interface. It contains memory to store message data.
Memory associated with one message's data is called a message buffer. A message buffer that is configured to store data for frames to be transmitted is called a transmit buffer. A message buffer that is configured to store data for received frames is called a receive buffer.
Note that this CHI element does not handle status data of messages.
The protocol engine interface provides the protocol engine with a means of control and gives it access to data held in the four CHI data handling units. Moreover it allows the protocol engine to interoperate with the CHI services. This interface is not visible to the host.
Note that the previous two requirements are necessary but not sufficient. For further message data handling requirements see below.
CHI States
CHI state transition triggers (Transitions W1 and W5 are described in Table 13):
CHI State Description:
CHI services may affect data stored in the status, control or message interface. They may not affect data stored in the configuration interface.
CHI services do not affect the protocol engine's operation, neither directly nor indirectly through one of status, control or message data handling elements.
General Requirements
All assumptions and dependencies are documented where they apply. There are no additional general assumptions or dependencies.
Host Processor Interface
The following set of requirements must be met by every instantiation of the host processor interface.
Note that the previous two requirements are necessary but not always sufficient for consistent data access, e.g. for message buffer access further mechanisms are necessary (see section ‘Message Data Handling Interaction’).
It is also possible to provide a FlexRay communication controller with multiple host processor interfaces. If a FlexRay controller implementation supports multiple instances of host processor interfaces (e.g. a parallel bus and a serial communication link or different multiple parallel busses) then the following additional two requirements apply:
In a FlexRay controller the configuration data will usually be comprised of a set of registers and memories. However there is not necessarily a one-to-one mapping between this set and the protocol parameters it determines. This is the case because there are protocol parameters, which can be derived from other protocol parameters. Moreover, a FlexRay controller may require parameters in a different representation than specified further on (Example: pSamplePeriod[ns]=gdBit[ns]/pSamplesPerBit)).
Configuration Data Handling Requirements
Interaction with the configuration data handling must meet the following requirements
It is assumed that the host in any case will have means to determine whether a mechanism such as “HardReset” have modified configuration data. Moreover, no protocol mechanism will ever change any configuration data under any circumstance.
5. DisableCHIService (<CHI_service>, <CHI_service_feature>)
Note that Table 34 is not subject to conformance testing. Specific FlexRay controller implementations may have deviating maximum latency values. However, these values must be determined, documented and constant.
Status Data Handling Interaction
Status data is derived from controller internal state variables which serve as their source. There are two types of status data:
Some status indicators may be combined in a super state which may not be accessible by one atomic host operation. Likewise for status indicators which are too large to be accessed by an atomic read operation. Dedicated status consistency mechanisms may be required to assure that they can be read consistently by the host processor with a non-atomic sequence of read operations.
The host can book a slot-channel tuple for transmission. Note that the booking does not include further conditions like subscription (e.g. cycle counter filtering) even though transmit buffers may support additional conditions to determine which data is transmitted during the booked slot-channel tuples. The booking of a specific slot-channel must be unique in the cluster. The host can also subscribe a slot-channel tuple for reception. Depending on the FlexRay controller implementation the subscription may include further conditions e.g. a matching cycle counter, etc. Identical subscriptions may coexist in the same cluster.
PutMessage
Communication with Protocol Engine
The protocol engine interface is split into a control and a data interface. The control interface is used to request a protocol state change at the protocol engine (see below). The data interface provides services which can be requested by the protocol engine. These services are described further on.
RequestStateChange
Operation: The state change request is propagated to the protocol engine. It is in the responsibility of the protocol engine to react accordingly, e.g. some state change requests have to be followed immediately while others allow to complete an ongoing transmit or receive process. The protocol engine confirms the request by using the PutProtocolState interface to report its transition to the requested state.
PutFrame
Operation: The data provided by the protocol engine is forwarded to all CHI services and to message data handling. These CHI elements interact with each other to determine
GetFrame
Operation: The protocol engine requests frame data through this interface for every slot and channel.
If no slot-channel tuple for transmission is contained in the configuration data the value of <slot_is_booked> shall be FALSE and the protocol engine will try to receive a frame.
If a slot-channel tuple for transmission is contained in the configuration data, though, <slot_is_booked> shall be TRUE, and a frame or null frame will be transmitted if <frame_data_found> is TRUE respectively FALSE.
In case both <slot_is_booked> and <frame_data_found> are TRUE message data handling assures that cPaddingValue is set in FData[pMaxPayloadLenth..PayloadLength-1] in case pMaxPayloadLength is smaller than PayloadLength.
PutProtocolState
Operation: This interface is used by the protocol engine whenever the protocol state changes. This information is provided to all CHI services, status data handling, which interact accordingly to
PutErrorStatusVector
GetConfigurationData
Operation: Whenever the protocol engine requires a specific protocol parameter it uses this interface to request the value. The configuration data handling element may extract it directly from the configuration data or calculate the value from the configuration data.
Status Data Handling Interaction
The protocol engine must provide all indicators required for CHI which cannot be generated by one of the CHI elements.
Message Data Handling Interaction
The controller host interface services (CHI services) provide different services to the host processor. Conceptually the CHI services can be seen as an additional service layer that builds on the protocol services provided by the protocol engine.
CHI services of higher complexity like the Message filtering service fall apart in different CHI service features. Specific CHI service features may require other CHI service features as prerequisite.
Each CHI service is classified as either required or optional. All services, i.e. those classified as required as well as those classified as optional, however, must adhere to the requirements defined in this chapter. In addition a CHI service may contain a set of different subservices. Each CHI service feature in turn is also classified as either required or optional. A CHI service is required if it provides at least one required CHI service feature.
A CHI service may also build on other CHI services. In this case a CHI service is required if it provides a dependency for at least one other CHI service.
The CHI services interact with the host processor through the four data handling units. This way the service status is indicated to the host processor and the host processor can control and configure the service. In addition a CHI service can act on message data provided by either the host processor or the protocol engine to the message data handling unit.
Currently eight CHI services are defined. Table 46 lists the eight CHI services along with any potential CHI service features and the respective classifications.
The protocol engine interface propagates all data provided by the protocol engine via PutFrame, PutProtocolStatus, PutErrorStatusVector to all CHI services. Upon this data the CHI services perform all operations and checks necessary to fulfill their functions.
Message Filtering Service
The message filtering service provides a means for retrieving message data from message buffers for transmission, respectively for storing received message data to message buffers, depending on specific filter conditions. In order to provide this service the protocol engine accesses each message buffer via a message filter. Each message filter can assess one or more filter conditions. The message filter checks whether the message data meets the defined filter conditions or not. Message filters may be used with receive buffers as well as with transmit buffers.
Currently filtering conditions are defined for the frame ID, the channel ID, the cycle counter and the message ID.
The following transmit buffer related requirements must be met independently from the filtering condition:
The following receive buffer related requirements must be met independently from the filtering condition:
Within Frame ID filtering the filter condition is applied to the frame ID. Frame ID filtering applies to transmit and receive buffers.
Within channel filtering the filter condition is applied to the channel. Channel filtering applies to transmit and receive buffers.
Within message ID filtering the filter condition is applied to the message ID. Message ID filtering applies only to receive buffers.
Within cycle count filtering the filter condition is applied to the cycle count. Cycle count filtering applies to transmit and receive buffers.
Message FIFO's are used to store and receive frame contents according to the “first-in first-out” principle. Currently only receive FIFO's are defined.
The receive FIFO stores the content from valid frames received by the protocol engine. The host processor consumes the messages from the FIFO by reading from the FIFO.
Interaction with Protocol Engine Interface
Receive FIFO: Stores the provided message data upon a PutFrame request if no dedicated message buffer can be found and the frame is accepted by optional filters.
Interaction with Configuration Data Handling
Message filters may be configured in static or variable configuration data for select specific message for storage in receive FIFOs. These message filters may accept or reject specific frame Ids or message Ids.
Interaction with Status Data Handling
Message FIFOs are used to store/retrieve message data only when no dedicated message buffer is configured for a specific message and the frame is accepted by optional filters.
Note that if more than one channel is fed into one receive FIFO, then the message sequence in the FIFO will be consistent with the message sequence for each channel individually, however no specific storage sequence is defined between messages of different channels.
Network Management Service
Description
The Network management service provides means for the host to handle the network management vector that can be transmitted in a FlexRay frame.
Constraints
The network management service is functional only during NormalOperation.
Interaction with Protocol Engine Interface
This CHI service scans each frame provided by the protocol engine through PutFrame. If NMIndicationBit is set it becomes active.
Interaction with Configuration Data Handling
It is not required that vGloNMVecis valid in operation modes other than the NormalOperation.
It is up to the application to use only a subset of the gNetworkManagementVectorLength bytes for NM. In this case it is the responsibility of the application to mask the unused bits.
An implicit indication could be the cycle counter value of the communication cycle the NM vector was generated from. The host could read and store this value, read the NM vector and verify if the cycle counter value matches the stored value. If this check fails, the NM vector read is possibly not consistent. If the check succeeds the NM vector is consistent. This is only true if the host takes less than 64 cycles to read the NM vector, because the cycle counter values repeat after 63 cycles.
For all received frames provided to the host the message interface shall also provide the values of fNMIndBit and fLocNMVec. fNMIndBit and fLocNMVec represent the values for NM indication bit and NM vector contained in the (received) frame.
Timer Service
Description
This service allows the synchronization of the application with the global time in the FlexRay cluster. Timers may be absolute (specific cycle and macrotick) or relative (to the time when they are started), and they may repetitive or single shot timers.
Interaction with Protocol Engine Interface
Timer events are triggered depending on the latest values of vMacrotick and vCycle.
Interaction with Configuration Data Handling
Timers as well as the timer interrupt can be enabled or disabled during NormalOperation.
Interaction with Status Data Handling
This service allows to control which symbols are transmitted during the symbol window. Moreover it provides information to the host processor about the symbol received during the symbol window. This service has the following features:
The value of vTXSymbol shall provided on request through the GetConfigurationData interface if the argument is “vTXSymbol”. (TBD—formalize and standardize description).
Interaction with Configuration Data Handling
The length of the symbol window is a cluster constant and therefore determined by static configuration.
Interaction with Control Data Handling
This service checks conditions to generate interrupt requests as well as conditions to reset these requests.
Interaction with Protocol Engine Interface
Depending on the interrupts a FlexRay controller implementation supports this CHI service may check conditions for interrupt generation or reset upon data provide through PutFrame, upon the protocol state provided through PutProtocolState and on the error status vector provided by PutErrorStatusVector.
Interaction with Configuration Data Handling
None required.
Interaction with Control Data Handling
Depending on the additional interrupts a FlexRay controller implementation supports further interrupt requests are generated.
Interaction with Message Data Handling
Depending on the additional interrupts a FlexRay controller implementation supports upon reception or transmission of specific frames.
Optical Diagnosis Service
Description
This service provides information provided by the optical transceiver indicating if the optical power is below a given threshold.
Interaction with Protocol Engine Interface
Requirement 112: An interface function PutOpticalDiagnosisFlags shall be provided.
Interaction with Status Data Handling
Depending on the additional interrupts a FlexRay controller implementation supports upon reception or transmission of specific frames.
Bus Driver Interface
Introduction
This chapter describes the interface to the electrical FlexRay Bus Driver (BDe). This interface comprises three components, the interface to the FlexRay Communication Controller (CC), the interface to the FlexRay Bus Guardian (BG) and the interface to the host. A description of the BDe operation can be found in FlexRay Electrical Physical Layer Preliminary Functional Specification, v1.0, Philips Corporation, 2002 and in Chapter ‘Requirements for Hardware States’.
Bus Driver—Communication Controller Interface
Overview
The Bus Driver—Communication Controller Interface is shown in
The following description is valid, when the BDe is in BDe_Normal mode.
When the BDe is not in BDe_Normal mode, it signals Idle onto the channel.
Bus Driver—Bus Guardian Interface
Overview
The Bus Driver—Bus Guardian Interface is shown in
The following description is valid, when the BDe is in BDe_Normal mode.
When the BDe is not in BDe_Normal mode, then RxD and RxEN shall be in a logical HIGH state.
Bus Driver—Host Interface
The bus driver host interface is a product specific interface. It enables the host to control the operating modes of the BDe and to read error conditions from the BDe. This interface also has to signal the waking source (local wake-up event or remote wake-up via wake-up symbol on the bus).
The interface may be realized with a serial communication interface (e.g. “SPI”) or using hard wired signals (e.g. dedicated pins for operating mode control and error signaling).
A description of the BDe operating modes is provided in Chapter ‘Requirements for Hardware States’.
Interface Signal Timing
BDe Output Signals: RxD and RxEN
The expected timing of RxD and RxEN is depicted in
The Transmission Start Sequence (TSS) that a node receives may be shorter than the TSS that was originally sent. The reason for this is that active stars may truncate a portion of the TSS. RxEN will stay on logical LOW state after the last transmitted bit for the duration of the MediaIdleDetectionTime. (See Chapter ‘Coding and Decoding’ for more information about the TSS and the document FlexRay Electrical Physical Layer Preliminary Functional Specification, v1.0, Philips Corporation, 2002 for the effect of truncation).
A node that transmits a frame can read back its own transmission on RxD if loop back is provided by the BDe. In case that the last bit was transmitted as Data—1 (frames in static and dynamic part, symbols: EIS, SNS, or SAS), only the transmitting node may see a different behavior (depicted in red) of RxD after the end of its own frame or symbol than all other receivers in the network. This happens when common mode chokes are used with a significant stray inductance.
Since the symbols WU, CAS, MTS end on Data—0 the situation is slightly different in these cases. The RxD and RxEN behavior is shown in
The Transmission Start Sequence (TSS) that a node receives may be shorter than the TSS that was originally sent (see above). This effect might not be compensated by the effect of enlarging the symbol by the MediaIdleDetectionTime. The transmitting node may see, when reading back its own transmission, the behavior that is depicted by the dotted red line, when common mode chokes with a significant stray inductance are used.
BDe Input Signals: TxD and TxEN
The required timing of TxD and TxEN is depicted in
With the start of the first bit to be transmitted the TxEN is switched to logical LOW state and returned to logical HIGH state at the end of the last bit that was to be transmitted. Edges in TxEN are expected to be synchronous with the first and last edge within the TxD signal.
Bus Guardian Interface
Introduction
This chapter covers conformance requirements that apply to the interface between the communication controller (CC) and de-centralized bus guardian (BG) functional blocks. The decentralized bus guardian protects the communication channel(s) from improper transmissions by a faulty or misconfigured communication controller that attempts to transmit outside of its pre-configured schedule. The bus guardian has independent knowledge of the node's communication schedule and restricts transmission to only those times allowed by the schedule.
This chapter specifies the interface between the bus guardian and the communication controller and gives an overview of the bus guardian scheduling scheme. It also establishes the requirements on the BG and CC behavior with respect to the interface signals between the BG and CC. For a detailed functional specification of the bus guardian please refer to FlexRay Bus Guardian Preliminary Functional Specification, v1.2, Philips Corporation, 2002.
The second part of this chapter contains a specification of the BG schedule monitoring service provided by the communication controller. The purpose of this service is to supervise the bus guardian schedule and inform the host when a mismatch is detected between the communication schedule of the BG and CC.
BG-CC Interface Signals
Table 48 shows a list of bus guardian inputs and outputs at the interface between the bus guardian and the communication controller. The block diagram shown in
BG-CC Interface Signals Overview
BG-CC Interface Signals Description
MT
The MT signal, generated by the CC, is used as a clock signal for the BG scheduler. The rising edge of the MT signal must be aligned to the start of the CC's internal locally corrected macrotick. The CC shall ensure that any internal macrotick corrections are reflected in the MT signal during the same macrotick (i.e., the MT signal is an accurate representation of the CC's internal locally corrected macrotick clock).
BGT
The BGT signal, generated by the CC, is used for supervision of the MT period. The BGT period is not affected by clock corrections and depends only on the frequency of the CC's crystal oscillator and a frequency divider at the CC.
ARM
The ARM signal is generated by the CC and indicates the start of the communication cycle to the BG. The ARM signal from the CC is generated such that it is synchronous to the MT signal (ARM edges aligned to rising edge of the MT signal). The falling edge of the ARM signal defines the ARM trigger event for BG cycle synchronization. After node startup the BG schedule needs to be synchronized to the CC schedule. This is achieved by means of the first ARM trigger event that is detected by the BG after node startup. Subsequent ARM trigger events are not required for cycle synchronization, but for supervision of the configured cycle length. The BG checks for the regular occurrence of ARM trigger events at the start of each cycle by counting the number of MT periods between ARM trigger events and comparing the result to the expected BG cycle time as calculated below.
BGE
The BGE signal is generated by the bus guardian and controls transmit access to the communication medium. Any transmit access to the medium shall be disabled as long as the BGE signal is in an inactive condition (BGE=LOW). The BGE signal is also provided to the CC as an input signal that is used for supervision of the BG schedule. Please refer to the BG schedule monitoring service described below.
TxEN
The TxEN signal is generated by the CC and indicates that the CC is currently attempting to transmit on the particular channel. This signal shall be evaluated by the BG for supervision of the CC schedule. The BG shall detect a schedule mismatch if the TxEN signal is active while the BGE signal is inactive (Refer to the BG Functional Specification for details of the schedule monitoring features provided by the BG.).
Bus Guardian Scheduling Scheme
Parts of the BG schedule that may be used for transmission are separated by inter-slot gaps (ISG). This applies to static slots, the BG dynamic segment, and the BG symbol window. The BG shall enable transmission one macrotick prior to the expected beginning of a transmission and disable it one macrotick after the expected end. Note that a minimum ISG length of 2 macroticks is required in order to fulfill this requirement.
The ISG contains two optional elements gdBGpreEnablePart and gdBGpostEnablePart. Alignment of the BG schedule to the CC action points is achieved by configuration of gdBGpreEnablePart. while configuration of gdBGpostEnablePart allows to increase the safety margin between transmissions.
The BG communication cycle start is defined to be at the beginning of static slot 1. The BG shall assume the ARM trigger events happen at the BG cycle start.
At the beginning of the dynamic segment two possible cases must be distinguished (Refer to section ‘Dynamic Segment’).
In general, transmit access is enabled gdBGpreEnablePart macroticks after the beginning of the dynamic segment, independent from the configuration of gdMSActionPointOffset and stays enabled for gdBGDynSegment+2 macroticks.
The BG may be configured to enable or disable transmission during the BG dynamic segment and the BG symbol window, respectively. Transmit access is enabled gdBGpreEnablePart macroticks after the beginning of the symbol window and stays enabled for gdBGSymbolWindow+2 macroticks. The BG disables transmission during the BG watchdog disable time gdBGWatchdogDisable.
The BG shall support the application of the media access test during the symbol window, i.e. in addition to disabling transmit access a transmit attempt by the CC shall not be detected as schedule violation error. The purpose of the media access test is to check whether the BG successfully disables transmission. The BG supports application of the media access test if transmission during the symbol window is disabled (pBGSymWinEnable=0) and media access test is enabled (pBGMatEnable=1). Table 49 describes the configurable behavior of the BG during the BG symbol window.
The relation between BG configuration parameters and global protocol parameters is defined by:
gdBGStaticSlot+ISG=gdStaticSlot
gdBGDynSegment+ISG=gNumberOfMinislots*gdMinislot+(gdActionPointOffset−gdMSActionPointOffset)
The above equation only holds when gNumberOfMinislots !=0; The term (gdActionPointOffset−gdMSActionPointOffset) only applies if gdActionPointOffset>gdMSActionPointOffset.
gdBGSymbolWindow+ISG=gdSymbolWindow
The above equation only holds when gdSymbolWindow !=0.
gdBGWatchdogDisable=gdNIT
gdBGpreEnablePart+1=gdActionPointOffset
The inter-slot gap (ISG) is defined by:
ISG=gdBGpreEnablePart+gdBGpostEnablePart+2
Using BG configuration parameters the cycle time is calculated by:
BG cycle time (MT)=gNumberOfStaticSlots*(gdBGStaticSlot+ISG)+gdBGDynSegment+ISG+gdBGSymbolWindow+ISG+gdBGWatchdogDisable
gdBGDynSegment is an optional dynamic segment. (The BG dynamic segment and the corresponding ISG are not part of the BG schedule if gdBGDynSegment=0 is configured.) gdBGSymbolWindow is an optional symbol window. (The BG symbol window and the corresponding ISG are not part of the BG schedule if gdSymbolWindow=0 is configured.)
A summary of configuration parameters related to the bus guardian schedule is shown in Table 50.
BG-CC Synchronization
The FlexRay bus guardian approach maintains synchronization of the local BG schedule to the global time by basing all BG scheduling operations on a corrected macrotick signal (MT) being provided by the CC. This allows the BG to perform its media access protection function (i.e. restricting transmit access to the configured schedule) while being continuously synchronized to the global clock using the clock synchronization algorithm of the CC.
A second clock signal, bus guardian tick (BGT), used for supervising the period of the MT signal, is provided by the CC. The communication controller shall generate the BGT signal such that its period is independent from the clock correction performed by the CC (For example, the BGT signal could be derived from the application of a programmable prescaler to the oscillator input of the Communication Controller.). The bus guardian shall use the BGT signal to perform a supervision of the duration of the corrected macrotick by checking if the MT/BGT ratio deviates from the nominal ratio by more than a pre-defined configurable limit. Acceptable deviations from the nominal limit may be caused by the clock rate correction algorithm as it increases or decreases the length of certain macroticks to maintain the overall clock rate.
BG-CC Interface Requirements
Table 51 shows the BG-CC interface timing requirements. Note the specified restrictions have been introduced as a result of certain semiconductor technology limitations.
BG Schedule Monitoring Service
Background
The BG schedule monitoring (BGSM) service is a service that is provided by the FlexRay communication controller. The purpose of this service is to assess that the execution of the bus guardian schedule matches the execution of the respective schedule of the CC.
Proposed Functional Specification
Structure
The bus guardian schedule monitor uses the following input signals to perform its function (see
Interaction of the BG Schedule Monitor with the Protocol Operation
Background
Protocol operation can be separated in two distinct phases: the initial unsynchronized startup phase and the subsequent synchronized operation phase. The two phases differ as follows:
Within the synchronized operation phase the communication schedule is used to access the communication media. A communication schedule consists of the following constituents: the static segment, the dynamic segment, the symbol window and the network idle time (NIT).
Static Segment
The configuration parameter pdBgeStaticDuration defines the duration of the BGE active phase during transmission slots in the static segment. The relationship between pdBgeStaticDuration and other configuration parameters related to the static segment is given by:
pdBgeStaticDuration=gdBGStaticSlot+2=gdStaticSlot−gdBGpreEnablePart−gdBGpostEnablePart
with:
gdBGpreEnablePart=gdActionPointOffset−1
gdBGpostEnablePart=gdStaticSlot−pdBgeStaticDuration−gdActionPointOffset+1
Transmission Slot
Starting with the first macrotick of the transmission slot the following rule shall be applied:
Starting with the second macrotick of the transmission slot the following rule shall be applied:
Starting with macrotick gdActionPointOffset of the transmission slot the following rule shall be applied:
Starting with macrotick pdBgeStaticDuration+gdActionPointOffset the following rule shall be applied:
Starting with macrotick pdBgeStaticDuration+gdActionPointOffset+1 the following rule shall be applied:
Reception Slot
Starting with the first macrotick of the reception slot the following rule shall be applied:
Dynamic Segment
The configuration parameter pdBgeDynamicDuration defines the duration of the BGE active phase during the dynamic segment. The relationship between pdBgeDynamicDuration and other configuration parameters related to the dynamic segment is given by:
pdBgeDynamicDuration=gdBGDynSegment+2=gNumberOfMinislots*gdMinislot−gdBGpreEnablePart−gdBGpostEnablePart
The following rules apply only to configurations, that contain a dynamic segment (gdNumberOfMinislots !=0). The configuration parameter pBgsmDynSegDisabled indicates if transmission during the dynamic segment shall be enabled or disabled by the BG and controls which set of rules has to be applied.
pBgsmDynSegDisabled=TRUE
Starting with the first macrotick of the dynamic segment the following rule shall be applied:
Starting with the first macrotick of the dynamic segment the following rule shall be applied:
Starting with the second macrotick of the dynamic segment the following rule shall be applied:
Starting with macrotick pdBgeDynamicDuration+gdActionPointOffset the following rule shall be applied:
Starting with macrotick pdBgeDynamicDuration+gdActionPointOffset+1 the following rule shall be applied:
Symbol Window
The configuration parameter pdBgeSymbolDuration defines the duration of the BGE active phase during the symbol window. The relationship between pdBgeSymbolDuration and other configuration parameters related to the symbol window is given by:
pdBgeSymbolDuration=gdBGSymbolWindow+2=gdSymbolWindow−gdBGpreEnablePart−gdBGpostEnablePart
The following rules apply only to configurations, that contain a symbol window (gdSymbolWindow !=0). The configuration parameter pBgsmSymWinDisabled indicates if transmission during the symbol window shall be enabled or disabled by the BG and controls which set of rules has to be applied.
pBgsmSymWinDisabled=TRUE
Starting with the first macrotick of the symbol window the following rule shall be applied:
Starting with the first macrotick of the symbol window the following rule shall be applied:
Starting with the second macrotick of the symbol window the following rule shall be applied:
Starting with macrotick gdActionPointOffset of the symbol window the following rule shall be applied:
Starting with macrotick pdBgeSymbolDuration+gdActionPointOffset the following rule shall be applied:
Starting with macrotick pdBgeSymbolDuration+gdActionPointOffset+1 the following rule shall be applied:
Network Idle Time
Starting with the first macrotick of the network idle time the following rule shall be applied:
Upon detection of a rule violation the communication controller shall signal this violation to the host computer by means of the flag vBgsmError in the host interface.
The flag shall remain set until it is cleared by the host controller.
Comments
Currently it is not foreseen to have the option to deactivate the schedule monitor. Note with systems operating without a BG this implies the vBgsmError will indicate a permanent BG error as soon as the (expected) first mismatch between the configured rule and the BGE signal occurs.
Bus Guardian—Communication Controller Interaction and Monitoring
The bus guardian scheduler is directly clocked with the corrected macrotick signal from the communication controller and, therefore, a failing clock synchronization at the communication controller or a missing macrotick signal must be detected. The bus guardian supervises all signals from the communication controller that are used to synchronize the bus guardian.
For supervising the macrotick signal, an additional clock signal, the bus guardian tick, is provided by the communication controller. The BG tick signal is directly derived from the clock oscillator of the communication controller by means of a frequency divider and its period is not influenced by the macrotick clock correction. Supervision of the BG tick signal is performed by means of the BG-internal clock signal CLK. Finally, clock signal fail detectors are provided by the BG, in order to detect missing signals at the bus guardian inputs macrotick, BG tick, and ECLK.
The purpose of the macrotick watchdog is to check the ratio between the macrotick period and the BG tick period and to detect any deviation from the nominal ratio that exceeds pre-defined configurable limits. The allowed deviations within these limits may be caused by the distribution of the fractional part of the macrotick and/or by the clock rate correction.
The principle operation of the macrotick watchdog is to measure the period of the macrotick signal by counting the number of BG tick periods during a configurable number pMTScale of macrotick periods. Measurement over multiple macrotick periods is necessary in order to achieve the required supervision accuracy (The maximum BGT frequency is determined by technology restrictions).
A tolerance window can be derived from the nominal macrotick period T_MT_nom, the scaling factor pMTScale and the global clock sync parameter gRateCorrectionOut. Based on this tolerance window, which describes the valid range of macrotick periods, the configuration parameters pdBGValidMTMin and pdBGValidMTWindow of the macrotick watchdog are determined. The number of BG tick periods counted during a measurement period pMTScale*T_MT must match to the tolerance window defined by pdBGValidMTMin and pdBGValidMTWindow, otherwise an macrotick timing error is detected.
The macrotick watchdog can only check whether the corrected macrotick diverges from the statically configured nominal range (T_MT/T_BGT) by a certain value.
To avoid the detection of macrotick timing errors, that could be caused by application of the offset correction, the watchdog disable time WDT has been introduced to the bus guardian schedule. During the watchdog disable time supervision by the macrotick watchdog is disabled. This is achieved by setting the watchdog counters on hold, such that the masurement time and the BG tick count do not propagate during the watchdog disable time. The watchdog disable time does not affect the BG tick watchdog or the clock signal fail detectors.
BGT Watchdog
This watchdog is required to detect large deviations from the nominal BG tick period, such as would be caused by a crystal that is oscillating at a different harmonic or a frequency divider inside the communication controller that is operating at an incorrect ratio. For this purpose only coarse changes of the BG tick period, e.g. +/−50% of the nominal period, have to be detected. The BG tick watchdog uses the local clock CLK of the bus guardian as reference. The precision of the CLK signal depends on the configuration of the clock source, which may be the internal RC-oscillator or an external clock signal ECLK.
The principle operation of the BG tick watchdog is to measure the period of the BG tick signal by counting the number of CLK periods during a configurable number pBGTScale of BG tick periods. Measurement over a configurable number of periods allows to adjust the measurement period to the required precision.
If the BG tick watchdog detects one of the following error conditions, the bus guardian enters FailSilent mode, sets the corresponding error flag, and generates an interrupt request to the host:
Signal fail detectors are attached to the macrotick and BG tick signals from the communication controller as well as to the external clock signal ECLK and check for missing clock signals by means of clock edge detection. A signal fail error is reported if no rising clock edge is detected at the supervised signal after a pre-defined timeout, expressed in the number of clock periods of a reference signal.
Supervision of the macrotick signal is performed by counting BG tick periods between rising edges of the macrotick signal. The macrotick fail detector continuously checks for a missing macrotick signal, even during the watchdog disable time. Supervision of the BG tick signal is performed by counting CLK periods between rising edges of the BG tick signal.
Supervision of the ECLK signal is performed by counting clock periods of the internal RC-oscillator between rising edges of the ECLK signal. ECLK supervision is only enabled if the bus guardian is configured to derive the internal clock signal CLK from the ECLK signal. The clock signal from the internal RC-oscillator itself is supervised by an integrated analog fail detector, that does not need a reference signal.
If any of these fail detectors does not detect a rising clock edge of the supervised signal before the corresponding timeout period has expired, the bus guardian enters BG_FailSilent mode, sets an error flag and generates an interrupt request to the host.
Event Triggered Mode
Introduction
This chapter describes the event triggered communication mode of the FlexRay communication protocol. In contrast to the time triggered communication mode, the repetition interval of the communication cycle may vary in the event triggered communication mode.
Operating Modes
FlexRay supports two operating modes for communication cycle execution (see
The different operating modes are described below.
Time Triggered Communication Cycles
This mode is described in detail in the media access chapter (see Chapter ‘Media Access Scheme’).
Event Triggered Communication Cycles
In the event triggered communication mode the communication cycle is always initiated by a master node. The master node may initiate the communication cycle based on the input of a number of sources. The management of these sources is under host control via the CHI. The following functionality is the minimum required (see
All CHI sources can raise the CC Trigger signal (OR function). The protocol engine interface that is required is the CC Trigger Input.
If the CC trigger signal at a dedicated master occurs the communication cycle is initiated by sending an event indication symbol (EIS) within the trigger window. The new cycle is then started after the NIT with frame ID 1 is sent by the master.
The clocks on the master and slave nodes are synchronized by sending and receiving the EIS symbol. The FlexRay protocol does not specifically handle a fault that prevents the communication master from sending the EIS or frame ID 1. There are possible recovery strategies (reconfiguration of the system to use a new master, for example), but these must be implemented at the application level and are not part of the protocol.
The event triggered mode supports two channels. The master controls both channels in a two-channel system. The master sends the EIS and frame ID 1 at the same time on all configured channels. The slave nodes need not be connected to both channels. If a slave is connected to both channels, the channel with a correct EIS symbol in combination with the frame ID 1 wins the arbitration and determines the cycle start on the slave.
The use of an EIS symbol in combination with the frame with ID 1 provides the following advantages:
The communication cycle is the fundamental element of the media access scheme within FlexRay. It is defined by means of a timing hierarchy.
Timing Hierarchy
The timing hierarchy consists of four timing hierarchy levels as shown in
The highest level, the communication cycle level, defines the communication cycle. It contains the static segment, the dynamic segment, the symbol window and the network idle time (NIT). Within the static segment a static time division multiple access scheme is used to arbitrate transmissions as specified in Section ‘Static Segment’. Within the dynamic segment a dynamic mini-slotting based scheme is used to arbitrate transmissions as specified in Section ‘Dynamic Segment’. The symbol window is a communication period in which one symbol out of a defined set of symbols can be transmitted on the network as specified in Section ‘Symbol Window’. The static segment, the dynamic segment and the symbol window form the network communication time (NCT), a period during which network wide communication takes place. The network idle time defines a communication-free period that concludes each communication cycle.
The next lower level, the arbitration grid level, contains the arbitration grid that forms the backbone of FlexRay media arbitration. In the static segment the arbitration grid consists of consecutive time intervals, called static slots, in the dynamic segment the arbitration grid consists of consecutive time intervals, called minislots.
The arbitration grid level builds on the macrotick level that is defined by the macrotick. The macrotick is specified in Chapter “Clock Synchronization”. Specific macrotick boundaries are called action points. These are dedicated instants at which transmissions shall start (in the static segment, dynamic segment and symbol window) and shall end (only in the dynamic segment).
The lowest level in the hierarchy is defined by the microtick that is covered in Chapter ‘Clock Synchronization’.
Communication Cycle Execution
In the event triggered mode the communication cycle is executed under the control of a single master. Each node enters a phase called the cycle gap immediately after the end of the dynamic segment. If there is no dynamic segment the cycle gap begins at the end of the static segment. In the cycle gap the execution of the communication cycle is suspended until an event indication symbol (EIS) is received. The master issues the EIS symbol. Upon reception of the EIS symbol all nodes resume execution of the communication cycle.
Event Indication Symbol (EIS)
The Event Indication Symbol (EIS) is defined in Chapter ‘Coding and Decoding’. The second falling edge is used as the synchronization event (SyncEvent) on master and slave nodes. The EIS symbol is not required to be collision resilient. The trigger condition in the EIS is illustrated in
Clock Synchronization in Event Triggered Mode
Principle
Communication cycle timing in the event triggered mode is based on the EIS symbol. Since the start of a communication cycle is not predictable (and therefore the duration of a communication cycle is variable) there is no notion of time that can be used by the slave nodes to perform a clock rate correction, the EIS is simply used as a synchronizing event by the slave nodes and all subsequent timing is based on nominal (uncorrected) macroticks based on a timing grid that is set up by the arrival time of the EIS. The following paragraphs define the details of the clock synchronization for master and slave nodes.
Clock Synchronization of the Master Node
After the arrival of the CC trigger event on the master node, the symbol window starts and the master sends the EIS symbol within the symbol window at the beginning of the next microtick. While sending the EIS symbol, the timer vEDMTimer is initialized at the SyncEvent point with the configuration value pdMasterEIStoEndOfNIT (The parameter pdMasterEIStoEndOfNIT is expressed in microticks to minimize timing jitter.), which describes the duration between the SyncEvent point of the EIS and the end of the NIT.
When the timer vEDMTimer expires at the end of phase b (see
Beginning with the new cycle the master transmits a frame with ID 1. The cycle counter field of this frame is set to the master's local cycle counter.
Clock Synchronization of the Slave Node
If a slave is connected to two channels, the first valid reception of a EIS symbol on one of the two channels will be taken.
When a slave recognizes the reception of a valid EIS symbol, the timer vEDMTimer is provisionally initialized at the SyncEvent point with the configuration value pdSlaveEIStoEndOfNIT, which quantifies the duration between the SyncEvent point of the received EIS symbol and the end of the NIT (The parameter pdSlaveEIStoEndOfNIT is expressed in terms of the SyncEvent of the received EIS, and therefore should include the effects of any fixed network propagation delay. The parameter is expressed in microticks to minimize timing jitter.). The timer vEDMTimer will be committed when the EIS symbol was correctly received. The parameter pdSlaveEIStoEndOfNIT is configured during soft reset. When the timer vEDMTimer expires at the end of phase c (see
Using this procedure all slave nodes that receive the EIS and the master node switch consistently to the next communication cycle. During the startup phase the process is done in a different way (see below).
If the slave does not recognize the reception of a valid EIS symbol no action is performed. The local time proceeds until the reception of a new EIS symbol and the timing monitoring (see below) will signal an error.
Frame Processing in Event Triggered Mode
Frame Processing of the Master Node
The master node shall process frames using the procedure defined in Chapter ‘Frame Processing’ at the beginning of this document.
Frame Processing of the Slave Node
If no valid frame with frame ID 1 on at least one channel is correctly received in slot 1 after an EIS symbol on a slave node, then no communication will be performed by that slave node during the communication cycle (In this case, “no communication” means that no transmission of frames is possible. Receiving frames can be performed.). This will be indicated by setting S_Trig_Symb_Failure.
If at least one valid frame with ID 1 is received in slot 1 on a slave node, then the slave applies the frame checks described above with the exception that the cycle counter checks of slot 1 are handled as described below (In the descriptions below, it is assumed that a frame is only considered valid if all acceptance criteria other than cycle counter matching are met.):
After the first slot, all frames for the remainder of the communication cycle shall be processed using the procedure described in Chapter “Frame Processing” of this document.
Monitoring of Cycle Timing
The FlexRay event triggered mode has two different methods of monitoring the timing of the communication system, depending on whether a node is serving as the master or a slave:
The timing of the CC trigger is monitored by the master using a CC trigger window defined by two configuration parameters, pdExTrigCycleMin and pdExTrigCycleMax. The timing monitoring refers only to the external trigger source—the trigger sources ‘host trigger bit’ and ‘cycle timer’ do not affect the monitoring. There are three different cases with respect to the arrival of the CC trigger:
These conditions are depicted in
Monitoring of EIS Timing by the Slaves
The timing of the reception of Event Indication Symbols is monitored by the slaves through the use on an EIS window defined by two configuration parameters, pdEISSymbCycleMin and pdEISSymbCycleMax. There are three different cases with respect to the arrival of the EIS:
These conditions are depicted in
Startup and Reintegration—Event Triggered Mode
The following overview describes the CC behavior in the event triggered communication mode. Conditions for entering and exiting these states are described in Table 52.
If a node integrates into a running system or at startup, the cycle counter from the master is accepted without raising an error indication. The error indication is suppressed until integration is successfully completed.
State Diagram
Host Interface Requirements—Event Triggered Mode
For the event triggered communication mode the interrupt flags described above are available. Table 53 lists additional interrupt flags that are specific to the event triggered communications mode.
Every interrupt source described in Table 53 shall have an individual enable/disable mechanism.
Note:
It is possible to use the external source interrupt (EXT_SOR_INT) even if the external source is not used in order to gather information about the occurrence of external source trigger events.
Error Management—Master Triggered Mode
For the event triggered communication mode the error management described in Chapter “Error Signaling and Error Handling” applies in general. Only the treatment of frame with ID=1 is different. If a frame does not receive frame ID 1 after a correct EIS symbol, the slave node switches in Error (passive) and stops frame transmission until a next pair of valid EIS+frame Id 1 is received.
The error signaling counters are reinitialized during the transition at the beginning of the new communication cycle.
Controller Host Interface Example
Purpose
This chapter contains an example of a Controller Host Interface (CHI) that meets the Host Interface requirements defined in Chapter ‘Controller Host Interface’ and Chapter ‘Controller Host Interface Services’.
Some of these requirements are applicable to all FlexRay implementations and others are applicable only when specific optional protocol mechanisms are implemented.
Controller Status Registers
This section enumerates the registers that shall be supported by the Communication Controller to provide the host with status information regarding the operation of the controller, and the current value of different CC internal variables. The current controller status shall be provided on read request of the host. The status registers holding internal variables shall be cleared at the state transitions L1, L5 and L6 of the HW state machine (see Section ‘CC State Diagram’) and shall be updated by the CC. The host shall have read-only access to the status information. The host is generally not able to modify the contents of these registers, with the exception of some error flags, that may be cleared by the host.
Product Version Register
The CHI shall provide a 16-bit read-only register to hold the FlexRay Product Version Number. This number identifies the manufacturer, the product and the implemented protocol version in order to allow the user to distinguish between different products. Starting with the MSB, the register shall be used as follows:
The semiconductor manufacturer shall agree this version number with the FlexRay Consortium.
Current Cycle Counter Value
The CHI shall provide a 6-bit register to hold the current cycle counter value (vCycle). The content shall be incremented by CC at start of cycle.
Current Macrotick Value
The CHI shall provide a 16-bit register to hold the current macrotick value (vMacrotick). The content shall be incremented by CC and reset at start of cycle.
Rate Correction Value
The CHI shall provide an 8-bit register to hold the rate correction value (vRateCorrection) applied by the clock sync in the current cycle. (See Section ‘Calculation of the Rate Correction Value’)
Offset Correction Value
The CHI shall provide an 8-bit register to hold the offset correction value (vOffsetCorrection) applied by clock sync in the current cycle. (See Section ‘Calculation of the Offset Correction Value’)
Valid Sync Frames Channel A (VSFC_A)
The CHI shall provide a 5-bit register indicating the number of valid Sync Frames received in the previous cycle. The variable shall only be updated at the end of the static segment with the counter value VSFC_A.
Valid Sync Frames Channel B (VSFC_B)
The CHI shall provide a 5-bit register indicating the number of valid Sync Frames received in the previous cycle. The variable shall only be updated at the end of the static segment with the counter value VSFC_B.
Sync Frames used for Clock Sync
The CHI shall provide a 5-bit register indicating the number of valid Sync Frame pairs used for the calculation of the rate correction terms in the previous cycle. The register shall only be updated at the end of the NIT of the odd cycle with the counter value vValidSyncFrameCount. (See Section ‘Clock Synchronization—General Concepts’)
Missing Rate Correction Signal (MRCS)
The CC shall provide a flag to signal to the host, that no rate correction can be performed because no pairs of (even/odd) Sync Frames were received. The flag shall be reset by the CC after successful rate correction. (See Section ‘Missing Rate Correction Signal (MRCS)’)
Missing Offset Correction Signal (MOCS)
The CC shall provide a flag to signal to the host, that no offset correction can be performed because no Sync Frames were received in an odd cycle. The flag shall be reset by the CC after successful offset correction. (see Section ‘Missing Offset Correction Signal (MOCS)’)
Clock Correction Failed Counter (CCFC)
The CC shall provide a 4-bit counter that is incremented by one at the end of any odd communication cycle where either the Missing Offset Correction error or Missing Rate Correction error are active. The CCFC shall be reset to zero at the end of an odd communication cycle if neither the Offset Correction Failed nor the Rate Correction Failed errors are active. The CCFC stops at 15. (see Section ‘Clock Correction Failed Counter (CCFC)’)
Startup Majority Missed Signal (SMMS)
The CC shall provide a flag to signal to the host that the CC has received a set of sync frames during startup that did not result in a majority of the sync frames agreeing with the local view of the system time (see Section ‘Startup Majority Missed Signal (SMMS)’). The SMMS shall be reset by host interaction or when the CC performs the state transition L5 or L6 of the HW state machine (see Section ‘CC State Diagram’).
Protocol Error State
The CC shall provide 2 bits indicating the current protocol error state. (See Section ‘Protocol Error State Signal’)
Startup Status Vector
The CC shall provide a Startup Status Vector with following status flags:
A logical ‘1’ indicates the truth condition for each status flag.
For details see Section ‘Communication Startup and Reintegration’.
Bus Guardian Schedule Monitoring Error (BGME)
The CC shall provide a flag to signal a bus guardian schedule monitoring violation (vBgsmError) to the host. The flag shall be set by the schedule monitoring mechanism and shall be cleared only by the host. (see Section ‘Bus Guardian Schedule Monitoring Error (BGME)’)
Clock Correction Limit Reached (CCLR)
The CC shall provide a flag to signal to the host, that the Offset Correction Value (vOffsetCorrection) has reached the red region (vOffsetCorrection>gOffsetCorrectionOut). The CC shall only have the capability to set this flag. The flag shall remain set until it is cleared by the host. (See Section ‘Value Limitations’ and Section ‘Clock Correction Limit Reached (CCLR)’).
Media Access Test Warning
The CC shall provide a flag (pMATestWarning) to signal to the host, that the CC has received a Media Access Test Symbol (MTS) during the symbol window. The CC shall only have the capability to set this flag. The flag shall remain set until it is cleared by the host.
Wakeup Status Vector
The CC shall provide a Wakeup Status Vector with following status flags:
The CC shall provide a Communication Controller Status Vector with following status flags indicating the actual operation mode of the CC:
The CC shall set the status flag when entering the corresponding state or operation mode and shall clear it after leaving it, independent of the settings in the different configuration registers. For details see below and Sections ‘HW States of the CC’, and ‘Startup State Diagram—Time Triggered Protocol Mode (TT-D and TT-M)’.
Configuration and Control Registers
This section enumerates the registers supported by the Communication Controller to allow the host to control the operation of the CC. The host shall have write and read access to all configuration data.
Configuration data shall not be changed by the CC during normal operation. The CC shall reset the configuration data on its transition L1 from the CC_HWReset state (see Section ‘HW States of the CC’).
Module Configuration Register
The Module Configuration Register (MCR) enables the host to configure basic operating modes in the CC. (see Section ‘HW States of the CC’) The MCR shall provide the following control bits:
The CC shall provide a clock prescaler register consisting of the following three fields:
The CC shall provide a 16-bit register to hold the maximum expected clock deviation of the oscillator during one communication cycle (gdMaxDrift) in microticks, configurable only in CC_SoftReset.
Sample Voting Offset
The CC shall provide a 4-bit register to configure the offset from the start of the voting window (pVotingOffset) that is used to determine the value of a received bit from the start of the bit cell. This offset defines the first sample of the bit that shall be considered for the voting; configurable only in CC_SoftReset. (See Section ‘Bit Value Voting’)
Voting Samples
The CC shall provide a 4-bit register to configure the number of samples in the voting window (pVotingSamples) that are used to determine the value of a received bit; configurable only in CC_SoftReset. (See Section ‘Bit Value Voting’)
Nominal Macrotick Length
The CC shall provide an 8-bit register to hold the nominal (uncorrected) number of microticks per macrotick (pMicroPerMacroNom); may be modified only in CC_SoftReset.
Bus Guardian Tick
The CC shall provide a 4-bit register to configure the length of the Bus Guardian Tick (BGT) to be provided by the CC to the bus guardian in multiples of the CC microtick; configurable only in CC_SoftReset.
Static Slot Length
The CC shall provide an 8-bit register to configure the duration of a static slot (gdSlot) in minislots; may be modified only in CC_SoftReset. The static slot length must be identical in all nodes of a cluster.
Static Frame Data Length
The CC shall provide a 7-bit register to configure the (fixed) frame length (gPayloadLengthStatic) for all frames sent in the static part in double bytes; may be modified only in CC_SoftReset. The static slot length must be identical in all nodes of a cluster.
Number of Static Slots
The CC shall provide a 12-bit register to configure the number of static slots in a cycle (gNumberOfStaticSlots); may be modified only in CC_SoftReset. The static slot length must be identical in all nodes of a cluster.
The CC shall provide a 16-bit register to configure the duration of one communication cycle (gMinislotPerCycle) in minislots; may be modified only in CC_SoftReset. The cycle length must be identical in all nodes of a cluster.
Network Idle Time
The CC shall provide an 8-bit register to configure the duration of the network idle time (gdNetworkIdle) at the end of the communication cycle in minislots; may be modified only in CC_SoftReset.
Start of Latest Transmit
The CC shall provide a 16-bit register to configure the maximum minislot value (pdLatestTX) allowed before inhibiting new frame transmissions in the dynamic section of the cycle, expressed in terms of minislots from the beginning of the cycle; may be modified only in CC_SoftReset.
Transmission Start Sequence Duration
The CC shall provide a 4-bit register to configure the duration of the Transmission Start Sequence (TSS) (gdTransmissionStartSequence) in terms of bit times (gdBit); may be modified only in CC_SoftReset, and shall be identical in all nodes of a cluster.
Symbol Window Length
The CC shall provide an 8-bit register to configure the length of the symbol window in minislots; may be modified only in CC_SoftReset.
Media Access Test Cycle Counter
The CC shall provide a 6-bit register to configure the cycle counter value (pMATestCycle) in which the CC shall send the Media Access Test Symbol (MTS) periodically to perform the Media Access Test.
Media Access Test Enable
The CC shall provide a configuration flag (pMATestEnable) to enable the CC to periodically perform the Media Access Test if bit set. The flag shall be reset by default and may be modified only in CC_SoftReset.
External Clock Correction Acceptance
The CC shall provide a configuration flag to allow external clock correction when set. The flag shall be reset by default after power on reset and may be modified only in CC_SoftReset. The CC shall ignore the external clock corrections if this bit is not set.
Maximum Offset Correction
The CC shall provide an 8-bit register to hold the maximum permitted offset correction value (gOffsetCorrectionOut) to be applied during regular clock synchronization algorithm; may be modified only in CC_SoftReset. The CC checks the sum of internal and external offset correction against the gOffsetCorrectionOut parameter. (See Section ‘Correction Term Calculation—Value Limitations’)
Maximum Initial Offset Correction
The CC shall provide an 8-bit register to hold the initial offset correction value (gOffsetCorrectionInitOut) to be applied by the clock synchronization algorithm in the IntegrationVCW state; may be modified only in CC_SoftReset. (See Section ‘CC_IntegrationVWC State’)
Maximum Rate Correction
The CC shall provide an 8-bit register to hold the maximum permitted rate correction value (gRateCorrectionOut) to be applied by the internal clock synchronization algorithm; may be modified only in CC_SoftReset. The CC checks the sum of internal and external rate correction against the gRateCorrectionOut parameter. (See Section ‘Correction Term Calculation—Value Limitations’)
Cluster Drift Damping
The CC shall provide a 4-bit register to hold the cluster drift damping value (pClusterDriftDamping) used in clock synchronization to minimize accumulation of rounding errors; configurable only in CC_SoftReset. (See Section ‘Calculation of the Rate Correction Value’)
Bus Guardian Enable Duration for BGSM
The CC shall provide a 12-bit register to configure the duration (pBgenStaticDuration) of the bus guardian enable signal for the transmission phase of a static slot in macroticks. This shall be checked by the CC with the BGE signal produced by the bus guardian; may be modified only in CC_SoftReset. (See Section ‘BG Schedule Monitoring Service’)
Bus Guardian Dynamic Segment Enable Duration for BGSM
The CC shall provide a 16-bit register to configure the duration (pBgeDynamicDuration) of the bus guardian enable signal for the transmission phase of the dynamic segment in macroticks. This shall be checked by the CC with the BGE signal produced by the bus guardian; may be modified only in CC_SoftReset. (See Section ‘BG Schedule Monitoring Service’)
Bus Guardian Symbol Window Enable Duration for BGSM
The CC shall provide an 8-bit register to configure the duration (pBgeSymbolDuration) of the bus guardian enable signal for the transmission phase of the symbol window in macroticks. This shall be checked by the CC with the BGE signal produced by the bus guardian; may be modified only in CC_SoftReset. (See Section ‘BG Schedule Monitoring Service’)
BG Schedule Monitoring in Symbol Window
The CC shall provide a configuration flag (pBgsmSymWinDisabled) to disable bus guardian schedule monitoring during the symbol window when set; may be modified only in CC_SoftReset. (See Section ‘BG Schedule Monitoring Service’)
BG Schedule Monitoring in Dynamic Segment
The CC shall provide a configuration flag (pBgsmDynSegDisabled) to disable bus guardian schedule monitoring during the dynamic segment when set; may be modified only in CC_SoftReset. (See Section ‘BG Schedule Monitoring Service’)
Timer Interrupt Configuration Registers
The CC shall provide two Timer Interrupt Configuration Registers to enable the host to configure two different timer interrupts. Each register shall contain three fields:
In the CC a configuration switch decides whether the transmitter may add missing data bytes if the configured frame data length exceeds the length of the buffer data field. The configuration switch applies to all transmit buffers of the CC. The flag shall be disabled (logical ‘0’) by default, may be enabled (logical ‘1’) only in CC_SoftReset.
Cold Start Max
The CC shall provide an 8-bit register to configure the maximum number of cycles (gColdStartMax) that a cold starting node is permitted to try to start up the network without receiving any valid response from another node; configurable only in CC_SoftReset. If the value is “0” the CC is not allowed to start up the communication.
Cold Start Inhibit
The CC shall provide a configuration flag (vColdStartInhibit) to disable the cold starting of a node during wake-up when set. (See Section ‘ColdStart-Inhibit Mode’)
Max. without Clock Correction Passive
The CC shall provide a 4-bit register configurable with the number of cycles without performing rate correction (gMaxWithoutClockCorrectionPassive) when the CC shall enter the “Yellow” state. The register can be configured only in CC_SoftReset. (See Section ‘Error Handling for TT-D and TT-M Protocol Modes’)
Max. without Clock Correction Fatal
The CC shall provide a 4-bit register configurable with the number of cycles without performing rate correction (gMaxWithoutClockCorrectionFatal) when the CC shall enter the “Red” state. The register can be configured only in CC_SoftReset. (See Section ‘Error Handling for TT-D and TT-M Protocol Modes’)
Wake-Up Symbol Definition Registers
The CHI shall provide following registers to configure the parameters needed by the CC to send and receive the wake-up symbol:
The CC shall provide two 8-bit registers to configure the average delay compensation values for each channel (pDelayCompensationChx) in microticks; configurable only in CC_SoftReset. (See Section ‘Time Measurement’)
Buffer Control Register
The configuration of the message mailbox buffers (as Transmit, Dedicated Receive or FIFO Receive buffer) and host's access to the mailbox message buffers shall be controlled by the use of a Buffer Control Register.
(See below for implementation guidelines)
Clock Correction Registers
This section enumerates the registers the Communication Controller shall provide to allow external clock correction by the host. The host shall have write and read access to these registers.
The CC shall have read-only access during normal operation. The CC shall reset the configuration data during power on reset.
External Offset Correction
The CC shall provide an 8-bit register to hold the external clock offset correction value (vOffsetCorrectionExtern) in microticks to be applied by the internal clock synchronization algorithm when the External Clock Correction Acceptance bit is set (See above). The register content is supposed to be written by the host before start of the Network Idle Time (NIT) and it shall be consumed when applied by the CC. (See Section ‘External Clock Synchronization (Optional)’)
External Rate Correction
The CC shall provide an 8-bit register to hold the external clock rate correction value (vRateCorrectionExtern) in microticks to be applied by the internal clock synchronization algorithm when the External Clock Correction Acceptance bit is set (See above). The register content is supposed to be written by the host before start of the Network Idle Time (NIT) and it shall be consumed when applied by the CC. (See Section ‘External Clock Synchronization (Optional)’).
Message Buffers
The communication controller has to provide an implementation specific number of configurable message buffers for data communication with an implementation specific frame length up to the maximum of 254 data bytes. The message buffers shall be configurable to be used as transmit, dedicated receive or FIFO receive buffers.
Each buffer shall include the complete frame header and data field, and shall not include the frame CRC (See Section ‘FlexRay Frame Format’ for details). The CC shall provide suitable mechanisms to grant a secure access to the buffers. Using a suitable mechanism, either the CC or the host shall get access to one particular buffer. A predefined number of buffers shall be configurable during CC_SoftReset only while the others shall be reconfigurable during runtime.
Transmit Buffers
A portion of message buffers shall be configurable as transmit buffers.
There shall be one explicit transmit buffer, which is dedicated to be configured to hold the transmitted Sync frame of a node, if it transmits one, and which can be reconfigured only in CC_SoftReset. This shall ensure that for Sync Frames, the Sync Frame ID, Sync Bit, Payload Length and the corresponding header CRC can be changed only during CC_SoftReset, and that any node transmits at most one Sync frame per communication cycle. The CC shall provide mechanisms that do not allow the transmission of sync frames from other buffers.
For transmit frames in the dynamic segment reconfigurable buffers can be used. The frame ID, the header CRC, and the corresponding Payload Length shall be reconfigurable during runtime.
The CC shall not have the capability to calculate the transmit header CRC. The host is supposed to provide the frame IDs and header CRC's for all transmitted frames.
The CC shall not permit any write access by the host to the Null Frame Indication Bit.
The length field in all messages (static and dynamic) reflects the frame payload data length as defined in the frame format. The CC may use mailbox transmit buffer structures shorter than the actual configured data frame length in the static segment. In this case, the CC shall generate padding bytes—if enabled—to ensure that frames have proper physical length. However, this capability must be enabled via configuration (See above). The padding pattern shall be logical zero. The padding function shall apply only to frames to be transmitted in the static part. In the dynamic part no frame shall be transmitted if the data field in the buffer is shorter than the configured data length.
An indicator shall be provided for each transmit message buffer to indicate if the message was transmitted by the CC, respectively updated by the host. The host shall explicitly set this “Commit” flag when the buffer is ready for transmission. In the “Single-shot Mode” the CC shall reset the flag after transmission has been completed and the host may access the buffer for writing next message into the buffer. This hand-shaking flag shall be reset on the CC's transition from the CC_HWReset state (See Section ‘CC_HWReset State’).
The CC shall not transmit frame data from a buffer that the host is updating. The CC shall not transmit the message data out of the buffer before the host has indicated that the update is completed by setting the “Commit” flag.
Null Frame Transmission
The CHI shall provide for each transmit buffer a flag to allow the host to configure the transmission mode for the buffer. If this bit is set, the transmitter shall operate in the static segment in the so-called “Single-shot Mode”. If this bit is cleared, the transmitter shall operate in the static segment in the so-called “Continuous Mode”.
If a buffer is configured in the “Single-shot Mode”, the configured frame will be sent out by the transmitter only once after the host has set the “Commit” flag. As defined above, the CC resets the flag after transmission. If the host does not set the “Commit” flag before transmit time and there is no other transmit buffer with matching frame ID and cycle counter filter, the CC shall transmit a Null Frame with the Null Frame bit (fNullFrameIndicationBit) set and the payload data set to ‘0’.
If a buffer is configured in the “Continuous Mode”, the CC shall not reset the “Commit” flag after transmission. If the “Commit” flag is set, the frame shall be sent out any time the frame ID and cycle counter filter match. If the host clears the “Commit” flag and there is no other transmit buffer with matching frame ID and cycle counter filter, the CC shall transmit a Null Frame with the Null Frame bit (fNullFrameIndicationBit) set and the payload data cleared.
If a static slot is assigned to the CC, it shall transmit a Null Frame with the Null Frame Indication Bit (fNullFrameIndicationBit) set, and the rest of the frame header and the frame length unchanged (See Section ‘Null Frame Indication Bit’) in any of the following cases:
Null Frames shall not be transmitted in the dynamic segment.
Receive Buffers
A portion of the CC's message buffers shall be configurable as dedicated receive buffers.
The CC shall transfer only valid received messages from the serial receive message buffer to the dedicated receive buffer with the matching filter configuration (See below).
A receive message buffer shall contain space for all frame elements as defined in Chapter ‘Frame Formats’, except the frame CRC.
The payload length information presented to the host shall reflect the length indicated by the received payload length code, not any other value.
If no frame, null frame, or corrupted frame is received in a slot, the buffer contents prior to the reception shall not be deleted or overwritten. The discrepancy to the configured frame should be signaled to the host using a suitable bit in the corresponding buffer status register.
An indicator shall be provided for each dedicated receive message buffer to indicate if it contains new data (updated by the CC since last read). The host is responsible for clearing this flag after the read operation.
The CC shall not store frame data into a dedicated receive buffer that the host is reading.
The host shall not have write access to the dedicated receive buffers during normal operation. The host shall have write access to the dedicated receive buffers only while configuring the buffer in CC_SoftReset with the needed parameters for the dedicated receive process.
Null Frame Reception
The payload of a received Null Frame shall not be copied into the matching mailbox receive buffer. The reception of the Null Frame shall be signaled to the host by setting an appropriate bit in the receive buffer status register. (See below)
FIFO Receive Buffers
A portion of the CC's message buffers can be configured as FIFO receive buffers.
The CC shall transfer only valid received messages from the serial receive message buffer to the FIFO receive buffer if there is no matching dedicated receive buffer and the header is not rejected by the FIFO Rejection filter (See below).
A FIFO receive message buffer shall contain all frame elements as defined in Chapter “Frame Formats”, except the frame CRC.
An indicator shall be provided to indicate that a message was stored in a FIFO receive buffer by the CC. The indicator shall provide the information ‘FIFO not empty’. The CC shall reset the flag after all messages have been accessed by the host.
The CC shall not store frame data into a FIFO receive buffer that the host is reading. The data shall be stored into the next free FIFO buffer.
Frame Status and Error Information (FSEI)
There shall be dedicated frame status and error information associated with each message buffer. The Frame Status and Error Information contains 8 bits which are summarized in the following Table 54:
The vector content shall be updated at the end of the corresponding slot (defined by the configured Frame ID, See Section ‘Frame Status and Error Information (FSEI)’) by the communication controller and can be checked by the host. The flags shall be set if one of the listed errors is detected by the communication controller during the frame acceptance checks. (See Chapter “Frame Processing”) The vector content shall always show the status of the latest slot, which means that errors from previous cycles shall be overwritten.
The first seven flags refer specifically to the configured channel, on that the frame shall be received (see below), while the other two refer to the other channel.
In searching for Frame ID matches, searching shall commence with the first receive buffer. It shall proceed incrementally through the remaining receive buffers. If more than one receive buffer holds the same Frame ID and cycle counter filter, the error vector shall be updated in the first matching buffer.
Filtering and Masking
Definitions
Frame Filtering
Frame filtering shall be done by checking specific fields in a frame against corresponding configuration constants in the buffer, with the stipulation that the received frame shall only be processed further if the required matches occur. Otherwise, it shall be discarded. Frames shall be filtered on the following frame fields:
The CC shall provide a mechanism to mask the frame filters. The filtering parameters masked by the host shall be disregarded (set to “don't care”).
Filtering Mechanisms
The filtering mechanisms described below shall be applied differently for receive and transmit message buffers
There shall be a Channel Filtering field (2 bits) associated with each buffer. It serves as a filter for a receive message buffer, and as a control field for a transmit message buffer.
Depending on the buffer configuration (see Table 55)
Transmit buffer: the content of the buffer is transmitted only on the channels specified in the Channel Filtering Field when the Cycle Counter Filtering and Frame Id Filtering criteria are also met.
Frame ID Filtering
Every Transmit and dedicated Receive message buffer shall contain a frame ID. This frame ID shall be used differently for receive and transmit message buffers.
Cycle Counter Filtering is based on the notion of a Cycle Set. For filtering purposes, a match shall be detected if any one of the elements of the set is matched.
The operation of the filtering mechanism depends on the configuration of the buffer:
Message ID filtering applies only for receive message buffers and shall be used by the CC if the message Id filtering is configured (gMsgIdFilter=‘1’) (see above). For message ID filtering the first two data bytes out of the receive buffer shall be used. The received frame shall be stored in the configured receive buffer if the message ID, channel and cycle counter match. The frame ID shall be stored in the buffer, but ignored for filtering.
There shall be no message ID filtering used for frame transmission.
FIFO Filtering
For FIFO filtering there shall be one Rejection Filter and one Rejection Filter Mask available. Each register consists of 39 bits for channel (2 bits), frame ID (12 bits), cycle counter (9 bits), and message ID (16 bits). The two registers shall be reconfigurable only in CC_SoftReset.
A received frame shall be stored in the next free FIFO buffer if the channel, frame ID, cycle counter, and message ID are not rejected by the configured reject and mask reject filter and if there is no matching dedicated receive buffer available.
General Interrupts
Interrupts shall be triggered almost immediately when an error is detected by the controller, a frame is received or transmitted, or a configured timer interrupt is activated. This enables the host to react very quickly on specific error conditions, timers and events. The CC shall support disable/enable controls for each individual interrupt, separately and as a whole.
Tracking status and generating interrupts when a status change occurs shall be two independent tasks. Regardless of whether an interrupt is enabled, or not, the corresponding status should be tracked and indicated by the CC.
At least one hardware interrupt line shall be available to signal an interrupt to the host.
General Interrupt Register
The communication controller shall provide a General Interrupt and Error Indication Register.
The flags shall be set when the communication controller detects one of the listed errors or events. (See Sections ‘Channel Status and Error Information (CSEI)’ and ‘Frame Reception’) If the host checks the vector, it must reset the values so that the CC can update them.
The communication controller shall provide a General Error Interrupt, which shall be triggered when any of the flags is set, provided the corresponding interrupt is enabled.
General Interrupt Enable Register
The CC shall provide for each general interrupt indication flag a General Interrupt Enable flag. The settings in the General Interrupt Enable Register determine which status changes in the General Interrupt Register shall result in an interrupt.
Receive Interrupt Status Register
The communication controller shall provide a Receive Interrupt Status Register to indicate the reception of a valid frame (stored in one of the receive buffers), a Collision Avoidance Symbol (CAS), a Wake-up Symbol, a Media Access Test Symbol (MTS), an Event Indication Symbol (EIS), a Status Normal Symbol (SNS), a Status Alarm Symbol (SAS) or an optical diagnosis signal (when using an optical physical layer). The flags shall be set by the CC when a corresponding event occurs. If enabled, an interrupt is pending while one of the bits is set. If the host checks the vector, it must reset the values so that the CC can update them.
Following read-only bits shall be readable by host:
The communication controller shall provide a Receive Interrupt Enable Register to enable each of the Receive Interrupt Status Register flags separately. The settings in the Receive Interrupt Enable Register determine which status changes in the Receive Interrupt Status Register shall result in an interrupt.
General Error and Status Interrupt Enable Register
The CC shall provide an interrupt enable flag to individually enable each of the following status and errors:
The settings in the General Error and Status Interrupt Enable Register determine which status or error flags changes shall result in an interrupt. (See above)
Requirements for Optional Mechanisms
Network Management Services
If NM services are supported, the CHI shall provide the following:
If the optical diagnosis service is supported, the CHI shall provide the following:
The CHI shall provide one Buffer Control Register to configure the message mailbox buffers (as Transmit, Dedicated Receive or FIFO Receive buffer) and to control host's access to the message buffers.
This control register shall provide one byte for each mailbox buffer.
(Note:
The host can modify the control flags CFG and CFG_SR only during CC_SoftReset.)
Indication of Bus Events
The communication controller shall provide additional output signals to indicate the following events:
The exact attribution of events to interrupt vectors or lines shall be described in the documentation of the respective communication controller implementation.
In order to enable error monitoring in a star node the communication controller shall provide four output signals with the setting of internal status flags indicated by means of a pulse.
The
If an internal event is indicated, the corresponding signal shall be switched to the active state for a defined time, in order to generate a short logical “1” signal with a duration of at least 50 ns.
The SLMM signal confirms the reception of a frame with a correct format and correct CRC, even if the frame identifier deviates from the slot counter value at reception time.
The ERR signal indicates an error as described above.
The ROK signal indicates that a correct frame or a valid symbol has been received even if the message was not copied into a buffer in the communication controller.
The SOC signal confirms that a valid SOC symbol (Normal or Alarm) has been received or sent. It can be used to trigger timers or to start synchronized software tasks with every SOC.
Every communication controller should be able to generate at least the signals ERR, ROK and SOC.
System Parameters
The following parameters are used in the description of the present invention. Any values and ranges of the parameters are given by way of example and imply no restriction what so ever.
Protocol Constants
Global Cluster Constants
Cluster-Wide Technology-Dependent Constants (The constants listed here define implementation-specific restrictions. The specified values apply for the FlexRay bus guardian from Philips. Worst-case restrictions apply to the whole cluster if bus guardian devices from different semiconductor vendors are mixed in a cluster.)
Node Constants
Node Variables
Frame Variables
Event Indications
Glossary
In the following glossary some of the terms used for the description of the present invention are defined.
Communication Channel The inter-node connection through which signals are conveyed for the purpose of communication. The communication channel abstracts both the network topology, i.e. bus or star, as well as the physical transmission medium, i.e. electrical or optical.
Number | Date | Country | Kind |
---|---|---|---|
02 008 171.7 | Apr 2002 | EP | regional |
102 16 984.5 | Apr 2002 | DE | national |
This application is a continuation of PCT/EP03/03992 filed on Apr. 16, 2003 and also claims Paris Convention priority of EP 02 008 171.7 and DE 102 16 984.5 both filed on Apr. 16, 2002, the entire disclosures of which are all hereby incorporated by reference.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/EP03/03992 | Apr 2003 | US |
Child | 10613000 | Jul 2003 | US |