Skip to content

Flexray - FERAL Features

General information

Note

RAW messages coded in the FERAL FlexRay Native Protocol Version 1 are depricated and not supported by the third generation FERAL platform (3GP). Please make sure using the frame structure sepcified above when working with RAW messages.

FlexRay Channels

The FERAL implementation of FlexRay allows the use of two independent channels A and B. Messages sent on one of them will not collide with ones on the other channel if sent at the same time. When using Event messages (value messages), the channel to be used for transfer can be specified by the client as shown in the example below for channel A. For FlexRayChannel, the values A, B and BOTH are allowed.

Set FlexRay channel

Event txMsg = new ValueEvent<>(<payload>);
txMsg.addProperty(FlexRayFrameProperties.FLEXRAY_CHANNEL, FlexRayChannel.A);

Please note, that all network nodes are always able to receive on both channels. To filter received messages, the client needs to check the used channel itself. This can be done using the same message property:

Read FlexRay channel

var rxMsgChannel = rxMsg.getProperty(FlexRayFrameProperties.FLEXRAY_CHANNEL);

When using RAW frames, the channel can be selected by setting the value of the Channel ID according to the frame structure, which is listed below.

Value channel
0 A
1 B
2 BOTH

Static and dynamic slots

The message slot can be specified by the message address. When using Events/Value messages and the ApplicationInterface, this is done when defining a message type as shown below. In general, a FlexRay address is a String with the structure <segment>:<slot>. The allowed values for the segments are shown in the table , the possible slots depend on the network parameters. The segment identifiers are also accessable using the FlexRayConfig as STATIC_SEGMENT_IDENTIFIER and DYNAMIC_SEGMENT_IDENTIFIER.

Value segment
s static
d dynamic

Slot definition: Dynmic segment, slot 1

    interfaceSender.addTxMessageType("d:1", <portName>, <messageSize>);
    interfaceReceiver.addRxMessageType("d:1", <portName>, <messageSize>);

For RAW messages, the Slot field has to be used. For this, please take a look at the Protocol-Specific Fields.

Address style convention

By convention, all addresses in FERAL are written using lower case characters.

Other Message properties

As known from other FERAL network models, message properties can be used to add metadata to the Event messages (for WAR messages, please refer to Protocol-Specific Fields). The properties for FlexRay messages are listed in the table and can be accessed using the class FlexRayFrameProperties:

Name Property Type/Range Description
FLEXRAY_CHANNEL FlexRayChannel Specifies the used channel for transmission.
START_UP_FRAME_INDICATOR boolean, {0,1} Indicator flag for startup frames.
SYNC_FRAME_INDICATOR boolean, {0,1} Indicator flag for sync frames.
NULL_FRAME_INDICATOR boolean, {0,1} Indicator flag for null frames.
PAYLOAD_PREAMBLE_FRAME_INDICATOR boolean, {0,1} Indicator flag for payload preamble frames.
FLEXRAY_CYCLE int: [0,63] Value of the FlexRay cycle counter.

Network Configuration

When creating a FlexRay network, a bunch of configuration parameters can be used to adapt the model to the use case. There are network specific paremeters and general network parameters. In the table below, the network specific parameters are listed. They can be set using the FlexRayConfig which is returned by the FlexRayNetwork with the getConfig() command.

Name Type/Range Description
cycleStart [0,63] Start cycle of the network.
gdStaticSlot [3,664] Duration of the static slot in macroticks.
numberOfStaticSlots [2,1023] Number of static slots per cycle.
macroPerCycle [8,16000] Number of macroticks per cycle.
numberOfMinislots [0,7988] Number of minislots in the dynamic segment.
gdSymbolWindow [0,162] Store the duration of the symbol window in macroticks. The symbol window is optional within a FlexRay simulation. If set to zero no symbol window is part in the communication cycle. This is global cluster parameter.

The general network parameters for adapting the network behaviour in the following table are directly accessable at the FlexRayNetwork using Getters and Setters.

Name Type/Range Description
console Console The console for the network logging.
bitRate long The bitrate of the network in bits/second.
logTransmissions boolean Configures if network transmissions on medium level should be logged.
logHexadecimalValues boolean Configure if network transmissions on medium level should be logged as hexadecimal values.

Frame Structure

Position Size Type Name Description
0-3 4 int8 InterfaceID The interface ID enables the selection of an interface. Normally, only one interface per endpoint is supported, and the interface ID is therefore 1.
4-7 4 int8 BusID The bus ID defines the bus type and the bus specific format that is used for the frame.
8 1 int8 ChannelID The channel ID enables the selection of a channel for network configurations that support multiple channels.
9 1 int8 Direction May be used to indicate the direction of a message (TX/RX).
10 1 int8 Version Defines the version of the used message format.

BusID Values

Bus ID Bus Type
1 CAN (without FD support)
2 FlexRay
3 Ethernet
4 CAN (with CANFD support)
5 LIN
6 LINPhys

Protocol-Specific Fields

In the table below the protocol specific frame structure for raw messages is listed.

Position Size Type Name Description
11 4 int8 StartupFrame Indicates if FlexRay frame is a startup-frame (1) or not (0).
12 1 int8 SyncFrame Indicates if FlexRay frame is a sync-frame (1) or not (0).
13 1 int8 NullFrame Indicates if FlexRay is a null-frame (1) or not (0).
14 1 int8 PayloadPreambleIndicator Indicates if FlexRay is a payload-frame (1) or not (0).
15 1 int8 CycleCount The FlexRay cycle of the message.
16 <var> String Slot 0-terminated String that indicates the Flexray slot of the frame. Valid slot definitions are s:# and d:#. The # indicates the slot number, prefix s: marks the static segment, and prefix d: marks the dynamic segment.
16 + <var> 2 int8 Length Indicates the length of the FlexRay frame.
18 + <var> <length> [int8] Payload Payload data bytes of the Flexray frame.