FlexRay Protocol Specification V2.1 Rev.A
FlexRay Protocol Specification V2.1 Rev.A
Protocol Specification
Version 2.1
2.1 Revision A
FlexRay Protocol Specification Disclaimer
Disclaimer
This specification as released by the FlexRay Consortium is intended for the purpose of information only.
The use of material contained in this specification requires membership within the FlexRay Consortium or
an agreement with the FlexRay Consortium. The FlexRay Consortium will not be liable for any unauthorized
use of this Specification.
Following the completion of the development of the FlexRay Communications System Specifications
commercial exploitation licenses will be made available to End Users by way of an End User's License
Agreement. Such licenses shall be contingent upon End Users granting reciprocal licenses to all Core
Partners and non-assertions in favor of all Premium Associate Members, Associate Members and Devel-
opment Members.
All details and mechanisms concerning the bus guardian concept are defined in the FlexRay Bus Guardian
Specifications.
The FlexRay Communications System is currently specified for a baud rate of 10 Mbit/s. It may be extended
to additional baud rates.
No part of this publication may be reproduced or utilized in any form or by any means, electronic or
mechanical, including photocopying and microfilm, without permission in writing from the publisher.
The Core Partners of the FlexRay Consortium are BMW AG, DaimlerChrysler AG, Freescale Halbleiter
Deutschland GmbH, General Motors Corporation, Philips GmbH, Robert Bosch GmbH, and Volkswagen
AG.
Table of Contents
Chapter 1
Introduction.............................................................................................................. 10
1.1 Scope .............................................................................................................................................10
1.2 References .....................................................................................................................................10
1.2.1 FlexRay consortium documents ........................................................................................... 10
1.2.2 Non-consortium documents.................................................................................................. 10
1.3 Revision history ..............................................................................................................................12
1.4 Terms and definitions .....................................................................................................................13
1.5 Acronyms and abbreviations ..........................................................................................................16
1.6 Notational conventions ...................................................................................................................18
1.6.1 Parameter prefix conventions............................................................................................... 18
1.6.2 Color coding ......................................................................................................................... 18
1.7 SDL conventions ............................................................................................................................19
1.7.1 General................................................................................................................................. 19
Chapter 2
Protocol Operation Control .................................................................................... 29
2.1 Principles ........................................................................................................................................29
2.1.1 Communication controller power moding ............................................................................. 29
2.2 Description......................................................................................................................................31
2.2.1 Operational overview............................................................................................................ 32
2.2.1.1 Host commands............................................................................................................ 33
2.2.1.2 Error conditions ............................................................................................................ 33
2.2.1.2.1 Errors causing immediate entry to the POC:halt state ..........................................33
2.2.1.2.2 Errors handled by the degradation model .............................................................34
2.2.1.3 POC status ................................................................................................................... 34
2.2.1.4 SDL considerations for single channel nodes .............................................................. 36
2.3 The Protocol Operation Control process ........................................................................................36
2.3.1 POC SDL utilities.................................................................................................................. 37
Chapter 3
Coding and Decoding ............................................................................................. 54
Chapter 4
Frame Format........................................................................................................... 90
4.1 Overview.........................................................................................................................................90
4.2 FlexRay header segment (5 bytes) ................................................................................................90
4.2.1 Reserved bit (1 bit) ............................................................................................................... 90
4.2.2 Payload preamble indicator (1 bit) ........................................................................................ 91
4.2.3 Null frame indicator (1 bit) .................................................................................................... 91
4.2.4 Sync frame indicator (1 bit)................................................................................................... 91
4.2.5 Startup frame indicator (1 bit) ............................................................................................... 92
4.2.6 Frame ID (11 bits)................................................................................................................. 92
4.2.7 Payload length (7 bits).......................................................................................................... 93
4.2.8 Header CRC (11 bits) ........................................................................................................... 93
4.2.9 Cycle count (6 bits)............................................................................................................... 94
4.2.10 Formal header definition..................................................................................................... 94
Chapter 5
Media Access Control ........................................................................................... 100
5.1 Principles ......................................................................................................................................100
5.1.1 Communication cycle ......................................................................................................... 100
5.1.2 Communication cycle execution ......................................................................................... 101
5.1.3 Static segment.................................................................................................................... 102
5.1.3.1 Structure of the static segment................................................................................... 102
5.1.3.2 Execution and timing of the static segment ................................................................ 102
5.1.4 Dynamic segment............................................................................................................... 103
5.1.4.1 Structure of the dynamic segment.............................................................................. 103
5.1.4.2 Execution and timing of the dynamic segment ........................................................... 103
5.1.5 Symbol window................................................................................................................... 106
5.1.6 Network idle time ................................................................................................................ 107
5.2 Description....................................................................................................................................107
5.2.1 Operating modes ................................................................................................................ 108
5.2.2 Significant events ............................................................................................................... 109
5.2.2.1 Reception-related events............................................................................................ 109
5.2.2.2 Transmission-related events ...................................................................................... 109
5.2.2.3 Timing-related events ................................................................................................. 110
5.3 Media access control process ......................................................................................................110
5.3.1 Initialization and state MAC:standby .................................................................................. 110
5.3.2 Static segment related states ............................................................................................. 112
5.3.2.1 State machine for the static segment media access control ...................................... 112
5.3.2.2 Transmission conditions and frame assembly in the static segment.......................... 114
5.3.3 Dynamic segment related states ........................................................................................ 116
5.3.3.1 State machine for the dynamic segment media access control ................................. 116
5.3.3.2 Transmission conditions and frame assembly in the dynamic segment..................... 120
5.3.4 Symbol window related states ............................................................................................ 121
5.3.4.1 State machine for the symbol window media access control ..................................... 121
5.3.4.2 Transmission condition in the symbol window............................................................ 122
5.3.5 Network idle time ................................................................................................................ 122
Chapter 6
Frame and Symbol Processing ............................................................................ 124
6.1 Principles ......................................................................................................................................124
6.2 Description....................................................................................................................................124
6.2.1 Operating modes ................................................................................................................ 125
6.2.2 Significant events ............................................................................................................... 126
6.2.2.1 Reception-related events............................................................................................ 126
6.2.2.2 Decoding-related events............................................................................................. 127
6.2.2.3 Timing-related events ................................................................................................. 127
6.2.3 Status data ......................................................................................................................... 128
6.3 Frame and symbol processing process........................................................................................130
Chapter 7
Wakeup and Startup.............................................................................................. 142
7.1 Cluster wakeup.............................................................................................................................142
7.1.1 Principles ............................................................................................................................ 142
7.1.2 Description.......................................................................................................................... 143
7.1.3 Wakeup support by the communication controller.............................................................. 144
7.1.3.1 Wakeup state diagram................................................................................................ 144
7.1.3.2 The POC:wakeup listen state ..................................................................................... 146
7.1.3.3 The POC:wakeup send state...................................................................................... 147
7.1.3.4 The POC:wakeup detect state.................................................................................... 148
7.1.4 Wakeup application notes .................................................................................................. 148
7.1.4.1 Wakeup initiation by the host...................................................................................... 148
7.1.4.1.1 Single-channel nodes ..........................................................................................149
7.1.4.1.2 Dual-channel nodes.............................................................................................149
7.1.4.1.2.1 Wakeup pattern reception by the bus driver................................................150
7.1.4.1.2.2 Wakeup pattern reception by the communication controller........................151
7.1.4.2 Host reactions to status flags signaled by the communication controller ................... 151
7.1.4.2.1 Frame header reception without coding violation ................................................151
7.1.4.2.2 Wakeup pattern reception ...................................................................................152
7.1.4.2.3 Wakeup pattern transmission ..............................................................................152
7.1.4.2.4 Termination due to unsuccessful wakeup pattern transmission ..........................152
7.1.4.3 Retransmission of wakeup patterns ........................................................................... 152
7.1.4.4 Transition to startup.................................................................................................... 152
Chapter 8
Clock Synchronization.......................................................................................... 169
8.1 Introduction...................................................................................................................................169
8.2 Time representation......................................................................................................................170
8.2.1 Timing hierarchy ................................................................................................................. 170
8.2.2 Global and local time .......................................................................................................... 171
8.2.3 Parameters and variables................................................................................................... 171
8.3 Synchronization process ..............................................................................................................172
8.4 Startup of the clock.......................................................................................................................175
8.4.1 Cold start startup ................................................................................................................ 177
8.4.2 Integration startup............................................................................................................... 177
8.5 Time measurement.......................................................................................................................180
8.5.1 Data structure ..................................................................................................................... 181
8.5.2 Initialization......................................................................................................................... 182
8.5.3 Time measurement storage................................................................................................ 183
8.6 Correction term calculation...........................................................................................................184
8.6.1 Fault-tolerant midpoint algorithm ........................................................................................ 184
8.6.2 Calculation of the offset correction value............................................................................ 185
8.6.3 Calculation of the rate correction value .............................................................................. 187
8.6.4 Value limitations ................................................................................................................. 189
8.6.5 External clock synchronization ........................................................................................... 190
8.7 Clock correction............................................................................................................................190
8.8 Sync frame configuration rules .....................................................................................................193
Chapter 9
Controller Host Interface ...................................................................................... 194
9.1 Principles ......................................................................................................................................194
9.2 Description....................................................................................................................................194
9.3 Interfaces......................................................................................................................................195
9.3.1 Protocol data interface........................................................................................................ 195
Appendix A
System Parameters ............................................................................................... 210
A.1 Protocol constants........................................................................................................................210
A.1.1 cdCASRxLowMin ................................................................................................................211
A.2 Physical layer constants...............................................................................................................212
A.2.1 cdTxMax..............................................................................................................................212
A.3 Performance Constants ...............................................................................................................213
Appendix B
Configuration Constraints .................................................................................... 214
B.1 General ........................................................................................................................................214
B.2 Global cluster parameters ............................................................................................................214
B.2.1 Protocol relevant .................................................................................................................214
B.2.2 Protocol related ...................................................................................................................216
Chapter 1
Introduction
1.1 Scope
The FlexRay communication protocol described in this document is specified for a dependable automotive
network. Some of the basic characteristics of the FlexRay protocol are synchronous and asynchronous
frame transfer, guaranteed frame latency and jitter during synchronous transfer, prioritization of frames
during asynchronous transfer, multi-master clock synchronization1, error detection and signaling, error
containment on the physical layer through the use of a bus guardian device, and scalable fault tolerance2.
1.2 References
1 Multi-master clock synchronization refers to a synchronization that is based on the clocks of several (three or more)
synchronization masters or sync nodes.
2
Scalable fault tolerance refers to the ability of the FlexRay protocol to operate in configurations that provide various degrees of
fault tolerance (for example, single or dual channel clusters, clusters with or without bus guardians, clusters with many or
few sync nodes, etc.).
[Wad01] T. Wadayama, “Average Distortion of Some Cyclic Codes”, web site available at: http://www-
tkm.ics.nitech.ac.jp/~wadayama/distortion.html
[Wel88] J. L. Welch and N. A. Lynch, "A New Fault-Tolerant Algorithm for Clock Synchronization", Infor-
mation and Computation, vol. 77, no. 1, pp. 1-36, April 1988.
[Z100] ITU-T Recommendation Z.100 (03/93), Programming Languages - CCITT Specification and
Description Language (SDL), International Telecommunication Union, Geneva, 1993.
2.1 May The SDL processes in Chapter 3 (Coding) have been restructured.
2005
Appendix B has been almost completely rewritten.
BG references and BGSM chapter (former chapter 10) have been removed.
Specific significant changes to CHI:
• channel dependency of pMicroInitialOffset[Ch] and pMacroInitialOffset[CH]
has been introduced in 9.3.1.1.2
• pDecodingCorrection has been added in CHI in 9.3.1.1.2
• error indicator in CHI has been added in 9.3.1.3.3
• vSyncFramesEven/Odd/A/B have been removed in 9.3.1.3.4
2.1 Dec Use of SDL priority input to resolve certain race conditions (see section 1.7.3.4 and
Rev A 2005 Figure 5-21 and Figure 8-8)
Re-arrangement of SDL to eliminate the use of SDL "enabling condition" structure
(Figure 6-10, Figure 6-11, Figure 7-3, Figure 7-4, and Figure 7-5)
Update of zLastDynTxSlot (Figure 5-13, Figure 5-20, Figure 5-21, and Figure 5-22)
Re-arrangement of channel idle detection (Figure 2-9, Figure 3-15, Figure 3-16, Fig-
ure 3-17, Figure 3-18, Figure 3-25, Figure 3-36, Figure 3-37, Figure 7-3, and Figure
7-11)
Introduction of new "a" class of variables (see section 1.6.1)
Replacement of the bit counter by a timer in Figure 3-23
Explicit export of all CHI variables
Extension of the color coding to SDL signals (see section 1.6.2)
Rework of Appendix B
Numerous non-technical corrections and clarifications were made throughout the
document.
bus
a communication system topology in which nodes are directly connected to a single, common
communication media (as opposed to connection through stars, gateways, etc.). The term bus is also
used to refer to the media itself.
bus driver
an electronic component consisting of a transmitter and a receiver that connects a communication
controller to one communication channel.
bus guardian
an electronic component that protects a channel from interference caused by communication that is
channel
see communication channel.
channel idle
the condition of medium idle as perceived by each individual node in the network.
clique
set of communication controllers having the same view of certain systems properties, e.g., the global
time value or the activity state of communication controllers.
cluster
a communication system of multiple nodes connected via at least one communication channel directly
(bus topology) or by star couplers (star topology).
coldstart node
a node capable of initiating the communication startup procedure on the cluster by sending startup
frames.
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.
communication cycle
one complete instance of the communication structure that is periodically repeated to comprise the
media access method of the FlexRay system. The communication cycle consists of a static segment,
an optional dynamic segment, an optional symbol window, and a network idle time.
communication slot
an interval of time during which access to a communication channel is granted exclusively to a specific
node for the transmission of a frame with a frame ID corresponding to the slot. FlexRay distinguishes
between static communication slots and dynamic communication slots.
cycle counter
the number of the current communication cycle.
cycle time
the time within the current communication cycle, expressed in units of macroticks. Cycle time is reset
to zero at the beginning of each communication cycle.
frame
a structure used by the communication system to exchange information within the system. A frame
consists of a header segment, a payload segment and a trailer segment. The payload segment is used
to convey application data.
frame identifier
the frame identifier defines the slot position in the static segment and defines the priority in the
dynamic segment. A lower identifier indicates a higher priority.
gateway
a node that is connected to two or more independent communication networks that allows information
to flow between the networks.
global time
combination of cycle counter and cycle time.
Hamming distance
the minimum distance (i.e., the number of bits which differ) between any two valid code words in a
binary code.
host
the part of an ECU where the application software is executed, separated by the CHI from the FlexRay
protocol engine.
macrotick
an interval of time derived from the cluster-wide clock synchronization algorithm. A macrotick consists
of an integral number of microticks. The actual number of microticks in a given macrotick is adjusted
by the clock synchronization algorithm. The macrotick represents the smallest granularity unit of the
global time.
medium idle
the condition of the physical transmission medium when no node is actively transmitting on the
physical transmission medium.
microtick
an interval of time derived directly from the CC's oscillator (possibly through the use of a prescaler).
The microtick is not affected by the clock synchronization mechanisms, and is thus a node-local
minislot
an interval of time within the dynamic segment of the communication cycle that is of constant duration
(in terms of macroticks) and that is used by the synchronized FTDMA media access scheme to
manage media arbitration.
network
the combination of the communication channels that connect the nodes of a cluster.
network topology
the arrangement of the connections between the nodes. FlexRay supports bus, star, cascaded star,
and hybrid network topologies.
node
a logical entity connected to the network that is capable of sending and/or receiving frames.
null frame
a frame that contains no usable data in the payload segment. A null frame is indicated by a bit in the
header segment, and all data bytes in the payload segment are set to zero.
precision
the worst-case deviation between the corresponding macroticks of any two synchronized nodes in the
cluster.
slot
see communication slot.
star
a device that allows information to be transferred from one physical communication link to one or more
other physical communication links. A star duplicates information present on one of its links to the
other links connected to the star. A star can be either passive or active.
startup frame
FlexRay frame whose header segment contains an indicator that integrating nodes may use time-
related information from this frame for initialization during the startup process. Startup frames are
always also sync frames.
startup slot
communication slot in which a startup frame is sent.
static segment
portion of the communication cycle where the media access is controlled via a static Time Division
Multiple Access (TDMA) scheme. During this segment access to the media is determined solely by the
progression of time.
sync frame
FlexRay frame whose header segment contains an indicator that the deviation measured between the
frame's arrival time and its expected arrival time should be used by the clock synchronization
algorithm.
sync slot
communication slot in which a sync frame is sent.
CE Communication Element
CHI Controller Host Interface
CHIRP Channel Idle Recognition Point
CODEC Coding and Decoding Process
CRC Cyclic Redundancy Code
CSP Clock Synchronization Process
CSS Clock Synchronization Startup Process
DTS Dynamic Trailing Sequence
ECU Electronic Control Unit, same as node
EMC Electromagnetic Compatibility
ERRN Error Not signal
FES Frame End Sequence
FSP Frame and Symbol Processing
Naming Information
Description
Convention Type
g Cluster Parameter that must have the same value in all nodes in a cluster, is
Parameter initialized in the POC:default config state, and can only be changed
while in the POC:config state.
p Node Para- Parameter that may have different values in different nodes in the
meter cluster, is initialized in the POC:default config state, and can only be
changed while in the POC:config state.
Naming Information
Description
Convention Type
d Time Duration Value (variable, parameter, etc.) describing a time duration, the time
between two points in time
Parameters, constants and variables are highlighted with blue italics. An example is the parameter gdStat-
icSlot. This convention is not used within SDL diagrams, as it is assumed that such information is obvious.
The meaning of the prefixes of parameters, constants, and variables is described in section 1.6.1.
SDL states are highlighted in green italics. An example is the SDL state POC:normal active. This
highlighting convention is not used within SDL diagrams. Further notational conventions related to SDL
states are described in section 1.7.2.
SDL signals are highlighted in brown italics. An example is the SDL signal CHIRP on A. Again, this
convention is not used within the SDL diagrams themselves as the fact that an item is an input or output
signal should be obvious.
Terms which are important for FlexRay are highlighted in red italics at their first (or defining) instance in the
text. An example is the term communication element.
3
If the duration time expression is zero or negative then the timer is started and expires immediately.
This specification assumes the existence of an underlying microtick timebase. This timebase, which is
available to all processes, contains a microtick counter that is started at zero at some arbitrary epoch
assumed to occur before system startup. As time progresses, this timebase increments the microtick
counter without bound4. Explicit use of the SDL 'now' construct returns the value of this microtick counter.
The difference between the timestamps of two events represents the number of microticks that have
occurred between the events.
4
This is in contrast to the vMicrotick variable, which is reset to zero at the beginning of each cycle.
5 For example, it is not allowed for a communication controller to connect to Channel A of one cluster and Channel B of another
cluster.
Channel A
Channel B
The FlexRay communication network can also be a single bus. In this case, all nodes are connected to this
bus.
Star Star
1A 1B
6
A channel with two star couplers would have the stars connected to each other. Communication between nodes connected to
different stars would pass through both stars (a cascaded star topology).
7
With the obvious exception of the node transmitting the original signal
Figure 1-3 shows a single channel network built with two star couplers. Each node has a point-to-point-
connection to one of the two star couplers. The first star coupler (1A) is directly connected to the second
star coupler (2A).
Node E
Node A
Node F
Node B
Star
2A
Star
1A
Node G
Node C
Node H
Note that it is also possible to have a redundant channel configuration with cascaded stars. An example of
such a configuration is Figure 1-4. Note that this example does not simply replicate the set of stars for the
second channel - Star 1A connects nodes A, B, and C, while Star 1B connects nodes A, C, and E.
Star Star
1B 2B
Star Star
1A 2A
Node B Node C
A fundamentally different type of hybrid topology is shown in Figure 1-6. In this case, different topologies
are used on different channels. Here, channel A is implemented as a bus topology connection, while
channel B is implemented as a star topology connection.
Channel A
Star
1B
The protocol implications of topologies with stubs on the connection between active stars have not been
fully analyzed. As a result, such topologies are not currently recommended.
1.9.2 Overview
Figure 1-7 depicts an example node architecture. One communication controller, one host, one power
supply unit, and two bus drivers are depicted. Each communication channel has one bus driver to connect
the node to the channel. In addition to the indicated communication and control data interfaces an optional
interface between the bus driver and the power supply unit may exist.
Communication Data
Host Communication Controller
Configuration Data &
Status Information
Communication Data
Communication Data
Control Signal
Control Signal
Bus Driver
Communication Data
Host Communication Controller
Configuration Data &
Status Information
TxD
TxEN
The CC uses the TxD (Transmit Data) signal to transfer the actual signal sequence to the BD for trans-
mission onto the communication channel. TxEN (Transmit Data Enable Not) indicates the CC's request to
have the bus driver present the data on the TxD line to its corresponding channel
The BD uses the RxD (Receive Data) signal to transfer the actual received signal sequence to the CC.
The electrical characteristics and timing of these signals are specified in [EPL05].
EN
ERRN
This interface is product specific; some restrictions are given in [EPL05] that define minimum functionality
to ensure interoperability.
SDI
SDO
SCK
INTN
INH
The electrical characteristics and behavior of the INH signal are specified in [EPL05].
Chapter 2
Protocol Operation Control
This chapter defines how the core mechanisms of the protocol are moded in response to host commands
and protocol conditions.
2.1 Principles
The primary protocol behavior of FlexRay is embodied in four core mechanisms, each of which is described
in a dedicated chapter of this specification.
• Coding and Decoding (see Chapter 3)
• Media Access Control (see Chapter 5)
power off
power on
reset POC
operational
Figure 2-1 depicts an overview of the CC power moding operation. Power level and time thresholds and the
state of the hardware reset dictate its operation. These product-specific thresholds are briefly described in
Table 2-1.
PowerOnPowerThreshold Power level that causes a transition from the power off state to the
power on state
PowerOffPowerThreshold Power level that causes a transition from the power on state to the
power off state
POCOperationalPowerThreshold Power level that must be sustained before the POC operational
state can be entered from the reset state
POCOperationalTimeThreshold The time duration that the power level POCOperationalPower-
Threshold must be sustained before POC operational state can be
entered
ResetPowerThreshold Power level that causes a transition from the POC operational
state to the reset state if sustained
ResetTimeThreshold The time duration that the power level ResetPowerThreshold must
be sustained before the transition from the POC operational state
to the reset state is caused
The CC shall transition from power off to power on when the supply voltage exceeds PowerOnPower-
Threshold and shall transition from power on to power off when the power supply decreases below Power-
OffPowerThreshold.
Upon entry to power on, the CC shall initially reside in the reset state. The CC shall transition from reset to
POC operational when both of the following two conditions are met:
1. A power level of at least POCOperationalPowerThreshold is sustained for a time duration of at least
POCOperationalTimeThreshold, and,
2. The hardware reset is not asserted.
The CC shall transition from POC operational to reset when either of the following two conditions are met:
1. A power level of no more than ResetPowerThreshold but still greater than PowerOffPowerThreshold,
is sustained for a time duration of at least ResetTimeThreshold, or,
2. The hardware reset is asserted.
In the power off state there is insufficient power for the CC to operate8. In the power on state (including both
reset and POC operational) the CC shall guarantee that all pins are in prescribed states. In the POC opera-
tional state the CC shall drive the pins in accordance with the product specification. The POC controls the
other protocol mechanisms in the manner described in this chapter while the CC is in the POC operational
state.
2.2 Description
The relationships between the CHI, POC and the core mechanisms are depicted in Figure 2-29.
8
While the CC cannot enforce specific behavior of the pins, there shall be product-specific behavior specified (e.g. high
impedance).
9 The dark lines represent data flows between mechanisms that are relevant to this chapter. The lighter gray lines are relevant
to the protocol, but not to this chapter.
to / from host
controller
host interface
protocol
operation
control
clock
macrotick
synchronization
generation
processing
coding / decoding
processes
to channel interface channel B from channel interface
Product-specific errors are accommodated by the POC, but not described in this specification (see section
2.3.3). Similarly, host detected error strategies are supported by the POC's ability to respond to a host
FREEZE command (see section 2.3.3), but the host-based mechanisms that trigger the command are
beyond the scope of this specification. Only errors detected by the POC or one of the core mechanisms are
explicitly detailed in this specification.
The vPOC structure is an aggregation of eight distinct status variables. vPOC!State is used to indicate the
state of the POC and is based on the T_POCState formal definition in Definition 2-2.
newtype T_POCState
literals CONFIG, DEFAULT_CONFIG, HALT, NORMAL_ACTIVE, NORMAL_PASSIVE,
READY, STARTUP, WAKEUP;
endnewtype;
Definition 2-2: Formal definition of T_POCState.
vPOC!Freeze is used to indicate that the POC has entered the POC:halt state due to an error condition
requiring an immediate halt (see section 2.3.3). vPOC!Freeze is Boolean.
vPOC!CHIHaltRequest is used to indicate that a request has been received from the CHI to halt the POC
at the end of the communication cycle (see section 2.3.6.1). vPOC!CHIHaltRequest is Boolean.
vPOC!ColdstartNoise is used to indicate that the STARTUP mechanism completed under noisy channel
conditions (see section 7.2). vPOC!ColdstartNoise is Boolean.
vPOC!SlotMode is used to indicate what slot mode the POC is in (see sections 2.3.6.1, 2.3.6.2.2, and
2.3.6.2.3). vPOC!SlotMode is based on the T_SlotMode formal definition in Definition 2-3.
newtype T_SlotMode
vPOC!ErrorMode is used to indicate what error mode the POC is in (see sections 2.3.6.2.2 and 2.3.6.2.3).
vPOC!ErrorMode is based on the T_ErrorMode formal definition in Definition 2-4.
newtype T_ErrorMode
literals ACTIVE, PASSIVE, COMM_HALT;
endnewtype;
Definition 2-4: Formal definition of T_ErrorMode.
vPOC!WakeupStatus is used to indicate the outcome of the execution of the WAKEUP mechanism (see
Figure 2-7 and section 7.1.3.1). vPOC!WakeupStatus is based on the T_WakeupStatus formal definition in
Definition 2-5.
newtype T_WakeupStatus
literals UNDEFINED, RECEIVED_HEADER, RECEIVED_WUP, COLLISION_HEADER,
COLLISION_WUP, COLLISION_UNKNOWN, TRANSMITTED;
endnewtype;
Definition 2-5: Formal definition of T_WakeupStatus.
The individual T_StartupState values are the states within the STARTUP mechanism in section 7.2.4.
In addition to the vPOC data structure, the POC makes two counters available to the host via the CHI. These
counters are vClockCorrectionFailed and vAllowPassiveToActive, and are described in section 2.3.6.2.4.
10 The states depicted as wakeup and startup are actually procedures containing several states. The depiction is simplified for
the purpose of an overview.
POCOperational
default
config
config
halt
ready
PROTOCOL_
ENGINE_READY
CODEC control on A (READY),
’update vPOC in CHI’ CODEC control on B (READY),
FSP control on A (STANDBY),
FSP control on B (STANDBY),
MAC control on A (STANDBY),
MAC control on B (STANDBY),
CSP control (STANDBY)
PROTOCOL_
ENGINE_HALT ’update vPOC in CHI’
’update vClockCorrectionFailed in CHI’
The SDL processes associated with the core mechanisms are created simultaneously by the POC. While
the processes must terminate themselves, the POC is also responsible for simultaneously triggering this in
all of the processes. Figure 2-5 depicts the macros for performing these two tasks.
INSTANTIATE_ALL_ CODEC_A,
PROCESSES CODEC_B,
FSP_A,
FSP_B,
MAC_A,
MAC_B,
CSP,
MTG
TERMINATE_ALL_
PROCESSES terminate CODEC_A,
terminate CODEC_B,
’update vPOC in CHI’ terminate FSP_A,
terminate FSP_B,
terminate MAC_A,
terminate MAC_B,
terminate CSP,
terminate MTG
1. Behaviors corresponding to host commands that preempt the regular behavioral flow.
2. Behavior that brings the POC to the POC:ready state.
3. Behavior leading from the POC:ready state to the POC:normal active state.
4. Behavior once the POC:normal active state has been reached, i.e., during "normal operation".
The remainder of this section addresses these four components in succession, explaining the required
behavior using SDL diagrams.
false pSingleSlotEnabled ?
halt
true
PROTOCOL_ENGINE_
READY
ready
When a serious error occurs, the POC is notified to halt the operation of the protocol engine. For this
purpose, a freeze mechanism is supported. There are three methods for triggering the freeze mechanism:
1. A host FREEZE command relayed to the POC by the CHI.
2. A fatal protocol error signaled by one of the core mechanisms.
3. A product-specific error detected by a built-in self-test (BIST) or sanity check.
In all three circumstances the POC shall set vPOC!Freeze to true as an indicator that the event has
occurred, stop the protocol engine by setting all core mechanism to the STANDBY mode, and then transition
to the POC:halt state11.
At the host's discretion, the ongoing operation of the POC can be interrupted by immediately placing the
POC in the POC:ready state12. In response to this command, the POC modes the core mechanisms appro-
priately (see section 2.3.1), reinitializes vColdstartInhibit and vPOC!SlotMode, and then transitions to
POC:ready.
11 Note that the values of vPOC!State and vPOC!StartupState are intentionally not altered so that the CHI can indicate to the
host what state the POC was in at the time the freeze occurred.
halt
CHI DEFAULT_CONFIG
command
TERMINATE_ALL_
vPOC!State := DEFAULT_CONFIG;
vPOC!Freeze := false;
vPOC!CHIHaltRequest := false;
vPOC!ColdstartNoise := false;
default config vPOC!SlotMode := SINGLE;
vPOC!ErrorMode := ACTIVE;
vPOC!WakeupStatus := UNDEFINED;
CHI CONFIG command vPOC!StartupState := UNDEFINED;
’update vPOC in CHI’
vPOC!State := CONFIG;
’update vPOC in CHI’
config
CHI CONFIG_
COMPLETE command
INSTANTIATE_ALL_
PROCESSES vPOC!State := READY;
vColdstartInhibit := true;
zChannelIdle(A) := false;
zChannelIdle(B) := false;
pSingleSlotEnabled ? false
true
vPOC!SlotMode :=
vPOC!SlotMode := ALL;
SINGLE;
PROTOCOL_ENGINE_
READY
ready
12
The application notes contain several circumstances where the host avails itself of this command to perform control tasks that
are jointly performed by the CC and the host. Generally it is a host mechanism for disrupting a CC process that it suspects
has failed.
The POC shall enter the POC:default config state when the CC enters the POC Operational power state
(see section 2.1.1). The POC:default config shall also be entered from the POC:halt state if a
DEFAULT_CONFIG command is received from the CHI. In the latter case, the POC shall signal the core
mechanisms to terminate so that they can be created again as a part of the normal initialization process.
Prior to entering the POC:default config state the POC shall initialize the elements of the vPOC data
structure that is used to communicate the POC status to the CHI. With the exception of vPOC!SlotMode,
the values assumed by the vPOC elements are obvious initial values and are depicted in Figure 2-7. The
initial value of vPOC!SlotMode is defaulted to SINGLE until the configuration process is carried out to set it
to the value desired by the host.
In the POC:default config state the POC awaits the explicit command from the host to enable configuration.
The POC shall enter the POC:config state in response to the CONFIG command. Configuration of the CC
is only allowed in the POC:config state and this state can only be entered with an explicit CONFIG command
issued while the POC is in the POC:default config state or the POC:ready state (see section 2.3.5).
In the POC:config state the host configures the CC. The host is responsible for verifying this configuration
and only allowing the initialization to proceed when a proper configuration is verified. For this purpose, an
explicit CONFIG_COMPLETE command is required for the POC to progress from the POC:config state.
The POC shall transition to the POC:ready state in response to the CONFIG_COMPLETE command. On
13
The value is determined by the node configuration, pSingleSlotEnabled, a Boolean used to indicate whether the single slot
mode is enabled. This supports an optional strategy to limit frame transmissions following startup to a single designated
frame until the host confirms that the node is synchronized to the cluster and enables the remaining transmissions with an
ALL_SLOTS command (see section 2.3.6.1).
vPOC!State := WAKEUP;
vPOC!WakeupStatus :=
UNDEFINED; vPOC!ErrorMode :=
vPOC!State := CONFIG;
’update vPOC in CHI’ ACTIVE;
WAKEUP
config
vPOC!State := READY;
STARTUP
vPOC!SlotMode ? SINGLE
else
MAC control on A (ALL),
MAC control on B (ALL)
vPOC!State := NORMAL_ACTIVE;
vPOC!StartupState := UNDEFINED;
’update vPOC in CHI’
’update vClockCorrectionFailed in CHI’ normal active
The CONFIG command shall cause the host to re-enter the POC:config state to allow the host to alter the
current CC configuration. Since the core mechanism processes are created on the transition back to
POC:ready following the configuration process, the processes shall be terminated on the transition to
POC:config. This is accomplished in the SDL with the TERMINATE_ALL_PROCESSES macro (see section
2.3.1), which signals the individual processes so that they can terminate themselves.
The WAKEUP command shall cause the POC to commence the wakeup procedure in accordance with the
configuration loaded into the CC when it was previously configured. This procedure is described in detail in
section 7.1, and is represented in Figure 2-8 by the WAKEUP macro invocation. On completion of the
wakeup procedure, the POC shall mode all the core mechanisms appropriately for POC:ready (see section
2.3.1) and return to the POC:ready state.
The RUN command shall cause the POC to commence a sequence of tasks to bring the POC to normal
operation, i.e. the POC:normal active state. First, all internal status variables are reset to their starting
values14. Then the startup procedure is executed. In Figure 2-8 this is represented by the STARTUP macro
invocation. This procedure is described in detail in section 7.2. This procedure modes the core mechanisms
appropriately to perform the sequence of tasks necessary for the node to start or enter an actively commu-
nicating cluster.
The startup procedure results in the node being synchronized to the timing of the cluster. At the end of the
communication cycle, the POC shall mode the core mechanisms depending on the values of
vPOC!SlotMode and the configuration pKeySlotUsedForSync (see Appendix B) as depicted in Figure 2-8:
1. The CODEC mechanism shall be moded to NORMAL and the FSP mechanism shall be moded to GO
for both channels.
2. If the node is a sync node (including coldstart nodes) (pKeySlotUsedForSync is true) CSP shall be
14 This is necessary because the POC:ready state may have been entered due to a READY command from the CHI that
caused the POC to enter POC:ready from a state where the status variables had already been altered (see section 2.3.2).
CHI ALLOW _
COLDSTART com mand
vColdstartInhibit := false;
-
(default config, config, wakeup
The behavior of the POC during startup is influenced by whether the node is currently inhibited from partic-
ipating in the startup process as a coldstart node (see section 7.2.3). The node's ability to act as coldstart
node is reflected in the Boolean variable vColdstartInhibit. While this value is acted upon in the startup
procedure, the CHI can change it at any time once the POC:ready state is reached. Hence it is relevant in
the current context. The POC shall change the value of vColdstartInhibit when instructed to do so by the
CHI.
In a similar manner, both the wakeup and startup procedures must be able to determine whether or not a
given channel is idle. Again, this knowledge is acted upon in the wakeup and startup procedures, but it can
change at any point in time once the POC:ready state is reached. Hence it is relevant in the current context.
The channel idle status is captured using the mechanism depicted in Figure 2-9 and is stored in the appro-
priate element of the zChannelIdle array. The POC shall change the value of the appropriate zChannelIdle
array element to false whenever a communication element start is signaled for the corresponding channel
by the CODEC (see section 3.2.6.1). Similarly, the POC shall change the value of the appropriate zChan-
nelIdle array element to true whenever a channel idle recognition point (CHIRP) is signaled for the corre-
sponding channel by the CODEC (see section 3.2.6.1).
The zChannelIdle array is of type T_ChannelBoolArray as defined in Definition 2-7.
newtype T_ChannelBoolArray
Array(T_Channel,Boolean);
endnewtype;
Definition 2-7: Formal definition of T_ChannelBoolArray.
The index to the array is the channel identifier, which is of type T_Channel as defined in Definition 2-8.
newtype T_Channel
literals A, B;
15 POC:wakeup listen is a state from the wakeup procedure (see section 7.1) and POC:coldstart listen and POC:integration
listen are states in the startup procedure (see section 7.2).
endnewtype;
Definition 2-8: Formal definition of T_Channel.
CHI ALL_SLOTS
CHI HALT command
command
vPOC!SlotMode ? else
vPOC!CHIHaltRequest := true;
’update vPOC in CHI’
SINGLE
vPOC!SlotMode :=
- ALL_PENDING;
’update vPOC in CHI’
Figure 2-10: Capture of asynchronous host commands for end-of-cycle processing [POC].
The HALT command shall be captured by setting the vPOC!CHIHaltRequest value to true. When processed
at the end of the current cycle, the HALT command will cause the POC to enter the POC:halt state. This is
the standard method used by the host to shut down the CC.
The ALL_SLOTS command shall be captured by setting vPOC!SlotMode to ALL_PENDING. The command
shall be ignored if vPOC!SlotMode is not SINGLE. When processed at the end of the current cycle, the
ALL_PENDING status causes the POC to enable the transmission of all frames for the node.
While in the POC:normal active state, the POC performs several tasks at the end of each communication
cycle to determine if it is necessary to change its own operating mode or the operating modes of any of the
core mechanisms. These changes result in appropriate moding commands to the core mechanisms. The
remainder of this section describes the cyclical POC processing that evaluates whether there is a need for
these mode changes and the moding consequences.
*
cycle start
(vCycleCounter)
normal active
SyncCalcResult(zSyncCalcResult,
zStartupNodes,zRefNode)
vPOC!SlotMode ? ALL_PENDING
NORMAL_
ACTIVE PASSIVE
ERROR_CHECK
COMM_HALT
vPOC!CHIHalt- vPOC!CHIHalt-
true true
Request ? Request ?
false
false
halt
normal passive
vAllowPassiveToActive :=0;
vPOC!State := NORMAL_PASSIVE;
’update vAllowPassiveToActive in CHI’
’update vPOC in CHI’
’update vClockCorrectionFailed in CHI’
section 2.3.6.2.4.3, but it results in one of three possible POC outcomes depending on the new value
of vPOC!ErrorMode:
a. If the vPOC!ErrorMode is ACTIVE and the CHI did not relay a HALT command to the POC in the
preceding communication cycle (see section 2.3.6.1), the POC shall mode the MAC and CSP
mechanisms to support resumption of frame transmission based on whether the node is a sync node
(pKeySlotUsedForSync is true) and whether the node is currently in single slot mode, and then
transition to the POC:normal active state.
b. If the vPOC!ErrorMode is PASSIVE and the CHI did not relay a HALT command to the POC in the
preceding communication cycle (see section 2.3.6.1), the POC shall return to the POC:normal
passive state.
c. If vPOC!ErrorMode is COMM_HALT or the CHI did relay a HALT command to the POC in the
preceding communication cycle (see section 2.3.6.1), the POC shall stop the execution of the core
mechanisms by moding them to STANDBY and transition to the POC:halt state.
normal passive
SyncCalcResult(zSyncCalcResult,
zStartupNodes,zRefNode)
vPOC!SlotMode ? ALL_PENDING
PASSIVE_
PASSIVE ACTIVE
ERROR_CHECK
COMM_HALT
vPOC!CHIHalt- vPOC!CHIHalt-
true true
Request ? Request ?
false vPOC!State := HALT; false
’update vPOC in CHI’
’update vClockCorrectionFailed PROTOCOL_ENGINE_
halt
vPOC!State := NORMAL_ACTIVE;
’update vPOC in CHI’
’update vClockCorrectionFailed in CHI’
pKeySlotUsed-
ForSync ?
false true
i. The node is configured to allow communication to be halted due to severe clock calculation errors
(pAllowHaltDueToClock is true), then the vPOC!ErrorMode is set to COMM_HALT.
ii. The node is configured not to allow communication to be halted due to severe clock calculation
errors (pAllowHaltDueToClock is false), then the vPOC!ErrorMode is set to PASSIVE.
The value returned by the macro to the cyclical process depicted in Figure 2-12 corresponds to the new
vPOC!ErrorMode value.
NORMAL_ERROR_
CHECK
vCycleCounter ? even
odd
MISSING_TERM
vClockCorrectionFailed :=
0;
odd
vClockCorrectionFailed :=
vClockCorrectionFailed + 1;
vClockCorrection-
else
Failed ?
< gMaxWithoutClock-
CorrectionFatal
vClockCorrection-
else
Failed ?
>= gMaxWithoutClockCorrection-
Passive
pAllowHalt-
false
DueToClock ?
PASSIVE
COMM_HALT
b. If the node is configured to allow the resumption of transmissions following the entry to POC:normal
passive (pAllowPassiveToActive is nonzero) the behavior is determined by how many consecutive
odd cycles have yielded WITHIN_BOUNDS.
i. If less than pAllowPassiveToActive consecutive odd cycles have yielded WITHIN_BOUNDS,
then the vPOC!ErrorMode remains PASSIVE.
ii. If at least pAllowPassiveToActive consecutive odd cycles have yielded WITHIN_BOUNDS, the
vPOC!ErrorMode depends on the number (zStartupNodes) of startup frame pairs observed in the
preceding double cycle.
A. If the node has seen more than one startup frame pair (zStartupNodes > 1) then the
vPOC!ErrorMode is set to ACTIVE.
B. If the node has seen only one startup frame pair (zStartupNodes = 1) and if the node is a
coldstart node (pKeySlotUsedForStartup = true) then the vPOC!ErrorMode is set to ACTIVE.
C. If neither of the preceding two conditions is met then the vPOC!ErrorMode remains PASSIVE.
3. If zSyncCalcResult is EXCEEDS_BOUNDS:
a. If the node is configured to allow communication to be halted due to severe clock calculation errors
(pAllowHaltDueToClock is true), then the vPOC!ErrorMode is set to COMM_HALT.
PASSIVE_ERROR_
CHECK
MISSING_TERM
odd odd
vClockCorrectionFailed :=
vClockCorrection- 0;
else
Failed ?
pAllowPassive-
< gMaxWithoutClock- =0
ToActive ?
CorrectionFatal - 1
vClockCorrectionFailed := else
vClockCorrectionFailed + 1;
pAllowHalt- vAllowPassive-
false
DueToClock ? ToActive ?
vAllowPassiveToActive := = pAllowPassive
true 0; ToActive - 1
else
COMM_HALT ’update
vAllowPassiveToActive in CHI’
=0 zStartupNodes ? >1
=1
pKeySlotUsed-
false
ForStartup ?
true
vPOC!ErrorMode :=
ACTIVE;
PASSIVE
ACTIVE
Chapter 3
Coding and Decoding
This chapter defines how the node performs frame and symbol coding and decoding.
3.1 Principles
This chapter describes the coding and decoding behavior of the TxD, RxD, and TxEN interface signals
between the communication controller and the bus driver.
A node may support up to two independent physical layer channels, identified as channel A and channel B.
Refer to section 1.9.4 for additional information on the interface between the CC and the BD. Since the
FlexRay protocol is independent from the underlying physical layer, the description in this chapter assumes
a binary medium with two distinct levels, called HIGH and LOW.16 A bit stream generated from these two
3.2 Description
In order to support two channels each node must implement two sets of independent coding and decoding
processes, one for channel A and another for channel B. The subsequent paragraphs of this chapter specify
the function of the coding and decoding for channel A. It is assumed that whenever a channel-specific
process is defined for channel A there is another, essentially identical, process defined for channel B, even
though this process is not explicitly described in the specification.
The description of the coding and decoding behavior is contained in three processes. These processes are
the main coding and decoding process (CODEC) and the following two sub-processes:
1. Bit strobing process (BITSTRB).
2. Wakeup pattern decoding process (WUPDEC).
The POC is responsible for creating the CODEC process before entering the POC:ready state. Once instan-
tiated, the CODEC process is responsible for creating and terminating the subprocesses. The POC is
responsible for sending a signal that causes a termination of the CODEC process.
The relationships between the coding/decoding and the other core mechanisms are depicted in Figure 3-
117.
16
Detailed bus state definitions may be found in the appropriate physical layer specification ([EPL05], for example).
17 The dark lines represent data flows between mechanisms that are relevant to this chapter. The lighter gray lines are relevant
to the protocol, but not to this chapter.
to / from host
controller
host interface
protocol
operation
control
clock
macrotick
synchronization
generation
processing
coding / decoding
processes
to channel interface channel B from channel interface
18
The purpose of the TSS is to "open the gates" of an active star, i.e., to cause the star to properly set up input and output
connections. During this set up, an active star truncates a number of bits at the beginning of a communication element. The
TSS prevents the content of the frame or symbol from being truncated.
19
See also Chapter 5.
20
See also section 3.2.4.
21 This ensures that there is a period of one gdBit during which the TxD output is at the HIGH level prior to the transition of TxEN
output to the HIGH level. This is required for the stability of certain types of physical layers.
CODEC a b
FSS BSS BSS BSS FES
High
TxD
Low
TSS 1st byte sequence last byte sequence
High 1 * gdBit
MSB LSB
TxEN
Low
Figure 3-2 shows the bit stream of a frame transmitted in the static segment and related events relevant to
the CODEC process:
a. Input signal transmit frame on A (vType, vTF) received from the MAC process (see Figure 5-17) and
output signal decoding halted on A sent to the FSP process (see Figure 6-9, Figure 6-10, and Figure 6-
17).
b. Output signal decoding started on A sent to the FSP process (see Figure 6-18).
MAC
FSP MAC MAC FSP
CODEC a b c d
FSS BSS BSS BSS FES DTS
High
TxD
Low
TSS 1st byte sequence last byte sequence
High 1 * gdBit
TxEN MSB LSB
Low
Figure 3-3 shows the bit stream of a frame transmitted in the dynamic segment and related events relevant
1. Pattern 1 = Collision Avoidance Symbol22 (CAS) and Media Access Test Symbol (MTS).
2. Pattern 2 = Wakeup Symbol (WUS).
The node shall encode the MTS and CAS in exactly the same manner. Receivers distinguish between these
symbols based on the node's protocol status. The encoding process does not distinguish between these
two symbols. The bit streams for each of the symbols are described in the subsequent sections.
22
See also Chapter 7.
MAC
FSP FSP
CODEC a b
High
TxD
Low
TSS cdCAS
High
TxEN
Low
Figure 3-4 illustrates the bit stream for a CAS or MTS symbol and related events relevant to the CODEC
POC POC
CODEC a b
WUS 1 WUS 2
High
TxD
Low
High
TxEN
Low
gdWakeupSymbolTxLow gdWakeupSymbolTxIdle
Figure 3-5 shows the bit stream of a wakeup pattern and related events relevant to the CODEC process:
a. Input signal transmit symbol on A (vType) received from the POC process with vType = WUP (see Fig-
ure 7-4).
23
pWakeupPattern is a configurable parameter that indicates how many times the WUS is repeated to form a WUP.
b. Output signal WUP transmitted on A sent to the POC process (see Figure 7-4).
The node shall transmit a WUS with the edges of the TxEN signal being synchronous to the TxD signal.
Note that there is no TSS transmission associated with a WUS. The node must be capable of detecting
activity on the channel during gdWakeupSymbolTxIdle inside a WUP as shown in Figure 3-6.
Rx
POC
Rx
bitstrobing
disabled
POC
WUPDEC(3) d
Rx
node 3
>=RxLow >=RxIdle =RxLow
gdWakeupSymbolRxWindow
Figure 3-6 shows an example bit stream that could result from a wakeup symbol collision and shows related
events relevant to the CODEC and WUPDEC processes:24
a. Input signal transmit symbol on A (vType) received from the POC process of node 1 with vType =
WUP (see Figure 7-4).
b. Input signal transmit symbol on A (vType) received from the POC process of node 2 with vType =
WUP (see Figure 7-4).
c. Output signal wakeup collision on A sent from the CODEC process of node 1 to the POC process of
node 1 (see Figure 7-4).
d. Output signal WUP decoded on A to the POC process of node 3 (see 3.2.6.2.2).
24
In the figure, node 2 transmits a WUP even though node 1 had previously begun transmitting a WUP. This can occur if node
2 does not receive the WUS previously sent by node 1. One possible reason that this could occur is that the first WUS was
used to wake up a sleeping star positioned between node 1 and node 2. On the other hand, node 3 may receive the first
WUS sent by node 1 if both nodes are on the same branch/stub of the star.
cVotingDelay
channel sample
clock
RxD glitch
voting window 11111 11111 11110 11100 11001 10011 00111 01111 11111 11110 11100 11000 10000 00000 00000 00000 00000 00001 00011 00111 01111
zVotedVal
25 CC's that support two channels shall perform the sampling and majority voting operations for both channels. The channels
are independent (i.e., the mechanism results in two sets of voted values, one for channel A and another for channel B).
A sample counter shall count the samples of zVotedVal cyclically in the range of 1 to cSamplesPerBit.
A bit synchronization edge is used to realign the bit timing of the receiver (i.e., bit clock resynchronization).
The node shall enable the bit synchronization edge detection each time a HIGH bit is strobed except when
a HIGH bit is strobed while decoding bits from a byte in the header, payload or trailer. Synchronization is
enabled for the edge between the two bits in the BSS for these bytes, however.
The bit clock alignment shall perform the bit synchronization when it is enabled and when zVotedVal
changes to LOW.
When a bit synchronization edge is detected (and bit synchronization is enabled) the bit clock alignment
shall not increment the sample counter but instead shall set it to a value of two for the next sample. The
node shall only perform bit synchronization on HIGH to LOW transitions of zVotedVal (i.e., on the falling
edge of the majority voted samples)26.
Whenever a bit synchronization is performed, the bit clock alignment mechanism shall disable further bit
synchronizations until it is enabled again as described above. The bit stream decoding process shall
perform at most one bit synchronization between any two consecutive bit strobe points.
The bit synchronization mechanism defines the phase of the cyclic sample counter, which in turn determines
the position of the strobe point. The strobe point is the point in time when the cyclic sample counter value
gdSampleClockPeriod
TSS FSS BSS n byte BSSn+1
High
zVotedVal
Low
samples 1 1 0 0 0 0 0 .... 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 X ..... 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 X
sample
2 3 4 2 3 4 5 .... 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 2 3 4 5 6 7 8 1 .......1 2 3 4 5 6 7 8 1 2 2 3 4 5 6 7 8 1
count
sample counter reset cStrobeOffset sample counter reset sample counter reset
26
This is necessary as the output of the physical layer may have different rise and fall times for rising and falling edges.
The example from Figure 3-8 shows the nominal case of an FSS and BSS with cSamplesPerBit samples.
At the bit synchronization edge, the sample counter is set to '2' for the sample following the detected edge.
The example also shows a misalignment after the received first header byte of the frame. The misalignment
is reflected by the value of the sample counter at the start of the HIGH bit of the BSS (see the first highlighted
area). The first expected sample (HIGH) of BSS n + 1 should occur when the sample counter value is '1'.
Since it actually occurs when the sample counter value is '2', the edge was decoded with a delay of one
channel sample clock period. Bit synchronization, performed by resetting the sample counter, takes place
with the next bit synchronization edge (see second highlighted area). The effect of the bit synchronization
is that the distance of edge to the strobe point is the same as if the edge would have appeared at the
expected sample (see also 3.2.7).
To detect activity on a channel, it is necessary that at least cStrobeOffset consecutive LOW samples make
it through the majority voter27. This is a consequence of the combination of the majority voting and the bit
synchronization mechanisms.
The SDL representation of the BITSTRB process is depicted in Figure 3-35.
27
In order to allow the detection of colliding startup frames, a FlexRay system must be configured in such a way that in the
event of colliding startup frames a node shall detect at least one strobed LOW bit so that detectable noise is produced to
enable setting of the tWakeupNoise timer (see Chapter 7).
28
This is possible because transmission of the sync frame begins at the static slot action point of the transmitting node.
Due to certain effects on the physical transmission medium it is possible that the first edge at the start of a
frame is delayed longer than all other edges of the same frame, causing the TSS seen at the RxD input to
be shorter than the TSS that was transmitted. This effect is called TSS truncation and it has various causes
(e.g., optical transmission, connection setup in star couplers, etc.). The cumulative effect of all such causes
on a TSS transmitted from node M to node N is to reduce the length of the TSS by dTruncationM,N. A node
shall accept the TSS as valid if any number of consecutive strobed logical LOW bits in the range of 1 to
(gdTSSTransmitter + 1) is detected.
Signals transmitted from a node M are received at node N with the propagation delay dPropagation-
DelayM,N. The propagation delay is considered to be the same for all corresponding edges in the transmit
TxD signal of node M to the receive RxD signal at node N except for the first edge at the start of the frame.
Figure 3-9 depicts the effect of propagation delay and TSS truncation. For a more detailed description refer
to [EPL05].
Node M
BSS
transmitter FSS
High
TxD channel idle
Low
dPropagationDelayM,N
Node N receiver
High
RxD channel idle
Low dTruncationM,N
TSS
As a result of TSS truncation and propagation delay, it is not possible to know the precise relationship
between when a receiver begins to see a TSS and when the transmitter started to send the TSS. It is
necessary to base the time measurements of received frames on an element of the frame that is not affected
by TSS truncation. The receiving node takes the timestamp of a secondary time reference point (TRP) that
occurs during the first BSS of a message and uses this to calculate the timestamp of a primary TRP that
represents when the node should have seen the start of the TSS if the TSS had not been affected by TSS
truncation and propagation delay. The timestamp of the primary TRP is used as the observed arrival time
of the frame by the clock synchronization algorithm.
The strobe point of the second bit of the first BSS in a frame (i.e., the first HIGH to LOW edge detected after
a valid TSS) is defined to be the secondary TRP. A receiver shall capture a time stamp, zSecondaryTRP,
at the secondary TRP of each potential frame start.
The node shall calculate a primary TRP, zPrimaryTRP, from the secondary TRP timestamp. The zPrima-
ryTRP timestamp serves as the sync frame's observed arrival time for the clock sync, and is passed onto
the FSP process via the frame decoded on A (vRF) signal. Both zPrimaryTRP and zSecondaryTRP are
measured in microticks.
transmitter TxD
BSS
TSS
receiver zVotedVal
pDecodingCorrection
pDelayCompensation[A]
Figure 3-10 depicts definitions for the time reference point calculations and shows the following significant
events:
a. Transmitter static slot action point - the point at which the transmitter begins sending its frame
b. Secondary TRP (timestamp zSecondaryTRP), located at the strobe point of the second bit of the first
BSS. At this point in time, the decoding process shall provide the output signal potential frame start on
A to the CSS on channel A process (see also section 8.4.2).
c. Primary TRP (timestamp zPrimaryTRP), calculated from zSecondaryTRP by subtracting a fixed offset
(pDecodingCorrection) and a delay compensation term (pDelayCompensation) that attempts to correct
for the effects of propagation delay. Note that this does not represent an actual event, but rather only
indicates the point in time that the timestamp represents.
The difference between zPrimaryTRP and zSecondaryTRP is the summation of node parameters pDecod-
ingCorrection and pDelayCompensation. The calculation of pDecodingCorrection is given in B.4.23.
The Primary TRP timestamp is passed to the FSP process (and subsequently to the clock synchronization
process) via the PrimaryTRP element of the vRF structure (see Figure 3-34, Figure 6-8, Figure 6-10, Figure
6-11, and Figure 8-11). The clock synchronization algorithm uses the deviation between zPrimaryTRP and
the sync frame's expected arrival time to calculate and compensate the node's local clock deviation. For
additional details concerning the time difference measurements see Chapter 8.
The bit stream decoding of the individual channels on a dual channel node shall operate independently from
one another.
The node shall derive the channel sample clock period gdSampleClockPeriod from the oscillator clock
period directly or by means of division or multiplication. In addition to the channel sample clock period, the
decoding process shall operate based on the programmed bit length as characterized by the parameter
gdBit. The programmed bit length is an integer multiple of the channel sample clock period. It is defined to
be the product of samples per bit cSamplesPerBit and the channel sample clock period gdSampleClock-
Period.
The relation between the channel sample clock period and the microtick is characterized by the microtick
prescaler pSamplesPerMicrotick. The channel sample clock and the microtick clock must be synchronized,
i.e., there must be an integer multiplicative relationship between the two periods and the two clocks must
have a fixed phase relationship.
CODEC a b c d e
BITSTRB
strobing
High
zVotedVal
cChannelIdleDelimiter
Low
BSS FES DTS
Figure 3-11 shows the received bit stream of a frame and events in relation to the CODEC and the BITSTRB
processes:
a. Output signal idle end on A to the POC process shown in Figure 2-9, Figure 7-3, and Figure 7-11;
output signal CE start on A to the MAC process shown in Figure 5-21, and to the FSP process shown
in Figure 6-9.
b. Output signal potential frame start on A to the CSS process shown in Figure 8-8.
c. Output signal header received on A to the POC process shown in Figure 7-3, Figure 7-5, Figure 7-11,
Figure 7-12, and Figure 7-14.
d. Output signal frame decoded on A (vRF) to the FSP process shown in Figure 6-10.
e. Output signal CHIRP on A to the MAC process shown in Figure 5-21, to the FSP process shown in
Figure 6-17, and to the POC process shown in Figure 2-9, Figure 7-3, and Figure 7-11.
29 Note that successful decoding does not necessarily imply successful reception in terms of being able to present the payload
of the decoded stream to the host.
POC POC
MAC POC MAC
FSP FSP FSP
CODEC a b c
BITSTRB
strobing
Figure 3-12 shows the received bit stream of a CAS/MTS and events in relation to the CODEC and the
BITSTRB processes:
a. Output signal idle end on A to the POC process shown in Figure 2-9, Figure 7-3, and Figure 7-11;
output signal CE start on A to the MAC process shown in Figure 5-21, and to the FSP process shown
in Figure 6-9.
b. Output signal symbol decoded on A to the POC process shown in Figure 2-9, Figure 7-3, Figure 7-11,
Figure 7-12, and Figure 7-14, to the MAC process shown in Figure 5-21, and to the FSP process
shown in Figure 6-11.
c. Output signal CHIRP on A to the POC process shown in Figure 2-9, Figure 7-3, and Figure 7-11, to the
MAC process shown in Figure 5-21, and to the FSP process shown in Figure 6-17.
samples 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
sample count 2 3 4 2 3 4 5 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 2 3 4 5 6 7 8
30
There are specific cases where a single glitch cannot be tolerated and others where two glitches can be tolerated.
Asymmetric delays cause bit edges to occur earlier or later than would otherwise be expected from a
receiver's perspective. This could contribute to individual receivers incorrectly determining a received bit
value. To avoid this effect these delays must be bounded such that the aggregate effect of asymmetric
delays at any receiving node does not affect the majority of bit samples used in determining the voted value
at the strobe offset. Asymmetry causes and effects are described and characterized in [EPL05] in Chapter
12 and in [EPLAN05] in section 2.15.
1. In the STANDBY mode, the execution of the CODEC and all of its subprocesses are effectively halted.
POC:state name
WUPDEC, CODEC, BITSTRB POC:config POC:else
-,-,- standby, standby, standby
POC:wakeup POC:ready
STANDBY
go, go, go go, ready, go
POC:startup
go, go, go
POC:normal
standby, go, go
vRF!Channel := A;
BITSTRB_A,
WUPDEC_A
set TxEN to HIGH,
BITSTRB control on A (GO),
WUPDEC control on A (GO)
WAKEUP NORMAL
WUPDEC control on A WUPDEC control on A
(GO) (STANDBY)
standby DECODING
NORMAL WAKEUP
standby - ready
*
terminate CODEC_A
terminate BITSTRB_A,
terminate WUPDEC_A
The variable zBit is used to describe the level of the TxD and TxEN interface signals between the CODEC
and a bus driver. The zBit variable is of type T_BitLevel as defined in Definition 3-3:
newtype T_BitLevel
literals HIGH, LOW;
endnewtype;
Definition 3-3: Formal definition of T_BitLevel.
The CODEC process provides the assembled bit stream via the TxD signal to the BD (with the SDL signals
set TxD to HIGH and set TxD to LOW) and controls the BD via the TxEN signal (the SDL signals set TxEN
to HIGH and set TxEN to LOW). The transmitting node shall set TxD to HIGH in the case of a '1' bit and
shall set TxD to LOW in the case of a '0' bit.
Figure 3-18 shows the behavior of the encoding. After reception of the transmit frame on A signal the
prepbitstream function is called. This function takes the inbound frame vTF from the MAC process,
prepares the bit stream zBitStream of type T_BitStreamArray for transmission, and calculates the bit stream
length zBitStreamLength. The prepbitstream function shall break the frame data down into individual
bytes, prepend a TSS, add an FSS at the end of the TSS, create a series of extended byte sequences by
adding a BSS at the beginning of each byte of frame data, calculate the frame CRC bytes and create the
extended byte sequences for the CRC, and assembles a continuous bit stream out of the extended byte
sequences. The function prepCASstream shall prepend a TSS to the symbol bit stream.
newtype T_BitStreamArray
Array (Integer, T_BitLevel);
31
The frame sent on the channel also contains the frame CRC. The frame CRC is not part of the vTF variable - it is added to the
frame by the CODEC.
32
T_Header and T_Payload are defined in Chapter 4.
endnewtype;
Definition 3-4: Formal definition of T_BitStreamArray.
* (standby, ready)
STATFRAME,
vType ? WUP
DYNFRAME
SYMBOL
prepbitstream(vTF, zBitStream, prepCASstream (zBit
zBitStreamLength); Stream, zBitStreamLength);
vType ? SYMBOL
else
TRANSMIT_FES
vType ? else
DYNFRAME
TRANSMIT_DTS
zCodecMode ? else
WAKEUP
WUPDEC control on A
(GO)
Immediately after instantiating of the CODEC process, the encoder sends the signal set TxEN to HIGH to
disable the BD's transmitter.
newtype T_Type
literals STATFRAME, DYNFRAME, SYMBOL, WUP;
endnewtype;
Definition 3-5: Formal definition of T_Type.
TRANSMIT_FES
set(tBitDuration);
tBitDuration
set(tBitDuration);
tBitDuration
TRANSMIT_DTS
set(tBitDuration);
tBitDuration
DTS start on A
set(tBitDuration);
tBitDuration
TRANSMIT_BIT_
STREAM
zBitCnt := 0;
set(tBitDuration);
zBitStream(zBitCnt) ? HIGH
LOW
tBitDuration
zBitCnt := zBitCnt+ 1;
zBitCnt? =zBitStreamLength
else
WUP_ENCODING
zRemainingPattern :=
pWakeupPattern;
zRemainingPattern ? else
>0
zRemainingPattern :=
WUP transmitted on A
zRemainingPattern - 1;
set(tWusLow);
BITSTRB control on A
(GO)
WUSTXIDLE_
wakeup collision
DECODING
no collision
BITSTRB control on A
(STANDBY)
WUSTXIDLE_
DECODING
zLowBitCnt := 0;
set(tWusIdle);
WusTxIdle decoding
zBit ? HIGH
LOW
zLowBitCnt :=
zLowBitCnt := 0;
zLowBitCnt + 1;
= cdWakeupMaxCollision
wakeup collision
on A
DECODING
WAIT_FOR_CE_START
FSS ok
header ok
payload ok
newtype T_ByteStreamArray
Array (Integer, T_ByteArray);
endnewtype;
Definition 3-7: Formal definition of T_ByteStreamArray.
syntype
T_CRCCheckPassed = Boolean
endsyntype;
Definition 3-8: Formal definition of T_CRCCheckPassed.
syntype
T_MicrotickTime = Integer
endsyntype;
Definition 3-9: Formal definition of T_MicrotickTime.
33
Refer to Chapter 6 for further type definitions.
newtype T_ReceiveFrame
struct
PrimaryTRP T_MicrotickTime;
Channel T_Channel;
Header T_Header;
Payload T_Payload;
endnewtype;
Definition 3-10: Formal definition of T_ReceiveFrame.
WAIT_FOR_CE_START
CE start on A
TSS_DECODING
zBitCnt:= 1;
TSS decoding
zBitCnt:= zBitCnt + 1;
zBit ? HIGH
LOW
else zBitCnt ?
> gdTSSTransmitter + 1
SYMBOL_DECODING
symbol decoding
zBit ? LOW
zBitCnt ? else
zBitCnt ? else
>= cdCASRxLowMin
> gdCASRxLowMax
symbol decoded on A
FSS_BSS_DECODING
zBitCnt := 1;
FSS_BSS decoding
zBitCnt := zBitCnt + 1;
34
If a bit is strobed at a microtick boundary ’now’ should reflect the larger microtick value.
HEADER_DECODING
zByteCnt := 0;
zByte := CALL
BYTE_DECODING;
zByteStream(zByteCnt) :=
zByte(0:7);
zByteCnt := zByteCnt + 1;
zBssError := CALL
BSS_DECODING; decoding error
zBssError ? true
=5 headerCRCcheck
(zByteStream(0:4),
zCRCCheckPassed);
zCRCCheckPassed ? false
true
header received on A
getpayloadlength
(zByteStream(2),
zPayloadLength);
The function headerCRCcheck returns a Boolean, zCRCCheckPassed, which is true if the header CRC
check was passed (see section 4.5.2) and is false if the header CRC check fails. The function getpayloa-
dlength returns zPayloadLength, the number of bytes in the payload segment of a frame. The CODEC
process uses zPayloadLength to determine the correct length of a received frame. See also Figure 3-33
and Figure 3-34.
byte decoding
zByte(zBitCnt) := zBit;
zBitCnt := zBitCnt + 1;
=8
enable sync edge detect
on A
zByte
zBit ? LOW
HIGH
zBit ? HIGH
LOW
false true
FES_DECODING
zBit ? HIGH
LOW
zBit ? LOW
PAYLOAD_DECODING
zByteCnt ?
= zPayloadLength + 5
else
zByte := CALL
BYTE_DECODING;
zByteStream(zByteCnt) :=
zByte(0:7);
zByteCnt := zByteCnt + 1;
zBssError := CALL
BSS_DECODING;
zBssError ? false
true
decoding error
TRAILER_DECODING
zByte := CALL
BYTE_DECODING;
zByteStream(zByteCnt) :=
zByte(0:7);
zByteCnt := zByteCnt + 1;
zBssError := CALL
BSS_DECODING;
decoding error
zBssError ? true
false
else zByteCnt ?
zByteStream(zByteCnt) :=
zByte(0:7);
frameCRCcheck(zByteStream
(0:zByteCnt),
zCRCCheckPassed);
zCRCCheckPassed ? false
true
getRF(vRF, zByteStream
(0:zByteCnt));
frame decoded on A
(vRF)
FES ok
The function frameCRCcheck returns a Boolean, zCRCCheckPassed, which is true if the frame CRC check
was passed (see section 4.5.3) and is false if the frame CRC check fails. This function is channel specific
due to the channel specific initialization vectors of the CRC calculation (see section 4.5.3 for details).
The function getRF used in Figure 3-34 extracts decoded header and payload data from zByteStream and
returns it via the structure variable vRF.
The bit strobing process BITSTRB has the following two operating modes:
1. In the STANDBY mode bit strobing is effectively halted.
2. In the GO mode the bit strobing process shall be executed.
At the transition from the state CODEC:standby to the state CODEC:ready the bit strobing process
BITSTRB is set in the mode GO and at any transition of the CODEC process to CODEC:standby the bit
strobing process BITSTRB is set to STANDBY.
zStrbMode ? STANDBY
GO zSampleCounter := 1;
zVotedVal := HIGH;
zEnEdgeDetect := true;
zEdgeDetectMode := true;
zPrevStrobedVal := HIGH;
zChannelIdle := false;
zPrevVal := zVotedVal; zIdleCnt := 0;
zEdgeDetectMode := false;
zEdgeDetectMode := true;
zEnEdgeDetect := false;
zEnEdgeDetect ? false
true
zPrevVal ?
else
zVotedVal ?
zPrevVal = HIGH and zVotedVal = LOW
zSampleCounter ? else
zEnEdgeDetect := false;
zSampleCounter := 2;
= cStrobeOffset
bit strobed on A
(zVotedVal)
zVotedVal ?
else
zEdgeDetectMode ?
zVotedVal = HIGH and zEdgeDetectMode = true
zEnEdgeDetect := true;
CE_AND_IDLE_CHECK
zPrevStrobedVal :=
zVotedVal;
zSampleCounter :=
zSampleCounter + 1;
else zSampleCounter ?
> cSamplesPerBit
zSampleCounter := 1;
CE_AND_IDLE_CHECK
zIdleCnt ? else
= cChannelIdleDelimiter =1 zIdleCnt := 0;
CHIRP on A
* (standby) *
BITSTRB control on A
terminate BITSTRB_A
(zStrbMode)
zStrbMode ? STANDBY
GO idle end on A
- standby
1. In the STANDBY mode, the wakeup pattern decoding process (WUPDEC) is effectively halted.
standby
WUPDEC control on A
(zWupDecMode)
zWupDecMode ? else
WUP_DEC standby
* (standby) *
WUPDEC control on A
(zWupDecMode)
terminate WUPDEC_A
zWupDecMode ? else
STANDBY
standby -
Figure 3-38: Control of the wakeup pattern detection process and its termination [WUPDEC_A].
WUP_DEC
* (standby)
zBitCnt := 0;
tWUPWindow
set(tWUPWindow);
WusLow1 decoding
LOW zBit ?
HIGH
>=gdWakeupSymbolRxLow
zBitCnt := 1;
HIGH zBit ?
LOW
zBitCnt := zBitCnt + 1;
zBitCnt ? else
>=gdWakeupSymbolRxIdle
zBitCnt := 1;
WusLow2 decoding
zBitCnt := zBitCnt + 1;
else zBitCnt ?
>=gdWakeupSymbolRxLow
WUP decoded on A
reset(tWUPWindow);
’set WUP received
indicator on A in CHI’;
Chapter 4
Frame Format
4.1 Overview
An overview of the FlexRay frame format is given in Figure 4-1. The frame consists of three segments.
These are the header segment, the payload segment, and the trailer segment.
Payload preamble indicator
Header CRC
Covered Area
The node shall transmit the frame on the network such that the header segment appears first, followed by
the payload segment, and then followed by the trailer segment, which is transmitted last. Within the
individual segments the node shall transmit the fields in left to right order as depicted in Figure 4-1, (in the
header segment, for example, the reserved bit is transmitted first and the cycle count field is transmitted
last).
35 The receiving node uses the value of the reserved bit for the Frame CRC checking process, but otherwise ignores its value
(i.e., the receiver shall accept either a 1 or a 0 in this field).
36
If the null frame indicator is set to zero the payload preamble indicator is irrelevant because the payload contains no usable
data.
37
The null frame indicator indicates only whether payload data was available to the communication controller at the time the
frame was sent. A null frame indicator set to zero informs the receiving node(s) that data in the payload segment must not
be used. If the bit is set to one data is present in the payload segment from the transmitting communication controller's
perspective. The receiving node may still have to do additional checks to decide whether the data is actually valid from an
application perspective.
38 For example, the clock synchronization algorithm will use the arrival time of null frames with the Sync frame indicator set to
one (provided all other criteria for that frame's acceptance are met).
• If the sync frame indicator is set to zero then no receiving node shall consider the frame for synchro-
nization or synchronization related tasks.
• If the sync frame indicator is set to one then all receiving nodes shall utilize the frame for synchroni-
zation if it meets other acceptance criteria (see below).
The clock synchronization mechanism (described in Chapter 8) makes use of the sync frame indicator.
There are several conditions that result in the sync frame indicator being set to one and subsequently
utilized by the clock synchronization mechanism. Details of how the node shall set the sync frame indicator
are specified in Chapter 5 and section 8.8.
syntype T_SyFIndicator = Integer
constants 0 : 1
endsyntype;
Definition 4-4: Formal definition of T_SyFIndicator.
39
Sync frames may only sent in the static segment. Please refer to the rules to configure sync frames.
40 The configuration of exactly three nodes in a cluster as coldstart nodes avoids the formation of cliques during startup for
several fault scenarios. It is also possible to configure more than three nodes as coldstart nodes but the clique avoidance
mechanism will not work in this case.
41 In binary: from (000 0000 0001) to (111 1111 1111)
2 2
42
The frame ID of a transmitted frame is determined by the value of vSlotCounter(Ch) at the time of transmission (see Chapter
5). In the absence of faults, vSlotCounter(Ch) can never be zero when a slot is available for transmission. Received frames
with frame ID zero will always be identified as erroneous because a slot ID mismatch is a certainty due to the fact that there
is no slot with ID zero.
43 Frame IDs range from 1 to 2047. The zero is used to mark invalid frames, empty slots, etc.
44
The payload length field does not include the number of bytes within the header and the trailer segments of the FlexRay
frame.
45 For a given frame in the static segment the values of the header fields covered by the CRC do not change during the
operation of the cluster in the absence of faults. Implicitly, the CRC does not need to change either. Offline calculation of the
CRC makes it unlikely that a fault-induced change to the covered header fields will also result in a frame with a valid header
CRC (since the CRC is not recalculated based on the modified header fields).
46
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 sync frame
indicator bit + 1 startup frame indicator bit + 11 frame ID bits + 7 payload length bits = 20 bits). This polynomial was obtained
from [Wad01] and its properties were verified using the techniques described in [Koo02].
With respect to the computation of the header CRC, the sync frame indicator shall be shifted in first, followed
by the startup frame indicator, followed by the most significant bit of the frame ID, followed by subsequent
bits of the frame ID, followed by the most significant bit of the payload length, and followed by subsequent
bits of the payload length.
The node shall transmit the header CRC such that the most significant bit of the header CRC is transmitted
first with the remaining bits of the header CRC being transmitted in decreasing order of significance.
A detailed description of how to generate and verify the header CRC is given in section 4.5.2.
syntype T_HeaderCRC = Integer
constants 0 : 2047
endsyntype;
Definition 4-8: Formal definition of T_HeaderCRC.
The frame CRC described in section 4.5.3 has a Hamming distance of six for payload lengths up to and
including 248 bytes. For payload lengths greater than 248 bytes the CRC has a Hamming distance of four.
For frames transmitted in the dynamic segment the first two bytes of the 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 payload preamble indicator in the frame header indicates whether the payload segment contains
the message ID.
For frames transmitted in the static segment the first 0 to 12 bytes of the payload segment may optionally
be used as a network management vector. The payload preamble indicator in the frame header indicates
whether the payload segment contains the network management vector48. The length of the network
management vector gNetworkManagementVectorLength is configured during the POC:config state and
cannot be changed in any other state. gNetworkManagementVectorLength can be configured between 0
and 12 bytes, inclusive.
Starting with payload "Data 0" the node shall transmit the bytes of the payload segment 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.49
The product specific host interface specification determines the mapping between the position of bytes in
the buffer and the position of the bytes in the payload segment of the frame.
47 The length of the payload segment indicated by the Length field of the T_Header structure corresponds to the number of
bytes that are sent on the communication channel. It does not necessarily correspond to the number of bytes used by the
application in the payload segment. The data provided by the application may be shorter than the payload segment. A
padding function in the communication controller fills the "missing" bytes if the configured transmit buffer is smaller than the
configured payload length.
48
Frames that contain network management data are not restricted to contain only network management data - the other bytes
in the payload segment may be used to convey additional, non-Network Management data.
49
If a message ID exists, the most significant byte of the message ID is transmitted first followed by the least significant byte of
the message ID. If no message ID exists the transmission starts with the first payload data byte (Data 0) followed by the
remaining payload data bytes.
50
This allows lower bits to remain at defined positions if the length of the NMvector changes.
NM 0 NM 1 NM 2
Data n
Data 0 Data 1 Data 2
Message ID
Data 2 Data n
Data 0 Data 1
16 bits
0 ... 254 bytes
Payload Segment
51 This includes the header CRC, as well as any Communication Controller-generated "padding" bytes that may be included in
the payload segment.
24 22 20 19 18 16 14 13 11 10 8 7 6 3
x +x +x +x +x +x +x +x +x +x +x +x +x +x +x+1
2 11 9 8 7 5 3 2 11 9 8 7 6 3
= (x + 1) ⋅ (x + x + x + x + x + x + x + x + 1) ⋅ (x + x + x + x + x + x + 1)
The node shall use a different initialization vector depending on which channel the frame should be trans-
mitted53:
• The node shall use the initialization vector 0xFEDCBA for frames sent on channel A.
• The node shall use the initialization vector 0xABCDEF for frames sent on channel B.
With respect to the computation of the frame CRC, the frame fields shall be fed into the CRC generator in
network order starting with the reserved bit, and ending with the least significant bit of the last byte of the
payload segment.
The frame CRC shall be transmitted such that the most significant bit of the frame CRC is transmitted first
with the remaining bits of the frame CRC being transmitted in decreasing order of significance.
A detailed description of how to generate or verify the Frame CRC is given in section 4.5.3.
syntype T_FrameCRC = Integer
52 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 [Cas93], and its properties were verified using the
techniques described in [Koo02].
53
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).
54
Transmitting nodes use the bit sequence that will be fed into the coding algorithm (see Chapter 3), 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.)).
The results of the calculation (vCrcReg) are compared to the header CRC value in the frame. If the
calculated and received values match the header CRC check passes, otherwise it fails.
55
This makes it unlikely that a fault in the CC that causes the value of a sync or startup frame indicator to change would result
in a frame that is accepted by other nodes in the network because the header CRC would not match. Removing the
capability of the transmitter to generate the CRC minimizes the possibility that a frame that results from a CC fault would
have a proper header CRC.
The results of the calculation (vCrcReg) are compared to the frame CRC value in the frame on the appro-
priate channel. If the calculated and received values match the header CRC check passes, otherwise it fails.
Chapter 5
Media Access Control
This chapter defines how the node shall perform media access control.
5.1 Principles
In the FlexRay protocol, media access control is based on a recurring 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.
t
communication
cycle level
static segment dynamic segment symbol window network
idle time
arbitration
grid level
static slot static slot minislot minislot
action point action point action point
macrotick
level
macrotick
microtick
level
microtick
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 5.3.2. Within the dynamic segment a dynamic mini-slotting based scheme is used to arbitrate trans-
missions as specified in section 5.3.3. The symbol window is a communication period in which a symbol can
be transmitted on the network as specified in section 5.3.4. The network idle time is a communication-free
period that concludes each communication cycle as specified in section 5.3.5.
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 8. Designated macrotick boundaries are called action points. These are specific
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, which is described in Chapter 8.
microtick
cycle x-1 cycle x
The node shall maintain a cycle counter vCycleCounter that contains the number of the current communi-
cation cycle. Initialization and maintenance of the cycle counter are specified in Chapter 8.
The media access procedure is specified by means of the media access process for channel A. The node
shall contain an equivalent media access process for channel B.
channel B frame ID 1
1 2 3
The number of static slots gNumberOfStaticSlots is a global constant for a given cluster.
56
This requirement applies to the entire operation of the cluster, as opposed to only a single cycle. For example, it is not
acceptable to configure a cluster such that different nodes transmit in the same slot/channel combination in different cycles.
57
Analogously, transmitting only on channel B is also allowed.
All static slots consist of an identical number of gdStaticSlot macroticks. The number of macroticks per static
slot gdStaticSlot is a global constant for a given cluster. Appropriate configuration of the static slot length
gdStaticSlot must assure that the frame and the channel idle delimiter and any potential safety margin fit
within the static slot under worst-case assumptions. Details are given in Appendix B.
For any given node one static slot (as defined in pKeySlotId) may be assigned to contain a sync frame (as
identified by pKeySlotUsedForSync), a special type of frame required for synchronization within the cluster.
Specific sync frames may be assigned to be startup frames (as identified by pKeySlotUsedForStartup).
Figure 5-4 depicts the detailed timing of the static slot.
frame ID 1 frame ID 2 t
macrotick
slot
1 2
counter
microtick
slot 1 slot 2
Each static slot contains an action point that is offset from the start of the slot by gdActionPointOffset
macroticks. In the static segment frame transmissions start at the action point of the static slot. The number
of macroticks contained in the action point offset gdActionPointOffset is a global constant for a given cluster.
The formula for determining the parameter gdActionPointOffset and the corresponding constraints are
specified in Appendix B.
transmission may only start within the first pLatestTx minislots of the dynamic segment
minislot
macrotick
minislot
action point
minislot action point offset
gdMinislotActionPointOffset
minislot
gdMinislot
In the dynamic segment, frame transmissions start at the minislot action point of the first minislot of the
corresponding dynamic slot. In the dynamic segment, frame transmissions also end at a minislot action
point. This is achieved by means of the dynamic trailing sequence (DTS) as specified in Chapter 3.
In contrast to a static slot, the dynamic slot distinguishes between the dynamic slot transmission phase and
the dynamic slot idle phase. The dynamic slot transmission phase extends from the start of the dynamic slot
to the end of 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 receiving nodes.
Figure 5-7 depicts the detailed timing within the dynamic segment.
minislot
slot
m m+1 m+2 m+3
counter
slot counter incremented at
the end of each dynamic slot
The start of the dynamic segment requires particular attention. The first action point in the dynamic segment
occurs gdActionPointOffset macroticks after the end of the static segment if gdActionPointOffset is larger
than gdMinislotActionPointOffset else it occurs gdMinislotActionPointOffset macroticks after the end of the
static segment.58
The two cases are illustrated in Figure 5-8.
58 This ensures that the duration of the gap following the last static frame transmission is at least as large as the gaps between
successive frames within the static segment.
minislot minislot
macrotick macrotick
minislot minislot
action point action point
gdMinislotActionPointOffset dynamic seg- gdMinislotActionPointOffset
ment offset
gdMinislot gdMinislot
gdActionPointOffset gdActionPointOffset
last static slot first dynamic slot last static slot first dynamic slot
(a) (b)
Figure 5-8: Timing at the boundary between the static and dynamic segments.
The node performs slot counter housekeeping on a per channel basis. At the end of every dynamic slot the
node increments the slot counter vSlotCounter by one. This is done until either
1. the channel's slot counter has reached cSlotIDMax, or
2. the dynamic segment has reached the minislot gNumberOfMinislots, i.e. the end of the dynamic seg-
ment.
Once one of these conditions is met the node sets the corresponding slot counter to zero for the remainder
of the communication cycle.
The arbitration procedure ensures that all fault-free receiving nodes implicitly know the dynamic slot in which
the transmission starts. Further, all fault-free receiving nodes also agree implicitly on the minislot in which
slot counting is resumed. As a result, the slot counters of all fault-free receiving nodes match the slot counter
of the fault-free transmitting node and the frame identifier contained in the frame.
channel idle
channel active delimiter channel idle
symbol t
macrotick
action point
symbol window
gdSymbolWindow
The symbol window contains an action point that is offset from the start of the slot by gdActionPointOffset
5.2 Description
The relationship between the Media Access Control processes and the other protocol processes is depicted
in Figure 5-1059.
59 The dark lines represent data flows between mechanisms that are relevant to this chapter. The lighter gray lines are relevant
to the protocol, but not to this chapter.
to / from host
controller
host interface
protocol
operation
control
clock
macrotick
synchronization
generation
processing
coding / decoding
processes
to channel interface channel B from channel interface
In order to support two channels each node needs to contain a media access control process for channel
A and a media access control process for channel B.
4. In the STARTUPFRAME mode transmissions are restricted to the transmission of one startup null-
frame per cycle on each configured channel if the node is configured to send a startup frame.
5. In the SINGLESLOT mode transmissions are restricted to the transmission of one sync frame per
cycle on each configured channel if the node is configured to send a sync frame, or to the transmission
of a specified single-slot frame per cycle on each configured channel if the node is configured to sup-
port the single-slot mode.
6. In the ALL mode frames and symbols are sent in accordance with the node's transmission slot alloca-
tion.
Definition 5-1 gives the formal definition of the MAC operating modes.
newtype T_MacMode
literals STANDBY, NOCE, STARTUPFRAMECAS, STARTUPFRAME, SINGLESLOT, ALL;
endnewtype;
Definition 5-1: Formal definition of T_MacMode.
channel idle
channel idle channel active delimiter channel idle
channel idle
channel idle channel active delimiter channel idle
DTS start
For communication channel A the transmission-relevant event is the start of the dynamic trailing sequence
within the transmission pattern on channel A (signal DTS start on A).
For communication channel B the transmission-relevant event is the start of the dynamic trailing sequence
within the transmission pattern on channel B (signal DTS start on B).
transmit symbol on A
(SYMBOL)
STATIC_SEGMENT_A
fatal
DYNAMIC_SEGMENT_A
error
done
SYMBOL_WINDOW_A
NIT_A
Figure 5-14 depicts how mode changes are processed by the media access process.
reset (tCASActionPoint);
reset (tActionPoint);
reset (tSlotBoundary); *
(standby)
reset (tMinislot);
reset (tMinislotActionPoint);
MAC control on A
reset (tSymbolWindow);
(zMacMode)
reset (tDynamicSegmentOffset);
STANDBY zMacMode ?
else
standby -
As depicted in Figure 5-15 a node shall terminate the MAC process upon occurrence of the terminate event
issued by the protocol operation control.
terminate MAC_A
The node shall perform media access in the static segment according to Figure 5-17 for channel A.
STATIC_SEGMENT_A
cycle start
(vCycleCounter)
static segment start on A
vSlotCounter := 1; (vCycleCounter, vSlotCounter)
’update vSlotCounter in CHI’;
slot boundary on A
(vSlotCounter)
set (tActionPoint);
set (tSlotBoundary);
action point on A
ASSEMBLE_ nothing to
STATIC_FRAME_A transmit
frame vTF to transmit
transmit frame on A
(STATFRAME, vTF)
tSlotBoundary
vSlotCounter :=
vSlotCounter + 1;
’update vSlotCounter in CHI’;
vSlotCounter ? else
> gNumberOfStaticSlots
done
The node shall start frame transmission at the action point of an assigned static slot if appropriate trans-
mission conditions are met (see section 5.3.2.2).
The transmission data that shall be sent is specified in the T_TransmitFrame data structure that is defined
in Definition 5-2.
newtype T_TransmitFrame
struct
Header T_Header;
Payload T_Payload;
endnewtype;
Definition 5-2: Formal definition of T_TransmitFrame.
At the end boundary of every static slot the node shall increment the slot counter vSlotCounter for channel
A and the slot counter vSlotCounter for channel B by one.
newtype T_Assignment
literals UNASSIGNED, ASSIGNED;
endnewtype;
Definition 5-5: Formal definition of T_Assignment.
Assuming a variable vTCHI of type T_CHITransmission imported from the CHI, the node shall assemble the
frame in the following way if vTCHI!Assignment is set to ASSIGNED:
1. The reserved bit shall be set to zero.
2. If pKeySlotId equals vSlotCounter then
a. the startup frame indicator shall be set in accordance with pKeySlotUsedForStartup, and
b. the sync frame indicator shall be set in accordance with pKeySlotUsedForSync.
else
c. the startup frame indicator shall be set to zero, and
d. the sync frame indicator shall be set to zero.
3. The frame ID field shall be set to the current value of the slot counter vSlotCounter.
4. The length field shall be set to gPayloadLengthStatic.
5. The header CRC shall be set to the value vTCHI!HeaderCRC retrieved from the CHI.
6. The cycle count field shall be set to the current value of the cycle counter vCycleCounter.
7. If the host has data available (vTCHI!TxMessageAvailable set to true) then
a. the null frame indicator shall be set to one, and
b. the payload preamble indicator shall be set to the value vTCHI!PPIndicator imported from the CHI,
and
c. vTCHI!Length number of two-byte payload words shall be copied from vTCHI!Message to
ASSEMBLE_
STATIC_FRAME_A
NOCE zMacMode ?
else
UNASSIGNED vTCHI!Assignment ?
ASSIGNED
else vSlotCounter ?
= pKeySlotId
false pKeySlotUsedForStartup ?
true
vTF!Header!SuFIndicator := 0;
vTF!Header!SyFIndicator := 0;
nothing to false pKeySlotUsedForStartup ? true
vTF!Header!SyFIndicator := vTF!Header!SyFIndicator :=
0; 1;
vTF!Header!Reserved := 0;
vTF!Header!FrameID := vSlotCounter;
STARTUPFRAME, vTF!Header!CycleCount := vCycleCounter;
zMacMode? vTF!Header!Length := gPayloadLengthStatic;
STARTUPFRAMECAS
vTF!Header!HeaderCRC := vTCHI!HeaderCRC;
else
vTCHI!TxMessage
false true
Available ?
vTF!Header!NFIndicator := 0; vTF!Header!NFIndicator := 1;
vTF!Header!PPIndicator := 0; vTF!Header!PPIndicator := vTCHI!PPIndicator;
'set all bytes in vTF!Payload to 0'; frame vTF to 'copy vTCHI!Length number of words from
transmit vTCHI!Message to vTF!Payload';
'set any remaining bytes in vTF!Payload to 0';
wait for
the end of the
dynamic
segment
offset
wait for
wait for
the AP
the end of
transmission
the minislot
start
wait for
the end of
the
wait for
the end of
the dynamic
standby
segment
The node shall perform media access in the dynamic segment as depicted in Figure 5-20, Figure 5-21,
Figure 5-22, and Figure 5-23.
In the dynamic segment the node shall increment the slot counter vSlotCounter at the end of each dynamic
slot. If the increment would cause vSlotCounter to exceed the maximum slot ID cSlotIDMax then vSlot-
Counter is instead set to zero and remains at this value until the end of the dynamic segment.
DYNAMIC_SEGMENT_A
gNumberOfMinislots ? =0
>0
dynamic segment start
on A (vSlotCounter)
else gdActionPointOffset ?
> gdMinislotActionPointOffset
set
(tDynamicSegmentOffset);
tDynamicSegmentOffset
fatal DYN_SEG_LOOP_A
error
done
’update zLastDynTxSlot
in CHI’
DYN_SEG_LOOP_A
transmit frame on A
(DYNFRAME, vTF)
CE start on A tMinislot
wait for the DTS start
DTS start on A
zEndMinislot := zMinislot +
CHIRP on A
gdDynamicSlotIdlePhase;
tMinislot tMinislot
= zEndMinislot or
zMinislot ? =zEndMinislot zMinislot ?
= gNumberOfMinislots
else else
= gNumberOf- zMinislot := zMinislot + 1;
zMinislot ?
Minislots set (tMinislot);
else
zMinislot := zMinislot + 1;
set (tMinislot);
zMinislot ? = gNumberOfMinislots
else
'set pLatestTx violation
status indicator in CHI'; done
vSlotCounter ? else
= cSlotIDMax
fatal protocol error
vSlotCounter := 0;
’update vSlotCounter in CHI’; vSlotCounter := vSlotCounter + 1;
zMinislot := zMinislot + 1;
zMinislot := zMinislot + 1; slot boundary on A set (tMinislotActionPoint);
fatal error set (tMinislot); (vSlotCounter) set (tMinislot);
’update vSlotCounter in CHI’;
slot boundary on A
(vSlotCounter)
tMinislot
= gNumberOfMinislots zMinislot ?
else
'set pLatestTx violation
status indicator in CHI'; zMinislot := zMinislot + 1;
set (tMinislotActionPoint);
fatal protocol error set (tMinislot);
-
fatal error
tMinislot
zMinislot ? = gNumberOfMinislots
else
zMinislot := zMinislot + 1; done
set (tMinislot);
Figure 5-23: Dynamic segment termination in the event of slot counter exhaustion [MAC_A].
60
The implicit input tMinislotActionPoint in state MAC:wait for the DTS start has been explicitly defined in this figure to express
more clearly its relationship to the priority input DTS start on A. In case both signals are received simultaneously the timer
expiration is preserved for the subsequent state.
ASSEMBLE_
DYNAMIC_FRAME_A
else zMacMode ?
ALL
vTF!Header!Reserved := 0;
else vTCHI!Assignment ? vTF!Header!SyFIndicator := 0;
vTF!Header!SuFIndicator := 0;
ASSIGNED vTF!Header!FrameID := vSlotCounter;
vTCHI!TxMessage vTF!Header!CycleCount := vCycleCounter;
false vTF!Header!Length := vTCHI!Length;
Available ?
vTF!Header!HeaderCrc := vTCHI!HeaderCrc;
true
vTF!Header!PPIndicator := vTCHI!PPIndicator;
nothing to vTF!Header!NFIndicator := 1;
transmit 'copy vTCHI!Length number of words from
vTCHI!Message to vTF!Payload';
frame vTF to
transmit
wait for
wait for
the symbol
the end of
window
the symbol
action
window
standby point
The node shall perform media access in the symbol window as depicted in Figure 5-26. At the start of the
symbol window the node shall set the slot counter vSlotCounter to zero.
The node shall start symbol transmission at the action point of the symbol window if the symbol transmission
conditions are met.
SYMBOL_WINDOW_A
=0 gdSymbolWindow ?
>0
vSlotCounter := 0;
set (tActionPoint);
set (tSymbolWindow);
’update vSlotCounter in CHI’;
tActionPoint
'does the host request
the transmission of a
no MTS on A' ?
yes
else zMacMode ?
ALL
transmit symbol on A
(SYMBOL)
tSymbolWindow
done
NIT_A
vSlotCounter := 0;
’update vSlotCounter in CHI’;
NIT start on A
(vSlotCounter)
done
At the start of the NIT the node shall set the slot counter vSlotCounter to zero.
Chapter 6
Frame and Symbol Processing
This chapter defines how the node shall perform frame and symbol processing.
6.1 Principles
Frame and symbol processing (FSP) is the main processing layer between frame and symbol decoding,
which is specified in Chapter 3, and the controller host interface, which is specified in Chapter 9.
Frame and symbol processing checks the correct timing of frames and symbols with respect to the TDMA
scheme, applies further syntactical tests to received frames, and checks the semantic correctness of
received frames.
61 The dark lines represent data flows between mechanisms that are relevant to this chapter. The lighter gray lines are relevant
to the protocol, but not to this chapter.
to / from host
controller
host interface
protocol
operation
control
clock
macrotick
synchronization
generation
processing
coding / decoding
processes
to channel interface channel B from channel interface
In order to support two channels each node needs to contain a frame and symbol processing process for
channel A and a frame and symbol processing process for channel B.
channel idle
channel idle channel active delimiter channel idle
62
In order to address channel consistency checks for sync frames.
PrimaryTRP T_MicrotickTime;
Channel T_Channel;
Header T_Header;
Payload T_Payload;
endnewtype;
Definition 6-2: Formal definition of T_ReceiveFrame.
network
static static dynamic dynamic dynamic symbol idle
slot slot slot slot slot window time
communication cycle
1. static segment start on channel B (signal static segment start on B (vCycleCounter, vSlotCounter);
where vCycleCounter holds the number of the current communication cycle and vSlotCounter holds
the number of the communication slot that is just beginning on channel B),
2. slot boundary on channel B (signal slot boundary on B (vSlotCounter); where vSlotCounter holds the
number of the communication slot that is just beginning on channel B),
3. dynamic segment start on channel B (signal dynamic segment start on B (vSlotCounter); where vSlot-
Counter holds the number of the current communication slot on channel B),
4. symbol window start on channel B (signal symbol window start on B (vSlotCounter); where vSlot-
Counter holds the value 0),
5. network idle time (NIT) start on channel B (signal NIT start on B (vSlotCounter); where vSlotCounter
holds the value 0).
The parameter ValidFrame denotes whether a valid frame was received in a slot of the static or dynamic
segment. The parameter is set to false if no valid frame was received, or to true if a valid frame was received.
The parameter ValidMTS denotes whether a valid MTS was received in the symbol window. The parameter
is set to false if no valid MTS was received, or to true if a valid MTS was received.
The parameter SyntaxError denotes whether a syntax error has occurred. A syntax error occurs if
1. the node starts transmitting while the channel is not in the idle state,
2. a decoding error occurs,
3. a frame is decoded in the symbol window or in the network idle time,
4. a symbol is decoded in the static segment, in the dynamic segment, or in the network idle time,
5. a frame is received within the slot after the reception of a semantically correct frame,
6. two or more symbols are received within the symbol window.
This parameter is set to false if no syntax error occurred, or to true if a syntax error did occur. Note - it is
possible to have SyntaxError = true and ValidFrame = true. This could occur, for example, if a syntactically
incorrect frame is received first, followed by a semantically correct and syntactically correct frame in the
same slot. This would result in ValidFrame = true, SyntaxError = true, and ContentError = false.
The parameter Segment denotes the segment in which the slot status was recorded. Its type is defined in
Definition 6-4.
newtype T_Segment
literals STUP, STATIC, DYNAMIC, SW, NIT;
endnewtype;
Definition 6-4: Formal definition of T_Segment.
The parameter Segment is set to STUP during the unsynchronized startup phase. The values STATIC,
DYNAMIC, SW, and NIT denote the static segment, the dynamic segment, the symbol window, and the
network idle time, respectively.
standby
wait for
CE start
decoding
in progress
wait for
transmission
end
wait for
CHIRP
Figure 6-4: State overview of the FSP state machine (shown for one channel).
FSP control on A
(zFspMode)
As depicted in Figure 6-6, a node shall enter the FSP:standby state from any state within the FSP process
(with the exception of the FSP:standby state itself) if the protocol operation control process sets the FSP
process to the STANDBY mode.
*
(standby)
FSP control on A
content error on B
(zFspMode)
standby -
Figure 6-6: FSP control [FSP_A].
In addition, the node shall apply cross-channel content checks to identify cross-channel inconsistencies
whenever zSegment = STATIC.63
As depicted in Figure 6-7, a node shall terminate the FSP process upon occurrence of the terminate event
issued by the protocol operation control process.
terminate FSP_A
63
zSegment is STATIC during the static segment in normal operation, but can also be STATIC during some portions of startup.
vSS!ValidFrame = true
SLOT_SEGMENT_END
and
_A
vRF!Header!SyFIndicator = 1
and
false zContentErrorOnB = false ?
true
valid sync frame on A
(vRF)
vSS!ValidFrame := false;
vSS!ValidMTS := false;
vSS!SyntaxError := false;
vSS!ContentError := false;
vSS!TxConflict := false;
vSS!SlotCount := vSlotCounter;
done
slot boundary on A
(vSlotCounter)
zSegment := STATIC;
SLOT_SEGMENT_END
_A
vSS!BViolation := false;
Figure 6-9: Transitions from the FSP:wait for CE start state [FSP_A].
decoding in progress
frame decoded on A
decoding halted on A decoding error on A
(zRF)
vSS!SyntaxError := true;
true vSS!ValidFrame ? vSS!SyntaxError := true;
vSS!TxConflict := true;
false
STATIC DYNAMIC
decoding in progress
symbol decoded on A
SW
true vSS!ValidMTS ?
false
vSS!BViolation:= true;
SLOT_SEGMENT_END
_A
vRF!Header!FrameID > 0
and
vRF!Header!FrameID <= gNumberOfStaticSlots
and
vRF!Header!Length = gPayloadLengthStatic
and
vRF!Header!SyFIndicator = 1
PROCESS_STARTUP_
and
FRAME_A
true false
done
channel idle
channel idle channel active delimiter channel idle
macrotick
static slot
gdStaticSlot
content error on A
done
Figure 6-14: Frame acceptance checks for the static segment [FSP_A].
channel idle
channel idle channel active delimiter channel idle
minislots
dynamic slot
idle phase
gdDynamicSlotIdlePhase
dynamic slot
vRF!Header!FrameID > 0
and
vRF!Header!FrameID = vSlotCounter
and
vRF!Header!CycleCount = vCycleCounter
and
vRF!Header!SyFIndicator = 0
and
vRF!Header!SuFIndicator = 0
PROCESS_DYNAMIC_ and
FRAME_A vRF!Header!NFIndicator =1 ?
true false
done
Figure 6-16: Frame acceptance checks for the dynamic segment [FSP_A].
If either a slot boundary or one of the four segment boundaries is crossed then the node shall execute the
SLOT_SEGMENT_END_A macro to provide the current slot status, and any frame data that may have been
received, to the host interface for further processing. In this case the node shall remain in the FSP:wait for
CHIRP state.
vSS!SyntaxError := true;
vSS!SyntaxError := true;
vSS!TxConflict := true;
wait for CE start
zSegment := STATIC;
vSS!BViolation:= true;
SLOT_SEGMENT_END
_A
Figure 6-17: Transitions from the FSP:wait for CHIRP state [FSP_A].
Figure 6-18: Transitions from the FSP:wait for transmission end state [FSP_A].
Chapter 7
Wakeup and Startup
This chapter describes the procession of a FlexRay cluster from sleep mode to full operation and the
integration of newly configured nodes into a FlexRay cluster already in operation.
First the cluster wakeup is described in detail. Some application notes regarding the interaction between
communication controller and host are provided.
Following the wakeup section, communication startup and reintegration is described. This section also
describes the integration of nodes into a communication cluster.
64
To simplify discussion, the sequence of tasks executed while triggering the cluster wakeup is referred to here as the wakeup
"procedure" even though it is realized as an SDL macro, and not an SDL procedure. The normal grammatical use of the
term is intended rather than the precise SDL definition. Since SDL processes are not used in the wakeup mechanism, the
usage does not introduce ambiguity.
65
The host may force a mode change from wakeup mode to the POC:ready state. Note, however, that a forced mode-change
to the POC:ready state during wakeup may have consequences regarding the consistency of the cluster.
66
For example, the transmission unit of the bus driver may be faulty.
The wakeup procedure tolerates any number of nodes simultaneously trying to wake up a channel and
resolves this situation such that eventually only one node transmits the wakeup pattern. Additionally, the
wakeup pattern is collision resilient; so even in the presence of a fault causing two nodes to simultaneously
transmit a wakeup pattern the signal resulting from the collision can still wake up the other nodes.
7.1.2 Description
The wakeup procedure is a subset of the Protocol Operation Control (POC) process. The relationship
between the POC and the other protocol processes is depicted in Figure 7-167.
to / from host
controller
host interface
clock
macrotick
synchronization
generation
processing
clock
synchronization clock
clock
startup synchronization
synchronization
channel B startup channel A
startup
coding / decoding
processes
to channel interface channel B from channel interface
67 The dark lines represent data flows between mechanisms that are relevant to this chapter. The lighter gray lines are relevant
to the protocol, but not to this chapter.
tWakeup := pdListenTimeout;
tWakeupNoise := gListenNoise * pdListenTimeout;
abort
WAKEUP_LISTEN
wakeup
enter send
detect
WAKEUP_SEND collision WAKEUP_DETECT
cause
wakeup complete
The parameter pWakeupChannel identifies the channel that the communication controller is configured to
wake up. The host can only configure the wakeup channel in the POC:config state. After the communication
controller has entered the POC:ready state the host can initiate wakeup on channel pWakeupChannel.
Upon completing the wakeup procedure the communication controller shall return into the POC:ready state
and signal to the host the result of the wakeup attempt.
The return condition of the WAKEUP macro is formally defined as T_WakeupStatus in section 2.2.1.3 in
Definition 2-5.
The return status variable vPOC!WakeupStatus is set by the POC to
• UNDEFINED, if the communication controller has not yet executed the WAKEUP mechanism since
the last entry to the POC:default config state (see Figure 2-7), or when the POC responds to a CHI
WAKEUP command,
• RECEIVED_HEADER, if the communication controller has received a frame header without coding
violation on either channel during the initial listen phase,
• RECEIVED_WUP, if the communication controller has received a valid wakeup pattern on channel
pWakeupChannel during the initial listen phase,
• COLLISION_HEADER, if the communication controller has detected a collision during wakeup
pattern transmission by receiving a valid header during the ensuing detection phase,
• COLLISION_WUP, if the communication controller has detected a collision during wakeup pattern
transmission by receiving a valid wakeup pattern during the ensuing detection phase,
• COLLISION_UNKNOWN, if the communication controller has detected a collision but did not detect
a subsequent reception event that would allow the collision to be categorized as either COLLI-
SION_HEADER or COLLISION_WUP,
• TRANSMITTED, if the wakeup pattern was completely transmitted.
WAKEUP_LISTEN
zChannelIdle(A) and
false
zChannelIdle(B) ?
true
set (tWakeup);
set (tWakeupNoise);
zWakeupNoiseOut := false;
wakeup listen
zWakeupNoiseOut := false;
pWakeupChannel ? else
set (tWakeupNoise);
abort abort
wakeup wakeup
zChannelIdle(A) and
true
zChannelIdle(B) ?
zWakeupNoiseOut ? false
true
tWakeup tWakeupNoise
zChannelIdle(A) or
false
zChannelIdle(B) ?
true
zWakeupNoiseOut := true;
enter
send
The purpose of the POC:wakeup listen state is to inhibit the transmission of the wakeup pattern if existing
communication or a startup is already in progress.
68
For a single channel node, the unattached channel is assumed to always be idle.
The timer tWakeup enables a fast cluster wakeup in a noise free environment, while the timer tWakeup-
Noise enables wakeup under more difficult conditions when noise interference is present.
When ongoing communication is detected or a wakeup of pWakeupChannel is already in progress, the
wakeup attempt is aborted.
WAKEUP_SEND
pWakeupChannel ?
A B
transmit symbol on A transmit symbol on B
(WUP) (WUP)
wakeup send
vPOC!WakeupStatus :=
TRANSMITTED;
Figure 7-4: Transitions from the state POC:wakeup send state [POC].
In this state, the communication controller transmits the wakeup pattern on the configured channel and
checks for collisions.
Since the communication controller transmits the wakeup pattern on pWakeupChannel, it cannot really
determine whether another node sends a wakeup pattern or frame on this channel during its transmission.
Only during the idle portions of the wakeup pattern can it listen to the channel. If during one of these idle
portions activity is detected, the communication controller leaves the send phase and enters a succeeding
monitoring phase (POC:wakeup detect state) so that the cause of the collision might be identified and
presented to the host.
WAKEUP_DETECT
set (tWakeup);
wakeup detect
header received on A,
WUP decoded on A WUP decoded on B tWakeup
header received on B
A B
vPOC!WakeupStatus := vPOC!WakeupStatus :=
vPOC!WakeupStatus := COLLISION_HEADER; COLLISION_UNKOWN;
COLLISION_WUP;
In this state, the communication controller attempts to discover the reason for the wakeup collision encoun-
tered in the previous state (POC:wakeup send).
This monitoring is bounded by the expiration of the timer tWakeup. The detection of either a wakeup pattern
indicating a wakeup attempt by another node or the reception of a frame header indicating existing commu-
nication causes a direct transition to the POC:ready state.
69
The host must distinguish between a local wakeup event and a remote wakeup received via the channel. This information is
accessible at the bus driver.
70 This is done to speed up the wakeup process and to limit the amount of traffic on the channels, which reduces the number of
1. The host first configures the communication controller. The coldstart inhibit mode71 shall be entered by
setting vColdStartInhibit to true.
2. The host checks whether a wakeup pattern was received by the bus driver.
3. The host puts the bus driver into the BD_Normal mode.
4. If a wakeup pattern was received by the bus driver, the node should enter the startup (step 9) instead
of performing a wakeup.
If no wakeup pattern received by the bus driver, the node may perform a wakeup of the attached chan-
nel (which will eventually wake both channels of a dual-channel cluster).
5. The host configures pWakeupChannel to the attached channel.
6. The host commands the communication controller to begin the wakeup procedure.
7. After its wakeup attempt is complete the communication controller returns the result of the wakeup
attempt.
Node A
power wakeup wakeup
wakeup/coldstart node config ready send ready integration listen coldstart listen
off/reset listen
channel A, B
wake channel B
Node B
wakeup wakeup
wakeup/coldstart node power off / reset config ready ready coldstart listen
listen send
channel A, B
Node C
integration
non coldstart node power off / reset config ready
listen
channel B
wakeup
Channel A
pattern
wakeup
B
pattern
Figure 7-6: A short example of how the wakeup of two channels can be accomplished in a fault-
tolerant way by coldstart nodes.72
A communication controller shall not send a wakeup pattern on both channels at the same time73. If it is
necessary to wake both channels, the host can only wake them one at a time.
To avoid certain types of failures, a single communication controller should not wake up both channels.
Instead, a different controller should wake up each channel.
To accomplish this, a communication controller that has received a local wakeup event proceeds normally
and only wakes a single channel, e.g., channel A (see Figure 7-6). Following this, it does not wake the other
channel but rather enters startup. If it is a coldstart node, the coldstart inhibit flag must be set to true, so that
it cannot actively initiate the cluster startup. Only after the node detects a wakeup pattern on channel B
should it clear the coldstart inhibit flag and actively coldstart the cluster.
Two example wakeup strategies are now given as examples to demonstrate how cluster wakeup can be
accomplished. Neither strategy is concerned with the details of error recovery and therefore do not handle
some error situations that are likely to occur.
74
This has no functional effect for non-coldstart nodes.
75
This has no functional effect for non-coldstart nodes.
76 The collision of a wakeup pattern transmitted by this node with another wakeup pattern generated by a fault-free node will
generally not result in this exit condition. Such a collision can be recognized after entering the POC:wakeup detect state and
would be signaled by setting the variable vPOC!WakeupStatus to COLLISION_WUP.
77 E.g. an erroneous star that needs significantly more time to start up and to be able to forward messages.
78
This parameter depends heavily on implementation details of the components used and the ECU structure.
The vColdstartInhibit flag can be used to effectively deal with this situation. A communication controller with
this flag set to true will only participate in the startup attempts made by other nodes but not initiate one itself.
The host should not clear this flag before the above mentioned minimal time for another node to become
ready for the communication startup. However, the host shall clear it as soon as all coldstart nodes are
awake in the fault-free case79. Please refer to section 7.2.2 for further details of this flag.
7.2.1 Principles
7.2.1.1 Definition and properties
Before communication startup can be performed, the cluster has to be awake, so the wakeup procedure
has to be completed before startup can commence. The startup is performed on all channels synchronously.
The action of initiating a startup process is called a coldstart. Only a limited number of nodes may initiate a
79 If these times are not known at system design time, it is advised to clear the flag late rather than early.
80
This does not imply any restrictions concerning which nodes may initiate a cluster wakeup.
7.2.2 Description
The startup procedure is a subset of the Protocol Operation Control (POC) process. The relationship
between the POC and the other protocol processes is depicted in Figure 7-7.
to / from host
protocol
operation
control
clock
macrotick
synchronization
generation
processing
clock
synchronization clock
clock
startup synchronization
synchronization
channel B startup channel A
startup
coding / decoding
processes
to channel interface channel B from channel interface
81
This is the case under the assumption that the cluster contains exactly the three recommended coldstart nodes.
µT timer tStartup;
STARTUP
µT timer tStartupNoise; tStartup := pdListenTimeout;
INTEGRATION_
COLDSTART_LISTEN
LISTEN
COLDSTART_COL- INITIALIZE_
LISION_RESOLUTION SCHEDULE
COLDSTART_JOIN
done done
enter abort
operation startup
COLDSTART_GAP
ABORT_STARTUP
pKeySlotUsed-
false zColdstartAborted ?
ForStartup ?
true false
true
'set coldstart abort
indicator in CHI'
vRemainingCold-
else
StartAttempts ?
>1
vColdstartInhibit ? true
false
A communication controller can enter communication via three different paths. Two of these paths are
restricted to coldstart nodes, while the remaining path is open only to non-coldstart nodes.
In sections 7.2.4.1, 7.2.4.2 and 7.2.4.3, an outline of the three startup paths in the fault-free case is given
to supplement the precise SDL description that is given in the subsequent sections.
cycle
schedule no schedule cycle 0 cycle 1 cycle 2 cycle 3 cycle 4 cycle 5 cycle 6 cycle 7 cycle 8
CAS S S S S S S S S S S S S S S
Channel A A A A A B A B A B A B A B C
CAS S S
Legend : CAS symbol : startup frame of node A : startup frame of node B : frame of node C
A B C
82 Please note that several simplifications have been made within this diagram to make it more accessible, e.g. the state
transitions do not occur on cycle change, but well before that (see Chapter 8).
7.2.4.1 Path of the node initiating the coldstart (leading coldstart node)
Node A in Figure 7-10 follows this path and is therefore called a leading coldstart node.
When a coldstart node enters startup, it listens to its attached channels and attempts to receive FlexRay
frames (see SDL macro COLDSTART_LISTEN in Figure 7-11).
If no communication83 is received, the node commences a coldstart attempt. The initial transmission of a
CAS symbol is succeeded by the first regular cycle. This cycle has the number zero.
From cycle zero on, the node transmits its startup frame (with the exception of the coldstart gap or the abort
of the startup attempt). Since each coldstart node is allowed to perform a coldstart attempt, it may occur that
several nodes simultaneously transmit the CAS symbol and enter the coldstart path. This situation is
resolved during the first four cycles after CAS transmission. As soon as a node that initiates a coldstart
attempt receives a CAS symbol or a frame header during these four cycles, it reenters the listen state.
Consequently, only one node remains in this path (see SDL macro COLDSTART_COLLISION_RESO-
LUTION in Figure 7-12).
In cycle four, other coldstart nodes begin to transmit their startup frames. The node that initiated the
coldstart collects all startup frames from cycle four and five and performs clock correction as described in
Chapter 8. If clock correction does not signal any errors and the node has received at least one valid startup
83
See Figure 7-11 for exact definition.
84
See Chapter 8 for exact definition.
85 Presumably it is the node that initiated the coldstart, but not necessarily.
86
See Chapter 8 for exact definition.
In the following double cycles, it tries to find at least two coldstart nodes that transmit startup frames that fit
into its own schedule. If this fails, or if clock correction signals an error, the node aborts the integration
attempt and tries anew.
After receiving valid startup frames pairs for two consecutive double cycles from at least two coldstart
nodes, the node leaves startup and enters operation. Thereby, it leaves startup at least two cycles after the
node that initiated the coldstart. That means that all nodes of the cluster can leave startup at the end of cycle
7, just before entering cycle 8 (see Figure 7-10 and SDL macro INTEGRATION_CONSISTENCY_CHECK
in Figure 7-19).
COLDSTART_LISTEN
zChannelIdle(A) and
false
zChannelIdle(B) ?
true
set (tStartup);
zStartupNoiseOut := false;
set (tStartupNoise);
vPOC!StartupState := COLDSTART_LISTEN;
’update vPOC in CHI’
coldstart listen
header received on A,
header received on B,
symbol decoded on A,
symbol decoded on B
set (tStartupNoise);
zStartupNoiseOut := false;
zChannelIdle(A) and
true
zChannelIdle(B) ?
false
set (tStartup); reset (tStartup);
zStartupNoiseOut ? false
true
zChannelIdle(A) or
false
zChannelIdle(B) ?
true
zIntegrating(A) := true; zIntegrating(B) := true;
zColdstartNoise := true;
reset (tStartup);
reset (tStartupNoise);
reset (tStartup);
zStartupNoiseOut := true;
reset (tStartupNoise);
enter
FSP control on A (STARTUP), initialize
FSP control on B (STARTUP), schedule
cold start MAC control on A (STARTUPFRAMECAS),
MAC control on B (STARTUPFRAMECAS),
CSP control (SYNC)
enter coldstart
collision resolution
Figure 7-11: Transitions from the state POC:coldstart listen state [POC].87
87
For a single channel node, the not-attached channel is assumed to be always idle.
A coldstart node still allowed88 to initiate a coldstart enters the POC:coldstart listen state before actually
performing the coldstart. In this state the coldstart node tries to detect ongoing frame transmissions and
coldstart attempts.
This state is left and the POC:initialize schedule state is entered as soon as a valid startup frame has been
received (see Chapter 8 for details of this mechanism), as the node tries to integrate on the node that has
transmitted this frame.
When neither CAS symbols nor frame headers can be detected for a predetermined time duration, the node
initiates the coldstart and enters the POC:coldstart collision resolution state. The amount of time that has to
pass before a coldstart attempt may be performed is defined by the two timers tStartup and tStartupNoise.
The timer tStartup expires quickly, but is stopped whenever a channel is active (see Chapter 3 for a
description of channel states). It is restarted when all attached channels are in idle state. The timer tStar-
tupNoise is only restarted by the reception of correctly decoded headers or CAS symbols to guarantee a
cluster startup when the channel is noisy.
COLDSTART_COL-
zCycleTemp :=
zCycleTemp + 1;
zColdstartAborted := true;
else zCycleTemp ?
=4
Figure 7-12: Transitions from the POC:coldstart collision resolution state [POC].
The purpose of this state is to detect and resolve collisions between multiple simultaneous coldstart
attempts of several coldstart nodes. Each entry into this state starts a new coldstart attempt by this node.
88
See macro STARTUP_PREPARE in Figure 7-9. The condition 'vRemainingColdStartAttempts > 1' arises from the necessity
of using up one round through the state POC:coldstart collision resolution for the collision resolution and needing the second
round for actually integrating the other nodes.
The reception of a complete header without coding errors or the reception of a valid CAS symbol causes
the communication controller to abort the coldstart attempt. This resolves conflicts between multiple
coldstart nodes performing a coldstart attempt at the same time, so only one leading coldstart node remains.
In the fault-free case and under certain configuration constraints (see Appendix B) only one coldstart node
will proceed to the POC:coldstart consistency check state. The other nodes abort startup since they
received a frame header from the successful coldstart node.
The number of coldstart attempts that a node is allowed to make is restricted to the initial value of the
variable vRemainingColdStartAttempts. vRemainingColdStartAttempts is reduced by one for each
attempted coldstart. A node may enter the POC:coldstart listen state only if this variable is larger than one
and it may enter the state POC:coldstart collision resolution state only if this variable is larger than zero. A
value of larger than one is required for entering the POC:coldstart listen state because one coldstart attempt
may be used for performing the collision resolution, in which case the coldstart attempt could fail.
After four cycles in this state, the node enters the POC:coldstart consistency check state.
COLDSTART_CON-
vPOC!StartupState := COLDSTART_CONSISTENCY_CHECK;
’update vPOC in CHI’
coldstart consistency
check
SyncCalcResult
(zSyncCalcResult, zStartupNodes, zRefNode)
vCycleCounter ? odd
even
else zStartupNodes ?
else zStartupNodes ?
>0
=0
vRemainingCold-
else else zSyncCalcResult ?
StartAttempts ?
>0
WITHIN_BOUNDS
vPOC!ColdstartNoise :=
zColdstartAborted := true;
zColdstartNoise;
Figure 7-13: Transitions from the state POC:coldstart consistency check state [POC].
In this state, the leading coldstart node checks whether the frames transmitted by other following coldstart
nodes (non-coldstart nodes cannot yet transmit in the fault-free case) fit into its schedule.
If no valid startup frames are received in the even cycle in this state, it is assumed that the other coldstart
nodes were not ready soon enough to initialize their schedule from the first two startup frames sent during
the POC:coldstart collision resolution state. Therefore, if another coldstart attempt is allowed, the node
enters the state POC:coldstart gap state to wait for the other coldstart nodes to get ready.
If a valid startup frame is received in the even cycle in this state, but the clock correction signals errors in
the odd cycle or no valid pair of startup frames can be received in the double cycle, the node aborts the
coldstart attempt.
If a valid pair of startup frames has been received and the clock correction signals no errors the node leaves
startup and enters operation (see Chapter 2).
COLDSTART_GAP
FSP control on A (STARTUP),
FSP control on B (STARTUP),
MAC control on A (NOCE) ,
MAC control on B (NOCE),
coldstart gap
In the POC:coldstart gap state the leading coldstart node stops transmitting its startup frame. This causes
all nodes currently integrating on the leading coldstart node to abort their integration attempt.
In the same way as during the POC:coldstart collision resolution state, the leading coldstart node aborts the
coldstart attempt if it receives a frame header or a valid CAS symbol. If it does not receive either, it proceeds
after one cycle by reentering the POC:coldstart collision resolution state for another coldstart attempt.
INITIALIZE_
SCHEDULE
vPOC!StartupState :=
INITIALIZE_SCHEDULE;
’update vPOC in CHI’
initialize schedule
pKeySlotUsed-
ForStartup ? false zIntegrating(A) or
true
zIntegrating(B) ?
true
false
As soon as a valid startup frame has been received in one of the listen states (see Figure 7-8), the
POC:initialize schedule state is entered. If clock synchronization successfully receives a matching second
valid startup frame and derives a schedule from them (indicated by receiving the signal integration
successful on A or integration successful on B), the POC:integration consistency check state is entered.
Otherwise the node reenters the appropriate listen state.
INTEGRATION_
COLDSTART_CHECK vPOC!StartupState :=
INTEGRATION_COLDSTART_CHECK;
’update vPOC in CHI’
SyncCalcResult (zSyncCalcResult,
zStartupNodes, zRefNode)
zSyncCalcResult ? else
zStartupNodes ? =0
>1
=1
zRefNode ? false
true
even vCycleCounter ?
odd
Figure 7-16: Transitions from the POC:integration coldstart check state [POC].
Only integrating (following) coldstart nodes pass through this state. In this state it shall be verified that the
clock correction can be performed correctly and that the coldstart node that the node has initialized its
schedule from is still available.
The clock correction is activated and if any error is signaled the integration attempt is aborted.
During the first double cycle in this state either two valid startup frame pairs or the startup frame pair of the
node that this node has integrated on must be received; otherwise the node aborts the integration attempt.
If at the end of the first double cycle in this state the integration attempt has not been aborted, the
POC:coldstart join state is entered.
COLDSTART_JOIN
FSP control on A (STARTUP),
FSP control on B (STARTUP),
MAC control on A (STARTUPFRAME),
MAC control on B (STARTUPFRAME),
CSP control (SYNC)
zCycleTemp := 0;
vPOC!StartupState := COLDSTART_JOIN;
’update vPOC in CHI’
coldstart join
SyncCalcResult (zSyncCalcResult,
zStartupNodes, zRefNode)
WITHIN_BOUNDS
zCycleTemp :=
zCycleTemp + 1;
zStartupNodes ? =0
>0
else zCycleTemp ?
=3
Only following coldstart nodes enter this state. Upon entry they begin transmitting startup frames and
continue to do so in subsequent cycles. Thereby, the leading coldstart node and the nodes joining it can
check if their schedules agree with each other.
If the clock correction signals any error, the node aborts the integration attempt.
If a node in this state sees at least one valid startup frame during all even cycles in this state and at least
one valid startup frame pair during all double cycles in this state, it leaves startup and enters operation (see
Chapter 2).
INTEGRATION_
LISTEN
vPOC!StartupState :=
INTEGRATION_LISTEN;
’update vPOC in CHI’
CHI ALLOW_COLDSTART
integration listen command
In this state the node waits for either a valid startup frame or for the vColdstartInhibit flag to be cleared.
If the vColdstartInhibit flag is cleared the node reevaluates whether it is allowed to initiate a coldstart and
consequently enter the state POC:coldstart listen state.
zTwoSNSeen := 0;
zTwoSNRequired := false;
vPOC!StartupState :=
INTEGRATION_CONSISTENCY_CHECK;
integration ’update vPOC in CHI’
consistency check
SyncCalcResult
(zSyncCalcResult,
zStartupNodes, zRefNode)
zSyncCalcResult ? else
>1 zStartupNodes ? =0
=1
zRefNode ? false
true
zTwoSNRequired ? true
false
zTwoSNSeen :=
zTwoSNSeen := 0;
zTwoSNSeen + 1;
even vCycleCounter ?
odd
zTwoSNRequired := true;
else zTwoSNSeen ?
>=4
Figure 7-19: Transitions from the POC:integration consistency check state [POC].
Only integrating non-coldstart nodes pass through this state. In this state the node verifies that clock
correction can be performed correctly and that enough coldstart nodes are sending startup frames that
agree with the node's own schedule.
Clock correction is activated and if any errors are signaled the integration attempt is aborted.
During the first even cycle in this state, either two valid startup frames or the startup frame of the node that
this node has integrated on must be received; otherwise the node aborts the integration attempt.
During the first double cycle in this state, either two valid startup frame pairs or the startup frame pair of the
node that this node has integrated on must be received; otherwise the node aborts the integration attempt.
After the first double cycle, if less than two valid startup frames are received within an even cycle, or less
than two valid startup frame pairs are received within a double cycle, the startup attempt is aborted.
Nodes in this state need to see two valid startup frame pairs for two consecutive double cycles each to be
allowed to leave startup and enter operation (see Chapter 2). Consequently, they leave startup at least one
double cycle after the node that initiated the coldstart and only at the end of a cycle with an odd cycle
number.
Chapter 8
Clock Synchronization
8.1 Introduction
In a distributed communication system every node has its own clock. Because of temperature fluctuations,
voltage fluctuations, and production tolerances of the timing source (an oscillator, for example), the internal
time bases of the various nodes diverge after a short time, even if all the internal time bases are initially
synchronized.
to / from host
protocol
operation
control
clock
macrotick
synchronization
generation
processing
clock
synchronization clock
clock
startup synchronization
synchronization
channel B startup channel A
startup
coding / decoding
processes
to channel interface channel B from channel interface
A basic assumption for a time-triggered system is that every node in the cluster has approximately the same
view of time and this common global view of time is used as the basis for the communication timing for each
node. In this context, "approximately the same" means that the difference between any two nodes' views of
the global time is within a specified tolerance limit. The maximum value of this difference is known as the
precision.
The FlexRay protocol uses a distributed clock synchronization mechanism in which 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 relationship between the clock synchronization processes and the other protocol processes is depicted
in Figure 8-189.
vCycleCounter cCycleCountMax
gdCycle
vMacrotick gMacroPerCycle - 1
gdMacrotick
Microticks are time units derived directly from the communication controller's (external) oscillator clock tick,
optionally making use of a prescaler. Microticks are controller-specific units. They may have different
durations in different controllers. The granularity of a node's internal local time is a microtick.
The macroticks are synchronized on a cluster-wide basis. Within tolerances, the duration of a macrotick is
identical throughout all synchronized nodes in a cluster. The duration of each local macrotick is an integer
number of microticks; the number of microticks per macrotick may, however, differ from macrotick to
macrotick within the same node. The number of microticks per macrotick may also differ between nodes,
and depends on the oscillator frequency and the prescaler. Although any given macrotick consists of an
integral number of microticks, the average duration of all macroticks in a given cycle may be non-integral
(i.e., it may consist of a whole number of microticks plus a fraction of a microtick).90
89 The dark lines represent data flows between mechanisms that are relevant to this chapter. The lighter gray lines are relevant
to the protocol, but not to this chapter.
A cycle consists of an integer number of macroticks. The number of macroticks per cycle shall be identical
in all nodes in a cluster, and remains the same from cycle to cycle. At any given time all nodes should have
the same cycle number (except at cycle boundaries as a result of imperfect synchronization in the cluster).91
90
This is true even for the nominal (uncorrected) average duration of a macrotick (for example 6000 microticks distributed over
137 macroticks).
91 The cycle number discrepancy is at most one, and lasts no longer than the precision of the system.
92
An atomic action is an action where no interruption is possible.
static dyn. sym. NIT static dyn. sym. NIT static dyn. sym. NIT static dyn. sym. NIT
correction values
measurement
values
measurement rate correction
phase value calculation
offset correction
value calculation
Figure 8-3: Timing relationship between clock synchronization, media access schedule, and the
execution of clock synchronization functions.
The primary task of the clock synchronization function is to ensure that the time differences between the
nodes of a cluster stay within the precision. Two types of time differences between nodes can be distin-
guished:
• Offset (phase) differences and
• Rate (frequency) differences.
Methods are known to synchronize the local time base of different nodes using offset correction or rate
correction. FlexRay uses a combination of both methods. The following conditions must be fulfilled:
• Rate correction and offset correction shall be done in the same way in all nodes. Rate correction
shall be performed over the entire cycle.
• Offset correction shall be performed only during the NIT in the odd communication cycle, starts at
gOffsetCorrectionStart, and must be finished before the start of the next communication cycle.
• Offset changes (implemented by synchronizing the start time of the cycle) are described by the
variable vOffsetCorrection. vOffsetCorrection indicates the number of microticks that are added to
the offset correction segment of the network idle time. vOffsetCorrection may be negative. The
value of vOffsetCorrection is determined by the clock synchronization algorithm. The calculation of
vOffsetCorrection takes place every cycle but a correction is only applied at the end of odd commu-
nication cycles. The calculation of vOffsetCorrection is based on values measured in a single
communication cycle. Although the SDL indicates that this computation cannot begin before the
NIT, an implementation may start the computation of this parameter within the dynamic segment or
symbol window as long as the reaction to the computation (update of the CHI and transmission of
the SyncCalcResult and offset calc ready signals) is delayed until the NIT. The calculation must be
complete before the offset correction phase begins.
• Rate (frequency) changes are described by the variable vRateCorrection. vRateCorrection is an
integer number of microticks that are added to the configured number of microticks in a communica-
tion cycle (pMicroPerCycle)93. vRateCorrection may be negative. The value of vRateCorrection is
determined by the clock synchronization algorithm and is only computed once per double cycle. The
calculation of vRateCorrection takes place following the static segment in an odd cycle. The calcula-
tion of vRateCorrection is based on the values measured in an even-odd double cycle. Although the
SDL indicates that this computation cannot begin before the NIT, an implementation may start the
computation of this parameter within the dynamic segment or symbol window as long as the
reaction to the computation (update of the CHI and transmission of the SyncCalcResult and rate
calc ready signals) is delayed until the NIT. The calculation must be completed before the next even
cycle begins.
The following data types will be used in the definition of the clock synchronization process:
newtype T_EvenOdd
The protocol operation control (POC) process sets the operating mode for the clock synchronization
process (CSP) (Figure 8-4) into one of the following modes:
1. In the STANDBY mode the clock synchronization process is effectively halted.
2. In the NOSYNC mode CSP performs clock synchronization under the assumption that it is not trans-
mitting sync frames (i.e., it does not include its own clock in the clock correction computations).
3. In the SYNC mode CSP performs clock synchronization under the assumption that it is transmitting
sync frames (i.e., it includes its own clock in the clock correction computations).
Definition 8-3 gives the formal definition of the CSP operating modes.
newtype T_CspMode
literals STANDBY, NOSYNC, SYNC;
endnewtype;
newtype T_SyncCalcResult
literals WITHIN_BOUNDS, EXCEEDS_BOUNDS, MISSING_TERM;
endnewtype;
Definition 8-3: Formal definition of T_CspMode and T_SyncCalcResult.
After the POC sets the CSP mode to something other than STANDBY, the CSP waits in the CSP:wait for
startup state until the POC forces the node to a cold start or to integrate into a cluster. The startup
procedure, including its initialization and interaction with other processes, is described in the macro
INTEGRATION CONTROL, which is explained in section 8.4.
Before further explanation of the processes an array is defined (Definition 8-4) which is used to store the
frame IDs of the received sync frames.
93
pMicroPerCycle is the configured number of microticks per communication cycle without correction.
newtype T_FrameIDTable
Array(T_ArrayIndex, T_FrameID)
endnewtype;
Definition 8-4: Formal definition of T_ArrayIndex, T_SyncNodes, and T_FrameIDTable.
standby
zSyncCalcResult := WITHIN_BOUNDS;
STANDBY
CSP control
'import vExternOffsetControl,
(zCspMode )
vExternRateControl from CHI'
CALC_OFFSET
zCspMode ?
offset calc ready
(vOffsetCorrection)
else
odd
CALC_RATE
attempt integration
rate calc ready
INTEGRATION (vRateCorrection)
CONTROL
INIT_MEASUREMENT
MEASUREMENT
After finishing the startup procedure a repetitive sequence consisting of cycle initialization (Figure 8-10), a
measurement phase (Figure 8-11), and offset (Figure 8-14) and rate (Figure 8-15) calculation is executed.
All elements of this sequence are described below. The offset calculation will be done every cycle, the rate
calculation only in the odd cycles.
The clock synchronization control (Figure 8-5) handles mode changes done by the POC. It also handles
process termination requests sent by the POC.
*
(standby) *
CSP control
terminate CSP
(zCspMode )
terminate CSS_A,
STANDBY zCspMode ?
terminate CSS_B
reset macrotick
generation
-
standby
INTEGRATION
CONTROL
CSS_A,
CSS_B
vOffsetCorrection := 0;
vRateCorrection := 0;
run
terminate CSS_A,
terminate CSS_B
- - - -
set(tMicroInitialOffset_A); set(tMicroInitialOffset_B);
The startup procedure will be entered when the CSP receives the signal attempt integration from the POC
(see Figure 8-4). The control of the node's startup is described in the INTEGRATION CONTROL macro
depicted in Figure 8-6.
94
There is no configuration that selects the channel that starts the MTG process. The process is started by the first channel that
receives a potential frame start in the expected time window after reception of a valid even startup frame on the same
channel (refer to Figure 8-8).
*
terminate CSS_A
zFrameStart := now;
= zID vRF!Header!FrameID ? zID := 0;
zPotFrameStart := true;
false zPotFrameStart ?
true
zID := vRF!Header!FrameID;
vCycleCounter := (vRF!Header!CycleCount + 1) mod 64;
vMacrotick := (zID -1) * gdStaticSlot + pMacroInitialOffset[A];
reset(tID); set(tSecondFrame);
integration started on A
pMicroPerCycle - pdMaxDrift
vRF!Header!FrameID ? else true
> now - zFrameStart ?
frame too
= zID false early ?
pMicroPerCycle + pdMaxDrift
true
< now - zFrameStart ?
false
vRF!Header!CycleCount vRateCorrection := now -
false frame too
= vCycleCounter ? zFrameStart - pMicroPerCycle;
late ?
true
integration request on A
false zIntegration ?
integration aborted on A
true
set(tID);
continue integration on A
reset(tSecondFrame);
The reception of the corresponding valid odd startup frame and the satisfaction of the conditions for
integration leads to the termination of the CSS process for this channel. Before termination a signal is sent
indicating successful integration; this signal causes the INTEGRATION CONTROL macro of CSP to
terminate the CSS process for the other channel (see Figure 8-6). This behavior of this termination is
depicted in Figure 8-7.
The timer tSecondFrame in Figure 8-8 is used to restart the clock synchronization startup process if the
corresponding odd startup frame was not received after an appropriate period of time.
The variable zID is used to prohibit attempts to integrate on a coldstart node if an integration attempt on this
coldstart node failed in the previous cycle. The timer tID prevents this prohibition from applying for more
than one double cycle.
95 The priority input symbol on the state CSS_A:wait for second startup frame has been included to resolve the ambiguity that
arises if the timer tSecondFrame expires at the same time a valid odd startup frame on A signal is received.
line i Value Valid Startup Value Valid Startup Value Valid Startup Value Valid Startup
read access:
zsDev(14)(even)(A)!Valid and
true false
zsDev(14)(odd)(A)!Valid ?
newtype T_ChannelDev
Array(T_Channel, T_DevValid)
endnewtype;
newtype T_EOChDev
Array(T_EvenOdd, T_ChannelDev)
endnewtype;
newtype T_DevTable
Array(T_ArrayIndex, T_EOChDev)
endnewtype;
Definition 8-6: Formal definition of T_ChannelDev, T_EOChDev, and T_DevTable.
The structured data type T_DevTable is a three dimensional array with the dimensions line number (1 …
15), communication channel (A or B), and communication cycle (even or odd). Each line is used to store the
received data of one sync node. If the node is itself a sync node the first line is used to store a deviation of
zero, corresponding to the deviation of its own sync frame. Each element in this three dimensional array
contains a deviation value (the structure element Value), a Boolean value indicating whether the deviation
value is valid (the structure element Valid), and a Boolean value indicating whether the sync frame corre-
sponding to this deviation was a startup frame (the structure element Startup). Figure 8-9 gives an example
of this data structure.
8.5.2 Initialization
The data structure introduced in section 8.5.1 is used to instantiate a variable (zsDev). A portion of this
variable will be reset at the beginning of every communication cycle; the even part at the beginning of an
INIT_MEASUREMENT
zsDev(1:15)(even:odd)(A:B)!Valid := false;
zCspMode ? else zsDev(1:15)(even:odd)(A:B)!Startup := false;
zsID(1:15) := 0; zLine := 0;
SYNC
else zLine ?
true SYNC
< gSyncNodeMax
zLine := zLine + 1; zPos := zLine; zPos := position(zsID, zLine := 1; zPos := zLine;
zsID(zLine) := pKeySlotId; pKeySlotId); zsID(zLine) := pKeySlotId;
'set sync frame zsDev(zPos)(zEO)(A:B)!Valid := true; position returns the index where
overflow in CHI' zsDev(zPos)(zEO)(A:B)!Value := 0; the value of ’pKeySlotId’ is located
in the list ’zsID’
MEASUREMENT
zAllOnA := false;
zAllOnB := false;
zActionPoint := now;
member(zsID,
true
vRF!Header!FrameID)?
false
else
vRF!Header!
even odd
CycleCount ?
zCh := vRF!Channel;
zsDev(zPos)(zEO)(zCh)!Value :=
vRF!PrimaryTRP - zActionPoint;
zsDev(zPos)(zEO)(zCh)!Valid := true;
vRF!Header!
0 1 abs returns the
SuFIndicator ?
absolute value
abs(zsDev(zPos)
else
(zEO)(zCh)!Value) ?
<= pdAcceptedStartupRange
zsDev(zPos)(zEO)(zCh)!
Startup := true;
The difference between the action point and primary time reference point time stamps, along with Booleans
indicating that the data is valid and whether or not the frame is also a startup frame, is saved in the appro-
priate location in the previously defined data structure (see Figure 8-11). The measurement phase ends
when the static segment ends.
The reception of more than gSyncNodeMax sync frames per channel in one communication cycle indicates
an error inside the cluster. This is reported to the host and only the first gSyncNodeMax received sync
frames are used for the correction value calculation.
1-2 0
3-7 1
>7 2
2. The measured values are sorted and the k largest and the k smallest values are discarded.
3. The largest and the smallest of the remaining values are averaged for the calculation of the midpoint
value.97 The resulting value is assumed to represent the node's deviation from the global time base
and serves as the correction term.
15
13
11
… + 17 / 2 = 8
6
-3
-5
Figure 8-12: Algorithm for clock correction value calculation (k=2).
96
The parameter k is not the number of asymmetric faults that can be tolerated.
97 The division by two of odd numbers should truncate toward zero such that the result is an integer number. Example: 17 / 2 =
8 and -17 / 2 = -8.
zLength := length(zList);
length returns the number of
elements contained in zList
=0 zLength ?
else
CALC_OFFSET
zsMListAB := []; z := 0;
zStartupNodes := 0;
zRefNode := false;
vsSyncIdListA := [];
vsSyncIdListB := [];
z := z+1;
z? >gSyncNodeMax
else
zsDev(z)(zEO)(A)!Startup or
true
zsDev(z)(zEO)(B)!Startup ?
zStartupNodes := false
zStartupNodes+1;
=0 length(zsMListAB) ? else
else zsID(z) ? =1
else
zRefNode := true;
zSyncCalcResult :=
MISSING_TERM; vOffsetCorrection := call
vOffsetCorrection := 0; midterm(zsMListAB);
’update vOffsetCorrection,
vsSyncIdListA, vsSyncIdListB in CHI’
The SDL abstraction of execution in zero time could lead the reader to the conclusion that the calculation
of the offset correction value needs to complete in zero time. This is of course unachievable. It is anticipated
that real implementations may take substantial time to calculate the correction, and that implementations
may begin the calculation earlier than is shown in Figure 8-4 (i.e., may begin the calculation during the
measurement process). Therefore the following restriction on the time required for offset correction calcu-
lation is introduced:
The offset correction calculation must be completed no later than cdMaxOffsetCalculation after the
end of the static segment or 1 MT after the start of the NIT, whichever occurs later.
CALC_RATE
zsMRateAB := []; z := 0;
zStartupPairs := 0;
zRefPair := false;
z := z+1;
>gSyncNodeMax z?
else
zsDev(z)(even)(A)!Valid and
true false
zsDev(z)(odd)(A)!Valid ?
zsDev(z)(even)(B)!Valid and
false
zsDev(z)(odd)(B)!Valid ?
zsDev(z)(even)(B)!Valid and
true
zsDev(z)(odd)(B)!Valid ?
true
false
append(zsMRateAB, (zsDev(z)(odd)(A)!Value -
zsDev(z)(even)(A)!Value + zsDev(z)(odd)(B)!Value
- zsDev(z)(even)(B)!Value)/2);
zSyncCalcResult ? else
else EXCEEDS_BOUNDS
vRateCorrection := (call midterm
zSyncCalcResult := (zsMRateAB)) + vRateCorrection;
MISSING_TERM;
else
vRateCorrection := vRateCorrection vRateCorrection := vRateCorrection
- pClusterDriftDamping; vRateCorrection := 0; + pClusterDriftDamping;
The rate correction value vRateCorrection is a signed integer indicating by how many microticks the node's
cycle length should be changed. Negative values mean the cycle should be shortened; positive values
mean the cycle should be lengthened.
The following steps are depicted in the SDL diagram in Figure 8-15:
1. Pairs of previously stored deviation values are selected and the difference between the values within a
pair is calculated. Pairs are selected that represent sync frames received on the same channel, in the
same slot, on consecutive cycles. If there are two pairs for a given sync frame ID (one pair for channel
A and another pair for channel B) the average of the differences is used.
2. The number of received sync frame pairs is checked and if no sync frame pairs were received an error
flag is set to true.
3. The fault-tolerant midpoint algorithm is executed (see section 8.6.1).
4. A damping value pClusterDriftDamping for the rate correction term is applied.
5. The correction term is checked against specified limits. If the correction term exceeds the specified
limits an error flag is set to true and the correction term is set to the maximum or minimum value as
appropriate (see section 8.6.4).
6. If appropriate, an external correction value supplied by the host is added to the calculated correction
term (see section 8.6.5).
98
The division by two of odd numbers should truncate toward zero such that the result is an integer number. Example: 17 / 2 =
8 and -17 / 2 = -8.
99
A node-specific configuration value is used to allow clusters that have different microtick durations in different nodes.
Value: +1 -1 0
The handling of the external correction values is depicted in Figure 8-14 and Figure 8-15.
The configuration must ensure that the addition of the external correction value can be performed even if
the pre-configured limit is exceeded by the addition of an external correction term.
Either of the two paths will set initial values for the cycle counter, the macrotick counter, and the rate
correction value. A loop will be executed every microtick and, as a result, macroticks are generated that
include a uniform distribution of a correction term over the entire time range. This loop is only left if the
macrotick generation process is terminated by the POC process (e.g. in case of an error) or if a reset
macrotick generation signal is received from the POC, CSP, CSS_A, or CSS_B process.
The relevant time range for the application of the rate correction term is the entire cycle; the time range for
the application of the offset correction term is the time between the start of the offset correction until the next
cycle start. The macrotick generation process handles this by two different initializations. At the cycle start
the algorithm is initialized using only the rate correction value; at the start of the offset correction phase the
algorithm is initialized again, this time including the offset correction values.
Concurrent with the MTG process new measurement values are taken by the CSP and these values are
used to calculate new correction values. These new correction values are ultimately applied and used by
the macrotick generation process. The new offset correction value is applied at the start of offset correction
period in an odd communication cycle, and the new rate correction value is applied at the cycle start in an
even communication cycle.
vMacrotick := gMacroPerCycle -
gdStaticSlot; vCycleCounter := 63;
zRateCorr := 0; zOffsetCorr := 0; zOffsetCorr := 0;
zIntegrationRound := true; zIntegrationRound := true;
macrotick (vMacrotick)
zRateCorrection := zRateCorr;
zMicroPerPeriod := pMicroPerCycle + zRateCorrection;
zMacroPerPeriod := gMacroPerCycle; initialize rate
zMicroDistribution := 0; vMicrotick := 0; correction
zMicroDistribution :=
reset macrotick oscillator microtick offset calc ready rate calc ready
generation clock (zOffsetCorr) (zRateCorr)
<= 0 zOffsetCorr := 0;
zIntegrationRound := true;
vMacrotick := (vMacrotick +
1) mod gMacroPerCycle;
vMacrotick ? 0
else vCycleCounter :=
(vCycleCounter +1) mod 64;
macrotick (vMacrotick) zIntegrationRound := false;
macrotick (vMacrotick),
’update vMacrotick in CHI’
cycle start (vCycleCounter)
’update vMacrotick,
else vMacrotick ?
vCycleCounter in CHI’
=gOffsetCorrectionStart
even vCycleCounter ?
odd
true zIntegrationRound ?
zIntegrationRound := false;
false
zMicroDistribution := 0;
zMicroPerPeriod := pMicroPerCycle + zRateCorrection -
vMicrotick + zOffsetCorr; initialize offset
zMacroPerPeriod := gMacroPerCycle - gOffsetCorrectionStart; correction
100 The frames sent on the two channels in the sync slot do not need to be identical (i.e., they may have differing payloads), but
they must both be sync frames.
Chapter 9
Controller Host Interface
9.1 Principles
The controller host interface (CHI) manages the data and control flow between the host processor and the
FlexRay protocol engine within each node.101
The CHI contains two major interface blocks - the protocol data interface and the message data interface.
The protocol data interface manages all data exchange relevant for the protocol operation and the message
data interface manages all data exchange relevant for the exchange of messages as illustrated in Figure 9-
1.
host processor
CHI
message message message
protocol protocol protocol
message buffer buffer buffer
CHI Services configuration control status
buffers configuration control status
data data data
data data data
protocol engine
The protocol data interface manages the protocol configuration data, the protocol control data, and the
protocol status data. The message data interface manages the message buffers, the message buffer
configuration data, the message buffer control data, and the message buffer status data.
In addition, the CHI provides a set of CHI services that define self-contained functionality that is transparent
to the operation of the protocol.
9.2 Description
The relationships between the CHI and the other protocol processes are depicted in Figure 9-2102.
101
Please note that due to implementation constraints the CHI may add product specific delays for data or control signals
exchanged between the host and the protocol engine.
102 The dark lines represent data flows between mechanisms that are relevant to this chapter. The lighter gray lines are relevant
to / from host
controller
host interface
protocol
operation
control
clock
macrotick
synchronization
generation
processing
coding / decoding
processes
to channel interface channel B from channel interface
9.3 Interfaces
9.3.1 Protocol data interface
9.3.1.1 Protocol configuration data
The host shall have write access to protocol configuration data only when the protocol is in the POC:config
state
The host shall have read access to protocol configuration data regardless of the protocol state.
15. the number of microticks pMicroInitialOffset[B] between the actual time reference point on channel B
and the subsequent macrotick boundary of the secondary time reference point,
16. the number of microticks pExternOffsetCorrection constituting the correction term used to correct the
calculated offset correction value in the course of external clock synchronization,
17. the number of microticks pExternRateCorrection constituting the correction term used to correct the
calculated rate correction value in the course of external clock synchronization,
18. the number of microticks pOffsetCorrectionOut constituting the upper bound for a permissible offset
correction,
19. the number of microticks pRateCorrectionOut constituting the upper bound for a permissible rate cor-
rection,
20. the Boolean flag pAllowHaltDueToClock that controls the transition to the POC:halt state due to a
clock synchronization error,
21. the number of consecutive even/odd cycle pairs pAllowPassiveToActive during which valid clock syn-
chronization terms must be received before the node transitions from the POC:normal passive state to
the POC:normal active state, including the configuration data to disable transitions from the POC:nor-
mal passive state to the POC:normal active state,
22. the Boolean flag pSingleSlotEnabled that defines whether a node will send in only one or in all config-
103 The CHI does not buffer host commands and issue them to the POC at a later time – they are essentially passed
“immediately” to the POC process.
2. A list containing the IDs of the sync frames received or transmitted on channel B within the even com-
munication cycle as well as the number of valid entries contained in this list,
3. A list containing the IDs of the sync frames received or transmitted on channel A within the odd com-
munication cycle as well as the number of valid entries contained in this list,
4. A list containing the IDs of the sync frames received or transmitted on channel B within the odd com-
munication cycle as well as the number of valid entries contained in this list.
The information shall be updated no sooner than the start of the NIT and no later than 10 macroticks after
the start of the offset correction phase of the NIT. Note that this implies that for some NIT configurations the
data update may complete after the start of the next cycle.
The following synchronization frame-related protocol variable shall be provided in the CHI:
1. the number of consecutive even/odd cycle pairs vClockCorrectionFailed that have passed without
clock synchronization having performed an offset or a rate correction due to lack of synchronization
frames (as maintained by the POC process).
104
This can be used to determine if the frame corresponding to a given slot in the dynamic segment was actually transmitted.
This is especially beneficial for continuous transmission mode since then the "frame transmitted" flag is less useful.
105 It is not required that any implementation supports the modification of buffer configuration data in other POC states than the
POC:config state.
106 The specific mechanism for determining when the information is valid is not specified. For example, the CHI may
automatically invalidate the information if it has not been updated by the host within a certain period of time. These features
are implementation dependent. It is expected that most implementations will support at least two behaviors - either the
message is transmitted exactly once as the result of a buffer update, or a message is transmitted continuously until the host
invalidates the buffer.
107 Access by host can mean: resetting the frame transmitted flag directly; resetting it as a consequence of access to another
flag, e.g. "transmit buffer valid" flag; or by write access to the payload data itself.
3. a content error flag that shall be set if a content error was observed in the transmission slot
(vSS!ContentError set to true) or cleared if no content error was observed in the transmission slot
(vSS!ContentError set to false),
4. a slot boundary violation flag that shall be set if a slot boundary violation, i.e. channel active at the start
or at the end of the slot, was observed in the transmission slot (vSS!BViolation set to true) or cleared if
no slot boundary violation was observed in the transmission slot (vSS!BViolation set to false),
5. a transmission conflict flag that shall be set if a transmission conflict error was observed in the trans-
mission slot (vSS!TxConflict set to true) or cleared if no transmission conflict error was observed in the
transmission slot (vSS!TxConflict set to false),
6. a valid frame flag that shall be set if a valid frame was received in the transmission slot
(vSS!ValidFrame set to true) or cleared if no valid frame was received in the transmission slot
(vSS!ValidFrame set to false).
108
An additional optional selection criteria based on message ID filtering is specified in section 9.3.3.3.
109
A frame is syntactically valid if it fulfills the decoding rules defined in section 3.3.5 including the check for a valid header CRC
and a valid frame CRC in accordance with the number of two-byte payload words as denoted in the header of the frame.
110
A semantically valid frame is a syntactically valid frame that also fulfils a set of content related criteria.
111 The host can assess such a truncation through the data element vRF!Header!Length.
112
The exact behavior of the relative timer is implementation specific. In particular, the point at which the timer begins to
decrement may vary from implementation to implementation. Also note that the duration of a macrotick varies from
macrotick to macrotick, especially during the offset correction phase. As a result, the duration of a relative timer can vary
substantially depending on when in the cycle it is activated.
Appendix A
System Parameters
cCrcInit[B] Initialization vector for the calculation of the frame CRC 0xABCDEF
on channel B (hexadecimal).
cdCAS Duration of the logical low portion of the collision avoid- 30 gdBit
ance symbol (CAS) and media access test symbol (MTS).
cdWakeupSymbolTxIdle Duration of the idle phase between two low phases inside 18 µs
a wakeup pattern.
cHCrcInit Initialization vector for the calculation of the header CRC 0x01A
on channel A or channel B (hexadecimal).
cHCrcPolynomial Header CRC polynomial (hexadecimal). 0x385
cVotingDelay Number of samples of delay between the RxD input and (cVotingSam-
the majority voted output in the glitch-free case. ples -1) / 2
A.1.1 cdCASRxLowMin
The lower limit of the acceptance window for a collision avoidance symbol (CAS) must meet the following
constraint:
Constraint 1:
cdCASRxLowMin[gdBit]= floor( cdCAS[gdBit] * (1 - cClockDeviationMax) / (1 + cClockDeviationMax) )
= 29 gdBit
As a result, the constant cdCASRxLowMin is 29 gdBit.
cPropagationDelayMax Maximum propagation delay from the falling edge (in the BSS) in 2.5 µs
the transmit signal of node M to corresponding falling edge at the
receiver of node N.
Additional parameters related to the Electrical Physical Layer and active/passive stars may be found in
[EPL05].
A.2.1 cdTxMax
The value of cdTxMax can be determined in the following way:
gdMinislotMax[µs] 63
gdMacrotickMax[µs] 6
Appendix B
Configuration Constraints
B.1 General
This appendix specifies the configurable parameters of the FlexRay protocol. This appendix also identifies
the configurable range of the parameters, and gives constraints on the values that the parameters may take
on. The listed parameters will be part of the definition of FlexRay conformance classes.113 All implementa-
tions that support a given parameter must support at least the parameter range identified in this appendix.
An implementation is allowed, however, to support a broader range of configuration values.
Currently the only bit rate defined for FlexRay is 10 Mbit/s. There is, however, the intent that the protocol
will be expanded in the future to include bit rates lower than 10 Mbit/s. The configuration ranges shown in
this appendix reflect bit rates of between 2.5 Mbit/s and 10 Mbit/s. Changes in the range of supported bit
113
Exceptions for parameters which should not be part of a conformance class are indicated by footnote.
gdWakeupSymbolRxIdle Number of bits used by the node to test the duration of the 14 - 59 gdBit
'idle' portion of a received wakeup symbol. Duration is
equal to (gdWakeupSymbolTxIdle - gdWakeupSym-
bolTxLow)/2 minus a safe part. (Collisions, clock differ-
ences, and other effects can deform the Tx-wakeup
pattern.)
gdWakeupSymbolRxLow Number of bits used by the node to test the LOW portion 11 - 59 gdBit
of a received wakeup symbol. This lower limit of zero bits
has to be received to detect the LOW portion by the
receiver. The duration is equal to gdWakeupSym-
bolTxLow minus a safe part. (Active stars, clock differ-
ences, and other effects can deform the Tx-wakeup
pattern.)
gdWakeupSymbolRx- The size of the window used to detect wakeups. Detection 76 - 301 gdBit
Window of a wakeup requires a low and idle period (from one
gdWakeupSymbolTxIdle Number of bits used by the node to transmit the 'idle' part 45 - 180 gdBit
of a wakeup symbol. The duration is equal to cdWake-
upSymbolTxIdle.
gdWakeupSymbolTxLow Number of bits used by the node to transmit the LOW 15 - 60 gdBit
part of a wakeup symbol. The duration is equal to
cdWakeupSymbolTxLow.
gListenNoise Upper limit for the startup listen timeout and wakeup lis- 2 - 16
ten timeout in the presence of noise. It is used as a multi-
plier of the node parameter pdListenTimeout.
gOffsetCorrectionStart Start of the offset correction phase within the NIT, 9 - 15999 MT
expressed as the number of macroticks from the start of
cycle.
gPayloadLengthStatic Payload length of a static frame.b 0 - cPayload-
LengthMax
two-byte-
words
gSyncNodeMax Maximum number of nodes that may send frames with 2 - cSyncNo-
the sync frame indicator bit set to one. deMax
gdBitMaxa Maximum bit time taking into account the allowable gdBit * (1 + cClock-
clock deviation of each node. DeviationMax) [µs]
gdBitMinb Minimum bit time taking into account the allowable gdBit * (1 - cClock-
clock deviation of each node. DeviationMax) [µs]
gdMaxInitialization- Maximum timing error that a node may have following 0 - 11.7 µs
Error integration.
pAllowHaltDueToClock Boolean flag that controls the transition to the POC:halt Boolean
state due to a clock synchronization errors.
If set to true, the CC is allowed to transition to
POC:halt.
If set to false, the CC will not transition to the POC:halt
state but will enter or remain in the POC:normal pas-
sive state (self healing would still be possible).
pClusterDriftDamping Local cluster drift damping factor used for rate correc- 0 - 20 µT
tion.
pDecodingCorrection Value used by the receiver to calculate the difference 14 - 143 µT
between primary time reference point and secondary
time reference point.
pdMaxDrift Maximum drift offset between two nodes that operate 2 - 1923 µT
with unsynchronized clocks over one communication
cycle.
pKeySlotId ID of the slot used to transmit the startup frame, sync 1 - cStaticSlot-
frame, or designated single slot frame. IdMax
pKeySlotUsedForStartup Flag indicating whether the Key Slot is used to transmit Boolean
a startup frame. If pKeySlotUsedForStartup is set to
true then pKeySlotUsedForSync must also be set to
true.
pKeySlotUsedForSync Flag indicating whether the Key Slot is used to transmit Boolean
a sync frame. If pKeySlotUsedForStartup is set to true
then pKeySlotUsedForSync must also be set to true.
pLatestTx Number of the last minislot in which a frame transmis- 0 - 7980 Minislot
sion can start in the dynamic segment.
pSingleSlotEnabled Flag indicating whether or not the node shall enter sin- Boolean
Name Description
nStarPathM,N Number of stars on the signal path from any node M to a node N in a
network with active stars.
dBDRxia Activity reaction time. Time by which a transmission becomes short-
ened in a receiving node (when bus is switched from idle to active).
Constraint 3:
gdMaxPropagationDelay[Ch][µs] = max( pdBDTx[Ch]M[µs] + LineLength[Ch]M,N[m] * T0[µs/m] +
∑ pdStarDelay
k
[µs] + pdBDRx[Ch]N[µs] )M,N
k ∈ { nStar [ Ch ] MN }
nStar 0 1 2
LineLength[m] 24 48 72
pdBDTxMax[µs] 0.1
pdBDRxMax[µs] 0.1
pdStarDelayMax[µs] 0.25
gdMaxPropagationDelayMax[µs] 0.44 0.93 1.42
Table B-6: Maximum propagation delay in a cluster. Maximum values for LineLength, pdBDTx,
pdBDRx and pdStarDelay were chosen according to limits described in [EPL05].
gClusterDriftDampingMax[µT] 5
gdMaxPropagationDelay[µs] =
2.5
cPropagationDelayMax[µs]
For further parameter calculations it is assumed that gdMaxMicrotick[µs] = 0.05 µs or a smaller value.
Therefore the worst-case precision is assumed to be 11.7 µs.
gClusterDriftDampingMin[µT] 0
min( gdMaxPropagationDelay[µs]
0
- gdMinPropagationDelay[µs] )
Constraint 4:
aBestCasePrecision[µs] <= gAssumedPrecision[µs] <= aWorstCasePrecision[µs]
For purposes of configuration of the cluster, it is suggested that gAssumedPrecision should be:
[5] gAssumedPrecision[µs] = aWorstCasePrecision[µs] = (34 µT + 20 * gClusterDriftDamping[µT])
* gdMaxMicrotick[µs/µT] +2 * gdMaxPropagationDelay[µs]
pSamplesPerMicrotick
gdSample-
ClockPeriod[µs]
1 2 4
pdMicrotick[µs]
pMicroPer-
MacroNom
0.0125 0.025 0.050 0.100
40 - 1 2 4
60 - 1.5 3 6
80 1 2 4 -
120 1.5 3 6 -
240 3 6 - -
Some parameter constraints depend on the microtick length of the node and the nominal macrotick length
of the cluster. To define a minimum parameter range for these parameters, that is the basis of conformance
tests, a typical microtick length of 0.025 µs and the resulting nominal macrotick range of 1 µs to 6 µs
(Constraint 5) are assumed (green fields within Table B-9 and B-10).
The desired nominal macrotick length gdMacrotick in µs can be chosen to be less than, greater than, or
equal to the assumed precision. In all cases the macrotick length must fulfill the following constraint:
Constraint 5:
cdMinMTNom[µs] <= gdMacrotick[µs] <= cdMaxMTNom[µs]
Depending on the desired macrotick length the following additional constraint must be met.
Constraint 6:
gdMacrotick[µs] >= cMicroPerMacroNomMin[µT] * pdMicrotick[µs/µT]
The macrotick, expressed in microticks, is given by
[8] pMicroPerMacroNom[µT/MT]= gdMacrotick[µs/MT] / pdMicrotick[µs/µT]
= pMicroPerCycle[µT] / gMacroPerCycle[MT]
Note that pMicroPerMacroNom may have a fractional part (i.e., it does not need to be an integral number
of microticks).
Note that pMicroPerCycle might have rounding errors according to section 8.2.3.
Constraint 7:
gdMacrotick[µs] <= aFrameLengthStatic[gdBit] * gdBitMin[µs/gdBit]
However, the fulfillment of this constraint is given in any case because of the minimum frame length of 80
bits, a bit duration of around 100 ns and a maximum macrotick length of 6 µs.
B.4.3 gdMaxInitializationError
Consider the following assumptions:
• The maximum initialization error that an integrating node may have is
0 µs <= gdMaxInitializationError[µs] <= gAssumedPrecision[µs]
Constraint 8:
gAssumedPrecision[µs] >= gdMaxInitializationError[µs] >=
2 * (gdMaxMicrotick[µs] * (1 + cClockDeviationMax)) + gdMaxPropagationDelay[µs]
The upper limit is given by
gdMaxInitializationError[µs] = gAssumedPrecision[µs] = aWorstCasePrecision[µs] = 11.7µs.
B.4.4 pdAcceptedStartupRange
Consider the following assumptions:
• During integration a clock synchronization error greater than the assumed precision may occur and
be acceptable.
Constraint 9:
pdAcceptedStartupRange[µT] >= ceil( (gAssumedPrecision[µs] + gdMaxInitializationError[µs]) /
(pdMicrotick[µs/µT] * (1 - cClockDeviationMax)) )
The maximum value of this expression occurs when
• gAssumedPrecision = aWorstCasePrecision,
• gdMaxInitializationError = aWorstCasePrecision,
• pdMicrotick = 0.0125 µs
and is
pdAcceptedStartupRange = ceil( 1874.8 ) µT = 1875 µT.
B.4.5 pClusterDriftDamping
Consider the following assumptions:
• The drift damping factor gClusterDriftDamping is defined in multiples of the longest microtick
gdMaxMicrotick within the cluster:
gClusterDriftDamping[µT] = n * 1 µT with n = 0, 1, 2, ..., 5.
• The maximum microtick of a cluster gdMaxMicrotick is a multiple m of each nodes local microtick
pdMicrotick.
gdMaxMicrotick = m * pdMicrotick with m = 1, 2, 4 (see pSamplesPerMicrotick).
• The local drift damping pClusterDriftDamping is calculated by
B.4.6 gdActionPointOffset
Consider the following assumptions:
• The action point offset should be greater than the assumed precision.
• A minimum propagation delay of the network as seen by the local node is given by gdMinPropaga-
tionDelay[µs].
Constraint 11:
gdActionPointOffset[MT] >= ceil( (gAssumedPrecision[µs] - gdMinPropagationDelay[µs]) /
(gdMacrotick[µs/MT] * (1 - cClockDeviationMax)) )
In practice the minimum propagation delay gdMinPropagationDelay may be set to zero.
In order to prevent the possibility of the creation of cliques114 during startup an additional safety margin must
be added. In this case Constraint 12 replaces Constraint 11.
Constraint 12:
gdActionPointOffset[MT] >= ceil( (2 * gAssumedPrecision[µs] - gdMinPropagationDelay[µs] +
2 * gdMaxInitializationError[µs]) / (gdMacrotick[µs/MT] * (1 - cClockDeviationMax)) )
114 Clique formation may be possible if more than two coldstart nodes are configured in the cluster under specific error
scenarios.
gdMinPropagationDelayMin[µs] 0 0
gdMaxInitializationErrorMax[µs] - 11.7
gdMacrotickMin[µs] 1 1
gdActionPointOffsetMax[MT] 12 47
In order to determine the configuration range of the gdActionPointOffset an additional margin of safety is
taken into account. As a result, the parameter gdActionPointOffset must be configurable over a range of 1
to 63 MT.115 This also allows a static slot design with additional safety margin, i.e. the action point of the
static slots includes a safety margin beyond the achievable precision of the cluster.
Constraint 13:
gdMinislotActionPointOffset[MT] >= ceil( (gAssumedPrecision[µs] - gdMinPropagationDelay[µs]) /
(gdMacrotick[µs/MT] * (1 - cClockDeviationMax)) )
gdMinislotActionPointOffset shall be configurable in a range of 1 to 31 MT.
gdMinislotActionPointOffset can be independently configured from gdActionPointOffset. This is useful if the
static segment design includes an additional safety margin that is not required in the dynamic segment.
gdMinislotActionPointOffset can also be different from gdActionPointOffset if the worst case precision
(causing gdActionPointOffset) can be replaced by an assumed "average precision" for the dynamic
segment. In both cases, the independent choice of gdMinislotActionPointOffset allows increased throughput
respective bandwidth within the dynamic segment.
B.4.8 gdMinislot
Consider the following assumptions:
• The minislot action point gdMinislotActionPointOffset is greater than or equal to the assumed
precision gAssumedPrecision.
• The maximum propagation delay gdMaxPropagationDelay of the network is taken into account.
Constraint 14:
gdMinislot[MT] >= gdMinislotActionPointOffset[MT] + ceil( (gdMaxPropagationDelay[µs] +
gAssumedPrecision[µs]) / (gdMacrotick[µs/MT] * (1 - cClockDeviationMax)) )
With the assumptions for gdMinislotActionPointOffset given in section B.4.7 and allowing for a margin of
safety, the parameter gdMinislot must be configurable over a range of 2 to 63 MT.
115
Note that the gdActionPointOffset parameter also specifies the action point in the symbol window.
B.4.9 gdStaticSlot
Consider the following assumptions:
• A frame must consists of at least gdTSSTransmitter, cdFSS, 80 gdBit header and trailer (with gPay-
loadLengthStatic = 0), and cdFES.
• Each payload data word is equal to 2 * (8 gdBit + cdBSS[gdBit]) = 20 gdBit.
The length of a frame is given by:
[9] aFrameLength[gdBit] = gdTSSTransmitter[gdBit] + cdFSS[gdBit] + 80 gdBit +
aPayloadLength[2-byte-word] * 20 gdBit + cdFES[gdBit]
Substituting the length of a static frame for aPayloadLength results in:
[10] aFrameLengthStatic = aFrameLength with aPayloadLength = gPayloadLengthStatic
Additional to the frame length the following
• The maximum length of a frame is increased depending on the clock quality (cClockDeviationMax)
and the minimum duration of a macrotick.
• The influence of the precision is taken into account by gdActionPointOffset.
Constraint 15:
gdStaticSlot[MT] = 2 * gdActionPointOffset[MT] + ceil( ((aFrameLengthStatic[gdBit] +
cChannelIdleDelimiter[gdBit]) * gdBitMax[µs/gdBit] + gdMinPropagationDelay[µs] +
gdMaxPropagationDelay[µs]) / (gdMacrotick[µs/MT] * (1 - cClockDeviationMax)) )
gdActionPointOffsetMin[MT] 1
gdActionPointOffsetMax[MT] 63
gdTSSTransmitter Min[gdBit] 3 4 6
gdTSSTransmitterMax[gdBit] 5 8 15
aFrameLengthStaticMin[gdBit] 86 87 89
gdMinPropagationDelayMax[µs] 2.5
gdMaxPropagationDelayMin[µs] 0
gdMaxPropagationDelayMax[µs] 2.5
gdMacrotickMin[µs] 2 1
gdMacrotickMax[µs] 6
gdStaticSlotMin[MT] 9 6 4
As a result, the parameter gdStaticSlot must be configurable over a range of 4 to 661 MT.
B.4.10 gdSymbolWindow
Consider the following assumptions:
• The length of a symbol (CAS or MTS symbol) is defined by cdCAS116.
• A CAS or MTS symbol has to be sent with a leading transmit start sequence. The symbol window
takes this into account by using gdTSSTransmitter + cdCAS.
Constraint 16:
gdSymbolWindow[MT] = 2 * gdActionPointOffset[MT] + ceil( ((gdTSSTransmitter[gdBit] + cdCAS[gdBit] +
cChannelIdleDelimiter[gdBit]) * gdBitMax[µs/gdBit] + dBDRxai[µs] +
gdMinPropagationDelay[µs] + gdMaxPropagationDelay[µs]) /
(gdMacrotick[µs/MT] * (1 - cClockDeviationMax)) )
gdActionPointOffsetMax[MT] 63
gdTSSTransmitterMax[gdBit] 5 8 15
gdMinPropagationDelayMax[µs] 2.5
116 The collision avoidance symbol, CAS, is also used to be the media access test symbol, MTS. It is the only possible symbol
within the symbol window.
gdMaxPropagationDelayMax[µs] 2.5
gdMacrotickMin[µs] 2 1
gdSymbolWindowMin[MT] 0a
As a result, the parameter gdSymbolWindow must be configurable over a range of 0 to 142 MT.
B.4.11 gMacroPerCycle
The number of macroticks per cycle is based on the cycle duration and the macrotick length.
Constraint 17:
gdMacrotickMin[µs] 2 1 1
The cycle length in macroticks must also be equivalent to the sum of the lengths of the segments that make
up the cycle.
Constraint 18:
gMacroPerCycle[MT] = gdStaticSlot[MT] * gNumberOfStaticSlots + adActionPointDifference[MT] +
gdMinislot[MT] * gNumberOfMinislots + gdSymbolWindow[MT] + gdNIT[MT]
gdStaticSlotMin[MT] 9 6 4
gNumberOfStaticSlotsMin 2
gdMinislotMin[MT] 0
gNumberOfMinislotsMin[Minislot] 0
gdSymbolWindowMin[MT] 0
gdNITMin[MT] 2
gMacroPerCycleMin[MT] 20 14 10
As a result, the parameter gMacroPerCycle must be configurable over a range of 10 to 16000 MT.
B.4.12 pMicroPerCycle
The cycle length in microticks is implementation dependent and may be calculated using the following
equations:
Constraint 19:
pMicroPerCycle[µT] = round( gdCycle[µs] / pdMicrotick[µs/µT] )
gdActionPointOffsetMin[MT] 1
gdNITMin[MT] 2
pMicroPerMacroNomMin[µT]a 40 40 41
aFrameLengthStaticMin[gdBit] +
97 98 100
cChannelIdleDelimiter[gdBit]
gdBitMax[µs] 0.4006 0.2003 0.10015
gdMaxPropagationDelayMin[µs] 0
b
With pMicroPerMacroNomMin = 40 µT and pdMicrotick = 0.2 µs the maximum length of
gdMacrotick would exceed the maximum macrotick length of 6 µs.
pMicroPerCycleMax[µT] with
160000 160000 -
pdMicrotick = 0.100 µs
pMicroPerCycleMax[µT] with
320000 320000 320000
pdMicrotick = 0.050 µs
pMicroPerCycleMax[µT] with
- 640000 640000
pdMicrotick = 0.025 µs
pMicroPerCycleMax[µT] with
The maximum number of microticks per cycle depends on the microtick length. It is not required that any
implementation supports any microtick length but for each supported bit rate at least one microtick length
and the related number of microticks per cycle must be supported (see Table B-16). To support the minimum
macrotick length of 1 µs the bold marked numbers of microtick per cycle should be supported.
As a result, the parameter pMicroPerCycle must be configurable at least over a range of 640 to 640000 µT.
B.4.13 gdDynamicSlotIdlePhase
Consider the following assumptions:
• The duration of gdDynamicSlotIdlePhase[Minislots] must be greater than or equal to the idle
detection time.
• The idle detection time must be calculated based on the uncorrected bit time and therefore equals
cChannelIdleDelimiter * gdBitMax.
• The macroticks may also be shortened by the clock deviation.
Constraint 20:
gdDynamicSlotIdlePhase[Minislot] >= ceil( ( ceil( (cChannelIdleDelimiter * gdBitMax[µs] +
gAssumedPrecision[µs] + gdMaxPropagationDelay[µs]) /
(gdMacrotick[µs/MT] * (1 - cClockDeviationMax)) ) - (gdMinislot[MT] -
gdMinislotActionPointOffset[MT]) ) / gdMinislot[MT/Minislot] )
Note, to calculate the minimum and the maximum value of gdDynamicSlotIdlePhase the Constraint 14 must
also be fulfilled.
gAssumedPrecisionMin[µs] 0.5
gdMaxPropagationDelayMin[µs] 0
gdMaxPropagationDelayMax[µs] 2.5
gdMacrotickMin[µs] 2 1 1
gdMacrotickMax[µs] 6
gdMinislotMin[MT] 2
gdMinislotMax[MT] 63
gdDynamicSlotIdlePhaseMin[Minislot] 0 0 0
gdDynamicSlotIdlePhaseMax[Minislot] 2 2 1
B.4.14 gNumberOfMinislots
Consider the following:
[12] adActionPointDifference[MT] = 0 if gdActionPointOffset <= gdMinislotActionPointOffset
= 0 if gNumberOfMinislots = 0
= gdActionPointOffset - gdMinislotActionPointOffset else
Constraint 21:
gNumberOfMinislots[Minislot] = (gMacroPerCycle[MT] - gdNIT[MT] - adActionPointDifference[MT] -
gNumberOfStaticSlots * gdStaticSlot[MT] - gdSymbolWindow[MT]) / gdMinislot[MT/Minislot]
gNumberOfMinislots is always an integer. To fulfill Constraint 21 the parameters on the right side of the
equation must be chosen so that gNumberOfMinislots results in an integer.117
gdNITMin[MT] 2
adActionPointDifferenceMin[MT] 0
gNumberOfStaticSlotsMin 2
gdStaticSlotMin[MT] with
22 - -
gdMacrotick = 2 µs
gdStaticSlotMin[MT] with
- 22 13
gdMacrotick = 1 µs
gdSymbolWindowMin[MT] 0
Table B-19: Calculation of maximum values for gNumberOfMinislots.
gdMinislotMin[MT] 2
B.4.15 pRateCorrectionOut
Consider the following assumptions:
• The rate correction mechanism must compensate the accumulated error in microticks of one
complete cycle.
• The error of one cycle arises from worst-case clock deviations and is limited to twice the maximum
deviation of the clock frequency cClockDeviationMax.
Depending on, for example, the implementation of the external rate/offset correction, the value of the
pExternRateCorrection parameter might influence the choice of this parameter value as well. Detailed
analysis of effects due to external clock correction terms might influence the parameter range as well. In all
cases, however, the following constraint must be fulfilled:
Constraint 22:
pRateCorrectionOut[µT] = ceil( pMicroPerCycle[µT] * 2 * cClockDeviationMax / (1 - cClockDeviationMax) )
pRateCorrectionOutMin[µT] 4 2 2
117
That can be accomplished by e.g. increasing gdNIT or decreasing gMacroPerCycle.
Constraint 23:
gOffsetCorrectionMax[µs] >= gAssumedPrecision[µs] + gdMaxPropagationDelay[µs] -
gdMinPropagationDelay[µs]
gdActionPointOffsetMax[MT] 63
gdMacrotickMax[µs] 6 3
gdMinPropagationDelayMin[µs], 0
gdMaxPropagationDelayMin[µs]
gdMinPropagationDelayMax[µs], 2.5
gdMaxPropagationDelayMax[µs]
B.4.16.2 pOffsetCorrectionOut
Constraint 25:
pOffsetCorrectionOut[µT] = ceil( gOffsetCorrectionMax[µs] /
(pdMicrotick[µs/µT] * (1 - cClockDeviationMax)) )
pOffsetCorrectionOutMin[µT] 13
pOffsetCorrectionOutMax[µT] 3842 7683 15366 15567
As a result, the parameter pOffsetCorrectionOut shall be configurable over a range of 13 to 15567 µT.
Constraint 26:
gOffsetCorrectionStart[MT] = gMacroPerCycle[MT] - adOffsetCorrection[MT]
with adOffsetCorrection the length of the offset correction phase, which is constrained in formula [17] in the
next section.
B.4.18 gdNIT
Consider the following assumptions:
1. The NIT consists of offset calculation phase and offset correction phase.
2. The duration of offset calculation is implementation dependent and the phase must be completed
before the start of the offset correction phase. The upper limit for the duration is defined in section
8.6.2: The offset correction calculation must be completed no later than cdMaxOffsetCalculation after
the end of the static segment or 1 MT after the start of the NIT, whichever occurs later.
3. The earliest start of the offset correction phase is 1 MT after the start of the NIT.
4. The duration of offset correction phase is at least 1 MT.
5. The maximum possible value for offset correction is pOffsetCorrectionOut resp. gOffsetCorrectionMax.
The offset correction phase must be long enough (i.e., contain enough macroticks) to correct this
amount of offset while still keeping the length of shortened macroticks greater than or equal to cdMi-
croPerMacroMin microticks.
6. The offset correction phase and the offset calculation phase can be overlaid with parts of the rate cal-
culation phase.
7. The duration of rate calculation phase is implementation dependent and must be completed before the
end of the NIT. The upper limit is defined in section 8.6.3: The rate correction calculation must be com-
pleted no later than cdMaxRateCalculation after the end of the static segment or 2 MT after the start of
the NIT, whichever occurs later. This can induce the need for a prolonged NIT.
Due to item 1, 6 and 7, the NIT length gdNIT is either the remaining time required to calculate the offset
correction and then execute it, or the remaining time required to ensure that rate calculation finishes before
the cycle ends, whichever takes longer. Thus gdNIT can be constrained by
Constraint 27:
gdNIT[MT] >= max( adRemRateCalculation[MT]; adRemOffsetCalculation[MT] + adOffsetCorrection [MT] )
Due to item 2 the remaining length of the offset calculation phase during the NIT adRemOffsetCalculation
can be defined by
[15] adRemOffsetCalculation[MT] <= max( 1, ceil( (cdMaxOffsetCalculation[µT] *
gdMaxMicrotick[µs/µT] * (1 + cClockDeviationMax) - (adActionPointDifference[MT] +
gdMinislot[MT] * gNumberOfMinislots + gdSymbolWindow[MT]) * gdMacrotick[µs] *
(1 - cClockDeviationMax) ) / (gdMacrotick[µs] * (1 - cClockDeviationMax)) ) )
[16] adRemOffsetCalculation[MT] >= 1
gdNumberOfMinislotsMin 0
gdSymbolWindowMin[MT] 0
gOffsetCorrectionMaxMax[µs] 383.567
adRemOffsetCalculation[MT] 34
gdNITMin[MT] 2 2 2
gdNITMax[MT] 420 805 805
The configurable minimum for gdNIT can be found by making the assumption that the NIT consists of only
1 MT for offset calculation and only 1 MT for offset correction.
As a result, the parameter gdNIT must be configurable over a range of 2 MT to 805 MT.
B.4.19 pExternRateCorrection
Consider the following assumption:
• The absolute value of the external rate correction value shouldn't be greater than the maximum
acceptable rate correction value pRateCorrectionOut.
B.4.20 pExternOffsetCorrection
Consider the following assumption:
• The absolute value of the external offset correction value shouldn't be greater than the maximum
acceptable offset correction value pOffsetCorrectionOut.
Constraint 29:
pExternOffsetCorrection[µT] <= pOffsetCorrectionOut[µT]
The range of pExternOffsetCorrection shall be configurable over a range of 0 to 7 µT.118
B.4.21 pdMaxDrift
Consider the following assumption:
• The maximum drift of cycle length between transmitting and receiving nodes is limited by twice the
maximum deviation of the clock frequency cClockDeviationMax.
Constraint 30:
pdMaxDrift[µT] = ceil( pMicroPerCycle[µT] * 2 * cClockDeviationMax / (1 - cClockDeviationMax) )
118 A small value for pExternOffsetCorrection (much smaller than pOffsetCorrectionOut) has the advantage that a node which
does not apply the external offset correction by fault stays synchronized with the other nodes in the cluster.
pdMaxDriftMin[µT] 4 2 2
Table B-26: Calculation of the minimum of pdMaxDrift.
As a result, the parameter pdMaxDrift shall be configurable over a range of 2 to 1923 µT.
Constraint 31:
pdListenTimeout[µT] = 2 * (pMicroPerCycle[µT] + pdMaxDrift[µT])
pdMaxDriftMin[µT] 4 2 2
As a result, the parameter pdListenTimeout shall be configurable over a range of 1284 to 1283846 µT.
B.4.23 pDecodingCorrection
Consider following assumption:
• The time difference between the secondary time reference point and the primary time reference
point is the summation of pDecodingCorrection and pDelayCompensation (see Figure 3-10).
Constraint 32:
pDecodingCorrection[µT] = round( ((gdTSSTransmitter[gdBit] + cdFSS[gdBit] + 0.5 * cdBSS[gdBit]) *
cSamplesPerBit[samples/gdBit] + cStrobeOffset[samples] + cVotingDelay[samples]) /
pSamplesPerMicrotick[samples/µT] )
gdTSSTransmitterMin[gdBit] 3 4 6
gdTSSTransmitterMax[gdBit] 5 8 15
pSamplesPerMicrotickMin 1
pSamplesPerMicrotickMax 2 4
pDecodingCorrectionMin[µT] 24 14 18
pDecodingCorrectionMax[µT] 63 87 143
As a result, the parameter pDecodingCorrection shall be configurable between 14 and 143 µT.
B.4.24 pMacroInitialOffset
Consider the following assumption:
• pMacroInitialOffset[Ch] has to be in the range of
gdActionPointOffset < pMacroInitialOffset[Ch] < gdStaticSlot.
Constraint 33:
pMacroInitialOffset[Ch][MT] = gdActionPointOffset[MT] + ceil( (pDecodingCorrection[µT] +
pDelayCompensation[Ch][µT]) / pMicroPerMacroNom[µT/MT] )
gdActionPointOffsetMin[MT] 1
gdActionPointOffsetMax[MT] 63
pDecodingCorrectionMin[µT] 24 14 18
pDecodingCorrectionMax[µT] 63 87 143
pDelayCompensation[Ch]Min[µT] 0
pDelayCompensation[Ch]Max[µT] 50 100 200
pMicroPerMacroNomMin[µT] 40 80a
pMacroInitialOffset[Ch]Max[MT] 66 68 68
a
For the calculation pMicroPerMacroNomMin = 80 is used because pSamplesPerMicrotick = 1
and pMicroPerMacroNomMin = 40 are mutually exclusive for 10 MBit/s. Alternatively, pMicroPer-
MacroNomMin = 40 could be used but then pDecodingCorrectionMax = 72 and pDelayCompensa-
tion[Ch]Max = 100 must be used because of the longer necessary microtick. Both calculations
lead to the same result documented in the table.
b For the calculation pMicroPerMacroNomMax = 60 is used because pSamplesPerMicrotick = 2
and pMicroPerMacroNomMax = 120 are mutually exclusive for 2.5 MBit/s.
c
For the calculation pMicroPerMacroNomMax = 60 is used because pSamplesPerMicrotick = 4
and pMicroPerMacroNomMax = 240 are mutually exclusive for 5 MBit/s.
d
For the calculation pMicroPerMacroNomMax = 120 is used because pSamplesPerMicrotick = 4
and pMicroPerMacroNomMax = 240 are mutually exclusive for 10 MBit/s.
B.4.25 pMicroInitialOffset
Consider the following assumptions:
• pMacroInitialOffset[Ch][MT] - pMicroInitialOffset[Ch][µT] = secondary time reference point.
• 0 <= pMicroInitialOffset[Ch][µT] <= pMicroPerMacroNom[µT]
Constraint 35:
pMicroInitialOffset[Ch][µT] < floor( (((5 + 2 * gPayloadLengthStatic + 3) * 10 - 2) * gdBitMin[µs]) /
(pdMicrotick[µs/µT] * (1 + cClockDeviationMax)) )
pMicroInitialOffset[Ch]Min[µT] 0 0 0
pMicroInitialOffset[Ch]Max[µT] 111 185 239
B.4.26 pLatestTx
Consider the following assumptions:
119 The second modulo operation forces pMicroInitialOffset[Ch] to become zero if pDecodingCorrection +
pDelayCompensation[Ch] is exactly a multiple of one macrotick.
• For a given node, the payload length of the longest dynamic frame for transmission is given by
aPayloadLengthDynamic = pPayloadLengthDynMax120.
• Each node must guarantee that even for the longest frame sent in the dynamic segment transmis-
sion is completed before the end of the dynamic segment.
• After each frame the dynamic slot idle phase must be taken into account.
• The influence of clock deviation (cClockDeviationMax) on the length of a macrotick must be taken
into account.
Substituting the length of the maximum dynamic frame for aPayloadLength in equation [9] results in:
[19] aFrameLengthDynamic = aFrameLength with aPayloadLength = pPayloadLengthDynMax
With the definition of aFrameLengthDynamic in [19] and vDTSLowMin in [14], the constraint on pLatestTx is
Constraint 36:
pLatestTx[Minislot] <= floor( gNumberOfMinislots[Minislot] - ( ((aFrameLengthDynamic[gdBit] +
vDTSLowMin) * gdBitMax[µs/gdBit]) / (gdMacrotick[µs/MT] * (1 - cClockDeviationMax) *
gdMinislot[MT/Minislot]) ) - gdDynamicSlotIdlePhase[Minislot] )
aFrameLengthDynamicMin[gdBit] 86 87 89
vDTSLowMin[gdBit] 1
gdMacrotickMin[µs] 2 1
gdMinislotMin[MT] 2
gdDynamicSlotIdlePhaseMin[Minislot] 1a
The minimum value would occur if given if the dynamic segment is only as long as the frame that must be
transmitted plus gdDynamicSlotIdlePhase. In this case, the frame may start no later than the first minislot.
It is desirable, however, to also use this parameter to allow a system designer to prevent a node from trans-
mitting at all in the dynamic segment. Setting this parameter to zero would have this effect.
pLatestTxMin = 0 Minislot.
As a result, the parameter pLatestTx must be configurable over a range of 0 to 7980 minislots.
B.4.27 gdTSSTransmitter
Consider the following assumptions:
120 This parameter may be different for each node. It is the length of the longest possible frame sent in the dynamic segment by
the node under consideration.
Constraint 37:
gdTSSTransmitter[gdBit] >= ceil( (gdBitMax[µs] + dBDRxia[µs] +
dStarTruncationMax[µs] 0.45
dBDRxiaMax[µs] 0.45
gdTSSTransmitterMin[gdBit] 3 4 6
gdTSSTransmitterMax[gdBit] 5 8 15
B.4.28 gdCASRxLowMax
The upper limit of the acceptance window for a collision avoidance symbol (CAS) must meet the following
constraint:
Constraint 38:
gdCASRxLowMax[gdBit] = ceil( 2 * (gdTSSTransmitter[gdBit] + cdCAS[gdBit]) * (1 + cClockDeviationMax)
/ (1 - cClockDeviationMax) + 2 * dBDRxai[µs] / gdBitMin[µs/gdBit] )
gdTSSTransmitterMin[gdBit] 3 4 6
gdTSSTransmitterMax[gdBit] 5 8 15
dBDRxaiMin[µs] 0
dBDRxaiMax[µs] 0.4
gdCASRxLowMaxMin[gdBit] 67 69 73
gdCASRxLowMaxMax[gdBit] 73 81 99
Constraint 39:
gdWakeupSymbolTxIdle[gdBit] = ceil( cdWakeupSymbolTxIdle[µs] / gdBit[µs/gdBit] )
gdWakeupSymbolTxIdle[gdBit] 45 90 180
As a result, the parameter gdWakeupSymbolTxIdle shall be configurable between 45 and 180 gdBit.
B.4.30 gdWakeupSymbolTxLow
The following constraint must be met:
Constraint 40:
gdWakeupSymbolTxLow[gdBit] = ceil( cdWakeupSymbolTxLow[µs] / gdBit[µs/gdBit] )
gdWakeupSymbolTxLow[gdBit] 15 30 60
B.4.31 gdWakeupSymbolRxIdle
Consider the following assumptions:
• Because of the clock deviation between nodes, the wakeup symbol seen by the receiver may be
shorter than the transmitted wakeup symbol.
Constraint 41:
gdWakeupSymbolRxIdle[gdBit] = floor( ( gdWakeupSymbolTxIdle[gdBit] * (1 - cClockDeviationMax) -
gdWakeupSymbolTxLow[gdBit] * (1 + cClockDeviationMax) ) /
(2 * (1+ cClockDeviationMax)) )
gdWakeupSymbolTxIdle[gdBit] 45 90 180
gdWakeupSymbolTxLow[gdBit] 15 30 60
gdWakeupSymbolRxIdle[gdBit] 14 29 59
B.4.32 gdWakeupSymbolRxLow
Consider the following assumptions:
• Because of the clock deviation between nodes, the wakeup symbol seen by the receiver may be
shorter than the transmitted wakeup symbol.
• The truncation of the low level of a wakeup symbol is taken into account by the parameters dStar-
Truncation and dBDRxia123.
Constraint 42:
gdWakeupSymbolRxLow[gdBit] =
floor( ( gdWakeupSymbolTxLow[gdBit] * gdBitMin[µs/gdBit]
- (max( {x | x = nStarPathM,N } ) * dStarTruncation[µs] + dBDRxia[µs] ) ) /
gdBitMax[µs/gdBit] )
gdWakeupSymbolTxLow[gdBit] 15 30 60
gdBitMin[µs] 0.3994 0.1997 0.09985
dStarTruncationMax[µs] 0.45
dBDRxiaMin[µs] 0
123
dBDRxia is the upper bound since the value dBDTx01 (see [EPL05]) can be subtracted.
dBDRxiaMax[µs] 0.45
gdWakeupSymbolRxLowMin[gdBit] 11 23 46
gdWakeupSymbolRxLowMax[gdBit] 14 29 59
Table B-38: Calculation of minimum and maximum values of gdWakeupSymbolRxLow.
B.4.33 gdWakeupSymbolRxWindow
Consider the following assumptions:
• Because of the clock deviation between nodes, the wakeup symbol seen by the receiver may be
longer than the transmitted wakeup symbol.
gdWakeupSymbolTxLow[gdBit] 15 30 60
gdWakeupSymbolTxIdle[gdBit] 45 90 180
As a result, the parameter gdWakeupSymbolRxWindow shall be configurable between 76 and 301 gdBit.