DEENESPTFRRUARHIKOZHNL

Time Sync Over FlexRay (FrTSyn)

ModulFrTSyn (Time Sync Over FlexRay)
BSW-Modul-ID163
Standard-Header#include "FrTSyn.h"
SWS-SpezifikationAUTOSAR_CP_SWS_TimeSyncOverFlexRay.pdf, AUTOSAR_SWS_TimeSyncOverFlexRay.pdf
Umfang110 Records · 32 Snippets
ClusterZeitsynchronisation

Time Sync Over FlexRay (FrTSyn)

AUTOSAR Classic Communication Services-Modul Time Sync Over FlexRay (FrTSyn, Spezifikation: AUTOSAR_CP_SWS_TimeSyncOverFlexRay.pdf, AUTOSAR_SWS_TimeSyncOverFlexRay.pdf).

Funktionen — Übersicht

Typen — Übersicht

Anforderungen — Übersicht

Funktionen & Typen — Detailansicht

함수 FrTSyn_Init [SWS_FrTSyn_00063] 📄 PDF

void FrTSyn_Init(const FrTSyn_ConfigType* configPtr);

This function initializes the Time Synchronization over FlexRay.

함수 FrTSyn_SetTransmissionMode [SWS_FrTSyn_00065] 📄 PDF

void FrTSyn_SetTransmissionMode(uint8 CtrlIdx, FrTSyn_TransmissionModeType Mode);

This API is used to turn on and off the TX capabilities of the FrTSyn.

함수 FrTSyn_TriggerTransmit [SWS_FrTSyn_00069] 📄 PDF

Std_ReturnType FrTSyn_TriggerTransmit(PduIdType TxPduId, PduInfoType* PduInfoPtr);

Within this API, the upper layer module (called module) shall check whether the available data fits into the buffer size reported by PduInfoPtr->SduLength. If it fits, it shall copy its data into the buffer provided by PduInfoPtr->SduDataPtr and update the length of the actual copied data in PduInfoPtr->SduLength. If not, it returns E_NOT_OK without changing PduInfoPtr.

함수 FrTSyn_MainFunction [SWS_FrTSyn_00071] 📄 PDF

void FrTSyn_MainFunction(void);

Main function for cyclic call / resp. Timesync message transmission

타입 FrTSyn_ConfigType [SWS_FrTSyn_00061] 📄 PDF

This is the base type for the configuration of the Time Synchronization over FlexRay. A pointer to an instance of this structure will be used in the initialization of the Time Synchronization over FlexRay. The content of this structure is defined in chapter 10 Configuration specification.

requirement SWS_FrTSyn_00003 [SWS_FrTSyn_00003] 📄 PDF

A call to FrTSyn_Init initializes all internal vari- ables and sets the Time Synchronization over FlexRay to the initialized state.

requirement SWS_FrTSyn_00007 [SWS_FrTSyn_00007] 📄 PDF

The byte order for time values inside Time Synchronization messages is "Big Endian".

requirement SWS_FrTSyn_00010 [SWS_FrTSyn_00010] 📄 PDF

Time Synchronization messages contain User Data according to the given message format.

requirement SWS_FrTSyn_00011 [SWS_FrTSyn_00011] 📄 PDF

User Data shall be read consistently from the incoming Time Synchronization messages.

requirement SWS_FrTSyn_00012 [SWS_FrTSyn_00012] 📄 PDF

User Data shall be written consistently to outgoing Time Syn- chronization messages. If the number of User Data Fields in a Time Synchronization message is greater than the number of User Data Bytes provided by the StbM, the remaining User Data Fields shall be set to 0 (default value).

requirement SWS_FrTSyn_00013 [SWS_FrTSyn_00013] 📄 PDF

User Data shall be mapped to the StbM_UserDataType , where the byte number given in the message and by the StbM_UserDataType shall match (User Byte 0 mapped to StbM_UserDataType . userByte0 etc.). StbM_- UserDataType . userDataLength shall be set to the Time Synchronization message type specific number of User Bytes.

requirement SWS_FrTSyn_00014 [SWS_FrTSyn_00014] 📄 PDF

0 Type 0x10 Message Type 1 User Byte 2 default: 0 2 7..4 D 0..15 Time Domain Id 3..0 SC 0..15 Sequence Counter 3 7..2 FCNT 0..63 FlexRay Cycle Counter 1 SGW 0 = SyncToGTM 1 = SyncToSubDomain 0 reserved 0 4 User Byte 0 default: 0 5 User Byte 1 default: 0 6..11 SyncTimeSec 48 Bit time value in seconds 12..15 SyncTimeNSec 32 Bit time value in nanoseconds Table 7.1: SYNC not CRC secured message format

requirement SWS_FrTSyn_00015 [SWS_FrTSyn_00015] 📄 PDF

0 Type 0x20 Message Type 1 CRC 0..255 Checksum 2 7..4 D 0..15 Time Domain Id 3..0 SC 0..15 Sequence Counter 3 7..2 FCNT 0..63 FlexRay Cycle Counter 1 SGW 0 = SyncToGTM 1 = SyncToSubDomain 0 reserved 0 4 User Byte 0 default: 0 5 User Byte 1 default: 0 6..11 SyncTimeSec 48 Bit time value in seconds 12..15 SyncTimeNSec 32 Bit time value in nanoseconds Table 7.2: SYNC CRC secured message format

requirement SWS_FrTSyn_00018 [SWS_FrTSyn_00018] 📄 PDF

A Time Synchronization message sequence consists of a SYNC message per Time Domain.

requirement SWS_FrTSyn_00019 [SWS_FrTSyn_00019] 📄 PDF

For each configured Time Master (refer to FrTSynGlobal- TimeMaster ) the FrTSyn module shall periodically transmit SYNC messages with the cycle FrTSynGlobalTimeTxPeriod including the time value, which will be valid at the start of the next FlexRay cycle 0 and User Data, if the GLOBAL_TIME_BASE bit within the timeBaseStatus is set and FrTSynGlobalTimeTxPeriod is unequal to 0 and if the associated cyclicMsgResumeCounter is not running. The cyclic transmission shall be started in the earliest possible FrT- Syn_MainFunction call once the requirements above are fulfilled.

requirement SWS_FrTSyn_00020 [SWS_FrTSyn_00020] 📄 PDF

The SGW value (Time Gateway synchronization status) shall be retrieved from the Time Base synchronization status. If the SYNC_TO_GATEWAY bit within timeBaseStatus is not set the SGW value shall be SyncToGTM . Otherwise the SGW value shall be set to SyncToSubDomain .

requirement SWS_FrTSyn_00021 [SWS_FrTSyn_00021] 📄 PDF

Depending on FrTSynGlobalTimeTxCrcSecured the SYNC message shall be of type: FrTSynGlobalTimeTxCrcSecured Value SYNC Message Type CRC_NOT_SUPPORTED 0x10 SYNC not CRC secured message CRC_SUPPORTED 0x20 SYNC CRC secured message Table 7.5

requirement SWS_FrTSyn_00023 [SWS_FrTSyn_00023] 📄 PDF

For each configured Time Master ( FrTSynGlobalTimeMas- ter ) the FrTSyn module shall periodically transmit OFS messages with the cycle FrTSynGlobalTimeTxPeriod ) including the Offset Time value and User Data, if the GLOBAL_TIME_BASE bit within the timeBaseStatus is set and FrTSynGlobal- TimeTxPeriod is unequal to 0 and if the associated cyclicMsgResumeCounter is not running. The cyclic transmission shall be started in the earliest possible FrTSyn_MainFunc- tion call once the requirements above are fulfilled.

requirement SWS_FrTSyn_00025 [SWS_FrTSyn_00025] 📄 PDF

Depending on FrTSynGlobalTimeTxCrcSecured the OFS message shall be of type: FrTSynGlobalTimeTxCrcSecured Value OFS Message Type CRC_NOT_SUPPORTED 0x34 OFS not CRC secured message CRC_SUPPORTED 0x44 OFS CRC secured message Table 7.6

requirement SWS_FrTSyn_00026 [SWS_FrTSyn_00026] 📄 PDF

If FrTSyn_SetTransmissionMode(Controller, Mode) is called and parameter Mode equals FRTSYN_TX_OFF , all trans- mit requests from FrTSyn shall be omitted on this FlexRay channel.

requirement SWS_FrTSyn_00027 [SWS_FrTSyn_00027] 📄 PDF

If FrTSyn_SetTransmissionMode(Controller, Mode) is called and parameter Mode equals FRTSYN_TX_ON , all transmit re- quests from FrTSyn on this FlexRay channel shall be able to be transmitted.

requirement SWS_FrTSyn_00028 [SWS_FrTSyn_00028] 📄 PDF

The transmitter of a Synchronized Time Base (Time Master) shall perform the following steps to distribute the Synchronized Time Base: 1. Retrieve current Synchronized Time Base's Time Tuple as [T SYNC ;T0 VLT ] via StbM_BusGetCurrentTime 2. Protect the following two steps against interruptions: (a) Get currentCycle and currentMacroticks via FrIf_GetGlobal- Time (b) Retrieve current Virtual Local Time value as T1 VLT via StbM_GetCur- rentVirtualLocalTime 3. Calculate the (future) time value of the Time Base at the start of the next FlexRay cycle by T0 = T SYNC + (T1 VLT - T0 VLT ) + (64 - currentCycle ) * CycleLength - ( CycleLength / MacroticksPerCycle ) * currentMacroticks 4. Calculate SyncTimeSec (second portion of T0) and SyncTimeNSec (nanosec- ond portion of T0)

requirement SWS_FrTSyn_00029 [SWS_FrTSyn_00029] 📄 PDF

The transmitter of an Offset Time Base (Time Master) shall perform the following steps to distribute the Offset Time Base: 1. Retrieve current Offset Time via StbM_GetOffset 2. Write second portion of the Offset Time to OfsTimeSec 3. Write nanosecond portion of the Offset Time to OfsTimeNSec

requirement SWS_FrTSyn_00030 [SWS_FrTSyn_00030] 📄 PDF

A Sequence Counter ( SC ) of 4 bit is representing numbers from 0 to 15 per Time Domain. The Sequence Counter shall be independent be- tween SYNC and OFS messages and shall be incremented by 1 on every transmis- sion request of a SYNC or OFS message. It shall wrap around at 15 to 0 again.

requirement SWS_FrTSyn_00031 [SWS_FrTSyn_00031] 📄 PDF

The function Crc_CalculateCRC8H2F as defined in [6] shall be used to calculate the CRC , if configured.

requirement SWS_FrTSyn_00035 [SWS_FrTSyn_00035] 📄 PDF

The DataID shall be calculated as DataID = Data IDList[SC] , where DataIDList is given by configuration for each message type (refer to FrTSynGlobalTimeSyncDataIDList and FrTSynGlobalTimeOfs- DataIDList ).

requirement SWS_FrTSyn_00036 [SWS_FrTSyn_00036] 📄 PDF

The CRC shall be calculated over Time Synchroniza- tion message Byte 2 to Byte 15 and DataID , where Byte 2 is applied first, followed by the other bytes in ascending order, and DataID last.

requirement SWS_FrTSyn_00037 [SWS_FrTSyn_00037] 📄 PDF

For each transmission of a Time Synchronization message the FrTSyn module shall assemble the message as follows: • Calculate SC • Copy currentCycle (refer to [SWS_FrTSyn_00028]) to FCNT (for SYNC mes- sage) • Calculate SGW • Copy all data to the appropriate position within the related message • Calculate CRC (configuration dependent)

requirement SWS_FrTSyn_00038 [SWS_FrTSyn_00038] 📄 PDF

The FrTSyn shall only accept a SYNC message with Type equal to 0x20 and a correct CRC value if FrTSynRxCrcValidated is configured to CRC_VALIDATED .

requirement SWS_FrTSyn_00039 [SWS_FrTSyn_00039] 📄 PDF

The FrTSyn shall only accept a SYNC message with Type equal to 0x10 if FrTSynRxCrcValidated is configured to CRC_NOT_VALIDATED .

requirement SWS_FrTSyn_00040 [SWS_FrTSyn_00040] 📄 PDF

The FrTSyn shall only accept a SYNC message with Type equal to 0x10 or 0x20 if FrTSynRxCrcValidated is configured to CRC_IGNORED .

requirement SWS_FrTSyn_00041 [SWS_FrTSyn_00041] 📄 PDF

For valid SYNC messages a new Time Tuple, consisting of the Global Time value and the associated value of the Virtual Local Time, shall be calculated and forwarded to the StbM module via StbM_BusSetGlobalTime .

requirement SWS_FrTSyn_00042 [SWS_FrTSyn_00042] 📄 PDF

The FrTSyn shall only accept an OFS message with Type equal to 0x44 and a correct CRC value if FrTSynRxCrcValidated is configured to CRC_VALIDATED .

requirement SWS_FrTSyn_00043 [SWS_FrTSyn_00043] 📄 PDF

The FrTSyn shall only accept an OFS message with Type equal to 0x34 if FrTSynRxCrcValidated is configured to CRC_NOT_VALIDATED .

requirement SWS_FrTSyn_00044 [SWS_FrTSyn_00044] 📄 PDF

The FrTSyn shall only accept an OFS message with Type equal to 0x34 or 0x44 if FrTSynRxCrcValidated is configured to CRC_IGNORED .

requirement SWS_FrTSyn_00045 [SWS_FrTSyn_00045] 📄 PDF

For valid OFS messages a new Time Tuple, consisting of the Offset Time value and the associated value of the Virtual Local Time, shall be calculated (according [SWS_FrTSyn_00047]) and forwarded to the StbM module via StbM_BusSetGlobalTime .

requirement SWS_FrTSyn_00046 [SWS_FrTSyn_00046] 📄 PDF

The receiver of a Synchronized Time Base shall perform the following steps to assemble the Synchronized Time Base: 1. On SYNC message RX indication (or in the subsequent MainFunction call) store received time value T0 ( SyncTimeSec , SyncTimeNSec ) 2. Protect the following two steps against interruptions: (a) Get currentCycle and currentMacroticks via FrIf_GetGlobal- Time (b) Retrieve current Virtual Local Time value as T1 VLT via StbM_GetCur- rentVirtualLocalTime 3. Calculate Time Tuple [T1; T1 VLT ] to update the Time Slave's local instance of the Time Base: (a) T1 = T0 + ( CycleLength * currentCycle ) + (( CycleLength / MacrotickPerCycle ) * currentMacroticks ) (b) If currentCycle is greater or equal than the retrieved FCNT value from the transmitter (Time Master), then the calculated value T1 shall be subtracted by 64 times the FlexRay cycle duration: T1 = T1 - ( CycleLength * 64)

requirement SWS_FrTSyn_00047 [SWS_FrTSyn_00047] 📄 PDF

The receiver of an Offset Time Base shall perform the follow- ing steps to assemble the Offset Time: 1. Get second portion of the Offset Time out of OfsTimeSec 2. Get nanosecond portion of the Offset Time out of OfsTimeNSec 3. Retrieve current Virtual Local Time value via StbM_GetCurrentVirtualLo- calTime

requirement SWS_FrTSyn_00048 [SWS_FrTSyn_00048] 📄 PDF

The Sequence Counter Jump Width between two consecutive SYNC or two consecutive OFS messages of the same Time Domain shall be greater than 0 and smaller than or equal to FrTSynGlobalTimeSequenceCounterJump- Width . Otherwise a Time Slave shall discard the respective SYNC / OFS message. If the FrTSynGlobalTimeSequenceCounterJumpWidth value is set to 0, the Time Slave shall not do Sequence Counter Jump Width checks.

requirement SWS_FrTSyn_00049 [SWS_FrTSyn_00049] 📄 PDF

Upon reception of a SYNC (or OFS) message a Time Slave shall check the Sequence Counter of the received message per Time Domain against the configured value of FrTSynGlobalTimeSequenceCounterJumpWidth (ac- cording to [SWS_FrTSyn_00048]), unless it is the first message • at Startup or • after a Time Base update timeout has been detected ( TIMEOUT bit set in Time Base synchronization status timeBaseStatus ).

requirement SWS_FrTSyn_00050 [SWS_FrTSyn_00050] 📄 PDF

The function Crc_CalculateCRC8H2F as defined in [6] shall be used to validate the CRC , if configured.

requirement SWS_FrTSyn_00054 [SWS_FrTSyn_00054] 📄 PDF

The DataID shall be calculated as DataID = DataIDList [SC] , where DataIDList is given by configuration for each message Type .

requirement SWS_FrTSyn_00055 [SWS_FrTSyn_00055] 📄 PDF

The CRC shall be calculated over Time Synchroniza- tion message Byte 2 to Byte 15 and DataID , where Byte 2 is applied first, followed by the other bytes in ascending order, and DataID last.

requirement SWS_FrTSyn_00056 [SWS_FrTSyn_00056] 📄 PDF

For each received Time Synchronization message the FrT- Syn shall validate the message as follows (all conditions must match): 1. Type matches depending on the FrTSynRxCrcValidated parameter 2. SC value is within the accepted range (refer to [SWS_FrTSyn_00048] and [SWS_FrTSyn_00049]) 3. D matches to the defined Time Domain range for each Type 4. D matches to one of the configured Time Domains 5. SyncTimeNSec (SYNC message) or OfsTimeNSec (OFS message) matches the defined range of StbM_TimeStampType . nanoseconds . 6. CRC (including DataID ) matches depending on the FrTSynRxCrcValidated parameter.

requirement SWS_FrTSyn_00057 [SWS_FrTSyn_00057] 📄 PDF

For each received Time Synchronization message the FrTSyn shall disassemble the message after successful validation [SWS_FrTSyn_00056].

requirement SWS_FrTSyn_00058 [SWS_FrTSyn_00058] 📄 PDF

On errors and exceptions, the FrTSyn module shall not mod- ify its current module state but shall simply report the error event.

requirement SWS_FrTSyn_00059 [SWS_FrTSyn_00059] 📄 PDF

Type of error Related error code Error value API service called with wrong PDU or SDU. FRTSYN_E_INVALID_PDUID 0x01 API service used in un-initialized state FRTSYN_E_UNINIT 0x20 A pointer is invalid FRTSYN_E_NULL_POINTER 0x21 Type of error Related error code Error value FrTSyn initialization failed FRTSYN_E_INIT_FAILED 0x22 API called with invalid parameter FRTSYN_E_PARAM 0x23 Invalid Controller index FRTSYN_E_INV_CTRL_IDX 0x24

requirement SWS_FrTSyn_00060 [SWS_FrTSyn_00060] 📄 PDF

Module Header File Imported Type ComStack_Types.h PduIdType ComStack_Types ComStack_Types.h PduInfoType Module Header File Imported Type ComStack_Types.h PduLengthType FrIf FrIf.h FrIf_StateType Rte_StbM_Type.h StbM_FrTimeMasterMeasurementType Rte_StbM_Type.h StbM_FrTimeSlaveMeasurementType Rte_StbM_Type.h StbM_SynchronizedTimeBaseType Rte_StbM_Type.h StbM_TimeBaseStatusType Rte_StbM_Type.h StbM_TimeStampShortType Rte_StbM_Type.h StbM_TimeStampType Rte_StbM_Type.h StbM_UserDataType StbM.h StbM_MeasurementType StbM StbM.h StbM_VirtualLocalTimeType Std_Types.h Std_ReturnType Std Std_Types.h Std_VersionInfoType

requirement SWS_FrTSyn_00067 [SWS_FrTSyn_00067] 📄 PDF

The callback function FrTSyn_RxIndication shall inform the Det , if development error detection is enabled FrTSynDevErrorDetect is set to TRUE ) and if function call has failed because of the following reasons: • Invalid RxPduId (FRTSYN_E_INVALID_PDUID) • PduInfoPtr or SduDataPtr equals NULL_PTR (FRTSYN_E_NULL_ POINTER)

requirement SWS_FrTSyn_00070 [SWS_FrTSyn_00070] 📄 PDF

The callback function FrTSyn_TriggerTransmit shall in- form the Det , if development error detection is enabled FrTSynDevErrorDetect is set to TRUE ) and if function call has failed because of the following reasons: • Invalid TxPduId (FRTSYN_E_INVALID_PDUID) • PduInfoPtr or SduDataPtr equals NULL_PTR (FRTSYN_E_NULL_ POINTER)

requirement SWS_FrTSyn_00072 [SWS_FrTSyn_00072] 📄 PDF

The frequency of invocations of FrTSyn_MainFunction is determined by the configuration parameter FrTSynMainFunctionPeriod .

requirement SWS_FrTSyn_00074 [SWS_FrTSyn_00074] 📄 PDF

FrIf_GetCycleLength FrIf.h This API returns the configured time of the configuration parameter "GdCycle" in nanoseconds for the FlexRay controller with index FrIf_CtrlIdx. FrIf_GetGlobalTime FrIf.h Wraps the FlexRay Driver API function Fr_Get GlobalTime(). Important Note: FrIf_GetGlobalTime may be called within an exclusive area. FrIf_GetMacrotickDuration FrIf.h Retrieves the Duration of a Macrotick in ns FrIf_GetMacroticksPerCycle FrIf.h Retrieves the amount of Macroticks per Cycle FrIf_GetState FrIf.h Get current FrIf state. StbM_GetCurrentVirtualLocalTime StbM.h Returns the Virtual Local Time of the referenced Time Base.

requirement SWS_FrTSyn_00075 [SWS_FrTSyn_00075] 📄 PDF

Crc_CalculateCRC8H2F Crc.h This service makes a CRC8 calculation with the Polynomial 0x2F on Crc_Length Det_ReportError Det.h Service to report development errors. FrIf_Transmit FrIf.h Requests transmission of a PDU. StbM_BusGetCurrentTime StbM.h Returns the current Time Tuple, status and User Data of the Time Base. StbM_BusSetGlobalTime StbM.h Allows the Time Base Provider Modules to forward a new Global Time tuple (i.e., Rx Time Tuple) to the StbM. StbM_FrSetMasterTimingData (draft) StbM_FrTSyn.h Provides Flexray Timesyn module specific data for a Time Master to the StbM. Tags: atp.Status=draft StbM_FrSetSlaveTimingData (draft) StbM_FrTSyn.h Allows the FrTSyn Module to forward Flexray specific details to the StbM. Tags: atp.Status=draft StbM_GetCurrentTime StbM.h Returns a time value (Local Time Base derived from Global Time Base) in standard format. Note: This API shall be called with locked interrupts / within an Exclusive Area to prevent interruption (i.e., the risk that the time stamp is outdated on return of the function call). StbM_GetOffset StbM.h Allows the Timesync Modules to get the current Offset Time and User Data. StbM_GetTimeBaseStatus StbM.h Returns detailed status information for a Synchronized (or Pure Local) Time Base and, if called for an Offset Time Base, for the Offset Time Base and the underlying Synchronized Time Base. StbM_GetTimeBaseUpdateCounter StbM.h Allows the Timesync Modules to detect, whether a Time Base should be transmitted immediately in the subsequent <Bus>TSyn_MainFunction() cycle.

requirement SWS_FrTSyn_00077 [SWS_FrTSyn_00077] 📄 PDF

The Time Synchronization over FlexRay shall support the configuration for Time Master, Time Slave and Time Gateway.

requirement SWS_FrTSyn_00078 [SWS_FrTSyn_00078] 📄 PDF

The FrTSyn module shall call FrIf_GetGlobalTime only if FrIf_GetState returns FRIF_STATE_ONLINE . This is to ensure that FrIf_Get- GlobalTime returns valid time information, i.e. that the FlexRay communication con- troller is synchronous to the FlexRay global time.

requirement SWS_FrTSyn_00079 [SWS_FrTSyn_00079] 📄 PDF

0 Type 0x34 Message Type 1 User Byte 2 default: 0 2 7..4 D 16..31 Time Domain Id 3..0 SC 0..15 Sequence Counter 3 7..2 reserved 0 1 SGW 0 = SyncToGTM 1 = SyncToSubDomain 0 reserved 0 4 User Byte 0 default: 0 5 User Byte 1 default: 0 6 reserved 0 7 reserved 0 8..11 OfsTimeSec 32 Bit offset time value in seconds 12..15 OfsTimeNSec 32 Bit offset time value in nanoseconds Table 7.3: OFS not CRC secured message format

requirement SWS_FrTSyn_00080 [SWS_FrTSyn_00080] 📄 PDF

0 Type 0x44 Message Type 1 CRC 0..255 Checksum 2 7..4 D 16..31 Time Domain Id 3..0 SC 0..15 Sequence Counter 3 7..2 reserved 0 1 SGW 0 = SyncToGTM 1 = SyncToSubDomain 0 reserved 0 4 User Byte 0 default: 0 5 User Byte 1 default: 0 6 reserved 0 7 reserved 0 8..11 OfsTimeSec 32 Bit offset time value in seconds 12..15 OfsTimeNSec 32 Bit offset time value in nanoseconds Table 7.4: OFS CRC secured message format

requirement SWS_FrTSyn_00081 [SWS_FrTSyn_00081] 📄 PDF

The FrTSyn shall only accept a SYNC message with Type equal to 0x10 or a SYNC message with Type equal to 0x20 and a correct CRC value if FrTSynRxCrcValidated is configured to CRC_OPTIONAL .

requirement SWS_FrTSyn_00082 [SWS_FrTSyn_00082] 📄 PDF

The FrTSyn shall only accept an OFS message with Type equal to 0x34 or an OFS message with Type equal to 0x44 and a correct CRC value if FrTSynRxCrcValidated is configured to CRC_OPTIONAL .

requirement SWS_FrTSyn_00084 [SWS_FrTSyn_00084] 📄 PDF

If FrTSynGlobalTimeDebounceTime ) is greater than 0 for a Time Base, FrTSyn shall always do debouncing for the corresponding Timesync PDUs as described below, otherwise FrTSyn shall not do any debouncing.

requirement SWS_FrTSyn_00085 [SWS_FrTSyn_00085] 📄 PDF

FrTSynGlobalTimeDebounceTime represents the de- bounce value of a debounceCounter of a Time Base. FrTSyn shall reload the de- bounceCounter after a Timesync PDU for the corresponding Time Base (SYNC and OFS) has been sent. FrTSyn shall decrement the debounceCounter value on each invocation of FrTSyn_MainFunction , if no Timesync PDU is transmitted.

requirement SWS_FrTSyn_00086 [SWS_FrTSyn_00086] 📄 PDF

A new Timesync PDU shall only be sent if the corresponding debounceCounter has a value equal or less than zero.

requirement SWS_FrTSyn_00087 [SWS_FrTSyn_00087] 📄 PDF

If FrTSynImmediateTimeSync is set to TRUE for a Time Base, FrTSyn shall check on each FrTSyn_MainFunction call by calling StbM_- GetTimeBaseUpdateCounter , if the timeBaseUpdateCounter of the corre- sponding Time Base has changed.

requirement SWS_FrTSyn_00088 [SWS_FrTSyn_00088] 📄 PDF

If FrTSynImmediateTimeSync is set to TRUE and the time BaseUpdateCounter of a Time Base has changed and the GLOBAL_TIME_BASE bit of the timeBaseStatus is set, FrTSyn shall trigger an immediate transmission of Time Synchronization messages for the corresponding Time Base.

requirement SWS_FrTSyn_00089 [SWS_FrTSyn_00089] 📄 PDF

If FrTSynImmediateTimeSync is set to TRUE , cyclicMs- gResumeCounter and FrTSynCyclicMsgResumeTime shall be considered.

requirement SWS_FrTSyn_00090 [SWS_FrTSyn_00090] 📄 PDF

FrTSynCyclicMsgResumeTime represents the timeout value of a cyclicMsgResumeCounter that shall be started when either a SYNC or OFS message has been sent immediately, asynchronous to the cyclic Timesync message transmission. cyclicMsgResumeCounter shall be decremented on each invocation of FrTSyn_MainFunction , if no Timesync PDU is transmitted asyn- chronously.

requirement SWS_FrTSyn_00091 [SWS_FrTSyn_00091] 📄 PDF

If the cyclicMsgResumeCounter has reached a value equal or less than zero, FrTSyn shall resume cyclic Timesync message transmis- sion by sending either a SYNC or OFS message.

requirement SWS_FrTSyn_00092 [SWS_FrTSyn_00092] 📄 PDF

On an invocation of StbM_BusSetGlobalTime the member pathDelay of the measureDataPtr structure shall be set to 0.

requirement SWS_FrTSyn_00093 [SWS_FrTSyn_00093] 📄 PDF

If the cyclicMsgResumeCounter is started, FrTSyn shall stop cyclic Timesync message transmission.

requirement SWS_FrTSyn_00094 [SWS_FrTSyn_00094] 📄 PDF

If the SGW value (SYNC and OFS) is set to SyncToSubDo- main , the SYNC_TO_GATEWAY bit within timeBaseStatus shall be set to TRUE . Oth- erwise, it shall be set to FALSE .

requirement SWS_FrTSyn_00095 [SWS_FrTSyn_00095] 📄 PDF

The function FrTSyn_SetTransmissionMode shall inform the Det , if development error detection is enabled ( FrTSynDevErrorDetect is set to TRUE ) and if function call has failed because of the following reasons: • Invalid CtrlIdx (FRTSYN_E_INV_CTRL_IDX) • Invalid Mode (FRTSYN_E_PARAM)

requirement SWS_FrTSyn_00096 [SWS_FrTSyn_00096] 📄 PDF

The FrTSyn shall support Time Validation, if FrTSyn- TimeValidationSupport set to TRUE .

requirement SWS_FrTSyn_00097 [SWS_FrTSyn_00097] 📄 PDF

If • FrTSynTimeValidationSupport is enabled and • FrTSynEnableTimeValidation for the Time Domain is enabled FrTSyn shall do time recording for Time Validation for that Time Domain.

requirement SWS_FrTSyn_00098 [SWS_FrTSyn_00098] 📄 PDF

If • time recording for Time Validation is enabled for a Time Domain (refer to [SWS_FrTSyn_00096] and [SWS_FrTSyn_00097]) and • FrTSyn is configured as Time Slave for that Time Domain, FrTSyn shall call StbM_FrSetSlaveTimingData upon successful reception of a SYNC message. StbM_FrSetSlaveTimingData shall be called after StbM_BusSetGlobalTime .

requirement SWS_FrTSyn_00099 [SWS_FrTSyn_00099] 📄 PDF

Upon invocation of StbM_FrSetSlaveTimingData FrT- Syn shall pass following values • the Sequence Counter as received in the SYNC message, • the segment id of the physical channel on which the SYNC message has been received (refer to parameter FrTSynGlobalTimeNetworkSegmentId ) • currentCycle and currentMacroticks and FCNT as read upon reception of the SYNC message (refer to step 2 in [SWS_FrTSyn_00046]), • CycleLength and MacrotickDuration • the Sync ingress timestamp T1 VLT as retrieved in step 1 in [SWS_FrTSyn_00046]) • T0 as received in the SYNC message (refer to step 1 in [SWS_FrTSyn_00046]), by the parameter measureDataPtr . Struct members • measureDataPtr → referenceLocalTimestamp and • measureDataPtr → referenceGlobalTimestamp shall be passed as 0.

requirement SWS_FrTSyn_00100 [SWS_FrTSyn_00100] 📄 PDF

If • time recording for Time Validation is enabled for a Time Domain (refer to [SWS_FrTSyn_00096] and [SWS_FrTSyn_00097]) and • FrTSyn is configured as Time Master for that Time Domain, FrTSyn shall call StbM_FrSetMasterTimingData upon successful transmission of a SYNC message.

requirement SWS_FrTSyn_00101 [SWS_FrTSyn_00101] 📄 PDF

Upon invocation of StbM_FrSetMasterTimingData FrT- Syn shall pass the following data • the Sequence Counter as sent in the SYNC message • the segment id of the physical channel on which the SYNC message has been sent (refer to parameter FrTSynGlobalTimeNetworkSegmentId ) • currentCycle and currentMacroticks read upon construction of the Sync message (refer to step 2 in [SWS_FrTSyn_00028]), • cycleLength and macrotickDuration • the reference timestamp T1 VLT (refer to step 2 In [SWS_FrTSyn_00028]), • T0 as sent in the SYNC message (refer to step 3 In [SWS_FrTSyn_00028]), by the parameter measureDataPtr .

requirement SWS_FrTSyn_00102 [SWS_FrTSyn_00102] 📄 PDF

While a Time Base Timeout is present ( TIMEOUT bit is set in Time Base synchronization status timeBaseStatus ), FrTSyn shall discard SYNC (or OFS) messages until it has successfully validated (refer to [SWS_FrTSyn_00048]) 'n' consecutive SYNC (or OFS) messages ('n' is given by the parameter FrTSynGlob- alTimeSequenceCounterHysteresis ).

requirement SWS_FrTSyn_00103 [SWS_FrTSyn_00103] 📄 PDF

[SWS_FrTSyn_00103]) ⌋(RS_TS_20074) Refer to the chapter 10.2.5 in [7] for the configuration details of CSM job used for ICV generation.

requirement SWS_FrTSyn_00114 [SWS_FrTSyn_00114] 📄 PDF

[SWS_FrTSyn_00114] Upstream requirements: RS_TS_20074 ⌈When: • the FV is referenced (refer FrTSynIcvGenerationFvIdRef), • and the configured truncated FV length (StbMFreshnessValueTruncLength) is equal to the FV length (StbMFreshnessValueLength), the Time Master shall call StbM_GetTxFreshness to obtain the FV by using the StbMFreshnessValueId (referenced via the FrTSynIcvGenerationFvIdRef pa- rameter).⌋

requirement SWS_FrTSyn_00115 [SWS_FrTSyn_00115] 📄 PDF

[SWS_FrTSyn_00115] Upstream requirements: RS_TS_20074 ⌈When: • the FV is referenced (refer FrTSynIcvGenerationFvIdRef), • and the configured truncated FV length (StbMFreshnessValueTruncLength) < FV length (StbMFreshnessValueLength), the Time Master shall call StbM_GetTxFreshnessTruncData to obtain the FV and the truncated FV by using the StbMFreshnessValueId (referenced via the FrTSyn- IcvGenerationFvIdRef parameter).⌋ Note: Having the configured truncated FV length (StbMFreshnessValueTrun- cLength) > FV length (StbMFreshnessValueLength) in StbM is not a valid con- figuration. FlexRay

requirement SWS_FrTSyn_00116 [SWS_FrTSyn_00116] 📄 PDF

[SWS_FrTSyn_00116] Upstream requirements: RS_TS_20074 ⌈When the FV is not referenced (refer FrTSynIcvGenerationFvIdRef), the Time Master shall not include the FV in the ICV generation and neither in the SYNC mes- sage.⌋

requirement SWS_FrTSyn_00117 [SWS_FrTSyn_00117] 📄 PDF

[SWS_FrTSyn_00117] Upstream requirements: RS_TS_20074 ⌈If StbM_GetTxFreshness returns E_OK, the Time Master shall construct the SYNC message with FV and use the full FV in the ICV generation.⌋

requirement SWS_FrTSyn_00118 [SWS_FrTSyn_00118] 📄 PDF

[SWS_FrTSyn_00118] Upstream requirements: RS_TS_20074 ⌈If StbM_GetTxFreshnessTruncData returns E_OK, the Time Master shall con- struct the SYNC message with truncated FV and use the full FV in the ICV generation.⌋

requirement SWS_FrTSyn_00119 [SWS_FrTSyn_00119] 📄 PDF

[SWS_FrTSyn_00119] Upstream requirements: RS_TS_20074 ⌈When StbM_GetTxFreshness or StbM_GetTxFreshnessTruncData return a non-recoverable error code (i.e, E_NOT_OK), then the Time Master shall: • stop the ICV generation and set the FVL and the ICVL to 0 in the SYNC message, • call Det_ReportRuntimeError with parameter ErrorId set to FRTSYN_E_- FRESHNESSFAILURE (refer [SWS_FrTSyn_91000]), • call IdsM_SetSecurityEventWithContextData with parameter EventId set to SEV_TSYN_FR_FRESHNESS_NOT_AVAILABLE. ⌋ Refer to the chapter 10.2.5 in [7] for the configuration details of CSM job used for ICV generation.

requirement SWS_FrTSyn_00120 [SWS_FrTSyn_00120] 📄 PDF

[SWS_FrTSyn_00120] Upstream requirements: RS_TS_20074 ⌈If FrTSynIcvGenerationBase for the Time Domain is configured to ICV_MAC, the Time Master shall call Csm_MacGenerate to generate the ICV value.⌋ FlexRay

requirement SWS_FrTSyn_00121 [SWS_FrTSyn_00121] 📄 PDF

[SWS_FrTSyn_00121] Upstream requirements: RS_TS_20074 ⌈If FrTSynIcvGenerationBase for the Time Domain is configured to ICV_SIG- NATURE, the Time Master shall call Csm_SignatureGenerate to generate the ICV value.⌋ Note: The mode parameter is intentionally left open for the implementer to choose ( i.e. CRYPTO_OPERATIONMODE_SINGLECALL would possibly be the best option since it does not require further calls to CSM). The CSM job used to generate the ICV can be configured to synchronous or asyn- chronous behavior. The ICV generation timeout observation should be disabled, when the CSM job used to generate the ICV, is configured in synchronous behavior.

requirement SWS_FrTSyn_00122 [SWS_FrTSyn_00122] 📄 PDF

[SWS_FrTSyn_00122] Upstream requirements: RS_TS_20074 ⌈If FrTSynIcvGenerationTimeout is set to 0, the Time Master shall not do ICV generation timeout monitoring.⌋

requirement SWS_FrTSyn_00123 [SWS_FrTSyn_00123] 📄 PDF

[SWS_FrTSyn_00123] Upstream requirements: RS_TS_20074 ⌈If: • FrTSynIcvGenerationTimeout is set to any value greater than 0, • and Csm_MacGenerate or Csm_SignatureGenerate returns E_OK, the Time Master shall start the FrTSynIcvGenerationTimeout.⌋

requirement SWS_FrTSyn_00124 [SWS_FrTSyn_00124] 📄 PDF

[SWS_FrTSyn_00124] Upstream requirements: RS_TS_20074 ⌈If: • FrTSynIcvGenerationTimeout is set to any value greater than 0, • the callback FrTSyn_IcvGenerationIndication is called, the Time Master shall stop the FrTSynIcvGenerationTimeout.⌋

requirement SWS_FrTSyn_00125 [SWS_FrTSyn_00125] 📄 PDF

[SWS_FrTSyn_00125] Upstream requirements: RS_TS_20074 ⌈If one of the following conditions is true: • the authentication build counter has reached the configuration value FrTSynTx- AuthenticationBuildAttempts, FlexRay • the verification of the ICV has returned a non-recoverable error such as returning E_NOT_OK or KEY_FAILURE, • FrTSynIcvGenerationTimeout expires before the notification of the FrT- Syn_IcvGenerationIndication callback then the Time Master shall • stop the ICV generation and set the FVL and the ICVL to 0 in the SYNC message, • and call IdsM_SetSecurityEventWithContextData with parameter Even- tId set to SEV_TSYN_FR_ICV_GENERATION_FAILED. ⌋

requirement SWS_FrTSyn_00126 [SWS_FrTSyn_00126] 📄 PDF

[SWS_FrTSyn_00126] Upstream requirements: RS_TS_20074 ⌈With the notification of the FrTSyn_IcvGenerationIndication callback, the Time Master shall add the generated ICV to the SYNC message and transmit it.⌋

requirement SWS_FrTSyn_00127 [SWS_FrTSyn_00127] 📄 PDF

[SWS_FrTSyn_00127] Upstream requirements: RS_TS_20074 ⌈When the FV is referenced (refer FrTSynIcvGenerationFvIdRef), then the Time Master shall notify the successful transmission of the SYNC message to FVM by calling StbM_SPduTxConfirmation.⌋

requirement SWS_FrTSyn_00151 [SWS_FrTSyn_00151] 📄 PDF

[SWS_FrTSyn_00151] Upstream requirements: SRS_BSW_00323, SRS_BSW_00337, SRS_BSW_00386 ⌈The function FrTSyn_IcvGenerationIndication shall inform the Det, if devel- opment error detection is enabled (FrTSynDevErrorDetect is set to TRUE) and if the function call has failed because of the following reasons: • jobId is invalid (FRTSYN_E_PARAM) ⌋

requirement SWS_FrTSyn_00152 [SWS_FrTSyn_00152] 📄 PDF

[SWS_FrTSyn_00152] Upstream requirements: SRS_BSW_00323, SRS_BSW_00337 ⌈The function FrTSyn_IcvVerificationIndication shall inform the Det, if de- velopment error detection is enabled (FrTSynDevErrorDetect is set to TRUE) and if the function call has failed because of the following reasons: • jobId is invalid (FRTSYN_E_PARAM) ⌋

requirement SWS_FrTSyn_00153 [SWS_FrTSyn_00153] 📄 PDF

[SWS_FrTSyn_00153] Status: DRAFT Upstream requirements: RS_TS_20074 ⌈For every transmission of messages of type 0x50 and 0x60, the Time Master shall shall maintain an authentication build counter (refer to FrTSynTxAuthentication- BuildAttempts).⌋

requirement SWS_FrTSyn_00154 [SWS_FrTSyn_00154] 📄 PDF

[SWS_FrTSyn_00154] Status: DRAFT Upstream requirements: RS_TS_20074 ⌈Upon the initial processing of messages of type 0x50 and 0x60 (i.e., upon the first attempt of a freshness value and ICV generation for each received message) the Time Master shall set the authentication build counter to 0.⌋

requirement SWS_FrTSyn_00155 [SWS_FrTSyn_00155] 📄 PDF

[SWS_FrTSyn_00155]{DRAFT} ⌈If StbM_GetTxFreshness or StbM_Get- TxFreshnessTruncData return a recoverable error code (e.g., STBM_E_BUSY), then the Time Master shall increment the authentication build counter.⌋(RS_TS_20074)

requirement SWS_FrTSyn_00156 [SWS_FrTSyn_00156] 📄 PDF

[SWS_FrTSyn_00156]{DRAFT} ⌈If Csm_MacGenerate or Csm_SignatureGener- ate return a recoverable error code (e.g., E_BUSY, QUEUE_FULL), then the Time Mas- ter shall increment the authentication build counter.⌋(RS_TS_20074)

requirement SWS_FrTSyn_00171 [SWS_FrTSyn_00171] 📄 PDF

[SWS_FrTSyn_00171]{DRAFT} ⌈If • the generation of the authenticated message has failed • and the authentication build counter has not yet reached the configuration value FrTSynTxAuthenticationBuildAttempts, then the Time Master shall retry the freshness attempt and the ICV calculation in the next call of FrTSyn_MainFunction.⌋(RS_TS_20074)

requirement SWS_FrTSyn_00999 [SWS_FrTSyn_00999] 📄 PDF

These requirements on Time Synchronization from the RS Time Synchronization [1] are not applicable to FrTSyn , because they refer ei- ther to network types other than FlexRay or to the Time Base Manager mod- ule

requirement SWS_FrTSyn_91000 [SWS_FrTSyn_91000] 📄 PDF

[SWS_FrTSyn_91000]), • call IdsM_SetSecurityEventWithContextData with parameter EventId set to SEV_TSYN_FR_FRESHNESS_NOT_AVAILABLE. ⌋ Refer to the chapter 10.2.5 in [7] for the configuration details of CSM job used for ICV generation.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_FrTSyn
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_FrTSyn@rel:R20-11#d70684b5
Content hash
d70684b5
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_TimeSyncOverFlexRay.pdf#nameddest=SWS_FrTSyn_00063

주제 맵

요구사항

100
SWS_FrTSyn_00003SWS_FrTSyn_00006SWS_FrTSyn_00007SWS_FrTSyn_00009SWS_FrTSyn_00010SWS_FrTSyn_00011SWS_FrTSyn_00012SWS_FrTSyn_00013SWS_FrTSyn_00014SWS_FrTSyn_00015SWS_FrTSyn_00018SWS_FrTSyn_00019SWS_FrTSyn_00020SWS_FrTSyn_00021SWS_FrTSyn_00022SWS_FrTSyn_00023SWS_FrTSyn_00025SWS_FrTSyn_00026SWS_FrTSyn_00027SWS_FrTSyn_00028SWS_FrTSyn_00029SWS_FrTSyn_00030SWS_FrTSyn_00031SWS_FrTSyn_00035SWS_FrTSyn_00036SWS_FrTSyn_00037SWS_FrTSyn_00038SWS_FrTSyn_00039SWS_FrTSyn_00040SWS_FrTSyn_00041SWS_FrTSyn_00042SWS_FrTSyn_00043SWS_FrTSyn_00044SWS_FrTSyn_00045SWS_FrTSyn_00046SWS_FrTSyn_00047SWS_FrTSyn_00048SWS_FrTSyn_00049SWS_FrTSyn_00050SWS_FrTSyn_00054SWS_FrTSyn_00055SWS_FrTSyn_00056SWS_FrTSyn_00057SWS_FrTSyn_00058SWS_FrTSyn_00059SWS_FrTSyn_00060SWS_FrTSyn_00067SWS_FrTSyn_00070SWS_FrTSyn_00072SWS_FrTSyn_00074SWS_FrTSyn_00075SWS_FrTSyn_00077SWS_FrTSyn_00078SWS_FrTSyn_00079SWS_FrTSyn_00080SWS_FrTSyn_00081SWS_FrTSyn_00082SWS_FrTSyn_00084SWS_FrTSyn_00085SWS_FrTSyn_00086SWS_FrTSyn_00087SWS_FrTSyn_00088SWS_FrTSyn_00089SWS_FrTSyn_00090SWS_FrTSyn_00091SWS_FrTSyn_00092SWS_FrTSyn_00093SWS_FrTSyn_00094SWS_FrTSyn_00095SWS_FrTSyn_00096SWS_FrTSyn_00097SWS_FrTSyn_00098SWS_FrTSyn_00099SWS_FrTSyn_00100SWS_FrTSyn_00101SWS_FrTSyn_00102SWS_FrTSyn_00103SWS_FrTSyn_00114SWS_FrTSyn_00115SWS_FrTSyn_00116SWS_FrTSyn_00117SWS_FrTSyn_00118SWS_FrTSyn_00119SWS_FrTSyn_00120SWS_FrTSyn_00121SWS_FrTSyn_00122SWS_FrTSyn_00123SWS_FrTSyn_00124SWS_FrTSyn_00125SWS_FrTSyn_00126SWS_FrTSyn_00127SWS_FrTSyn_00151SWS_FrTSyn_00152SWS_FrTSyn_00153SWS_FrTSyn_00154SWS_FrTSyn_00155SWS_FrTSyn_00156SWS_FrTSyn_00171SWS_FrTSyn_00999SWS_FrTSyn_91000

상세 보기

개요에서 항목을 선택하세요.

초기화 및 상태

Returns the version information of this module.

void FrTSyn_GetVersionInfo(Std_VersionInfoType* versioninfo);

This function initializes the Time Synchronization over FlexRay.

void FrTSyn_Init(const FrTSyn_ConfigType* configPtr);

서비스

By this API service the FrTSyn gets an indication and the result of ICV generation.

void FrTSyn_IcvGenerationIndication(uint32 jobId, Crypto_ResultType result);

By this API service the FrTSyn gets an indication and the result of ICV verification.

void FrTSyn_IcvVerificationIndication(uint32 jobId, Crypto_ResultType result);

This API is used to turn on and off the TX capabilities of the FrTSyn.

void FrTSyn_SetTransmissionMode(uint8 CtrlIdx, FrTSyn_TransmissionModeType Mode);

콜백

Indication of a received PDU from a lower layer communication interface module.

void FrTSyn_RxIndication(PduIdType RxPduId, const PduInfoType* PduInfoPtr);

Within this API, the upper layer module (called module) shall check whether the available data fits into the buffer size reported by PduInfoPtr->SduLength. If it fits, it shall copy its data into the buffer provided by PduInfoPtr->SduDataPtr and update the length of the actual copied data in PduInfoPtr->SduLength. If not, it returns E_NOT_OK without changing PduInfoPtr.

Std_ReturnType FrTSyn_TriggerTransmit(PduIdType TxPduId, PduInfoType* PduInfoPtr);

주기적

Main function for cyclic call / resp. Timesync message transmission

void FrTSyn_MainFunction(void);

타입

This is the base type for the configuration of the Time Synchronization over FlexRay. A pointer to an instance of this structure will be used in the initialization of the Time Synchronization over FlexRay. The content of this structure is defined in chapter 10 Configuration specification.

Handles the enabling and disabling of the transmission mode

요구사항

SWS_FrTSyn_00003 requirement

A call to FrTSyn_Init initializes all internal vari- ables and sets the Time Synchronization over FlexRay to the initialized state.

SWS_FrTSyn_00006 requirement

The Sequence Counter ( SC ) shall be initialized with 0.

SWS_FrTSyn_00007 requirement

The byte order for time values inside Time Synchronization messages is "Big Endian".

SWS_FrTSyn_00009 requirement

The PayloadLength is 16.

SWS_FrTSyn_00010 requirement

Time Synchronization messages contain User Data according to the given message format.

SWS_FrTSyn_00011 requirement

User Data shall be read consistently from the incoming Time Synchronization messages.

SWS_FrTSyn_00012 requirement

User Data shall be written consistently to outgoing Time Syn- chronization messages. If the number of User Data Fields in a Time Synchronization message is greater than the number of User Data Bytes provided by the StbM, the remaining User Data Fields shall be set to 0 (default value).

SWS_FrTSyn_00013 requirement

User Data shall be mapped to the StbM_UserDataType , where the byte number given in the message and by the StbM_UserDataType shall match (User Byte 0 mapped to StbM_UserDataType . userByte0 etc.). StbM_- UserDataType . userDataLength shall be set to the Time Synchronization message type specific number of User Bytes.

SWS_FrTSyn_00014 requirement

0 Type 0x10 Message Type 1 User Byte 2 default: 0 2 7..4 D 0..15 Time Domain Id 3..0 SC 0..15 Sequence Counter 3 7..2 FCNT 0..63 FlexRay Cycle Counter 1 SGW 0 = SyncToGTM 1 = SyncToSubDomain 0 reserved 0 4 User Byte 0 default: 0 5 User Byte 1 default: 0 6..11 SyncTimeSec 48 Bit time value in seconds 12..15 SyncTimeNSec 32 Bit time value in nanoseconds Table 7.1: SYNC not CRC secured message format

SWS_FrTSyn_00015 requirement

0 Type 0x20 Message Type 1 CRC 0..255 Checksum 2 7..4 D 0..15 Time Domain Id 3..0 SC 0..15 Sequence Counter 3 7..2 FCNT 0..63 FlexRay Cycle Counter 1 SGW 0 = SyncToGTM 1 = SyncToSubDomain 0 reserved 0 4 User Byte 0 default: 0 5 User Byte 1 default: 0 6..11 SyncTimeSec 48 Bit time value in seconds 12..15 SyncTimeNSec 32 Bit time value in nanoseconds Table 7.2: SYNC CRC secured message format

SWS_FrTSyn_00018 requirement

A Time Synchronization message sequence consists of a SYNC message per Time Domain.

SWS_FrTSyn_00019 requirement

For each configured Time Master (refer to FrTSynGlobal- TimeMaster ) the FrTSyn module shall periodically transmit SYNC messages with the cycle FrTSynGlobalTimeTxPeriod including the time value, which will be valid at the start of the next FlexRay cycle 0 and User Data, if the GLOBAL_TIME_BASE bit within the timeBaseStatus is set and FrTSynGlobalTimeTxPeriod is unequal to 0 and if the associated cyclicMsgResumeCounter is not running. The cyclic transmission shall be started in the earliest possible FrT- Syn_MainFunction call once the requirements above are fulfilled.

SWS_FrTSyn_00020 requirement

The SGW value (Time Gateway synchronization status) shall be retrieved from the Time Base synchronization status. If the SYNC_TO_GATEWAY bit within timeBaseStatus is not set the SGW value shall be SyncToGTM . Otherwise the SGW value shall be set to SyncToSubDomain .

SWS_FrTSyn_00021 requirement

Depending on FrTSynGlobalTimeTxCrcSecured the SYNC message shall be of type: FrTSynGlobalTimeTxCrcSecured Value SYNC Message Type CRC_NOT_SUPPORTED 0x10 SYNC not CRC secured message CRC_SUPPORTED 0x20 SYNC CRC secured message Table 7.5

SWS_FrTSyn_00022 requirement

An offset message sequence consists of an OFS message per Time Domain.

SWS_FrTSyn_00023 requirement

For each configured Time Master ( FrTSynGlobalTimeMas- ter ) the FrTSyn module shall periodically transmit OFS messages with the cycle FrTSynGlobalTimeTxPeriod ) including the Offset Time value and User Data, if the GLOBAL_TIME_BASE bit within the timeBaseStatus is set and FrTSynGlobal- TimeTxPeriod is unequal to 0 and if the associated cyclicMsgResumeCounter is not running. The cyclic transmission shall be started in the earliest possible FrTSyn_MainFunc- tion call once the requirements above are fulfilled.

SWS_FrTSyn_00025 requirement

Depending on FrTSynGlobalTimeTxCrcSecured the OFS message shall be of type: FrTSynGlobalTimeTxCrcSecured Value OFS Message Type CRC_NOT_SUPPORTED 0x34 OFS not CRC secured message CRC_SUPPORTED 0x44 OFS CRC secured message Table 7.6

SWS_FrTSyn_00026 requirement

If FrTSyn_SetTransmissionMode(Controller, Mode) is called and parameter Mode equals FRTSYN_TX_OFF , all trans- mit requests from FrTSyn shall be omitted on this FlexRay channel.

SWS_FrTSyn_00027 requirement

If FrTSyn_SetTransmissionMode(Controller, Mode) is called and parameter Mode equals FRTSYN_TX_ON , all transmit re- quests from FrTSyn on this FlexRay channel shall be able to be transmitted.

SWS_FrTSyn_00028 requirement

The transmitter of a Synchronized Time Base (Time Master) shall perform the following steps to distribute the Synchronized Time Base: 1. Retrieve current Synchronized Time Base's Time Tuple as [T SYNC ;T0 VLT ] via StbM_BusGetCurrentTime 2. Protect the following two steps against interruptions: (a) Get currentCycle and currentMacroticks via FrIf_GetGlobal- Time (b) Retrieve current Virtual Local Time value as T1 VLT via StbM_GetCur- rentVirtualLocalTime 3. Calculate the (future) time value of the Time Base at the start of the next FlexRay cycle by T0 = T SYNC + (T1 VLT - T0 VLT ) + (64 - currentCycle ) * CycleLength - ( CycleLength / MacroticksPerCycle ) * currentMacroticks 4. Calculate SyncTimeSec (second portion of T0) and SyncTimeNSec (nanosec- ond portion of T0)

SWS_FrTSyn_00029 requirement

The transmitter of an Offset Time Base (Time Master) shall perform the following steps to distribute the Offset Time Base: 1. Retrieve current Offset Time via StbM_GetOffset 2. Write second portion of the Offset Time to OfsTimeSec 3. Write nanosecond portion of the Offset Time to OfsTimeNSec

SWS_FrTSyn_00030 requirement

A Sequence Counter ( SC ) of 4 bit is representing numbers from 0 to 15 per Time Domain. The Sequence Counter shall be independent be- tween SYNC and OFS messages and shall be incremented by 1 on every transmis- sion request of a SYNC or OFS message. It shall wrap around at 15 to 0 again.

SWS_FrTSyn_00031 requirement

The function Crc_CalculateCRC8H2F as defined in [6] shall be used to calculate the CRC , if configured.

SWS_FrTSyn_00035 requirement

The DataID shall be calculated as DataID = Data IDList[SC] , where DataIDList is given by configuration for each message type (refer to FrTSynGlobalTimeSyncDataIDList and FrTSynGlobalTimeOfs- DataIDList ).

SWS_FrTSyn_00036 requirement

The CRC shall be calculated over Time Synchroniza- tion message Byte 2 to Byte 15 and DataID , where Byte 2 is applied first, followed by the other bytes in ascending order, and DataID last.

SWS_FrTSyn_00037 requirement

For each transmission of a Time Synchronization message the FrTSyn module shall assemble the message as follows: • Calculate SC • Copy currentCycle (refer to [SWS_FrTSyn_00028]) to FCNT (for SYNC mes- sage) • Calculate SGW • Copy all data to the appropriate position within the related message • Calculate CRC (configuration dependent)

SWS_FrTSyn_00038 requirement

The FrTSyn shall only accept a SYNC message with Type equal to 0x20 and a correct CRC value if FrTSynRxCrcValidated is configured to CRC_VALIDATED .

SWS_FrTSyn_00039 requirement

The FrTSyn shall only accept a SYNC message with Type equal to 0x10 if FrTSynRxCrcValidated is configured to CRC_NOT_VALIDATED .

SWS_FrTSyn_00040 requirement

The FrTSyn shall only accept a SYNC message with Type equal to 0x10 or 0x20 if FrTSynRxCrcValidated is configured to CRC_IGNORED .

SWS_FrTSyn_00041 requirement

For valid SYNC messages a new Time Tuple, consisting of the Global Time value and the associated value of the Virtual Local Time, shall be calculated and forwarded to the StbM module via StbM_BusSetGlobalTime .

SWS_FrTSyn_00042 requirement

The FrTSyn shall only accept an OFS message with Type equal to 0x44 and a correct CRC value if FrTSynRxCrcValidated is configured to CRC_VALIDATED .

SWS_FrTSyn_00043 requirement

The FrTSyn shall only accept an OFS message with Type equal to 0x34 if FrTSynRxCrcValidated is configured to CRC_NOT_VALIDATED .

SWS_FrTSyn_00044 requirement

The FrTSyn shall only accept an OFS message with Type equal to 0x34 or 0x44 if FrTSynRxCrcValidated is configured to CRC_IGNORED .

SWS_FrTSyn_00045 requirement

For valid OFS messages a new Time Tuple, consisting of the Offset Time value and the associated value of the Virtual Local Time, shall be calculated (according [SWS_FrTSyn_00047]) and forwarded to the StbM module via StbM_BusSetGlobalTime .

SWS_FrTSyn_00046 requirement

The receiver of a Synchronized Time Base shall perform the following steps to assemble the Synchronized Time Base: 1. On SYNC message RX indication (or in the subsequent MainFunction call) store received time value T0 ( SyncTimeSec , SyncTimeNSec ) 2. Protect the following two steps against interruptions: (a) Get currentCycle and currentMacroticks via FrIf_GetGlobal- Time (b) Retrieve current Virtual Local Time value as T1 VLT via StbM_GetCur- rentVirtualLocalTime 3. Calculate Time Tuple [T1; T1 VLT ] to update the Time Slave's local instance of the Time Base: (a) T1 = T0 + ( CycleLength * currentCycle ) + (( CycleLength / MacrotickPerCycle ) * currentMacroticks ) (b) If currentCycle is greater or equal than the retrieved FCNT value from the transmitter (Time Master), then the calculated value T1 shall be subtracted by 64 times the FlexRay cycle duration: T1 = T1 - ( CycleLength * 64)

SWS_FrTSyn_00047 requirement

The receiver of an Offset Time Base shall perform the follow- ing steps to assemble the Offset Time: 1. Get second portion of the Offset Time out of OfsTimeSec 2. Get nanosecond portion of the Offset Time out of OfsTimeNSec 3. Retrieve current Virtual Local Time value via StbM_GetCurrentVirtualLo- calTime

SWS_FrTSyn_00048 requirement

The Sequence Counter Jump Width between two consecutive SYNC or two consecutive OFS messages of the same Time Domain shall be greater than 0 and smaller than or equal to FrTSynGlobalTimeSequenceCounterJump- Width . Otherwise a Time Slave shall discard the respective SYNC / OFS message. If the FrTSynGlobalTimeSequenceCounterJumpWidth value is set to 0, the Time Slave shall not do Sequence Counter Jump Width checks.

SWS_FrTSyn_00049 requirement

Upon reception of a SYNC (or OFS) message a Time Slave shall check the Sequence Counter of the received message per Time Domain against the configured value of FrTSynGlobalTimeSequenceCounterJumpWidth (ac- cording to [SWS_FrTSyn_00048]), unless it is the first message • at Startup or • after a Time Base update timeout has been detected ( TIMEOUT bit set in Time Base synchronization status timeBaseStatus ).

SWS_FrTSyn_00050 requirement

The function Crc_CalculateCRC8H2F as defined in [6] shall be used to validate the CRC , if configured.

SWS_FrTSyn_00054 requirement

The DataID shall be calculated as DataID = DataIDList [SC] , where DataIDList is given by configuration for each message Type .

SWS_FrTSyn_00055 requirement

The CRC shall be calculated over Time Synchroniza- tion message Byte 2 to Byte 15 and DataID , where Byte 2 is applied first, followed by the other bytes in ascending order, and DataID last.

SWS_FrTSyn_00056 requirement

For each received Time Synchronization message the FrT- Syn shall validate the message as follows (all conditions must match): 1. Type matches depending on the FrTSynRxCrcValidated parameter 2. SC value is within the accepted range (refer to [SWS_FrTSyn_00048] and [SWS_FrTSyn_00049]) 3. D matches to the defined Time Domain range for each Type 4. D matches to one of the configured Time Domains 5. SyncTimeNSec (SYNC message) or OfsTimeNSec (OFS message) matches the defined range of StbM_TimeStampType . nanoseconds . 6. CRC (including DataID ) matches depending on the FrTSynRxCrcValidated parameter.

SWS_FrTSyn_00057 requirement

For each received Time Synchronization message the FrTSyn shall disassemble the message after successful validation [SWS_FrTSyn_00056].

SWS_FrTSyn_00058 requirement

On errors and exceptions, the FrTSyn module shall not mod- ify its current module state but shall simply report the error event.

SWS_FrTSyn_00059 requirement

Type of error Related error code Error value API service called with wrong PDU or SDU. FRTSYN_E_INVALID_PDUID 0x01 API service used in un-initialized state FRTSYN_E_UNINIT 0x20 A pointer is invalid FRTSYN_E_NULL_POINTER 0x21 Type of error Related error code Error value FrTSyn initialization failed FRTSYN_E_INIT_FAILED 0x22 API called with invalid parameter FRTSYN_E_PARAM 0x23 Invalid Controller index FRTSYN_E_INV_CTRL_IDX 0x24

SWS_FrTSyn_00060 requirement

Module Header File Imported Type ComStack_Types.h PduIdType ComStack_Types ComStack_Types.h PduInfoType Module Header File Imported Type ComStack_Types.h PduLengthType FrIf FrIf.h FrIf_StateType Rte_StbM_Type.h StbM_FrTimeMasterMeasurementType Rte_StbM_Type.h StbM_FrTimeSlaveMeasurementType Rte_StbM_Type.h StbM_SynchronizedTimeBaseType Rte_StbM_Type.h StbM_TimeBaseStatusType Rte_StbM_Type.h StbM_TimeStampShortType Rte_StbM_Type.h StbM_TimeStampType Rte_StbM_Type.h StbM_UserDataType StbM.h StbM_MeasurementType StbM StbM.h StbM_VirtualLocalTimeType Std_Types.h Std_ReturnType Std Std_Types.h Std_VersionInfoType

SWS_FrTSyn_00067 requirement

The callback function FrTSyn_RxIndication shall inform the Det , if development error detection is enabled FrTSynDevErrorDetect is set to TRUE ) and if function call has failed because of the following reasons: • Invalid RxPduId (FRTSYN_E_INVALID_PDUID) • PduInfoPtr or SduDataPtr equals NULL_PTR (FRTSYN_E_NULL_ POINTER)

SWS_FrTSyn_00070 requirement

The callback function FrTSyn_TriggerTransmit shall in- form the Det , if development error detection is enabled FrTSynDevErrorDetect is set to TRUE ) and if function call has failed because of the following reasons: • Invalid TxPduId (FRTSYN_E_INVALID_PDUID) • PduInfoPtr or SduDataPtr equals NULL_PTR (FRTSYN_E_NULL_ POINTER)

SWS_FrTSyn_00072 requirement

The frequency of invocations of FrTSyn_MainFunction is determined by the configuration parameter FrTSynMainFunctionPeriod .

SWS_FrTSyn_00074 requirement

FrIf_GetCycleLength FrIf.h This API returns the configured time of the configuration parameter "GdCycle" in nanoseconds for the FlexRay controller with index FrIf_CtrlIdx. FrIf_GetGlobalTime FrIf.h Wraps the FlexRay Driver API function Fr_Get GlobalTime(). Important Note: FrIf_GetGlobalTime may be called within an exclusive area. FrIf_GetMacrotickDuration FrIf.h Retrieves the Duration of a Macrotick in ns FrIf_GetMacroticksPerCycle FrIf.h Retrieves the amount of Macroticks per Cycle FrIf_GetState FrIf.h Get current FrIf state. StbM_GetCurrentVirtualLocalTime StbM.h Returns the Virtual Local Time of the referenced Time Base.

SWS_FrTSyn_00075 requirement

Crc_CalculateCRC8H2F Crc.h This service makes a CRC8 calculation with the Polynomial 0x2F on Crc_Length Det_ReportError Det.h Service to report development errors. FrIf_Transmit FrIf.h Requests transmission of a PDU. StbM_BusGetCurrentTime StbM.h Returns the current Time Tuple, status and User Data of the Time Base. StbM_BusSetGlobalTime StbM.h Allows the Time Base Provider Modules to forward a new Global Time tuple (i.e., Rx Time Tuple) to the StbM. StbM_FrSetMasterTimingData (draft) StbM_FrTSyn.h Provides Flexray Timesyn module specific data for a Time Master to the StbM. Tags: atp.Status=draft StbM_FrSetSlaveTimingData (draft) StbM_FrTSyn.h Allows the FrTSyn Module to forward Flexray specific details to the StbM. Tags: atp.Status=draft StbM_GetCurrentTime StbM.h Returns a time value (Local Time Base derived from Global Time Base) in standard format. Note: This API shall be called with locked interrupts / within an Exclusive Area to prevent interruption (i.e., the risk that the time stamp is outdated on return of the function call). StbM_GetOffset StbM.h Allows the Timesync Modules to get the current Offset Time and User Data. StbM_GetTimeBaseStatus StbM.h Returns detailed status information for a Synchronized (or Pure Local) Time Base and, if called for an Offset Time Base, for the Offset Time Base and the underlying Synchronized Time Base. StbM_GetTimeBaseUpdateCounter StbM.h Allows the Timesync Modules to detect, whether a Time Base should be transmitted immediately in the subsequent <Bus>TSyn_MainFunction() cycle.

SWS_FrTSyn_00077 requirement

The Time Synchronization over FlexRay shall support the configuration for Time Master, Time Slave and Time Gateway.

SWS_FrTSyn_00078 requirement

The FrTSyn module shall call FrIf_GetGlobalTime only if FrIf_GetState returns FRIF_STATE_ONLINE . This is to ensure that FrIf_Get- GlobalTime returns valid time information, i.e. that the FlexRay communication con- troller is synchronous to the FlexRay global time.

SWS_FrTSyn_00079 requirement

0 Type 0x34 Message Type 1 User Byte 2 default: 0 2 7..4 D 16..31 Time Domain Id 3..0 SC 0..15 Sequence Counter 3 7..2 reserved 0 1 SGW 0 = SyncToGTM 1 = SyncToSubDomain 0 reserved 0 4 User Byte 0 default: 0 5 User Byte 1 default: 0 6 reserved 0 7 reserved 0 8..11 OfsTimeSec 32 Bit offset time value in seconds 12..15 OfsTimeNSec 32 Bit offset time value in nanoseconds Table 7.3: OFS not CRC secured message format

SWS_FrTSyn_00080 requirement

0 Type 0x44 Message Type 1 CRC 0..255 Checksum 2 7..4 D 16..31 Time Domain Id 3..0 SC 0..15 Sequence Counter 3 7..2 reserved 0 1 SGW 0 = SyncToGTM 1 = SyncToSubDomain 0 reserved 0 4 User Byte 0 default: 0 5 User Byte 1 default: 0 6 reserved 0 7 reserved 0 8..11 OfsTimeSec 32 Bit offset time value in seconds 12..15 OfsTimeNSec 32 Bit offset time value in nanoseconds Table 7.4: OFS CRC secured message format

SWS_FrTSyn_00081 requirement

The FrTSyn shall only accept a SYNC message with Type equal to 0x10 or a SYNC message with Type equal to 0x20 and a correct CRC value if FrTSynRxCrcValidated is configured to CRC_OPTIONAL .

SWS_FrTSyn_00082 requirement

The FrTSyn shall only accept an OFS message with Type equal to 0x34 or an OFS message with Type equal to 0x44 and a correct CRC value if FrTSynRxCrcValidated is configured to CRC_OPTIONAL .

SWS_FrTSyn_00084 requirement

If FrTSynGlobalTimeDebounceTime ) is greater than 0 for a Time Base, FrTSyn shall always do debouncing for the corresponding Timesync PDUs as described below, otherwise FrTSyn shall not do any debouncing.

SWS_FrTSyn_00085 requirement

FrTSynGlobalTimeDebounceTime represents the de- bounce value of a debounceCounter of a Time Base. FrTSyn shall reload the de- bounceCounter after a Timesync PDU for the corresponding Time Base (SYNC and OFS) has been sent. FrTSyn shall decrement the debounceCounter value on each invocation of FrTSyn_MainFunction , if no Timesync PDU is transmitted.

SWS_FrTSyn_00086 requirement

A new Timesync PDU shall only be sent if the corresponding debounceCounter has a value equal or less than zero.

SWS_FrTSyn_00087 requirement

If FrTSynImmediateTimeSync is set to TRUE for a Time Base, FrTSyn shall check on each FrTSyn_MainFunction call by calling StbM_- GetTimeBaseUpdateCounter , if the timeBaseUpdateCounter of the corre- sponding Time Base has changed.

SWS_FrTSyn_00088 requirement

If FrTSynImmediateTimeSync is set to TRUE and the time BaseUpdateCounter of a Time Base has changed and the GLOBAL_TIME_BASE bit of the timeBaseStatus is set, FrTSyn shall trigger an immediate transmission of Time Synchronization messages for the corresponding Time Base.

SWS_FrTSyn_00089 requirement

If FrTSynImmediateTimeSync is set to TRUE , cyclicMs- gResumeCounter and FrTSynCyclicMsgResumeTime shall be considered.

SWS_FrTSyn_00090 requirement

FrTSynCyclicMsgResumeTime represents the timeout value of a cyclicMsgResumeCounter that shall be started when either a SYNC or OFS message has been sent immediately, asynchronous to the cyclic Timesync message transmission. cyclicMsgResumeCounter shall be decremented on each invocation of FrTSyn_MainFunction , if no Timesync PDU is transmitted asyn- chronously.

SWS_FrTSyn_00091 requirement

If the cyclicMsgResumeCounter has reached a value equal or less than zero, FrTSyn shall resume cyclic Timesync message transmis- sion by sending either a SYNC or OFS message.

SWS_FrTSyn_00092 requirement

On an invocation of StbM_BusSetGlobalTime the member pathDelay of the measureDataPtr structure shall be set to 0.

SWS_FrTSyn_00093 requirement

If the cyclicMsgResumeCounter is started, FrTSyn shall stop cyclic Timesync message transmission.

SWS_FrTSyn_00094 requirement

If the SGW value (SYNC and OFS) is set to SyncToSubDo- main , the SYNC_TO_GATEWAY bit within timeBaseStatus shall be set to TRUE . Oth- erwise, it shall be set to FALSE .

SWS_FrTSyn_00095 requirement

The function FrTSyn_SetTransmissionMode shall inform the Det , if development error detection is enabled ( FrTSynDevErrorDetect is set to TRUE ) and if function call has failed because of the following reasons: • Invalid CtrlIdx (FRTSYN_E_INV_CTRL_IDX) • Invalid Mode (FRTSYN_E_PARAM)

SWS_FrTSyn_00096 requirement

The FrTSyn shall support Time Validation, if FrTSyn- TimeValidationSupport set to TRUE .

SWS_FrTSyn_00097 requirement

If • FrTSynTimeValidationSupport is enabled and • FrTSynEnableTimeValidation for the Time Domain is enabled FrTSyn shall do time recording for Time Validation for that Time Domain.

SWS_FrTSyn_00098 requirement

If • time recording for Time Validation is enabled for a Time Domain (refer to [SWS_FrTSyn_00096] and [SWS_FrTSyn_00097]) and • FrTSyn is configured as Time Slave for that Time Domain, FrTSyn shall call StbM_FrSetSlaveTimingData upon successful reception of a SYNC message. StbM_FrSetSlaveTimingData shall be called after StbM_BusSetGlobalTime .

SWS_FrTSyn_00099 requirement

Upon invocation of StbM_FrSetSlaveTimingData FrT- Syn shall pass following values • the Sequence Counter as received in the SYNC message, • the segment id of the physical channel on which the SYNC message has been received (refer to parameter FrTSynGlobalTimeNetworkSegmentId ) • currentCycle and currentMacroticks and FCNT as read upon reception of the SYNC message (refer to step 2 in [SWS_FrTSyn_00046]), • CycleLength and MacrotickDuration • the Sync ingress timestamp T1 VLT as retrieved in step 1 in [SWS_FrTSyn_00046]) • T0 as received in the SYNC message (refer to step 1 in [SWS_FrTSyn_00046]), by the parameter measureDataPtr . Struct members • measureDataPtr → referenceLocalTimestamp and • measureDataPtr → referenceGlobalTimestamp shall be passed as 0.

SWS_FrTSyn_00100 requirement

If • time recording for Time Validation is enabled for a Time Domain (refer to [SWS_FrTSyn_00096] and [SWS_FrTSyn_00097]) and • FrTSyn is configured as Time Master for that Time Domain, FrTSyn shall call StbM_FrSetMasterTimingData upon successful transmission of a SYNC message.

SWS_FrTSyn_00101 requirement

Upon invocation of StbM_FrSetMasterTimingData FrT- Syn shall pass the following data • the Sequence Counter as sent in the SYNC message • the segment id of the physical channel on which the SYNC message has been sent (refer to parameter FrTSynGlobalTimeNetworkSegmentId ) • currentCycle and currentMacroticks read upon construction of the Sync message (refer to step 2 in [SWS_FrTSyn_00028]), • cycleLength and macrotickDuration • the reference timestamp T1 VLT (refer to step 2 In [SWS_FrTSyn_00028]), • T0 as sent in the SYNC message (refer to step 3 In [SWS_FrTSyn_00028]), by the parameter measureDataPtr .

SWS_FrTSyn_00102 requirement

While a Time Base Timeout is present ( TIMEOUT bit is set in Time Base synchronization status timeBaseStatus ), FrTSyn shall discard SYNC (or OFS) messages until it has successfully validated (refer to [SWS_FrTSyn_00048]) 'n' consecutive SYNC (or OFS) messages ('n' is given by the parameter FrTSynGlob- alTimeSequenceCounterHysteresis ).

SWS_FrTSyn_00103 requirement

[SWS_FrTSyn_00103]) ⌋(RS_TS_20074) Refer to the chapter 10.2.5 in [7] for the configuration details of CSM job used for ICV generation.

SWS_FrTSyn_00114 requirement

[SWS_FrTSyn_00114] Upstream requirements: RS_TS_20074 ⌈When: • the FV is referenced (refer FrTSynIcvGenerationFvIdRef), • and the configured truncated FV length (StbMFreshnessValueTruncLength) is equal to the FV length (StbMFreshnessValueLength), the Time Master shall call StbM_GetTxFreshness to obtain the FV by using the StbMFreshnessValueId (referenced via the FrTSynIcvGenerationFvIdRef pa- rameter).⌋

SWS_FrTSyn_00115 requirement

[SWS_FrTSyn_00115] Upstream requirements: RS_TS_20074 ⌈When: • the FV is referenced (refer FrTSynIcvGenerationFvIdRef), • and the configured truncated FV length (StbMFreshnessValueTruncLength) < FV length (StbMFreshnessValueLength), the Time Master shall call StbM_GetTxFreshnessTruncData to obtain the FV and the truncated FV by using the StbMFreshnessValueId (referenced via the FrTSyn- IcvGenerationFvIdRef parameter).⌋ Note: Having the configured truncated FV length (StbMFreshnessValueTrun- cLength) > FV length (StbMFreshnessValueLength) in StbM is not a valid con- figuration. FlexRay

SWS_FrTSyn_00116 requirement

[SWS_FrTSyn_00116] Upstream requirements: RS_TS_20074 ⌈When the FV is not referenced (refer FrTSynIcvGenerationFvIdRef), the Time Master shall not include the FV in the ICV generation and neither in the SYNC mes- sage.⌋

SWS_FrTSyn_00117 requirement

[SWS_FrTSyn_00117] Upstream requirements: RS_TS_20074 ⌈If StbM_GetTxFreshness returns E_OK, the Time Master shall construct the SYNC message with FV and use the full FV in the ICV generation.⌋

SWS_FrTSyn_00118 requirement

[SWS_FrTSyn_00118] Upstream requirements: RS_TS_20074 ⌈If StbM_GetTxFreshnessTruncData returns E_OK, the Time Master shall con- struct the SYNC message with truncated FV and use the full FV in the ICV generation.⌋

SWS_FrTSyn_00119 requirement

[SWS_FrTSyn_00119] Upstream requirements: RS_TS_20074 ⌈When StbM_GetTxFreshness or StbM_GetTxFreshnessTruncData return a non-recoverable error code (i.e, E_NOT_OK), then the Time Master shall: • stop the ICV generation and set the FVL and the ICVL to 0 in the SYNC message, • call Det_ReportRuntimeError with parameter ErrorId set to FRTSYN_E_- FRESHNESSFAILURE (refer [SWS_FrTSyn_91000]), • call IdsM_SetSecurityEventWithContextData with parameter EventId set to SEV_TSYN_FR_FRESHNESS_NOT_AVAILABLE. ⌋ Refer to the chapter 10.2.5 in [7] for the configuration details of CSM job used for ICV generation.

SWS_FrTSyn_00120 requirement

[SWS_FrTSyn_00120] Upstream requirements: RS_TS_20074 ⌈If FrTSynIcvGenerationBase for the Time Domain is configured to ICV_MAC, the Time Master shall call Csm_MacGenerate to generate the ICV value.⌋ FlexRay

SWS_FrTSyn_00121 requirement

[SWS_FrTSyn_00121] Upstream requirements: RS_TS_20074 ⌈If FrTSynIcvGenerationBase for the Time Domain is configured to ICV_SIG- NATURE, the Time Master shall call Csm_SignatureGenerate to generate the ICV value.⌋ Note: The mode parameter is intentionally left open for the implementer to choose ( i.e. CRYPTO_OPERATIONMODE_SINGLECALL would possibly be the best option since it does not require further calls to CSM). The CSM job used to generate the ICV can be configured to synchronous or asyn- chronous behavior. The ICV generation timeout observation should be disabled, when the CSM job used to generate the ICV, is configured in synchronous behavior.

SWS_FrTSyn_00122 requirement

[SWS_FrTSyn_00122] Upstream requirements: RS_TS_20074 ⌈If FrTSynIcvGenerationTimeout is set to 0, the Time Master shall not do ICV generation timeout monitoring.⌋

SWS_FrTSyn_00123 requirement

[SWS_FrTSyn_00123] Upstream requirements: RS_TS_20074 ⌈If: • FrTSynIcvGenerationTimeout is set to any value greater than 0, • and Csm_MacGenerate or Csm_SignatureGenerate returns E_OK, the Time Master shall start the FrTSynIcvGenerationTimeout.⌋

SWS_FrTSyn_00124 requirement

[SWS_FrTSyn_00124] Upstream requirements: RS_TS_20074 ⌈If: • FrTSynIcvGenerationTimeout is set to any value greater than 0, • the callback FrTSyn_IcvGenerationIndication is called, the Time Master shall stop the FrTSynIcvGenerationTimeout.⌋

SWS_FrTSyn_00125 requirement

[SWS_FrTSyn_00125] Upstream requirements: RS_TS_20074 ⌈If one of the following conditions is true: • the authentication build counter has reached the configuration value FrTSynTx- AuthenticationBuildAttempts, FlexRay • the verification of the ICV has returned a non-recoverable error such as returning E_NOT_OK or KEY_FAILURE, • FrTSynIcvGenerationTimeout expires before the notification of the FrT- Syn_IcvGenerationIndication callback then the Time Master shall • stop the ICV generation and set the FVL and the ICVL to 0 in the SYNC message, • and call IdsM_SetSecurityEventWithContextData with parameter Even- tId set to SEV_TSYN_FR_ICV_GENERATION_FAILED. ⌋

SWS_FrTSyn_00126 requirement

[SWS_FrTSyn_00126] Upstream requirements: RS_TS_20074 ⌈With the notification of the FrTSyn_IcvGenerationIndication callback, the Time Master shall add the generated ICV to the SYNC message and transmit it.⌋

SWS_FrTSyn_00127 requirement

[SWS_FrTSyn_00127] Upstream requirements: RS_TS_20074 ⌈When the FV is referenced (refer FrTSynIcvGenerationFvIdRef), then the Time Master shall notify the successful transmission of the SYNC message to FVM by calling StbM_SPduTxConfirmation.⌋

SWS_FrTSyn_00151 requirement

[SWS_FrTSyn_00151] Upstream requirements: SRS_BSW_00323, SRS_BSW_00337, SRS_BSW_00386 ⌈The function FrTSyn_IcvGenerationIndication shall inform the Det, if devel- opment error detection is enabled (FrTSynDevErrorDetect is set to TRUE) and if the function call has failed because of the following reasons: • jobId is invalid (FRTSYN_E_PARAM) ⌋

SWS_FrTSyn_00152 requirement

[SWS_FrTSyn_00152] Upstream requirements: SRS_BSW_00323, SRS_BSW_00337 ⌈The function FrTSyn_IcvVerificationIndication shall inform the Det, if de- velopment error detection is enabled (FrTSynDevErrorDetect is set to TRUE) and if the function call has failed because of the following reasons: • jobId is invalid (FRTSYN_E_PARAM) ⌋

SWS_FrTSyn_00153 requirement

[SWS_FrTSyn_00153] Status: DRAFT Upstream requirements: RS_TS_20074 ⌈For every transmission of messages of type 0x50 and 0x60, the Time Master shall shall maintain an authentication build counter (refer to FrTSynTxAuthentication- BuildAttempts).⌋

SWS_FrTSyn_00154 requirement

[SWS_FrTSyn_00154] Status: DRAFT Upstream requirements: RS_TS_20074 ⌈Upon the initial processing of messages of type 0x50 and 0x60 (i.e., upon the first attempt of a freshness value and ICV generation for each received message) the Time Master shall set the authentication build counter to 0.⌋

SWS_FrTSyn_00155 requirement

[SWS_FrTSyn_00155]{DRAFT} ⌈If StbM_GetTxFreshness or StbM_Get- TxFreshnessTruncData return a recoverable error code (e.g., STBM_E_BUSY), then the Time Master shall increment the authentication build counter.⌋(RS_TS_20074)

SWS_FrTSyn_00156 requirement

[SWS_FrTSyn_00156]{DRAFT} ⌈If Csm_MacGenerate or Csm_SignatureGener- ate return a recoverable error code (e.g., E_BUSY, QUEUE_FULL), then the Time Mas- ter shall increment the authentication build counter.⌋(RS_TS_20074)

SWS_FrTSyn_00171 requirement

[SWS_FrTSyn_00171]{DRAFT} ⌈If • the generation of the authenticated message has failed • and the authentication build counter has not yet reached the configuration value FrTSynTxAuthenticationBuildAttempts, then the Time Master shall retry the freshness attempt and the ICV calculation in the next call of FrTSyn_MainFunction.⌋(RS_TS_20074)

SWS_FrTSyn_00999 requirement

These requirements on Time Synchronization from the RS Time Synchronization [1] are not applicable to FrTSyn , because they refer ei- ther to network types other than FlexRay or to the Time Base Manager mod- ule

SWS_FrTSyn_91000 requirement

[SWS_FrTSyn_91000]), • call IdsM_SetSecurityEventWithContextData with parameter EventId set to SEV_TSYN_FR_FRESHNESS_NOT_AVAILABLE. ⌋ Refer to the chapter 10.2.5 in [7] for the configuration details of CSM job used for ICV generation.