AUTOSAR SWS SynchronizedTimeBaseManager
AUTOSAR SWS SynchronizedTimeBaseManager
AUTOSAR CP R20-11
Disclaimer
This work (specification and/or software implementation) and the material contained
in it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR
and the companies that have contributed to it shall not be liable for any use of the
work.
The material contained in this work is protected by copyright and other types of
intellectual property rights. The commercial exploitation of the material contained in
this work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the
work may be utilized or reproduced, in any form or by any means, without permission
in writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Table of Contents
Synchronization of RunnableEntities
Typcial examples of this use case are the sensor data read out or
synchronous actuator triggering by different RunnableEntities.
The application (and other BSW modules) shall provide a central module that
is responsible for the provision of information about absolute or relative time
and progression of it.
<<Notificaiton
<<Active Customer>>
Customer>>
SW-C
SW-C
<<Triggered
Synchronized Time-base Manager Customer>>
OS
<<Time Base
Provider>>
<bus>TSyn
The Synchronized Time-Base Manager itself does not provide means like network
time protocols or time agreement protocols to synchronize its (local) Time Bases to
Time Bases on other nodes. It interacts with the <Bus>TSyn modules of the BSW to
achieve such synchronization. Those modules take as shown in Figure 1 the role of
a Time Base Provider and support above mentioned time protocols.
With the information retrieved from the provider modules, the Synchronized Time-
Base Manager is able to synchronize its Time Bases to Time Bases on other nodes.
BSW modules and SW-C, which take the role of a customer, consume the time
information provided and managed by the Synchronized Time-Base Manager. Three
types of customers may be distingushed:
a) Triggered customer
b) Active customer
c) Notification customer
Thus, the Synchronized Time-Base Manager acts as Time Base broker by offering
the customers access to Synchronized Time Bases. Doing so, the Synchronized
Time-Base Manager abstracts from the “real” Time Base provider.
Providing access to Synchronized Time Bases between the updates of the Time
Base Providers is usually realized by using a Hardware Reference Clock; often in
combination with a Software Counter which keeps track of the Hardware Reference
Clock’s overflows. Together Software Counter and Hardware Reference clock form
the Virtual Local Time (despite the name the Virtual Local Time is an actually
realized implementation).
This time is subsequently used to drive the time of the Time Bases, taking account
their Rate Deviations and Offsets to the underlying Virtual Local Time.
<<Customer>>
OS / SW-C
Rate
Clock Rate
Conversion
Hardware Reference
Software Counter
Clock (GPT)
The API for accessing the Synchronized Time Bases is provided to application
software components as well as to other BSW modules:
For the interaction with application software components, standardized
AUTOSAR interfaces are specified in chapter 8.2.
For the interaction with other BSW modules, respective interfaces are
specified in chapter 8.1.3.
2.2 Definitions
a) Active Customer
This kind of customer autonomously calls the Synchronized Time-Base Manager
either
10 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
b) Triggered Customer
This kind of customer is triggered by the Synchronized Time-Base Manager.
Thus, the Synchronized Time-Base Manager itself is aware of the required
functionality of the customer and uses the defined interface of the customer to
access it.
c) Notification Customer
This kind of customer is notified by the Synchronized Time-Base Manager, if the
following Time Base related events occur:
Time Base status has changed (e.g. a timeout has occurred for a Time
Base)
Time Base value has reached a given value, which has been previously
set by the customer.
3 Related documentation
Thus, the specification SWS BSW General shall be considered as additional and
required specification for the Synchronized Time-Base Manager.
4.1 Limitations
The current module proposal has a number of limitations for the application of the
Synchronized Time-Base Manager within an AUTOSAR system.
4.1.1 OS ScheduleTable
The Synchronized Time-Base Manager does not deal with mode switches during
runtime.
4.1.4 Configuration
Errors, which occurred during Global Time establishment and which are not
caused by the module itself (e.g. loss of FlexRay global time is a FlexRay
issue and is not an issue of the Synchronized Time-Base Manager).
Errors, which occurred during interaction with customers.
Example: Calling the explicit OS ScheduleTable synchronization may cause
an exception, because the delta between the submitted parameter
“counterValue” and the OS internal counter is higher than the tolerance range
4.3 Conflicts
None.
In addition to the files defined in section 5.1.7 “Header file structure” of the SWS
BSW General, the StbM needs to include the file Os.h, EthIf.h and Gpt.h.
[SWS_StbM_00065]⌈
If a triggered customer is configured (refer to ECUC_StbM_00004 :
StbMTriggeredCustomer), StbM.c shall include Os.h to have access to the
schedule table interface of the OS.
⌋(SRS_BSW_00384)
[SWS_StbM_00246]⌈
If time stamping via Ethernet shall be supported (refer to
EthIfGlobalTimeSupport, which is referenced via StbMLocalTimeHardware
ECUC_StbM_00053 : , if set to EthTSynGlobalTimeDomain), StbM.c shall
include EthIf.h to have access to the interface of the EthIf module.
⌋(SRS_BSW_00384)
[SWS_StbM_00426]⌈
If time stamping via GPT shall be supported (which is referenced via
StbMLocalTimeHardware (ECUC_StbM_00053 : ), if set to
GptChannelConfiguration), StbM.c shall include Gpt.h to have access to the
interface of the GPT module.
⌋(RS_TS_00017, RS_TS_00002)
6 Requirements traceability
SWS_StbM_00411, SWS_StbM_00412,
SWS_StbM_00422, SWS_StbM_00424,
SWS_StbM_00431, SWS_StbM_00440,
SWS_StbM_00441, SWS_StbM_00442,
SWS_StbM_00443
RS_TS_00019 The Implementation of Time SWS_StbM_00356
Synchronization shall
support damping offset
correction
RS_TS_00024 The Implementation of Time SWS_StbM_00172
Synchronization shall
support storage of the Time
Base value at shutdown if
configured as Time Master
RS_TS_00025 The Implementation of Time SWS_StbM_00031, SWS_StbM_00183,
Synchronization shall SWS_StbM_00187, SWS_StbM_00199
provide fault detection
mechanisms
RS_TS_00029 The configuration of the SWS_StbM_00195, SWS_StbM_00213,
Time Synchronization SWS_StbM_00223, SWS_StbM_00228,
implementation shall allow SWS_StbM_00244, SWS_StbM_00408,
the implementation to SWS_StbM_00490, SWS_StbM_00491,
behave as a (vehicle wide) SWS_StbM_00492, SWS_StbM_91001,
Time Master SWS_StbM_91002, SWS_StbM_91005
RS_TS_00030 The configuration of the SWS_StbM_00195, SWS_StbM_00233,
Time Synchronization SWS_StbM_00248, SWS_StbM_00484,
implementation shall allow SWS_StbM_00485, SWS_StbM_00486
the implementation to
behave as a Time Slave
RS_TS_00031 The configuration of the SWS_StbM_00195, SWS_StbM_00228,
Time Synchronization SWS_StbM_00233, SWS_StbM_00248,
implementation shall allow SWS_StbM_00484, SWS_StbM_00485,
the implementation to SWS_StbM_00486, SWS_StbM_00490,
behave as a Time Gateway SWS_StbM_00491, SWS_StbM_00492,
SWS_StbM_91005
RS_TS_00032 The Implementation of Time SWS_StbM_00020, SWS_StbM_00022,
Synchronization shall trigger SWS_StbM_00077, SWS_StbM_00084,
registered customers SWS_StbM_00092, SWS_StbM_00093,
SWS_StbM_00107, SWS_StbM_00142,
SWS_StbM_00302, SWS_StbM_00303
RS_TS_00033 The Implementation of Time SWS_StbM_00437
Synchronization shall use a
time format with a resolution
of 1 ns
RS_TS_00034 The Implementation of Time SWS_StbM_00233, SWS_StbM_00247,
Synchronization shall SWS_StbM_00306, SWS_StbM_00307,
provide measurement data SWS_StbM_00308, SWS_StbM_00309,
to the application SWS_StbM_00310, SWS_StbM_00311,
SWS_StbM_00312, SWS_StbM_00313,
SWS_StbM_00314, SWS_StbM_00315,
SWS_StbM_00316, SWS_StbM_00317,
SWS_StbM_00318, SWS_StbM_00319,
SWS_StbM_00320, SWS_StbM_00322,
SWS_StbM_00323, SWS_StbM_00325,
SWS_StbM_00326, SWS_StbM_00328,
19 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
SWS_StbM_00329, SWS_StbM_00331,
SWS_StbM_00332, SWS_StbM_00333,
SWS_StbM_00334, SWS_StbM_00339,
SWS_StbM_00382, SWS_StbM_00383,
SWS_StbM_00384, SWS_StbM_00387,
SWS_StbM_00388, SWS_StbM_00428,
SWS_StbM_00458, SWS_StbM_00459,
SWS_StbM_00460, SWS_StbM_00461,
SWS_StbM_00462, SWS_StbM_00463,
SWS_StbM_00465, SWS_StbM_00466,
SWS_StbM_00467, SWS_StbM_00468,
SWS_StbM_00469, SWS_StbM_00470,
SWS_StbM_00471, SWS_StbM_00472,
SWS_StbM_00473, SWS_StbM_00474,
SWS_StbM_00475, SWS_StbM_00476,
SWS_StbM_00477, SWS_StbM_00478,
SWS_StbM_00479, SWS_StbM_00480,
SWS_StbM_00481, SWS_StbM_00482,
SWS_StbM_00483, SWS_StbM_00484,
SWS_StbM_00485, SWS_StbM_00486,
SWS_StbM_00487, SWS_StbM_00490,
SWS_StbM_00491, SWS_StbM_00492,
SWS_StbM_00493, SWS_StbM_00496,
SWS_StbM_00497, SWS_StbM_00500,
SWS_StbM_00501, SWS_StbM_00503,
SWS_StbM_00504, SWS_StbM_00505,
SWS_StbM_00506, SWS_StbM_00507,
SWS_StbM_00508, SWS_StbM_00509,
SWS_StbM_00510, SWS_StbM_00511,
SWS_StbM_00522, SWS_StbM_00523,
SWS_StbM_00524, SWS_StbM_00525
RS_TS_00035 The Implementation of Time SWS_StbM_00142, SWS_StbM_00240,
Synchronization shall SWS_StbM_00244, SWS_StbM_00247,
provide a system service SWS_StbM_00248, SWS_StbM_00275,
interface to applications SWS_StbM_00276, SWS_StbM_00286,
SWS_StbM_00287, SWS_StbM_00288,
SWS_StbM_00290
RS_TS_00036 The Implementation of Time SWS_StbM_00241, SWS_StbM_00242
Synchronization shall
provide a bus independent
customer interface
RS_TS_20001 The configuration of the SWS_StbM_00020, SWS_StbM_00022,
Time Synchronization SWS_StbM_00093, SWS_StbM_00277,
implementation shall allow SWS_StbM_00278, SWS_StbM_00279,
the interaction with different SWS_StbM_00282, SWS_StbM_00285,
types of customers SWS_StbM_00303
RS_TS_20069 The TimeSync over Ethernet SWS_StbM_00240, SWS_StbM_00247,
module shall provide read / SWS_StbM_91007, SWS_StbM_91008,
write access to bus protocol SWS_StbM_91009, SWS_StbM_91010
specific parameters
SRS_BSW_00005 Modules of the µC SWS_StbM_00140
Abstraction Layer (MCAL)
may not have hard coded
horizontal interfaces
SRS_BSW_00006 The source code of software SWS_StbM_00140
modules above the µC
Abstraction Layer (MCAL)
20 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
SWS_StbM_00503, SWS_StbM_00518,
SWS_StbM_00519, SWS_StbM_00520,
SWS_StbM_00521
SRS_BSW_00325 The runtime of interrupt SWS_StbM_00140
service routines and
functions that are running in
interrupt context shall be
kept short
SRS_BSW_00327 Error values naming SWS_StbM_00041
convention
SRS_BSW_00328 All AUTOSAR Basic SWS_StbM_00140
Software Modules shall
avoid the duplication of code
SRS_BSW_00333 For each callback function it SWS_StbM_00107, SWS_StbM_00273,
shall be specified if it is SWS_StbM_00285
called from interrupt context
or not
SRS_BSW_00334 All Basic Software Modules SWS_StbM_00140
shall provide an XML file
that contains the meta data
SRS_BSW_00336 Basic SW module shall be SWS_StbM_00140
able to shutdown
SRS_BSW_00337 Classification of SWS_StbM_00041, SWS_StbM_00094
development errors
SRS_BSW_00339 Reporting of production SWS_StbM_00058, SWS_StbM_00059
relevant error status
SRS_BSW_00341 Module documentation shall SWS_StbM_00140
contains all needed
informations
SRS_BSW_00342 It shall be possible to create SWS_StbM_00140
an AUTOSAR ECU out of
modules provided as source
code and modules provided
as object code, even mixed
SRS_BSW_00344 BSW Modules shall support SWS_StbM_00140
link-time configuration
SRS_BSW_00347 A Naming seperation of SWS_StbM_00140
different instances of BSW
drivers shall be in place
SRS_BSW_00353 All integer type definitions of SWS_StbM_00140
target and compiler specific
scope shall be placed and
organized in a single type
header
SRS_BSW_00358 The return type of init() SWS_StbM_00052
functions implemented by
AUTOSAR Basic Software
Modules shall be void
SRS_BSW_00360 AUTOSAR Basic Software SWS_StbM_00273, SWS_StbM_00285
Modules callback functions
are allowed to have
parameters
23 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
SWS_StbM_00518, SWS_StbM_00519,
SWS_StbM_00520, SWS_StbM_00521
SRS_BSW_00398 The link-time configuration is SWS_StbM_00140
achieved on object code
basis in the stage after
compiling and before linking
SRS_BSW_00399 Parameter-sets shall be SWS_StbM_00140
located in a separate
segment and shall be
loaded after the code
SRS_BSW_00400 Parameter shall be selected SWS_StbM_00140
from multiple sets of
parameters after code has
been loaded and started
SRS_BSW_00404 BSW Modules shall support SWS_StbM_00140
post-build configuration
SRS_BSW_00405 BSW Modules shall support SWS_StbM_00140
multiple configuration sets
SRS_BSW_00406 A static status variable SWS_StbM_00100, SWS_StbM_00121
denoting if a BSW module is
initialized shall be initialized
with value 0 before any APIs
of the BSW module is called
SRS_BSW_00407 Each BSW module shall SWS_StbM_00066
provide a function to read
out the version information
of a dedicated module
implementation
SRS_BSW_00412 - SWS_StbM_00140
SRS_BSW_00413 An index-based accessing SWS_StbM_00140
of the instances of BSW
modules shall be done
SRS_BSW_00414 Init functions shall have a SWS_StbM_00052, SWS_StbM_00249
pointer to a configuration
structure as single
parameter
SRS_BSW_00415 Interfaces which are SWS_StbM_00140
provided exclusively for one
module shall be separated
into a dedicated header file
SRS_BSW_00416 The sequence of modules to SWS_StbM_00140
be initialized shall be
configurable
SRS_BSW_00417 Software which is not part of SWS_StbM_00140
the SW-C shall report error
events only after the DEM is
fully operational.
SRS_BSW_00422 Pre-de-bouncing of error SWS_StbM_00140
status information is done
within the DEM
SRS_BSW_00426 BSW Modules shall ensure SWS_StbM_00140
data consistency of data
25 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
7 Functional specification
7.1.1 Preconditions
Required basic software modules for the Synchronized Time-Base Manager must be
available (running) before the Synchronized Time-Base Manager accesses them.
7.1.2 Initialization
[SWS_StbM_00170]⌈
On invocation of StbM_Init() each configured Time Base (refer to
StbMSynchronizedTimeBase, ECUC_StbM_00003 : ) shall be initialized with
zero and its synchronization status timeBaseStatus shall be set to 0x00.
⌋(RS_TS_00003)
[SWS_StbM_00345]⌈
For each Time Base the StbM shall initialize the corresponding event status
NotificationEvents with 0.
⌋(RS_TS_00016)
[SWS_StbM_00344]⌈
For each Time Base the StbM shall initialize the corresponding update counter
timeBaseUpdateCounter with 0.
⌋(RS_TS_00011)
[SWS_StbM_00171]⌈
For each Time Base configured to be stored non-volatile
(StbMStoreTimebaseNonVolatile == STORAGE_AT_SHUTDOWN), the Time
Base value shall be loaded from NvM. In case the restore is not successful, the Time
Base shall start with zero.
⌋(RS_TS_00004)
Note: The further details on the NvM handling is intentionally left open. The
implementer could choose e.g. between the ReadAll/WriteAll functionality from NvM;
or explicit NvM-Block configuration and synchronization; also block restore via
callback or via constant.
[SWS_StbM_00306]⌈
If StbMTimeRecordingSupport (ECUC_StbM_00038 : ) is set to TRUE, the StbM
shall initialize all Block Elements of the measurement recording table with zero (refer
to [Link].1 Record Tables ).
⌋(RS_TS_00034)
[SWS_StbM_00427]⌈
For each Time Base the StbM shall initialize all of the corresponding User Data bytes
with 0.
⌋(RS_TS_00015)
[SWS_StbM_00172]⌈
For each Time Base configured to be stored non-volatile
(StbMStoreTimebaseNonVolatile == STORAGE_AT_SHUTDOWN), the value
shall be stored to NvM latest at shutdown.
⌋(RS_TS_00024)
7.3.1 Introduction
A Global Time network contains of a Time Master and at least one Time Slave. The
Time Master is distributing via Time Synchronization messages the Global Time
Base to the connected Time Slaves for each Time Domain. For CAN and Ethernet,
the Time Slave corrects the received Global Time Base by considering the Time
Stamp at the transmitter side and the own generated receiver Time Stamp. For
FlexRay, the Time Synchronization mechanism is based on the local time of the
FlexRay bus.
The local instance of the Time Base (derived from a HW reference clock) will be
updated with the latest received valid value of the Global Time Base and runs
autonomously until the next value of the Global Time Base is received.
r/w access
update
init
Global Time Base Time Base
Raw Reference Clock
update
Time Master
read access
init
Local Time Base Time Base
Raw Reference Clock
update
Time Slave
Virtual Local Time Bases is derived from a hardware reference clock (see Figure 2).
The following hardware reference clocks are supported:
• OS counter
• GPT counter
• Ethernet freerunning counter (used for ingress and egress timestamping)
[SWS_StbM_00512]⌈
If StbMLocalTimeHardware ECUC_StbM_00053 : references a Gpt Channel as
local time source for a Synchronized Time Base, the StbM shall derive the Virtual
Local Time from the value of the corresponding GPT timer.
[SWS_StbM_00352]⌈
The StbM shall use the factor (StbMClockPrescaler/StbMClockFrequency) to
convert the time of its local hardware reference clock to the actual time of the Virtual
Local Time (refer to StbM_VirtualLocalTimeType [SWS_StbM_91003]), if the
29 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
Note: Rationale is that a tick duration of the hardware reference clock does not
necessarily have to match the resolution of the Virtual Local Time.
[SWS_StbM_00515]⌈
If the range of the corresponding HW reference counter is less than that of the
Virtual Local Time (refer to StbM_VirtualLocalTimeType [SWS_StbM_91003]),
the StbM shall extend the range accordingly.
⌋(RS_TS_00008)
Note: Depending on the HW reference clock one way of extending the range is to
count overflows of the HW reference clock.
[SWS_StbM_00178]⌈
If EthIfGlobalTimeSupport (referenced via StbMLocalTimeHardware
ECUC_StbM_00053 : , if set to EthTSynGlobalTimeDomain) is set to TRUE for a
Synchronized Time Base, the StbM shall derive the current value of the Virtual Local
Time (see StbM_VirtualLocalTimeType [SWS_StbM_91003]) from the
freerunning HW counter from the corresponding Ethernet Controller via
EthIf_GetCurrentTime().
[SWS_StbM_00437]⌈
StbM_GetCurrentVirtualLocalTime() shall return the value of the Virtual
Local Time of the associated Time Base.
For Offset Time Bases the Virtual Local Time of the referenced Synchronized Time
Base shall be returned.
If the Virtual Local Time could not be determined (e.g., the underlying hardware
counter has not been activated yet), StbM_GetCurrentVirtualLocalTime()
shall return E_NOT_OK.
⌋(RS_TS_00006, RS_TS_00008, RS_TS_00033)
The Time Domains 16 to 31 are Offset Time Bases. An Offset Time Base is linked to
a Synchronized Time Base only by system wide configuration.
Example:
For an Offset Time Base with Time Domain number 17 the OFFSET Timesync
messages on CAN and FR always contain 17-16 = 1 in the Time Domain field.
However, the underlying Synchronized Time Base could have Time Domain number
0, i.e., SYNC and FUP Timesync messages contain 0 in the Time Domain field.
Another Offset Time Base with Time Domain number 18 (2 in the Time Domain
field), may also based on the underlying Synchronized Time Base 0. An Offset Time
Base might have leaps in time, e.g. after GPS time becomes available.
Depending on its configuration the StbM may take one of the following three roles for
a Time Base:
Global Time Master
Time Slave
Time Gateway
Configuration
Container: StbMSynchronizedTimeBase1
Parameter: StbMSynchronizedTimeBaseIdentifier
Container: StbMSynchronizedTimeBase2
Parameter: StbMSynchronizedTimeBaseIdentifier
…
Parameter: …
CanTSyn
FrTSyn
Configuration
Configuration
Container: CanTSynGlobalTimeDomain 1
Container: FrTSynGlobalTimeDomain 1
Parameter: CanTSynGlobalTimeDomainId
Parameter: FrTSynGlobalTimeDomainId
…
…
Parameter: CanTSynSynchronizedTimeBaseRef
Parameter: FrTSynSynchronizedTimeBaseRef
Container: CanTSynGlobalTimeMaster
… Container: FrTSynGlobalTimeSlaver
Note: For system level representation of roles refer to figure 9.1 (“Big Picture of
AUTOSAR global time synchronization”) in [17]
A Global Time Master is the system wide origin for a given Time Base. Its Time Base
values are distributed via the network to the Time Slaves.
[SWS_StbM_00408]⌈
StbM_GetMasterConfig() shall return the value of the configuration parameter
StbMIsSystemWideGlobalTimeMaster (ECUC_StbM_00036 : ) for the Time
Base timeBaseId. This is to check, if the StbM is configured as system wide Global
Time Master for a specific Time Base.
⌋(RS_TS_00029)
In the role of a Time Slave the StbM updates its internally maintained local Time
Base based on Global Time Base values, which are provided by the corresponding
Timesync module.
A Time Gateway in the StbM is a Time Base which is referenced by one Time Slave
and one or more Time Masters. The Time Slave, which references a StbM Time
Gateway receives Timesync messages on the corresponding bus and passes the
received Time Base values to the StbM (refer to 7.3.1 “Introduction” for the basic
mechanisms). Every Time Master referencing the Time Gateway retrieves the
Gateway Time Base values from the StbM and transmits those on the bus.
Depending on configuration the reception on slave side can or cannot automatically
trigger the transmission on the master side.
So, Timesync messages are not routed directly through an AUTOSAR Time
Gateway. This is because routing delays need to be compensated.
The Synchronized Time-Base Manager has to interpolate the local instance of the
Global Time Base between the updates
from the Timesync Modules (for a Time Slave) and
from the application (for a Time Master)
Interpolation is done based on the Virtual Local Time, which is a local time reference
derived from some kind of HW counter (refer to ECUC_StbM_00047).
With
TL: Current value of the local instance of the Global Time
TGSync: Global Time value (part of the Main Time Tuple)
TV: Current value of the Virtual Local Time
TVSync: Virtual Local Time value (part of the Main Time Tuple)
r: optional Rate and Offset-By-Rate correction – if not used set to 1 for
Synchronized Time Bases and 0 for Offset Time Bases
The precision of a Time Base depends on the handling of the Main Time Tuple:
when and how is it interpolated by the StbM
for a Time Master or Time Gateway: how is it processed and transmitted by
the Timesync Modules
for a Time Slave or Time Gateway: how is it received and processed by the
Timesync Modules
Regarding the interpolation by the StbM it is obvious that the precision depends on
rounding effects and the granularity of the HW counters, e.g., if the Main Time Tuple
would be updated in every StbM_MainFunction() while the applied rate
correction value is small.
If requesting a Global Time by the application would always lead to an update of the
Main Tuple, the frequency of those requests would influence the precision as well.
It is therefore necessary to ensure that updates of the Main Time Tuple don’t happen
too often.
Once a new Time Tuple (denoted as Received Time Tuple [TGRx;TVRx]) is obtained
from a Timesync Module (i.e., after reception of Timesync message(s)), the StbM
determines a Time Tuple (denoted as Synclocal Time Tuple [TLSync;TVSync]) of the
34 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
local instance of the Global Time by using the Virtual Local Time of the Received
Time Tuple as reference (i.e., TV = TVRx).
The Main Time Tuple can be updated if a certain time has elapsed since the last
update (refer to [SWS_StbM_00433]).
The Main Time Tuple [TGSync;TVSync] is managed by the StbM. Each time TGSync is
updated, TVSync has to be updated as well and vice versa.
Below the application, in the BSW, the Time of a Time Base is always managed via
the Time Tuple structure:
Timesync Modules provide the received Global Time in form of a Time Tuple
to the StbM
Timesync Modules obtain the Global Time to transmit as a Time Tuple
A Global Time value set by the application is immediately extended to a Time
Tuple by adding the current value of the Virtual Local Time
[SWS_StbM_00433]⌈
The Main Time Tuple shall only be updated
after setting a new Global Time or a new Rate Correction value by the
application
after obtaining a Received Time Tuple (i.e., a new Time Tuple) from a
Timesync Module
after the Offset Correction By Rate Adaption interval (see
[SWS_StbM_00353])
However, the Main Time Tuple may be updated if there has been no update for more
than 3s.
⌋(RS_TS_00008, RS_TS_00002)
Note: The 3s interval is derived from the value range of 32 bit results (e.g., when
calculating the Virtual Local Time difference, i.e., 4.29 sec) with some safety margin.
This is to prevent too frequent updates of the Main Time Tuple, which would lead to
accumulation of rounding errors.
[SWS_StbM_00180]⌈
After initialization the StbM shall maintain the Local Time of each Time Base
autonomously via a hardware reference clock (referenced by
StbMLocalTimeClock).
⌋(RS_TS_00008, RS_TS_00002)
Note: While no Global Time Base value has yet been set/received
(GLOBAL_TIME_BASE bit is not yet set), the StbM shall maintain the Local Time of
each Time Base (i.e., progress the time) starting at the value restored from NvM or
at value 0 (depending on setting of StbMStoreTimebaseNonVolatile).
Note: Progressing the time means that the Virtual Local Time as part of the Main
Time Tuple needs to be retrieved once the Global Time part of the Main Time Tuple
was either set to 0 or to the value restored from NvM.
[SWS_StbM_00173]⌈
For Time Domains 0 to 15 StbM_GetCurrentTime() and
StbM_GetCurrentTimeExtended() shall return for the requested Time Domain
the time of the Time Base, the related Status and the User Data. The current time of
the Time Base shall be derived from the associated Virtual Local Time, which is
derived from either the referenced OS counter, a GPT or a referenced Ethernet
controller (refer to StbMLocalTimeHardware).
⌋(RS_TS_00005, RS_TS_00006, RS_TS_00014)
[SWS_StbM_00434]⌈
For Time Domains 0 to 15 StbM_GetCurrentTime(),
StbM_GetCurrentTimeExtended(), and StbM_BusGetCurrentTime()shall
return E_NOT_OK if the value of the associated Virtual Local Time could not be
retrieved.
⌋(RS_TS_00005, RS_TS_00006, RS_TS_00014)
Note: Retrieving a Virtual Local Time value may fail for several reasons, e.g., if the
related hardware counter was not yet activated.
[SWS_StbM_00435]⌈
For Time Base 0 to 15 StbM_BusGetCurrentTime() shall return for the
requested Time Domain the Time Tuple [TL;TV] of the Time Base, the related Status
and the User Data. The current time of the Time Base shall be derived from the
associated Virtual Local Time, which is derived from either the referenced OS
counter, a GPT or a referenced Ethernet controller (refer to
StbMLocalTimeHardware).
⌋(RS_TS_00005, RS_TS_00006, RS_TS_00014)
[SWS_StbM_00436]⌈
Although the retrieved value of the Virtual Local Time and the time which is returned
by StbM_GetCurrentTime(), StbM_GetCurrentTimeExtended(), and
36 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
Note: Prohibiting the update of the Main Time Tuple after e.g. every invocation of
StbM_BusGetCurrentTime() and StbM_GetCurrentTime() prevents
worsening the precision of the requested Time Base due to rounding errors.
[SWS_StbM_00342]⌈
On a valid invocation of StbM_SetGlobalTime() or
StbM_UpdateGlobalTime() the StbM shall update the Main Time Tuple of the
corresponding Synchronized Time Base.
Note: In order to improve precision further it may be beneficial for applications to call
StbM_SetGlobalTime() or StbM_UpdateGlobalTime() with locked interrupts.
[SWS_StbM_00516]⌈
On invocation of StbM_SetBusProtocolParam() for a Time Master of Time
Bases 0 to 15, the StbM shall forward the values provided in argument
protocolParam by calling EthTSyn_SetProtocolParam().
If
the corresponding Time Base is not mapped to Ethernet or
member protocolType of argument protocolParam is not set to
STBM_TIMESYNC_ETHERNET
StbM_SetBusProtocolParam() shall return E_NOT_OK.
⌋(RS_Main_00512)
[SWS_StbM_00179]⌈
For Time Bases 0 to 15 each invocation of StbM_BusSetGlobalTime() shall
update the corresponding Main Time Tuple and set the User Data and the Time
Base Status accordingly.
⌋(RS_TS_00007, RS_TS_00009)
Note: To update the Main Time Tuple does not mean to automatically overwrite the
Main Time Tuple with the Received Time Tuple.
[SWS_StbM_00438]⌈
The StbM shall determine for Time Bases 0 to 15 on each invocation of
StbM_BusSetGlobalTime() the Synclocal Time Tuple [TLSync;TVSync] by using the
value of the Virtual Local Time of the Received Time Tuple as reference (i.e., TVRx is
used for TV when calculating TL in [SWS_StbM_00355]). The Synclocal Time Tuple
shall be determined using the Main Time Tuple before the Main Time Tuple itself is
updated.
⌋(RS_TS_00007, RS_TS_00009)
[SWS_StbM_00517]⌈
On invocation of StbM_GetBusProtocolParam() for Time Bases 0 to 15, the
StbM shall read the structure values referenced by argument protocolParam by
calling EthTSyn_GetProtocolParam(), if member protocolType of argument
protocolParam is set to STBM_TIMESYNC_ETHERNET.
If
the corresponding Time Base is not mapped to Ethernet or
member protocolType of argument protocolParam is not set to
STBM_TIMESYNC_ETHERNET
StbM_GetBusProtocolParam() shall return E_NOT_OK.
⌋(RS_Main_00512)
An Offset Time Base only exists in combination with its underlying Synchronized
Time Base.
The Absolute Time value of an Offset Time Base is given by adding the Offset
Time value of an Offset Time Base to the time value of the underlying Synchronized
Time Base.
[SWS_StbM_00191]⌈
StbM_SetOffset() and StbM_GetOffset() shall only accept Offset Time
Bases with a timeBaseId 16 to 31.
⌋(RS_TS_00012, RS_TS_00013)
[SWS_StbM_00177]⌈
For Time Bases 16 to 31 the StbM_GetCurrentTime() and
StbM_GetCurrentTimeExtended() shall return for the requested Time Base an
absolute time value calculated by adding the given offset to the current Time Base of
the referenced Time Base via StbMOffsetTimeBase (ECUC_StbM_00030 : ).
⌋(RS_TS_00013)
[SWS_StbM_00193]⌈
Configuration Constraint: The parameter StbMOffsetTimeBase shall only be valid
for StbMSynchronizedTimeBaseIdentifier 16 to 31.
⌋(RS_TS_00012, RS_TS_00013)
[SWS_StbM_00190]⌈
Each valid invocation of StbM_SetOffset() shall update the Main Time Tuple of
the corresponding Offset Time Base. The Offset Time value and the User Data shall
be set accordingly.
⌋(RS_TS_00013, RS_TS_00015)
[SWS_StbM_00192]⌈
Each invocation of StbM_GetOffset() shall return the Offset Time value and the
User Data of the corresponding Offset Time Base.
⌋(RS_TS_00013, RS_TS_00014)
[SWS_StbM_00304]⌈
On invocation of StbM_SetGlobalTime() or StbM_UpdateGlobalTime() for
Time Bases 16 to 31 the StbM shall check the GLOBAL_TIME_BASE bit within
timeBaseStatus of the underlying Synchronized Time Base and shall return
E_NOT_OK if is not set.
[SWS_StbM_00393]⌈
For Time Bases 16 to 31 each invocation of StbM_BusSetGlobalTime() shall
update the corresponding Main Time Tuple and set the User Data and the Time
Base Status accordingly.
⌋(RS_TS_00007, RS_TS_00009)
Note: To update the Main Time Tuple does not mean to automatically overwrite the
Main Time Tuple with the Received Time Tuple.
[SWS_StbM_00439]⌈
The StbM shall determine for Time Bases 16 to 31 on each invocation of
StbM_BusSetGlobalTime() the Synclocal Time Tuple [TLSync;TVSync] by using the
value of the Virtual Local Time of the Received Time Tuple as reference (i.e., TVRx is
used for TV when calculating TL in [SWS_StbM_00355]). The Synclocal Time Tuple
shall be determined using the Main Time Tuple before the Main Time Tuple is
updated.
⌋(RS_TS_00007, RS_TS_00009)
A Pure Local Time Base will only locally be set and read. A Pure Local Time Base
behaves like a Synchronized Time Base since it progresses in time, however it is not
synchronized via Timesync modules. So, only a subset of APIs is supported by Pure
Local Time Base. Pure Local Time Bases behaving like an Offset Time Bases are
not supported.
[SWS_StbM_00413]⌈
After initialization the StbM shall maintain the Time of each Pure Local Time Base
autonomously via a hardware reference clock (referenced by
StbMLocalTimeClock).
⌋(RS_TS_00008, RS_TS_00002)
Note: While no Time Base value has yet been set (GLOBAL_TIME_BASE bit is not
yet set), the StbM shall maintain the time value of each Pure Local Time Base (i.e.,
progress the time) starting at the value 0.
[SWS_StbM_00398]⌈
For Pure Local Time Bases StbM_GetCurrentTime() and
StbM_GetCurrentTimeExtended() shall return the User Data as set by
StbM_SetGlobalTime(), StbM_UpdateGlobalTime() or
StbM_SetUserData() by the local Pure Local Time Master.
⌋(RS_TS_00015)
40 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
[SWS_StbM_00399]⌈
For Pure Local Time Bases all bits of the Time Base status timeBaseStatus shall
be set to 0, except for bit GLOBAL_TIME_BASE.
[SWS_StbM_00261]⌈
For Offset Time Bases StbM_GetCurrentTime() and
StbM_GetCurrentTimeExtended() shall derive the status timeBaseStatus to
be returned with the actual time value as follows from the status of the actual Offset
Time Base and the Synchronized Time Base (referenced via parameter
StbMOffsetTimeBase (ECUC_StbM_00030 : ):
[SWS_StbM_00262]⌈
For Synchronized Time Bases StbM_GetTimeBaseStatus() shall return
the status of the corresponding Synchronized Time Base via
syncTimeBaseStatus and
0 via offsetTimeBaseStatus
[SWS_StbM_00181]⌈
On a valid invocation of StbM_SetGlobalTime(), StbM_UpdateGlobalTime(),
or StbM_SetOffset() the StbM shall set the GLOBAL_TIME_BASE bit within
timeBaseStatus of the corresponding Time Base and shall clear all other bits.
⌋(RS_TS_00009)
Usually, a Time Slave starts its local Time Base from 0. So, after initialization the 1st
check against StbMTimeLeapFutureThreshold /
StbMTimeLeapPastThreshold would most likely always fail and the
TIMELEAP_FUTURE / TIMELEAP_PAST bit would be always set. To avoid this,
threshold monitoring will start only after a first valid Time Base value has been
received.
[SWS_StbM_00182]⌈
For Synchronized and Offset Time Bases for which the StbM is configured as Time
Slave or Time Gateway, an invocation of StbM_BusSetGlobalTime() shall check,
if the Global Time difference between the Received Time (i.e., the updated Time
Base value) and the Synclocal Time (i.e., the current Time Base value) exceeds the
configured threshold of StbMTimeLeapFutureThreshold (ECUC_StbM_00041 :
), i.e., TGRx - TLSync > StbMTimeLeapFutureThreshold, if at least one Time Base
value has been successfully received before.
With:
TLSync = Global Time part of the Synclocal Time Tuple
TGRx = Global Time part of the Received Time Tuple
In case the threshold is exceeded the StbM shall set the TIMELEAP_FUTURE bit
within timeBaseStatus of the Time Base.
[SWS_StbM_00305]⌈
For Synchronized and Offset Time Bases for which the StbM is configured as Time
Slave or Time Gateway, an invocation of StbM_BusSetGlobalTime() shall check,
if the Global Time difference between the Synclocal Time (i.e., the current Time
Base value) and the Received Time (i.e., the updated Time Base value) exceeds the
configured threshold of StbMTimeLeapPastThreshold (ECUC_StbM_00042 : ),
i.e., TLSync - TGRx > StbMTimeLeapPastThreshold, if at least one Time Base
value has been successfully received before.
With:
TLSync = Global Time part of the Synclocal Time Tuple
TGRx = Global Time part of the Received Time Tuple
In case the threshold is exceeded the StbM shall set the TIMELEAP_PAST bit within
timeBaseStatus of the Time Base.
exceeded), although the time drift was within the acceptable range. A time leap could
also occur if a Time Slaves continues operating while a Time Master performs a
restart.
[SWS_StbM_00425]⌈
For Synchronized and Offset Time Bases for which the StbM is configured as Time
Slave or Time Gateway StbM_GetTimeLeap() shall return the Global Time
difference between the Received Time and the Synclocal Time, i.e., TGRx - TLSync,
which is calculated upon each, except the very first, valid invocation of
StbM_BusSetGlobalTime() for the corresponding Time Base.
With
TLSync = Global Time part of the Synclocal Time Tuple
TGRx = Global Time part of the Received Time Tuple
If the calculated time difference exceeds the value range of the timeJump
parameter of StbM_GetTimeLeap() the returned time difference shall be limited to
either the maximum negative or the maximum positive value of the type of
timeJump (refer to StbM_TimeDiffType).
[SWS_StbM_00183]⌈
For Synchronized and Offset Time Bases for which the StbM is configured as Time
Slave or Time Gateway, the StbM shall observe the timeout
StbMSyncLossTimeout (ECUC_StbM_00028 : ). The timeout shall be measured
from last invocation of StbM_BusSetGlobalTime().
If the timeout occurs, the StbM shall set the TIMEOUT bit within timeBaseStatus
of the Time Base.
Note: Refer to notes beneath [SWS_StbM_00187] for suitable time references for
determining the StbMSyncLossTimeout (ECUC_StbM_00028 : ) timeout.
44 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
[SWS_StbM_00187]⌈
For Synchronized and Offset Time Bases for which the StbM is configured as Time
Gateway, the StbM shall set the SYNC_TO_GATEWAY bit within timeBaseStatus of
the Time Base when a timeout occurs (refer to [SWS_StbM_00183]).
⌋(RS_TS_00025, RS_TS_00009)
Note: The Global Time is only suitable as a time reference for determining the
StbMSyncLossTimeout (ECUC_StbM_00028 : ) timeout, if time leap detection is
configured appropriately - otherwise time leaps may shorten or lengthen the time
interval unacceptably.
In case of time span measurement based on the Virtual Local Time, the StbM shall
check for a timeout condition of a Time Base within StbM_MainFunction() and all
API functions, which return the Time Base Status (e.g.
StbM_GetTimeBaseStatus() or StbM_GetCurrentTime().
[SWS_StbM_00184]⌈
Every invocation of StbM_BusSetGlobalTime() shall set the SYNC_TO_GATEWAY
bit within timeBaseStatus of the Time Base to the value of the
SYNC_TO_GATEWAY bit within timeBaseStatus of the timeStampPtr argument
passed to StbM_BusSetGlobalTime().
⌋(RS_TS_00009)
[SWS_StbM_00185]⌈
For Synchronized and Offset Time Bases for which the StbM is configured as Time
Slave or Time Gateway, an invocation of StbM_BusSetGlobalTime() shall set
the GLOBAL_TIME_BASE bit within timeBaseStatus of the Time Base. Once set,
the bit is never cleared.
45 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
⌋(RS_TS_00009)
All Timesync Modules are working independently of the StbM regarding the handling
of the bus-specific Time Synchronization protocol (i.e. autonomous transmission of
Timesync messages on the bus).
[SWS_StbM_00414]⌈
StbM_GetTimeBaseUpdateCounter() shall return the value of the
timeBaseUpdateCounter of the corresponding Time Base.
⌋(RS_TS_00011)
[SWS_StbM_00351]⌈
For Synchronized and Offset Time Bases, the timeBaseUpdateCounter of a
Time Base shall have the value range 0 to 255.
⌋(RS_TS_00011)
[SWS_StbM_00350]⌈
For Synchronized and Offset Time Bases on a valid invocation of
StbM_SetGlobalTime(), StbM_BusSetGlobalTime(), or
StbM_TriggerTimeTransmission() and
for Offset Time Bases on a valid invocation of StbM_SetOffset(),
the StbM shall increment the timeBaseUpdateCounter of the corresponding
Time Base by 1 (one).
Note: For Offset Time Bases the term “corresponding Time Base” refers to the
Offset Time Base only and not to the underlying Synchronized Time Base.
User Data is part of each Global Time Base. User Data is set by the Global Time
Master of each Time Base and distributed as part of the Timesync messages.
User Data can be used to characterize the Time Base, e.g., regarding the quality of
the underlying clock source or regarding the progress of time.
User Data consists of up to three bytes. Due to the frame format of various Timesync
messages it is not possible to transmit all three bytes on every bus system. It is the
responsibility of the system designer to only use those User Data bytes that can be
distributed inside the vehicle network.
[SWS_StbM_00381]⌈
All functions that are setting User Data shall only set as many User Data bytes as
defined within the userDataLength element of the StbM_UserDataType
structure.
If userDataLength is equal to 0, no User Data bytes shall be set. User Data bytes
that are not set shall remain at their previous value.
⌋(RS_TS_00015)
The Synchronized Time-Base Manager provides the ability for Time Slaves to
perform Rate and Offset Correction.
For Global Time Masters the StbM provides the ability to perform Rate Correction of
their Time Base(s).
Rate Correction detects and eliminates rate deviations of local instances of Time
Bases. Rate Correction determines the rate deviation in the scope of a
measurement. This rate deviation is used as correction factor which the StbM uses
to correct the Time Base’s time whenever it is determined (e.g., in the scope of
StbM_GetCurrentTime() or StbM_BusGetCurrentTime()).
Note: Applying rate correction is inaccurate for short intervals (and for small rate
deviation values).
[SWS_StbM_00377]⌈
The StbM shall not perform Rate Correction when the measurement duration
StbMRateCorrectionMeasurementDuration (ECUC_StbM_00054 : ) is set to
zero.
⌋(RS_TS_00018)
[SWS_StbM_00376]⌈
For Rate Correction measurements, the StbM shall evaluate the TIMELEAP_FUTURE
and TIMELEAP_PAST flags during measurements. The StbM shall discard the
measurement, if any of the flags equals „Set“.
⌋(RS_TS_00018)
[SWS_StbM_00375]⌈
For Rate Correction measurements, the StbM shall evaluate state changes of the
SYNC_TO_GATEWAY flag during measurements. The StbM shall discard the
measurement if the flag state changes.
⌋(RS_TS_00018)
[SWS_StbM_00374]⌈
For Rate Correction measurements, the StbM shall evaluate the TIMEOUT flag. The
StbM shall discard the measurement, if the flag equals „Set“.
⌋(RS_TS_00018)
[SWS_StbM_00373]⌈
[SWS_StbM_00372]⌈
The StbM shall perform Rate Correction measurements to determine the rate
deviation of each configured Time Base.
⌋(RS_TS_00018)
[SWS_StbM_00371]⌈
The StbM shall perform Rate Correction measurements continuously. The end of a
measurement marks the start of the next measurement.
The start and end of measurements are always triggered by and aligned to the
reception of time values for Synchronized or Offset Time Bases.
⌋(RS_TS_00018)
StbMRateCorrectionMeasurementDuration Measurement
Measurement #
n n+1 n+2
n n+1 n+2
BusSetGlobalTime()
[SWS_StbM_00370]⌈
During runtime the StbM shall determine the timespan of a Rate Correction
measurement on the basis of the Virtual Local Time.
⌋(RS_TS_00018)
The Global Time is only suitable as a time reference for determining the timespan of
a Rate Correction measurement, if time leap detection is configured appropriately -
otherwise time leaps may shorten or lengthen the time interval unacceptably.
Note: For implementation details of the timespan measurement refer to Note after
[SWS_StbM_00370].
[SWS_StbM_00368]⌈
The StbM shall perform as many simultaneous Rate Correction measurements as
configured by parameter: StbMRateCorrectionsPerMeasurementDuration
(ECUC_StbM_00055 : ).
⌋(RS_TS_00018)
[SWS_StbM_00367]⌈
Simultaneous Rate Correction measurements shall be started with a defined offset
(ton) to yield Rate Corrections evenly distributed over the measurement duration.
ton = n * (StbMRateCorrectionMeasurementDuration /
StbMRateCorrectionsPerMeasurementDuration) (where ‘n’ is the zero-based
index of the current measurement).
⌋(RS_TS_00018)
Note: If a Rate Correction measurement start is delayed e.g. due to a late reception
of time values for Synchronized or Offset Time Bases (refer also to
[SWS_StbM_00371]) such, that it would coincide with the start of a later
simultaneous Rate Correction measurement, then the delayed measurement should
be discarded and only the most recent one should be started. That is, only one of the
simultaneous measurements is started at any reception of time values for
Synchronized or Offset Time Bases.
Note: The implementation can, e.g., be realized by storing the relevant time
snapshots in chained lists. Alternatively, measurements can be seen as objects,
which store their relevant data and can be used independently.
[SWS_StbM_00366]⌈
At the start of a Rate Correction measurement, the StbM shall store the Received
Time Tuple that is passed in the scope of the function
StbM_BusSetGlobalTime(). The elements of the stored Time Tuple have the
following denotation:
[SWS_StbM_00364]⌈
At the end of the Rate Correction measurement, the StbM shall store the Received
Time Tuple that is passed in the scope of the function
StbM_BusSetGlobalTime(). The elements of the stored Time Tuple have the
following denotation:
[SWS_StbM_00361]⌈
At the end of a Rate Correction measurement, the StbM shall calculate the resulting
correction rate (rrc) for Synchronized Time Bases as shown:
⌋(RS_TS_00018)
Note: To determine the resulting rate deviation the value 1 has to be subtracted from
rrc.
[SWS_StbM_00362]⌈
The StbM shall use the same value for rrc and rorc until a new value has been
calculated.
⌋(RS_TS_00018)
Note: A newly calculated Rate Correction rrc or rorc is only applied to following time
calculations.
[SWS_StbM_00360]⌈
At the end of a Rate Correction measurement, the StbM shall calculate the resulting
correction rate (rorc) for Offset Time Bases as shown:
⌋(RS_TS_00018)
Note: +1 is added for formal reasons in the formula for r orc. This is to have in
[SWS_StbM_00397] and [SWS_StbM_00412] aligned value ranges for rate
correction rorc and rrc and the corresponding rate deviation values.
51 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
[SWS_StbM_00397]⌈
For Time Bases with StbMSynchronizedTimeBaseIdentifier 0 to 31
(ECUC_StbM_00021 : ) and StbMIsSystemWideGlobalTimeMaster = False
(ECUC_StbM_00036 : ), the StbM shall return on invocation of
StbM_GetRateDeviation() the rate deviation, which has been calculated for that
Time Base (i.e., rrc -1 for Synchronized Time Bases or rorc - 1 for Offset Time Bases).
[SWS_StbM_00412]⌈
For a Synchronized Time Base the StbM shall use rrc = 1, if a valid correction rate
(rrc) has not yet been calculated or is not being calculated (refer
[SWS_StbM_00377]) but shall be applied (refer to [Link]).
For an Offset Time Base the StbM shall use rorc = 1, if a valid correction rate (rorc)
has not yet been calculated or is not being calculated (refer [SWS_StbM_00377])
but shall be applied (refer to [Link]).
⌋(RS_TS_00018)
[Link] Time Interpolation, Rate and Offset Correction (for Time Slaves)
Time interpolation happens whenever the current value of the local instance of a
Time Base shall be determined. The calculation is based on the Main Time Tuple.
If Rate Correction is enabled for a given Time Base the calculation includes the
Calculated Rate Correction value (rrc for Synchronized Time Bases, rorc for Offset
Time Bases).
Whenever a new Global Time Tuple is received, there is a difference between the
received Global Time and the Global Time of the Synclocal Time Tuple (see
[SWS_StbM_00438], [SWS_StbM_00439]). This difference is denoted as offset.
Offset Correction By Rate Adaption: the Main Time Tuple is not overwritten by
the Received Time Tuple, instead the applied Rate Correction is adapted
such that the existing offset is steadily reduced to zero within a configured
time span. Offset Correction By Rate Adaption can only be applied if Rate
Correction is enabled, of course (refer ot Figure 9).
[SWS_StbM_00359]⌈
The StbM shall calculate the Global Time offset (i.e., difference) between the
Received Time and the Synclocal Time upon each, except the very first, valid
invocation of StbM_BusSetGlobalTime(). The elements of the Time Tuples used
for calculating the Global Time offset have the following denotation:
[SWS_StbM_00355]⌈
The StbM shall calculate the current value of a Time Base based on the Main Tuple
and the current rate correction term according to:
With:
TL = Current value of the Time Base
TV = Current value of the Virtual Local Time
TVSync = Virtual Local Time part of the Main Time Tuple
TGSync = Global Time part of the Main Time Tuple
r = Current rate for correcting the local instance of the Time Base
⌋(RS_TS_00018)
[SWS_StbM_00440]⌈
For Synchronized Time Bases and if rate correction is enabled (see
[SWS_StbM_00377]) and if the absolute value of the time offset between the
Received Time and the Synclocal Time (abs(TGRx - TLSync)) is equal or greater than
StbMOffsetCorrectionJumpThreshold (ECUC_StbM_00056 : ), the StbM
shall use the factor rrc for the rate correction term r:
r = rrc
[SWS_StbM_00441]⌈
For Offset Time Bases and if rate correction is enabled (see [SWS_StbM_00377])
and if the absolute value of the time offset between the Received Time and the
Synclocal Time (abs(TGRx - TLSync)) is equal or greater than
StbMOffsetCorrectionJumpThreshold (ECUC_StbM_00056 : ), the StbM
shall use the factor rorc for the rate correction term r:
r = rorc - 1
[SWS_StbM_00356]⌈
If rate correction is enabled (see [SWS_StbM_00377]) and if the absolute value of
the time offset between the Received Time and the Synclocal Time (abs(TGRx -
TLSync)) is smaller than StbMOffsetCorrectionJumpThreshold
(ECUC_StbM_00056 : ), the StbM shall correct the time offset by temporarily
applying an additional rate (roc) to r:
r = rrc + roc (for Synchronized Time Bases)
54 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
This rate correction term shall be applied for the duration defined by parameter
StbMOffsetCorrectionAdaptionInterval (ECUC_StbM_00057 : ), starting
when obtaining the Received Time Tuple (i.e., it shall be applied as long as (TV -
TVSync) (see [SWS_StbM_00355]) is smaller than
StbMOffsetCorrectionAdaptionInterval).
With:
TCorrInt = StbMOffsetCorrectionAdaptionInterval
TLSync = Global Time part of the Synclocal Time Tuple
TGRx = Global Time part of the Received Time Tuple
⌋(RS_TS_00018, RS_TS_00019)
[SWS_StbM_00353]⌈
If an additional rate has been applied (Offset Correction By Rate Adaption according
to [SWS_StbM_00356]), the StbM shall after the period of
StbMOffsetCorrectionAdaptionInterval (i.e., (TV - TVSync) (see
[SWS_StbM_00355]) is larger or equal than
StbMOffsetCorrectionAdaptionInterval) insert the following two steps if it
needs to calculate the current value of a Time Base as defined by
[SWS_StbM_00355]:
1. It shall first calculate a temporary Time Tuple [TLTemp;TVTemp] using the
formula in [SWS_StbM_00355] with
TV = TVTemp = TVSync + StbMOffsetCorrectionAdaptionInterval
r = rrc + roc (for Synchronized Time Bases)
r = (rorc – 1) + roc (for Offset Time Bases)
TLTemp shall be set to the resulting value TL
2. Afterwards the Main Time Tuple [TGSync;TVSync] shall be set by an atomic
operation to the values of the temporary Time Tuple [TLTemp;TVTemp].
Note: It is possible for the StbM to perform the first two steps (i.e., to update the
Main Time Tuple) in its Main Function after expiration of
StbMOffsetCorrectionAdaptionInterval without being requested to
calculate the current time. However, since a request to calculate the current time
might occur after expiration of StbMOffsetCorrectionAdaptionInterval but
before the next Main Function invocation, it is not possible to always decouple the
first two steps from the last one.
55 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
[SWS_StbM_00400]⌈
If StbMOffsetCorrectionJumpThreshold (ECUC_StbM_00056 : ) is set to 0,
Offset Correction shall be performed by Jump Correction only.
⌋(RS_TS_00018)
[Link] Time Interpolation and Rate Correction for Global Time Masters
Rate correction in Global Time Masters can be applied to Synchronized and Offset
Time Bases (including Pure Local Time Bases).
Use cases are setting the rate of a Pure Local Time Base to the rate of a received
Synchronized Time Base or adjusting the rate of Synchronized Time Bases to
external time sources (e.g., GPS).
Rate correction is applied by setting a correction factor which the StbM uses to
correct the Time Base’s time whenever it is read (e.g., in the scope of
StbM_GetCurrentTime() or StbM_BusGetCurrentTime()).
The interpolation of the Time Base is based on the Main Time Tuple, the current
value of the Virtual Local Time and the current Rate Correction value.
[SWS_StbM_00395]⌈
If StbMAllowMasterRateCorrection equals TRUE, an invocation of
StbM_SetRateCorrection() shall set the rate correction value. Otherwise
StbM_SetRateCorrection() shall do nothing and return E_NOT_OK.
⌋(RS_TS_00018)
[SWS_StbM_00411]⌈
The StbM shall apply rate correction to a Time Base, if
StbMAllowMasterRateCorrection (ECUC_StbM_00043 : ) equals TRUE and a
valid rate correction value has been set by StbM_SetRateCorrection().
⌋(RS_TS_00018)
[SWS_StbM_00396]⌈
If the absolute value of the rate correction parameter rateDeviation, which is
passed to StbM_SetRateCorrection(), is greater than
StbMMasterRateDeviationMax, StbM_SetRateCorrection shall set the
actually applied rate correction value to either (StbMMasterRateDeviationMax)
or (-StbMMasterRateDeviationMax)(depending on sign of rateDeviation).
⌋(RS_TS_00018)
If aligning the rate of one Time Base to the rate of another one, it is possible to use
StbM_GetRateDeviation() and pass the value as argument to
StbM_SetRateCorrection().
[SWS_StbM_00424]⌈
The StbM shall calculate the (rate corrected) time (TL) of its local instance of the
Time Base as:
With:
TV = Current value of the Virtual Local Time
TVSync = Virtual Local Time part of the Main Time Tuple
TGSync = Global Time part of the Main Time Tuple
r = Rate for correcting the Time Base with
r = rrc for Synchronized Time Bases
r = rorc -1 for Offset Time Bases
⌋(RS_TS_00018)
[SWS_StbM_00442]⌈
For Synchronized Time Bases the Main Time Tuple shall be updated according to
[SWS_StbM_00440] and [SWS_StbM_00342].
[SWS_StbM_00443]⌈
For Offset Time Bases the Main Time Tuple shall be updated according to
[SWS_StbM_00441], [SWS_StbM_00190] and [SWS_StbM_00304].
57 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
[SWS_StbM_00422]⌈
For Time Bases with StbMSynchronizedTimeBaseIdentifier 32 to 127
(ECUC_StbM_00021 : ) and
for Time Bases with StbMSynchronizedTimeBaseIdentifier 0 to 31 and
StbMIsSystemWideGlobalTimeMaster equals True (ECUC_StbM_00036 :
)
the StbM shall return on invocation of StbM_GetRateDeviation() the rate
deviation that has been set by StbM_SetRateCorrection() for that Time Base.
[SWS_StbM_00431]⌈
For the Time Master of a Synchronized Time Base the StbM shall use r rc = 1, if a
valid correction rate (rrc) has not yet been set.
For the Time Master of an Offset Time Base the StbM shall use r orc = 1, if a valid
correction rate (rorc) has not yet been set.
⌋(RS_TS_00018)
The StbM allows Notification Customers (i.e., SW-Cs or other BSW modules) either
to register to be notified of status change events for a Time Base or to be notified if
an alarm expires.
Time Notification
Customer StbM GPT <bus>TSyn
StbM_StartTimer
StbM_BusSetGlobalTime
StbM_BusSetGlobalTime
Gpt_StartTimer
StbMTimerStartThreshold
CustomerTimerExpireTime StbM_TimerCallback
Trigger High Priority Task
x <Customer>_TimeNotificationCallback<TimeBase>
[SWS_StbM_00421]⌈
If any StbMNotificationCustomer (ECUC_StbM_00050 : ) is configured, the
StbM shall use one additional GPT source (referenced by StbMGptTimerRef
ECUC_StbM_00039 : ), which is not used for other purposes.
⌋(RS_TS_00017)
[SWS_StbM_00270]⌈
On invocation of StbM_StartTimer for a Time Notification Customer of a Time
Base the StbM shall calculate the time CustomerTimerExpireTime when that
Customer Timer will expire based on the corresponding Time Base. If a Customer
Timer for the same Customer is already running, StbM_StartTimer shall return
E_NOT_OK.
⌋(RS_TS_00017)
[SWS_StbM_00335]⌈
For currently active Time Notification Customers the StbM shall cyclically calculate
and monitor in its StbM_MainFunction the difference between the current value of
the corresponding Time Base and the expiration time
'CustomerTimerExpireTime'.
⌋(RS_TS_00017)
Note: Cyclic recalculation accounts for asynchronous updates of the Time Base e.g.
by StbM_BusSetGlobalTime().
[SWS_StbM_00336]⌈
A time interval StbMTimerStartThreshold (ECUC_StbM_00063 : ) before a
Customer Timer expires, the StbM shall calculate the time difference between
CustomerTimerExpireTime and the current value of the corresponding Time
Base.
[SWS_StbM_00271]⌈
Upon invocation of StbM_TimerCallback, the StbM shall calculate the time
difference between CustomerTimerExpireTime and the current value of the
corresponding Time Base.
If the calculated time difference exceeds the value range of the deviationTime
parameter of <Customer>_TimeNotificationCallback() the returned time
difference shall be limited to either the maximum negative or the maximum positive
value of the type of deviationTime (refer to StbM_TimeDiffType).
[SWS_StbM_00432]⌈
If the CustomerTimerExpireTime has been already passed, when the StbM
checks for the first time if StbMTimerStartThreshold has been reached, the
StbM shall call StbM_TimeNotificationCallback() immediately.
⌋(RS_TS_00017)
Note: This can happen, if the Time Base jumps over the expiration time (i.e.,
CustomerTimerExpireTime) due to an invocation of StbM_BusSetGlobalTime
but the GPT timer was not yet started.
[SWS_StbM_00337]⌈
If multiple Customer Timers run and expire within the same interval
StbMTimerStartThreshold, the StbM shall calculate all expiry points within the
StbMTimerStartThreshold interval and re-start the same GPT timer for next
expiry point after the previous expiry point has been reached.
⌋(RS_TS_00017)
[SWS_StbM_00277]⌈
For Synchronized, Offset and Pure Local Time Bases:
If parameter StbMNotificationInterface (ECUC_StbM_00068 : ) is set
to either SR_INTERFACE or CALLBACK_AND_SR_INTERFACE, the StbM shall
notify the application via the StatusNotification service interface.
If parameter StbMNotificationInterface is set to either CALLBACK or
CALLBACK_AND_SR_INTERFACE, the StbM shall use the callback
StatusNotificationCallback<TimeBase> to notify a CDD about status
related events.
If parameter StbMNotificationInterface is set to NO_NOTIFICATION
the notification mechanism shall be disabled for the given Time Base.
61 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
[SWS_StbM_00279]⌈
For each Time Base the StbM has a configurable mask
StbMStatusNotificationMask (ECUC_StbM_00045 : ), which allows to mask
individually status event notifications.
⌋(RS_TS_20001, RS_TS_00016)
[SWS_StbM_00284]⌈
The StbM shall detect the following status events:
⌋(RS_TS_00016)
[SWS_StbM_00278]⌈
For Synchronized and Offset Time Bases the StbM shall use a variable
NotificationEvents of type StbM_TimeBaseNotificationType to keep
track, if any status event (refer to [SWS_StbM_00284]) for the referenced Time
Base occurs.
If any status event occurs and the corresponding bit in the NotificationMask
mask is set, the corresponding bit in the NotificationEvents variable is set , i.e.,
NotificationEvents can only contain bits for the events, which are enabled
within the NotificationMask mask (refer to [SWS_StbM_00284]).
⌋(RS_TS_20001)
[SWS_StbM_00282]⌈
If any status event (refer to [SWS_StbM_00284]) occurs and the corresponding bit
in the NotificationMask mask is set, the StbM shall report the value of the
NotificationEvents variable
via the callback function StatusNotificationCallback<TimeBase>
(refer to parameter eventNotifications) and/or
via StatusNotification service interface (refer to data element
eventNotification)
depending on the setting of parameter StbMNotificationInterface
(ECUC_StbM_00068 : ).
If multiple status events occur simultaneously for the same Time Base, the StbM
shall trigger the callback function StatusNotificationCallback<TimeBase>
and the StatusNotification service interface only once.
⌋(RS_TS_20001)
Note: If e.g. a (re)synchronization takes place several of the following events may
occur simultaneously: EV_RESYNC, EV_TIMEOUT_REMOVED,
EV_GLOBAL_TIME_BASE, EV_TIMELEAP_FUTURE, EV_TIMELEAP_PAST,
EV_TIMELEAP_FUTURE_REMOVED / EV_TIMELEAP_PAST_REMOVED,
EV_RATECORRECTION, EV_SYNC_TO_SUBDOMAIN and
EV_SYNC_TO_GLOBAL_MASTER.
[SWS_StbM_00280]⌈
After reporting a status event via the
StatusNotificationCallback<TimeBase> API and the
StatusNotification service interface the StbM shall reset
NotificationEvents to 0.
63 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
⌋(RS_TS_00016)
[SWS_StbM_00020]⌈
The Synchronized Time-Base Manager must be able to interact with the OS as
Triggered Customer. The module calls the OS API for synchronizing OS
ScheduleTables.
⌋(SRS_BSW_00429, RS_TS_20001, RS_TS_00032)
[SWS_StbM_00022]⌈
The Synchronized Time-Base Manager shall provide means to configure the Time
Base to which the OS ScheduleTable should be synchronized (see container
ECUC_StbM_00004 : StbMTriggeredCustomer).
⌋(RS_TS_20001, RS_TS_00032)
[SWS_StbM_00084]⌈
Customers of type Triggered Customer shall be invoked periodically by the
Synchronized Time-Base Manager.
⌋(RS_TS_00032)
[SWS_StbM_00031]⌈
If a Triggered Customer is configured (refer to ECUC_StbM_00004 :
StbMTriggeredCustomer), the Synchronized Time-Base Manager shall monitor
the cyclic execution of the StbM_MainFunction() (see section [Link]).
[SWS_StbM_00093]⌈
The triggering period StbMTriggeredCustomerPeriod (refer to
ECUC_StbM_00020 : ) shall be configurable for each Triggered Customer.
⌋(RS_TS_20001, RS_TS_00032)
[SWS_StbM_00302]⌈
The StbM shall set the synchronization count of the OS ScheduleTable via
SyncScheduleTable().
⌋(RS_TS_00032)
The Synchronized Time-Base Manager is not responsible for starting and stopping
the execution of OS ScheduleTables.
[SWS_StbM_00303]⌈
The StbM shall derive the synchronization count of the OS ScheduleTable in
microseconds by calculating the modulus of the current Time Base value (converted
to microseconds) and OsScheduleTableDuration (see OsScheduleTable
container referenced by ECUC_StbM_00007 : ).
⌋(RS_TS_20001, RS_TS_00032)
Note: This requires, that the ticks of an OS counter, which drives a schedule table,
have a duration of 1 us.
[SWS_StbM_00077]⌈
The Synchronized Time-Base Manager shall synchronize OS ScheduleTables only
when the associated Synchronized Time Base is synchronized.
⌋(RS_TS_00032)
[SWS_StbM_00092]⌈
The Synchronized Time-Base Manager shall check the OS for the status of the OS
ScheduleTable by calling GetScheduleTableStatus() before performing the
synchronization.
Note: The Synchronized Time-Base Manager should ignore possible errors caused
by the sequential execution of a) getting OS ScheduleTable status and b) performing
the synchronization (e.g., someone else might have called a service to stop the OS
ScheduleTable in the meantime).
[Link] General
[SWS_StbM_00307]⌈
The StbM shall support the Global Time precision measurement for a Time Base, if
StbMTimeRecordingSupport (ECUC_StbM_00038 : ) is set to TRUE.
⌋(RS_TS_00034)
To verify the precision of each Local Time Base compared to the Global Time Base
a recording mechanism shall be optionally supported for Time Slaves and Time
Gateways.
In principle, the StbM takes a snapshot of all required data at the point in time, where
a synchronization event takes place. The StbM provides access to those values by
an actively pushed API function on each successful assembled data block. An Off-
Board Tester collects each block and calculates the precision afterwards and
maintains a history of recorded blocks and their elements accordingly.
How and by which protocol the data will be transferred to the Off-Board Tester will be
specified by the Application.
Figure 11: Simplified view how the recorded Time Base related snapshot data are taken
[SWS_StbM_00428]⌈
The StbM shall do Global Time precision measurement only for Synchronized Time
Bases and Offset Time Bases, for which StbMIsSystemWideGlobalTimeMaster
(ECUC_StbM_00036 : : ) is set to FALSE.
⌋(RS_TS_00034)
[SWS_StbM_00308]⌈
If Global Time Precision Measurement is enabled (refer to [SWS_StbM_00428] and
[SWS_StbM_00307]) for the Time Base, the StbM shall establish a table to record
values depending on the Synchronized Time Base with the following structure:
⌋(RS_TS_00034)
[SWS_StbM_00309]⌈
If Global Time Precision Measurement is enabled (refer to [SWS_StbM_00428] and
[SWS_StbM_00307]) for the Time Base, StbMClockfrequency
(ECUC_StbM_00051 : ) shall be mapped to the Header Element HWfrequency of
67 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
the table belonging to the Synchronized Time Base unless the Virtual Local Time for
the Time Base is provided by a Timesync module. In this case, HWfrequency shall
be set to 1000000000.
⌋(RS_TS_00034)
[SWS_StbM_00310]⌈
If Global Time Precision Measurement is enabled (refer to [SWS_StbM_00428] and
[SWS_StbM_00307]) for the Time Base, StbMClockprescaler
(ECUC_StbM_00052 : ) shall be mapped to the Header Element HWprescaler of
the table belonging to the Synchronized Time Base unless the Virtual Local Time for
the Time Base is provided by a Timesync module. In this case, HWprescaler shall
be set to 1.
⌋(RS_TS_00034)
[SWS_StbM_00382]⌈
If Global Time Precision Measurement is enabled (refer to [SWS_StbM_00428] and
[SWS_StbM_00307]) for the Time Base, the Synchronized Time Base Record
Table shall contain a history of as many blocks as configured by
StbMSyncTimeRecordTableBlockCount (ECUC_StbM_00058 : ).
⌋(RS_TS_00034)
⌋(RS_TS_00034)
[SWS_StbM_00383]⌈
If Global Time Precision Measurement is enabled (refer to [SWS_StbM_00428]) for
the Time Base, the Offset Time Base Record Table shall contain a history of as
many blocks as configured by StbMOffsetTimeRecordTableBlockCount
(ECUC_StbM_00059 : ).
⌋(RS_TS_00034)
[SWS_StbM_00312]⌈
If Global Time Precision Measurement is enabled (refer to [SWS_StbM_00428] for
the Time Base, on an invocation of StbM_BusSetGlobalTime() the StbM shall
update all elements of the block of the recording table.
Note: From the implementation point of view, this mechanism belongs to a ring
buffer concept in case data cannot be forwarded to the Application fast enough.
[SWS_StbM_00313]⌈
For Synchronized Time Bases, if Global Time Precision Measurement is enabled
(refer to [SWS_StbM_00428] and [SWS_StbM_00307]) for the Time Base, on an
invocation of StbM_BusSetGlobalTime() the StbM shall write the block elements
LocSeconds and
LocNanoSeconds
to the related measurement recording table before updating the Main Time Tuple
(i.e., updating the Local Time Base by the Global Time Base). LocSeconds and
LocNanoSeconds are the elements of the Global Time part of the Synclocal Time
Tuple (i.e., TLSync , see [SWS_StbM_00438]).
⌋(RS_TS_00034)
[SWS_StbM_00314]⌈
For Synchronized Time Bases, if Global Time Precision Measurement is enabled
(refer to [SWS_StbM_00428] and [SWS_StbM_00307]) for the Time Base, on an
invocation of StbM_BusSetGlobalTime() the StbM shall write the block elements
GlbSeconds,
GlbNanoSeconds,
69 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
VirtualLocalTimeLow,
RateDeviation,
TimeBaseStatus
PathDelay
to the related measurement recording table after updating the Main Time Tuple (i.e.,
after updating the Local Time Base by the Global Time Base).
GlbSeconds, GlbNanoSeconds are the elements of the Global Time part of the
Received Time Tuple (i.e., TGRx); VirtualLocalTimeLow is the nanosecondsLo
element of the Virtual Local Time part of the Received Time Tuple (i.e., TVRx).
⌋(RS_TS_00034)
[SWS_StbM_00388]⌈
For Offset Time Bases, if Global Time Precision Measurement is enabled (refer to
[SWS_StbM_00428] and [SWS_StbM_00307]) for the Time Base, on an invocation
of StbM_BusSetGlobalTime() the StbM shall write the block elements
GlbSeconds, GlbNanoSeconds and TimeBaseStatus to the related
measurement recording table.
⌋(RS_TS_00034)
[SWS_StbM_00315]⌈
If Global Time Precision Measurement is enabled (refer to [SWS_StbM_00428] and
[SWS_StbM_00307]) for the Time Base, the application collects the contents of the
header of the Synchronized Time Base Record Table by calling
StbM_GetSyncTimeRecordHead().
⌋(RS_TS_00034)
[SWS_StbM_00316]⌈
If Global Time Precision Measurement is enabled (refer to [SWS_StbM_00428] and
[SWS_StbM_00307]) for the Time Base, the application collects the contents of the
header of the Offset Time Base Record Table by calling
StbM_GetOffsetTimeRecordHead().
⌋(RS_TS_00034)
[SWS_StbM_00317]⌈
If Global Time Precision Measurement is enabled (refer to [SWS_StbM_00428] and
[SWS_StbM_00307]) for the Time Base, the StbM shall notify the Application by
calling SyncTimeRecordBlockCallback<TimeBase> in the next
StbM_MainFunction() call cycle block by block (i.e., repeatedly) for all unread
blocks (i.e., containing data that has yet not been passed to the Application), starting
with the block containing the oldest data, and followed by the blocks in ascending
order regarding their age (i.e., FIFO order), the block containing the newest data
shall be passed last.
The StbM shall ensure data integrity: a block shall not be passed if it currently being
overwritten and a block that is passed shall be prevented from being overwritten until
processed by the Application.
⌋(RS_TS_00034)
[SWS_StbM_00318]⌈
If Global Time Precision Measurement is enabled (refer to [SWS_StbM_00428] and
[SWS_StbM_00307]) for the Time Base, the StbM shall notify the Application by
calling OffsetTimeRecordBlockCallback<TimeBase> in the next
StbM_MainFunction() call cycle block by block (i.e., repeatedly) for all unread
blocks (i.e., containing data that has yet not been passed to the Application), starting
with the block containing the oldest data, and followed by the blocks in ascending
order regarding their age (i.e., FIFO order), the block containing the newest data
shall be passed last.
The StbM shall ensure data integrity: a block shall not be passed if it currently being
overwritten and a block that is passed shall be prevented from being overwritten until
processed by the Application.
⌋(RS_TS_00034)
Figure 12 outlines the basic concept of the “Time Validation” feature. Time Slaves,
Time Masters and Time Gateways collect information on the time synchronization
process from the corresponding Timesync modules, to allow for, e.g. predicting the
Global Time of Sync ingress events based on their local instance of the Global Time
(by using the Synclocal Time Tuple) and make this information available to the
application (i.e. to an SWC). In doing so one application can check peer-wise
whether a Master and a neighboring Slave agree upon the current Global Time.
The predictions, etc. may be locally analyzed by the application to detect any
impairments quickly with the desired safety integrity. Furthermore, information on the
time synchronization process between all Time Masters and Slaves that participate
in the “Time Validation” is also shared with a Validator SWC which may run
anywhere in the network, e.g. on the Global Time Master. The Validator SWC has
therefore global system view which allows the Validator to check whether a coherent
time base is established among all peers or not. The Validator constitutes
simultaneously a single authorization instance that can assess the safety integrity of
the overall system with the desired ASIL. The Validator receives the necessary
information from all entities via a user defined feedback channel.
The Time Validation feature only provides service interfaces to the application. The
feedback channel and the actual validation performed by the respective SWCs is not
standardized in AUTOSAR. It is done in a user defined way on application level.
71 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
TimeBaseProviderNotification_<bus>.SetSlaveTimingData()
Send Master Timing Information to Validator
Local Time at Sync Egress and
corresponding Global Time
[SWS_StbM_00465]⌈
The StbM shall record timing data for Time Validation for Synchronized Time Bases
(refer to ECUC_StbM_00021 : StbMSynchronizedTimeBase), which have Time
Validation enabled (i.e., ECUC_StbM_00072 : SbMTimeValidation is
configured).
⌋(RS_TS_00034)
[SWS_StbM_00466]⌈
For each Time Base,
which has Time Validation enabled (refer to [SWS_StbM_00465]) and
which is mapped to a Slave Communication Port in a Timesync module
the StbM shall manage a Time Slave Validation Record table with the following
structure:
…
Block
(StbMTime-
Validation-
RecordTable-
BlockCount
-1)
⌋(RS_TS_00034)
[SWS_StbM_00467]⌈
The type of the blocks in the Time Slave Validation Record Table (Table 2) shall
depend on the Timesync Module, which provides the data for the Time Slave
Validation Record Table of the corresponding Time Base.
⌋(RS_TS_00034)
[SWS_StbM_00468]⌈
For each Time Base,
which has Time Validation enabled (refer to [SWS_StbM_00465]) and
which is mapped to a Master Communication Port in a Timesync module
the StbM shall manage a Time Master Validation Record Table with the following
structure:
RecordTable-
BlockCount -
1)
⌋(RS_TS_00034)
[SWS_StbM_00469]⌈
The type of the blocks in the Time Master Validation Record Table (Table 4) shall
depend on the Timesync Module, which provides the data for the Time Master
Validation Record Table of the corresponding Time Base.
⌋(RS_TS_00034)
Note: If the StbM is configured to be a Time Gateway for a Time Base with Time
Validation enabled, one Time Slave Validation Record Table and one Time Master
Validation Record Tables are maintained for that Time Base by the StbM.
[SWS_StbM_00522]⌈
For each Time Base, which
has Time Validation enabled (refer to [SWS_StbM_00465]) and
is mapped to a Slave Communication Port on an Ethernet Time Domain
the StbM shall manage a Pdelay Initiator Time Validation Record Table with the
following structure:
pdelayInitiatorData StbM_PdelayInitiatorMeasur
Block 1
ementType
…
Block
(StbMTime-
Validation-
RecordTable-
BlockCount -1)
⌋(RS_TS_00034)
[SWS_StbM_00523]⌈
For each Time Base, which
has Time Validation enabled (refer to [SWS_StbM_00465]) and
is mapped to a Master Communication Port on an Ethernet Time Domain
the StbM shall manage a Pdelay Responder Validation Record Table with the
following structure:
⌋(RS_TS_00034)
[Link].1.3 Common
[SWS_StbM_00470]⌈
Each
Time Slave Validation Record Table (Table 2) and
Time Master Validation Record Table (Table 4)
Pdelay Initiator Validation Record Table (Table 6)
Pdelay Responder Validation Record Table (Table 7)
shall contain as many blocks as configured by
StbMTimeVadidationRecordTableBlockCount (ECUC_StbM_00073 : ).
⌋(RS_TS_00034)
[SWS_StbM_00471]⌈
If Time Validation is enabled for a Time Base (refer to [SWS_StbM_00464] and
[SWS_StbM_00465]), upon invocation of StbM_<bus>SetSlaveTimingData()
the StbM shall copy the content of the structure, which is passed by parameter
measureDataPtr, to the next free <bus>SlaveTimingData block of the Time
Slave Validation Record Table (Table 2) of that Time Base.
The StbM shall then shall set the value of the block element
<bus>[Link] as TLSync (refer
to [SWS_StbM_00438]) and
<bus>[Link] as TVSyn (refer to
[SWS_StbM_00438]).
(i.e., to the value of the Synclocal Time Tuple as set by the preceding call of
StbM_BusSetGlobalTime()).
⌋(RS_TS_00034)
[SWS_StbM_00472]⌈
If no free block is available in the Time Slave Validation Record Table of a Time
Base (i.e., all blocks have been written and no notification via operation
SetSlaveTimingData of port
TimeBaseProviderNotification_{bus}_{TimeBase} has yet occurred to
pass all blocks to the application), the StbM shall overwrite the block containing the
oldest measurement data upon invocation of
StbM_<bus>SetSlaveTimingData().
⌋(RS_TS_00034)
[SWS_StbM_00473]⌈
If Time Validation is enabled for a Time Base (refer to
SWS_StbM_00464,SWS_StbM_00465), upon invocation of
StbM_<bus>SetMasterTimingData() the StbM shall copy the content of the
structure, which is passed by parameter measureDataPtr, to the next free block
<bus>MasterTimingData of the Time Master Validation Record Table (Table 4) of
that Time Base.
⌋(RS_TS_00034)
[SWS_StbM_00474]⌈
If no free block is available in a Time Master Validation Record Table of a Time Base
(i.e., all blocks have been written and no notification via SetMasterTimingData of
port TimeBaseProviderNotification_{bus}_{TB_Name} has yet occurred to
76 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
pass all blocks to the application), the StbM shall overwrite the block containing the
oldest measurement data upon invocation of
StbM_<bus>SetMasterTimingData().
⌋(RS_TS_00034)
Note: From the implementation point of view, this mechanism belongs to a ring
buffer concept in case data cannot be forwarded to the application fast enough.
[SWS_StbM_00475]⌈
For each Time Base,
which has Time Validation enabled (refer to SWS_StbM_00465) and
for which the StbM is configured as a Time Slave or Time Gateway
the StbM shall check within each StbM_MainFunction() call, if new blocks (i.e.,
containing data that has not yet been passed to the application) have been written in
the Time Slave Validation Record Table (Table 2).
If so, the StbM shall pass all new blocks to the application by (repeatedly, block by
block) calling operation SetSlaveTimingData of port
TimeBaseProviderNotification_{bus}_{TimeBase}.
The StbM shall pass the blocks starting with the block containing the oldest data,
and followed by the blocks in ascending order regarding their age (i.e., FIFO order).
The block containing the newest data shall be passed last.
⌋(RS_TS_00034)
[SWS_StbM_00476]⌈
For each Time Base,
which has Time Validation enabled (refer to SWS_StbM_00465) and
for which the StbM is configured as a Time Master or Time Gateway
the StbM shall check within each StbM_MainFunction(), if new blocks (i.e.,
containing data that has not yet been passed to the application) have been written to
the Time Master Validation Record Table (Table 4).
If so, the StbM shall pass all new blocks to the application by (repeatedly, block by
block) calling operation SetMasterTimingData of port
TimeBaseProviderNotification_{bus}_{TimeBase}.
The StbM shall pass the blocks starting with the block containing the oldest data,
and followed by the blocks in ascending order regarding their age (i.e., FIFO order).
The block containing the newest data shall be passed last.
⌋(RS_TS_00034)
[SWS_StbM_00478]⌈
[SWS_StbM_00524]⌈
If no free block is available in the Pdelay Initiator Validation Record Table of a Time
Base (i.e., all blocks have been written and no notification via operation
SetPdelayInitiatorData of port
TimeBaseProviderNotification_Eth_{TimeBase} has yet occurred to pass
all blocks to the application), the StbM shall overwrite the block containing the oldest
measurement data upon invocation of StbM_EthSetPdelayInitiatorData().
⌋(RS_TS_00034)
[SWS_StbM_00479]⌈
For each Time Base, which
has Time Validation enabled (refer to SWS_StbM_00465) and
is mapped to a Slave Communication Port on an Ethernet Time Domain,
the StbM shall check within each StbM_MainFunction(), if new blocks (i.e.,
containing data that has not yet been passed to the application) have been written to
the Pdelay Initiator Validation Record Table (Table 6).
If so, the StbM shall pass all new blocks to the application by (repeatedly, block by
block) calling operation SetPdelayInitiatorData of port
TimeBaseProviderNotification_Eth_{TimeBase}.
The StbM shall pass the blocks starting with the block containing the oldest data and
followed by the blocks in ascending order regarding their age (i.e., FIFO order). The
block containing the newest data shall be passed last. ⌋(RS_TS_00034)
[SWS_StbM_00480]⌈
If Time Validation is enabled for a Time Base (refer to
SWS_StbM_00464,SWS_StbM_00465), upon invocation of
StbM_EthSetPdelayResponderData() the StbM shall write the content of the
structure, which is passed by parameter measureDataPtr, to the next free block
PdelayResponderData of the corresponding Pdelay Responder Validation Record
Table (Table 7) of that Time Base.
⌋(RS_TS_00034)
[SWS_StbM_00525]⌈
If no free block is available in the Pdelay Responder Validation Record Table of a
Time Base (i.e., all blocks have been written and no notification via operation
78 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
SetPdelayResponderData of port
TimeBaseProviderNotification_Eth_{TimeBase} has yet occurred to pass
all blocks to the application), the StbM shall overwrite the block containing the oldest
measurement data upon invocation of StbM_EthSetPdelayResponderData().
⌋(RS_TS_00034)
[SWS_StbM_00481]⌈
For each Time Base, which
has Time Validation enabled (refer to SWS_StbM_00465) and
is mapped to a Master Communication Port on an Ethernet Time Domain,
the StbM shall check within each StbM_MainFunction(), if new blocks (i.e.,
containing data that has not yet been passed to the application) have been written to
the Pdelay Responder Validation Record Table (Table 7).
If so, the StbM shall pass all new blocks to the application by (repeatedly, block by
block) calling operation SetPdelayResponderData of port
TimeBaseProviderNotification_Eth_{TimeBase}.
The StbM shall pass the blocks starting with the block containing the oldest data and
followed by the blocks in ascending order regarding their age (i.e., FIFO order). The
block containing the newest data shall be passed last.
⌋(RS_TS_00034)
[Link].2.3 Common
[SWS_StbM_00477]⌈
The StbM shall ensure data integrity of the blocks in the
Time Slave Validation Record Table (Table 2) and
Time Master Validation Record Table (Table 4) and
Pdelay Initiator Validation Record Table (Table 6) and
Pdelay Responder Validation Record Table (Table 7).
User defined Time Base Providers are implemented by a CDD module. Details of the
interaction between the StbM and such a CDD module are described in section
“Interfacing with StbM module” of [16].
[SWS_StbM_00513]⌈
The StbM module shall apply appropriate mechanisms to allow calls of its APIs from
other partitions than its main function, e.g. by providing a StbM satellite.
⌋(SRS_BSW_00459)
Note:
Parameter ECUC_StbM_00069 : StbMEcucPartitionRef references the
partition, which the StbM/main function is allocated to.
[SWS_StbM_00514]⌈
The StbM module shall ensure to keep the synchronous contract of its APIs, even so
they are called in other partitions than StbM module is assigned to.
⌋(SRS_BSW_00459)
[SWS_StbM_00199]⌈
For any StbM API service other than StbM_Init() and StbM_GetVersion() all
out parameters shall remain untouched, if an error occurs during execution of that
API service.
⌋(RS_TS_00025)
Note: For further details refer to the chapter 7.2 “Error Handling” in
SWS_BSWGeneral and chapter 8 for API specific error handling.
Based on this foundation, the following section specifies particular errors arranged in
the respective subsections below.
[SWS_StbM_00041]⌈
Type of error Related error code Error value
8 API specification
8.1 API
In this chapter, all types included from the following modules are listed:
[SWS_StbM_00051]⌈
Module Header File Imported Type
Eth_GeneralTypes.h Eth_TimeStampQualType
Eth
Eth_GeneralTypes.h Eth_TimeStampType
Gpt.h Gpt_ChannelType
Gpt
Gpt.h Gpt_ValueType
Os.h ScheduleTableStatusRefType
Os.h ScheduleTableStatusType
Os.h ScheduleTableType
Os Os.h StatusType
Os.h TickRefType
Os.h TickType
Rte_Os_Type.h CounterType
Std_Types.h Std_ReturnType
Std
Std_Types.h Std_VersionInfoType
⌋(SRS_BSW_00301)
[Link] StbM_ConfigType
[SWS_StbM_00249]⌈
Name StbM_ConfigType
Kind Structure
implementation specific
Elements Type --
Comment --
⌋(SRS_BSW_00414)
[Link] StbM_VirtualLocalTimeType
[SWS_StbM_91003]⌈
Name StbM_VirtualLocalTimeType
Kind Structure
nanosecondsLo
Type uint32
Type uint32
Variables of this type store time stamps of the Virtual Local Time. The unit is
Description
nanoseconds.
Variation --
Available
StbM.h
via
⌋(RS_TS_00009)
[Link] StbM_MeasurementType
[SWS_StbM_00384]⌈
Name StbM_MeasurementType
Kind Structure
pathDelay
⌋(RS_TS_00034)
[Link] StbM_GetVersionInfo
[SWS_StbM_00066]⌈
Service Name StbM_GetVersionInfo
void StbM_GetVersionInfo (
Syntax Std_VersionInfoType* versioninfo
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters
None
(inout)
⌋(SRS_BSW_00407)
[SWS_StbM_00094]⌈
If development error detection for the StbM module is enabled the function
StbM_GetVersionInfo shall raise the development error
STBM_E_PARAM_POINTER and return if versioninfo is a NULL pointer (NULL_PTR).
⌋(SRS_BSW_00386, SRS_BSW_00337)
[Link] StbM_Init
[SWS_StbM_00052]⌈
Service Name StbM_Init
void StbM_Init (
Syntax const StbM_ConfigType* ConfigPtr
)
Sync/Async Synchronous
The ECU State Manager calls the function StbM_Init() during the startup phase
of the ECU in order to initialize the module. The StbM is not functional until this
function has been called.
[SWS_StbM_00100]⌈
A static status variable denoting if the StbM is initialized shall be initialized with value
0 before any APIs of the StbM are called.
⌋(SRS_BSW_00406)
[SWS_StbM_00121]⌈
StbM_Init shall set the static status variable to a value not equal to 0.
⌋(SRS_BSW_00406)
[Link] StbM_GetCurrentTime
[SWS_StbM_00195]⌈
Service Name StbM_GetCurrentTime
Std_ReturnType StbM_GetCurrentTime (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax StbM_TimeStampType* timeStamp,
StbM_UserDataType* userData
)
Service ID
0x07
[hex]
Sync/Async Synchronous
Parameters
timeBaseId time base reference
(in)
Parameters
None
(inout)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Returns a time value (Local Time Base derived from Global Time Base) in standard
format.
Description 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).
[SWS_StbM_00196]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetCurrentTime() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which is
not configured or
within the reserved value range.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00197]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetCurrentTime() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter timeStamp
or userData.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_GetCurrentTimeExtended
[SWS_StbM_00200]⌈
Service Name StbM_GetCurrentTimeExtended
Std_ReturnType StbM_GetCurrentTimeExtended (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax StbM_TimeStampExtendedType* timeStamp,
StbM_UserDataType* userData
)
Service ID
0x08
[hex]
Sync/Async Synchronous
Parameters
timeBaseId time base reference
(in)
Parameters
None
(inout)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Returns a time value (Local Time Base derived from Global Time Base) in
extended format.
Description 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).
⌋(RS_TS_00005, RS_TS_00014)
[SWS_StbM_00201]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetCurrentTimeExtended() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which is
not configured or
within the reserved value range.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00202]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetCurrentTimeExtended() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter timeStamp
or userData.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_GetCurrentVirtualLocalTime
[SWS_StbM_91006]⌈
Service Name StbM_GetCurrentVirtualLocalTime
StbM_SynchronizedTimeBaseType timeBaseId,
StbM_VirtualLocalTimeType* localTimePtr
)
Sync/Async Synchronous
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Description Returns the Virtual Local Time of the referenced Time Base.
⌋(RS_TS_00006, RS_TS_00008)
[SWS_StbM_00444]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetCurrentVirtualLocalTime () shall report to DET the development
error STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter
localTimePtr.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_SetGlobalTime
[SWS_StbM_00213]⌈
Service Name StbM_SetGlobalTime
Std_ReturnType StbM_SetGlobalTime (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax const StbM_TimeStampType* timeStamp,
const StbM_UserDataType* userData
)
Service ID 0x0b
[hex]
Sync/Async Synchronous
Parameters
None
(inout)
Parameters
None
(out)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Allows the Customers to set the new global time that has to be valid for the system,
Description which will be sent to the busses. This function will be used if a Time Master is
present in this ECU.
⌋(RS_TS_00029, RS_TS_00010)
[SWS_StbM_00214]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetGlobalTime() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which is
not configured or
within the reserved value range.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00215]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetGlobalTime() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter timeStamp.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00448]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetGlobalTime() shall report to DET the development error
STBM_E_PARAM_TIMESTAMP, if called with a parameter timeStamp that contains
invalid elements (e.g., nanoseconds part > 999999999 ns).
⌋( SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00449]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetGlobalTime() shall report to DET the development error
STBM_E_PARAM_USERDATA, if called with an invalid value of parameter userData,
i.e., userDataLength > 3.
⌋( SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_UpdateGlobalTime
[SWS_StbM_00385]⌈
Service
StbM_UpdateGlobalTime
Name
Std_ReturnType StbM_UpdateGlobalTime (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax const StbM_TimeStampType* timeStamp,
const StbM_UserDataType* userData
)
Service ID
0x10
[hex]
Sync/Async Synchronous
Parameters
None
(inout)
Parameters
None
(out)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Allows the Customers to set the Global Time that will be sent to the buses. This
Description function will be used if a Time Master is present in this ECU. Using UpdateGlobal
Time will not lead to an immediate transmission of the Global Time.
⌋(RS_TS_00010)
[SWS_StbM_00340]⌈
[SWS_StbM_00341]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_UpdateGlobalTime() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter timeStamp.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00451]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_UpdateGlobalTime() shall report to DET the development error
STBM_E_PARAM_TIMESTAMP, if called with a parameter timeStamp that contains
invalid elements (e.g., nanoseconds part > 999999999 ns).
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00452]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_UpdateGlobalTime() shall report to DET the development error
STBM_E_PARAM_USERDATA, if called with an invalid value of parameter userData,
i.e., userDataLength > 3.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_SetUserData
[SWS_StbM_00218]⌈
Service Name StbM_SetUserData
Std_ReturnType StbM_SetUserData (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax
const StbM_UserDataType* userData
)
Sync/Async Synchronous
Parameters
None
(inout)
Parameters
None
(out)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Allows the Customers to set the new User Data that has to be valid for the
Description
system, which will be sent to the busses.
⌋(RS_TS_00015)
[SWS_StbM_00219]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetUserData() shall report to DET the development error STBM_E_PARAM,
if called with a parameter timeBaseId, which
is not configured or
is within the reserved value range.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00220]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetUserData() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter userData.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00457]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetUserData() shall report to DET the development error
STBM_E_PARAM_USERDATA, if called with an invalid value of parameter userData,
i.e., userDataLength > 3.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_SetOffset
[SWS_StbM_00223]⌈
Service Name StbM_SetOffset
Std_ReturnType StbM_SetOffset (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax const StbM_TimeStampType* timeStamp,
const StbM_UserDataType* userData
)
93 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
Sync/Async Synchronous
userData New User Data (Or NULL if no new user data is provided)
Parameters
None
(inout)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Allows the Customers and the Timesync Modules to set the Offset Time and the
Description
User Data.
⌋(RS_TS_00029, RS_TS_00013)
[SWS_StbM_00224]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetOffset() shall report to DET the development error STBM_E_PARAM, if
called with a parameter timeBaseId, which
is not configured or
refers to a Synchronized or Pure Local Time Base or
is within the reserved value range.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00225]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetOffset() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter timeStamp.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00453]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetOffset() shall report to DET the development error
STBM_E_PARAM_TIMESTAMP, if called with a parameter timeStamp that contains
invalid elements (e.g., nanoseconds part > 999999999 ns).
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00454]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetOffset() shall report to DET the development error
STBM_E_PARAM_USERDATA, if called with an invalid value of parameter userData,
i.e., userDataLength > 3.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_GetOffset
[SWS_StbM_00228]⌈
Service Name StbM_GetOffset
Std_ReturnType StbM_GetOffset (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax StbM_TimeStampType* timeStamp,
StbM_UserDataType* userData
)
Sync/Async Synchronous
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Description Allows the Timesync Modules to get the current Offset Time and User Data.
[SWS_StbM_00229]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetOffset() shall report to DET the development error STBM_E_PARAM, if
called with a parameter timeBaseId, which
is not configured or
refers to a Synchronized or Pure Local Time Base or
is within the reserved value range.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00230]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetOffset() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter timeStamp
or userData.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_BusGetCurrentTime
[SWS_StbM_91005]⌈
Service Name StbM_BusGetCurrentTime
Std_ReturnType StbM_BusGetCurrentTime (
StbM_SynchronizedTimeBaseType timeBaseId,
StbM_TimeStampType* globalTimePtr,
Syntax
StbM_VirtualLocalTimeType* localTimePtr,
StbM_UserDataType* userData
)
Sync/Async Synchronous
Parameters
None
(inout)
globalTime Value of the local instance of the Global Time, which is sampled
Ptr when the function is called
Parameters
Value of the Virtual Local Time, which is sampled when the
(out) localTimePtr
function is called
Description Returns the current Time Tuple, status and User Data of the Time Base.
[SWS_StbM_00446]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_BusGetCurrentTime() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which
refers to an Offset Time Base or
96 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
[SWS_StbM_00447]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_BusGetCurrentTime() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter
globalTimePtr, localTimePtr or userData.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_BusSetGlobalTime
[SWS_StbM_00233]⌈
Service Name StbM_BusSetGlobalTime
Std_ReturnType StbM_BusSetGlobalTime (
StbM_SynchronizedTimeBaseType timeBaseId,
const StbM_TimeStampType* globalTimePtr,
Syntax const StbM_UserDataType* userDataPtr,
const StbM_MeasurementType* measureDataPtr,
const StbM_VirtualLocalTimeType* localTimePtr
)
Sync/Async Synchronous
Parameters
None
(inout)
Parameters
None
(out)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Allows the Time Base Provider Modules to forward a new Global Time tuple (i.e.,
Description
the Received Time Tuple) to the StbM.
[SWS_StbM_00234]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_BusSetGlobalTime() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which
refers to a Pure Local Time Base or
is not configured or
is within the reserved value range
⌋(SRS_BSW_00386, SRS_BSW_00323)
Note:
A parameter timeBaseId within the reserved value range indicates legacy use.
[SWS_StbM_00235]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_BusSetGlobalTime() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter
globalTimePtr
measureDataPtr
localTimePtr
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00455]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_BusSetGlobalTime() shall report to DET the development error
STBM_E_PARAM_TIMESTAMP, if called with a parameter timeStamp that contains
invalid elements (e.g., nanoseconds part > 999999999 ns).
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00456]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_BusSetGlobalTime() shall report to DET the development error
STBM_E_PARAM_USERDATA, if called with an invalid value of parameter userData,
i.e., userDataLength > 3.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_GetRateDeviation
[SWS_StbM_00378]⌈
Service Name StbM_GetRateDeviation
Std_ReturnType StbM_GetRateDeviation (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax
StbM_RateDeviationType* rateDeviation
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (out) rateDeviation Value of the current rate deviation of a Time Base
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
⌋(RS_TS_00018)
[SWS_StbM_00379]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetRateDeviation() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which
is not configured or
is within the reserved value range.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00380]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetRateDeviation() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter
rateDeviation.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_SetRateCorrection
[SWS_StbM_00390]⌈
Std_ReturnType StbM_SetRateCorrection (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax StbM_RateDeviationType rateDeviation
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters
None
(inout)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Allows to set the rate of a Synchronized Time Base (being either a Pure Local
Description
Time Base or not).
⌋(RS_TS_00018)
[SWS_StbM_00391]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetRateCorrection() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which
is not configured or
is within the reserved value range.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00392]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetRateCorrection() shall report to DET the development error
STBM_E_SERVICE_DISABLED, if StbMAllowMasterRateCorrection is set to
FALSE for the corresponding Time Base, i.e., it is not allowed to call
StbM_SetRateCorrection().
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_GetTimeLeap
[SWS_StbM_00267]⌈
Service Name StbM_GetTimeLeap
Std_ReturnType StbM_GetTimeLeap (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax
StbM_TimeDiffType* timeJump
)
Sync/Async Synchronous
Reentrancy Reentrant
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
⌋(RS_TS_00005)
[SWS_StbM_00268]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetTimeLeap() shall report to DET the development error STBM_E_PARAM,
if called with a parameter timeBaseId, which
is not configured or
refers to a Pure Local Time Base or
is within the reserved value range.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00269]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetTimeLeap() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter timeJump.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_GetTimeBaseStatus
[SWS_StbM_00263]⌈
Std_ReturnType StbM_GetTimeBaseStatus (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax StbM_TimeBaseStatusType* syncTimeBaseStatus,
StbM_TimeBaseStatusType* offsetTimeBaseStatus
)
Service ID
0x14
[hex]
Sync/Async Synchronous
Reentrancy Reentrant
Parameters
timeBaseId Time Base reference
(in)
Parameters
None
(inout)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Returns detailed status information for a Synchronized (or Pure Local) Time Base
Description and, if called for an Offset Time Base, for the Offset Time Base and the underlying
Synchronized Time Base.
⌋(RS_TS_00005)
[SWS_StbM_00264]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetTimeBaseStatus() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which
is not configured or
is within the reserved value range.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00386]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetTimeBaseStatus() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter
syncTimeBaseStatus or offsetTimeBaseStatus.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_StartTimer
[SWS_StbM_00272]⌈
Service Name StbM_StartTimer
Std_ReturnType StbM_StartTimer (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax StbM_CustomerIdType customerId,
const StbM_TimeStampType* expireTime
)
Service ID
0x15
[hex]
Sync/Async Synchronous
Parameters
None
(inout)
Parameters
None
(out)
Description Sets a time value, which the Time Base value is compared against
⌋(RS_TS_00017)
[SWS_StbM_00296]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_StartTimer() shall report to DET the development error STBM_E_PARAM, if
called with a parameter timeBaseId, which
is not configured or
is within the reserved value range.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00406]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_StartTimer() shall report to DET the development error STBM_E_PARAM, if
called with a parameter customerId, which is not configured.
⌋(SRS_BSW_00386, SRS_BSW_00323)
103 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
[SWS_StbM_00298]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_StartTimer() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with an invalid pointer of parameter
expireTime.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_GetSyncTimeRecordHead
[SWS_StbM_00319]⌈
Service Name StbM_GetSyncTimeRecordHead
Std_ReturnType StbM_GetSyncTimeRecordHead (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax
StbM_SyncRecordTableHeadType* syncRecordTableHead
)
Sync/Async Synchronous
Parameters
None
(inout)
Accesses to the recorded snapshot data Header of the table belonging to the
Description
Synchronized Time Base.
⌋(RS_TS_00034)
[SWS_StbM_00320]⌈
The function StbM_GetSyncTimeRecordHead() shall be pre compile time
configurable ON/OFF by the configuration parameter:
StbMTimeRecordingSupport (ECUC_StbM_00038 : ).
⌋(RS_TS_00034)
[SWS_StbM_00394]⌈
[SWS_StbM_00405]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
GetSyncTimeRecordHead shall report to DET the development error
STBM_E_PARAM_POINTER, if called with an invalid pointer of parameter
syncRecordTableHead.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_GetOffsetTimeRecordHead
[SWS_StbM_00325]⌈
Service Name StbM_GetOffsetTimeRecordHead
Std_ReturnType StbM_GetOffsetTimeRecordHead (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax StbM_OffsetRecordTableHeadType* offsetRecordTableHead
)
Sync/Async Synchronous
Parameters
None
(inout)
Accesses to the recorded snapshot data Header of the table belonging to the
Description
Offset Time Base.
⌋(RS_TS_00034)
[SWS_StbM_00326]⌈
[SWS_StbM_00327]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetOffsetTimeRecordHead() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which
is not configured or
refers to a Pure Local or a Synchronized Time Base or
is within the reserved value range.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00404]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
GetOffsetTimeRecordHead shall report to DET the development error
STBM_E_PARAM_POINTER, if called with an invalid pointer of parameter
offsetRecordTableHead.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_TriggerTimeTransmission
[SWS_StbM_00346]⌈
Service Name StbM_TriggerTimeTransmission
Std_ReturnType StbM_TriggerTimeTransmission (
Syntax StbM_SynchronizedTimeBaseType timeBaseId
)
Service ID
0x1c
[hex]
Sync/Async Synchronous
Parameters
timeBaseId Time Base reference
(in)
Parameters
None
(inout)
Parameters
None
(out)
Description Called by the <Upper Layer> to force the Timesync Modules to transmit the current
⌋(RS_TS_00011)
[SWS_StbM_00349]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_TriggerTimeTransmission() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which
is not configured or
refers to a Pure Local Time Base or
is within the reserved value range.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_GetTimeBaseUpdateCounter
[SWS_StbM_00347]⌈
Service Name StbM_GetTimeBaseUpdateCounter
uint8 StbM_GetTimeBaseUpdateCounter (
Syntax StbM_SynchronizedTimeBaseType timeBaseId
)
Service ID
0x1b
[hex]
Sync/Async Synchronous
Parameters timeBase
Time Base reference
(in) Id
Parameters
None
(inout)
Parameters
None
(out)
Counter value belonging to the Time Base, that indicates a Time Base
Return value uint8
update to the Timesync Modules
⌋(RS_TS_00011)
[SWS_StbM_00348]⌈
107 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
[Link] StbM_GetMasterConfig
[SWS_StbM_91002]⌈
Service Name StbM_GetMasterConfig
Std_ReturnType StbM_GetMasterConfig (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax
StbM_MasterConfigType* masterConfig
)
Sync/Async Synchronous
Parameters
None
(inout)
Parameters
masterConfig Indicates, if system wide master functionality is supported
(out)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
⌋(RS_TS_00029)
[SWS_StbM_00415]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetMasterConfig() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which
is not configured or
is within the reserved value range.
⌋( SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00416]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetMasterConfig() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter
masterConfig.
⌋( SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_CanSetSlaveTimingData
[SWS_StbM_00484]{DRAFT} ⌈
Service Name StbM_CanSetSlaveTimingData (draft)
Std_ReturnType StbM_CanSetSlaveTimingData (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax
const StbM_CanTimeSlaveMeasurementType* measureDataPtr
)
Sync/Async Synchronous
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Allows the CanTSyn Module to forward CAN specific details to the StbM.
Description
Tags:[Link]=draft
[SWS_StbM_00485]{DRAFT} ⌈
Service Name StbM_FrSetSlaveTimingData (draft)
Std_ReturnType StbM_FrSetSlaveTimingData (
Syntax StbM_SynchronizedTimeBaseType timeBaseId,
Sync/Async Synchronous
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Allows the FrTSyn Module to forward Flexray specific details to the StbM.
Description
Tags:[Link]=draft
[Link] StbM_EthSetSlaveTimingData
[SWS_StbM_00486]{DRAFT} ⌈
Service Name StbM_EthSetSlaveTimingData (draft)
Std_ReturnType StbM_EthSetSlaveTimingData (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax
const StbM_EthTimeSlaveMeasurementType* measureDataPtr
)
Sync/Async Synchronous
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Description Allows the EthTSyn Module to forward Ethernet specific details to the StbM.
Tags:[Link]=draft
[SWS_StbM_00487]⌈
The function StbM_<bus>SetSlaveTimingData() shall be pre compile time
configurable ON/OFF. If the corresponding <bus>TSyn module is configured with
Time Validation Support enabled (refer to parameter
<bus>TSynTimeValidationSupport in <bus>TSyn module)
StbM_<bus>SetSlaveTimingData() shall be ON, otherwise OFF.
⌋(RS_TS_00034)
[SWS_StbM_00488]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_<bus>SetSlaveTimingData() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which does not refer to a
Synchronized Time Base.
⌋(SRS_BSW_00386, SRS_BSW_00323)
Note:
A parameter timeBaseId within the reserved value range indicates legacy use.
[SWS_StbM_00489]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_<bus>SetSlaveTimingData() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter
measureDataPtr.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_CanSetMasterTimingData
[SWS_StbM_00490]{DRAFT} ⌈
Service Name StbM_CanSetMasterTimingData (draft)
Std_ReturnType StbM_CanSetMasterTimingData (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax const StbM_CanTimeMasterMeasurementType* measureDataPtr
)
Sync/Async Synchronous
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Provides CAN Timesyn module specific data for a Time Master to the StbM.
Description
Tags:[Link]=draft
[Link] StbM_FrSetMasterTimingData
[SWS_StbM_00491]{DRAFT} ⌈
Service Name StbM_FrSetMasterTimingData (draft)
Std_ReturnType StbM_FrSetMasterTimingData (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax
const StbM_FrTimeMasterMeasurementType* measureDataPtr
)
Sync/Async Synchronous
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Provides Flexray Timesyn module specific data for a Time Master to the StbM.
Description
Tags:[Link]=draft
[Link] StbM_EthSetMasterTimingData
[SWS_StbM_00492]{DRAFT} ⌈
Service Name StbM_EthSetMasterTimingData (draft)
Std_ReturnType StbM_EthSetMasterTimingData (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax const StbM_EthTimeMasterMeasurementType* measureDataPtr
)
Sync/Async Synchronous
Parameters
None
(inout)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Provides Ethernet Timesyn module specific data for a Time Master to the Stb
Description M.
Tags:[Link]=draft
[SWS_StbM_00493]⌈
The function StbM_<bus>SetMasterTimingData() shall be pre compile time
configurable ON/OFF. If the corresponding <bus>TSyn module is configured with
Time Validation Support enabled (refer to parameter
<bus>TSynTimeValidationSupport in <bus>TSyn module),
StbM_<bus>SetMasterTimingData() shall be ON, otherwise OFF.
⌋(RS_TS_00034)
[SWS_StbM_00494]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_<bus>SetMasterTimingData () shall report to DET the development
error STBM_E_PARAM, if called with a parameter timeBaseId, which does not refer
to a Synchronized Time Base ⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00495]⌈
113 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
[Link] StbM_EthSetPdelayInitiatorData
[SWS_StbM_00496]{DRAFT} ⌈
Service Name StbM_EthSetPdelayInitiatorData (draft)
Std_ReturnType StbM_EthSetPdelayInitiatorData (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax const StbM_PdelayInitiatorMeasurementType* measureData
Ptr
)
Sync/Async Synchronous
Parameters
None
(inout)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
--
Description
Tags:[Link]=draft
⌋(RS_TS_00034)
[SWS_StbM_00497]⌈
The function StbM_EthSetPdelayInitiatorData() shall be pre compile time
configurable ON/OFF. If the EthTSyn module is configured with Time Validation
Support enabled (refer to parameter EthTSynTimeValidationSupport in
EthTSyn module), StbM_EthSetPdelayInitiatorData() shall be ON, otherwise
OFF.
⌋(RS_TS_00034)
[SWS_StbM_00498]⌈
114 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
[SWS_StbM_00499]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_EthSetPdelayInitiatorData() shall report to DET the development
error STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter
measureDataPtr.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_EthSetPdelayResponderData
[SWS_StbM_00500]{DRAFT} ⌈
Service Name StbM_EthSetPdelayResponderData (draft)
Std_ReturnType StbM_EthSetPdelayResponderData (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax const StbM_PdelayResponderMeasurementType* measureData
Ptr
)
Sync/Async Synchronous
Parameters
None
(inout)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
--
Description
Tags:[Link]=draft
⌋(RS_TS_00034)
[SWS_StbM_00501]⌈
The function StbM_EthSetPdelayResponderData() shall be pre compile time
configurable ON/OFF. If the EthTSyn module is configured with Time Validation
115 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
[SWS_StbM_00502]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_EthSetPdelayResponderData () shall report to DET the development
error STBM_E_PARAM, if called with a parameter timeBaseId, which does not refer
to a Synchronized Time Base
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00503]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_EthSetPdelayResponderData () shall report to DET the development
error STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter
measureDataPtr
⌋(SRS_BSW_00386, SRS_BSW_00323, RS_TS_00034)
[Link] StbM_GetBusProtocolParam
[SWS_StbM_91007]⌈
Service Name StbM_GetBusProtocolParam
Std_ReturnType StbM_GetBusProtocolParam (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax
StbM_ProtocolParamType* protocolParam
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters
None
(inout)
This API is used to get bus specific parameters from received Follow_Up
Description
message
⌋(RS_TS_20069)
[SWS_StbM_00518]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetBusProtocolParam() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which is not referring to a
Synchronized Time Base.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00519]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_GetBusProtocolParam() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter
protocolParam.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_SetBusProtocolParam
[SWS_StbM_91008]⌈
Service Name StbM_SetBusProtocolParam
Std_ReturnType StbM_SetBusProtocolParam (
StbM_SynchronizedTimeBaseType timeBaseId,
Syntax const StbM_ProtocolParamType* protocolParam
)
Sync/Async Synchronous
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
Description This API is used to set bus specific parameters of a Time Master
⌋(RS_TS_20069)
[SWS_StbM_00520]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetBusProtocolParam() shall report to DET the development error
STBM_E_PARAM, if called with a parameter timeBaseId, which is not referring to a
Synchronized Time Base.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[SWS_StbM_00521]⌈
If the switch StbMDevErrorDetect (ECUC_StbM_00012 : ) is set to TRUE,
StbM_SetBusProtocolParam() shall report to DET the development error
STBM_E_PARAM_POINTER, if called with a NULL pointer for parameter
protocolParam.
⌋(SRS_BSW_00386, SRS_BSW_00323)
[Link] StbM_MainFunction
[SWS_StbM_00057]⌈
Service
StbM_MainFunction
Name
void StbM_MainFunction (
Syntax void
)
Service ID
0x04
[hex]
This function will be called cyclically by a task body provided by the BSW Schedule.
Description It will invoke the triggered customers and synchronize the referenced OS Schedule
Tables.
⌋(SRS_BSW_00172, SRS_BSW_00373)
[SWS_StbM_00407]⌈
The frequency of invocations of StbM_MainFunction is determined by the
configuration parameter StbMMainFunctionPeriod.
⌋(SRS_BSW_00172)
[SWS_StbM_00107]⌈
If OS is configured as triggered customer, the function StbM_MainFunction shall
synchronize the referenced OS ScheduleTable.
⌋(RS_TS_00032, SRS_BSW_00333)
In this chapter all interfaces required from other modules are listed.
This chapter defines all interfaces which are required to fulfill the core functionality of
the Synchronized Time-Base Manager.
[SWS_StbM_00058]⌈
Header
API Function Description
File
Det_Report-
Det.h Service to report development errors.
Error
EthTSyn_Get- Eth This API is used to read FollowUp information TLV parameters from
ProtocolParam TSyn.h received Follow_Up message.
⌋(SRS_BSW_00301, SRS_BSW_00339)
This chapter defines all interfaces which are required to fulfill an optional functionality
of the Synchronized Time-Base Manager.
[SWS_StbM_00059]⌈
Header
API Function Description
File
This service reads the current count value of a counter (returning either
GetCounter-
Os.h the hardware timer ticks if counter is driven by hardware or the software
Value
ticks when user drives counter).
GetElapsed- This service gets the number of ticks between the current tick value and
Os.h
Value a previously read tick value.
GetSchedule- This service queries the state of a schedule table (also with respect to
Os.h
TableStatus synchronization).
Gpt_GetTime-
Gpt.h Returns the time already elapsed.
Elapsed
Gpt_Start-
Gpt.h Starts a timer channel.
Timer
Sync-
This service provides the schedule table with a synchronization count
Schedule- Os.h
and start synchronization.
Table
⌋(SRS_BSW_00301, SRS_BSW_00339)
[Link].1 SyncTimeRecordBlockCallback
[SWS_StbM_00322]⌈
Service Name SyncTimeRecordBlockCallback<TimeBase>
Std_ReturnType SyncTimeRecordBlockCallback<TimeBase> (
Syntax const StbM_SyncRecordTableBlockType* syncRecordTableBlock
)
Sync/Async Synchronous
Parameters
None
(inout)
Parameters
None
(out)
⌋(RS_TS_00034)
[SWS_StbM_00323]⌈
The function SyncTimeRecordBlockCallback<timeBaseId>()shall be set by
the parameter StbMSyncTimeRecordBlockCallback (ECUC_StbM_00060 : ).
⌋(RS_TS_00034)
[Link].2 OffsetTimeRecordBlockCallback
[SWS_StbM_00328]⌈
Service Name OffsetTimeRecordBlockCallback<TimeBase>
Std_ReturnType OffsetTimeRecordBlockCallback<TimeBase> (
const StbM_OffsetRecordTableBlockType* offsetRecordTable
Syntax
Block
)
Sync/Async Synchronous
Parameters
None
(inout)
Parameters
None
(out)
⌋(RS_TS_00034)
[SWS_StbM_00329]⌈
The function OffsetTimeRecordBlockCallback<timeBaseId> shall set by the
parameter StbMOffsetTimeRecordBlockCallback (ECUC_StbM_00061 : ).
⌋(RS_TS_00034)
[Link].3 StatusNotificationCallback
[SWS_StbM_00285]⌈
Service Name StatusNotificationCallback<TimeBase>
Std_ReturnType StatusNotificationCallback<TimeBase> (
Syntax StbM_TimeBaseNotificationType eventNotification
)
Sync/Async Synchronous
Holds the notification bits for the different Time Base related
Parameters (in) eventNotification
events
Parameters
None
(inout)
Parameters
None
(out)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
The callback notifies the customers, when a <TimeBase> related event occurs,
Description
which is enabled by the notification mask
[SWS_StbM_00299]⌈
The status notification callback function shall be set by the parameter
StbMStatusNotificationCallback (ECUC_StbM_00046 : ).
⌋(RS_TS_00016)
Note: The event notification callback might be called in interrupt context only, if there
is no callback configured in StbM which belongs to a SW-C.
[Link].4 <Customer>_TimeNotificationCallback
[SWS_StbM_00273]⌈
Service Name <Customer>_TimeNotificationCallback<TimeBase>
Std_ReturnType <Customer>_TimeNotificationCallback<Time
Base> (
Syntax StbM_TimeDiffType deviationTime
)
Service ID
0x18
[hex]
Sync/Async Synchronous
Parameters (in) deviationTime Difference time value when callback is called by StbM.
Parameters
None
(inout)
Parameters
None
(out)
E_OK: successful
Return value Std_ReturnType
E_NOT_OK: failed
This callback notifies the <Customer>, when a Time Base reaches the time value
Description
set by StbM_StartTimer for the <TimeBase>
[SWS_StbM_00274]⌈
The event notification callback function shall be set by the parameter
StbMTimeNotificationCallback (ECUC_StbM_00064 : .)
⌋(RS_TS_00017)
[Link] GlobalTime_Master
[SWS_StbM_00244]⌈
Name GlobalTime_Master_{Name}
Description --
Type StbM_SynchronizedTimeBaseType
Port Defined
Argument
{ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronized
Value(s) Value
[Link])}
(({ecuc(StbM/StbMSynchronizedTimeBase/StbMIsSystemWideGlobalTime
Master)} == TRUE ) ||({ecuc(StbM/StbMSynchronizedTimeBase/StbMAllow
Variation SystemWideGlobalTimeMaster)} == TRUE ))&&({ecuc(StbM/StbMSynchronized
TimeBase/StbMSynchronizedTimeBaseIdentifier)} < 128)
Name = {ecuc(StbM/[Link]-NAME)}
[Link] GlobalTime_Slave
[SWS_StbM_00248]⌈
Name GlobalTime_Slave_{Name}
Provided
Kind Interface GlobalTime_Slave_{Name}
Port
Description --
Type StbM_SynchronizedTimeBaseType
Port Defined Argument
Value(s) {ecuc(StbM/StbMSynchronizedTimeBase/Stb
Value
[Link])}
[Link] GlobalTime_StatusEvent
[SWS_StbM_00290]⌈
Name GlobalTime_StatusEvent_{TBName}
Description --
(({ecuc(StbM/StbMSynchronizedTimeBase/StbMNotificationInterface)} == SR_
INTERFACE|| {ecuc(StbM/StbMSynchronizedTimeBase/StbMNotificationInterface)} ==
Variation CALLBACK_AND_SR_INTERFACE))&& ({ecuc(StbM/StbMSynchronizedTimeBase/
StbMSynchronizedTimeBaseIdentifier)} < 128)
TBName = {ecuc(StbM/[Link]-NAME)}
⌋(RS_TS_00035, RS_TS_00016)
[Link] StartTimer
[SWS_StbM_91004]⌈
Name StartTimer_{TimeBase}_{Customer}
Provided
Kind Interface StartTimer
Port
Description --
Type StbM_SynchronizedTimeBaseType
{ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronized
Value
Port Defined [Link])}
Argument Value(s)
Type StbM_CustomerIdType
Value {ecuc(StbM/StbMSynchronizedTimeBase/StbMNotification
Customer/[Link])}
{ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBase
Identifier)} < 128
Variation TimeBase = {ecuc(StbM/[Link]-NAME)}
Customer = {ecuc(StbM/StbMSynchronizedTimeBase/StbMNotification
[Link]-NAME)}
⌋(RS_TS_00017)
[Link] GlobalTime_TimeEvent
[SWS_StbM_00276]⌈
Name GlobalTime_TimeEvent_{TBName}_{CName}
Description --
({ecuc(StbM/StbMSynchronizedTimeBase/StbMNotificationCustomer/StbMTime
NotificationCallback)}==NULL) && ({ecuc(StbM/StbMSynchronizedTimeBase/Stb
MSynchronizedTimeBaseIdentifier)} < 128)
Variation
TBName={ecuc(StbM/[Link]-NAME)}
CName={ecuc(StbM/StbMSynchronizedTimeBase/[Link]-
NAME)}
⌋(RS_TS_00035, RS_TS_00017)
[Link] GlobalTime_Measurement
[SWS_StbM_00387]⌈
Name MeasurementNotification_{TBName}
Description --
(({ecuc(StbM/StbMSynchronizedTimeBase/StbMIsSystemWideGlobalTimeMaster)} ==
FALSE) && ({ecuc(StbM/StbMSynchronizedTimeBase/StbMAllowSystemWideGlobal
TimeMaster)} == FALSE))&& ({ecuc(StbM/StbMGeneral/StbMTimeRecordingSupport)}
== True) && ({ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBase
Variation
Identifier)} < 32)&& (({ecuc(StbM/StbMSynchronizedTimeBase/StbMTimeRecording/
StbMSyncTimeRecordBlockCallback)}==NULL) && ({ecuc(StbM/StbMSynchronized
TimeBase/StbMTimeRecording/StbMOffsetTimeRecordBlockCallback)}==NULL))
TBName={ecuc(StbM/[Link]-NAME)}
⌋(RS_TS_00034)
[Link] TimeBaseProviderNotification_Eth
[SWS_StbM_00458]{DRAFT} ⌈
Name TimeBaseProviderNotification_Eth_{TB_Name} (draft)
TimeBaseProviderNotification_Eth_{TB_-
Kind RequiredPort Interface
Name}
--
Description
Tags:[Link]=draft
({ecuc(StbM/StbMSynchronizedTimeBase/StbMTimeValidation)} != NULL)
&&({ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)}
< 16) &&({ecuc(StbM/StbMSynchronizedTimeBase)} == {ecuc(EthTSyn/EthTSyn
Variation
GlobalTimeDomain/EthTSynSynchronizedTimeBaseRef->StbMSynchronizedTime
Base)}))
TBName={ecuc(StbM/[Link]-NAME)}
⌋(RS_TS_00034)
[Link] TimeBaseProviderNotification_Fr
[SWS_StbM_00459]{DRAFT} ⌈
Name TimeBaseProviderNotification_Fr_{TB_Name} (draft)
--
Description
Tags:[Link]=draft
({ecuc(StbM/StbMSynchronizedTimeBase/StbMTimeValidation)} != NULL)
&&({ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)}
Variation < 16) &&({ecuc(StbM/StbMSynchronizedTimeBase)} == {ecuc(FrTSyn/FrTSynGlobal
TimeDomain/FrTSynSynchronizedTimeBaseRef->StbMSynchronizedTimeBase)})
TBName={ecuc(StbM/[Link]-NAME)}
⌋(RS_TS_00034)
[Link] TimeBaseProviderNotification_Can
[SWS_StbM_00460]{DRAFT} ⌈
Name TimeBaseProviderNotification_Can_{TB_Name} (draft)
TimeBaseProviderNotification_Can_{TB_-
Kind RequiredPort Interface
Name}
--
Description
Tags:[Link]=draft
{ecuc(StbM/StbMSynchronizedTimeBase/StbMTimeValidation)} != NULL)
Variation &&({ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)}
< 16) &&({ecuc(StbM/StbMSynchronizedTimeBase)} == {ecuc(CanTSyn/CanTSyn
GlobalTimeDomain/CanTSynSynchronizedTimeBaseRef->StbMSynchronizedTime
Base)})
TBName={ecuc(StbM/[Link]-NAME)}
⌋(RS_TS_00034)
[Link] StatusNotification
[SWS_StbM_00286]⌈
Name StatusNotification
IsService false
Variation --
eventNotification
Variation --
⌋(RS_TS_00035, RS_TS_00016)
8.2.4 Client-Server-Interfaces
[Link] GlobalTime_Master
[SWS_StbM_00240]⌈
Name GlobalTime_Master_{Name}
Comment --
IsService true
(({ecuc(StbM/StbMSynchronizedTimeBase/StbMIsSystemWideGlobalTimeMaster)} ==
TRUE ) || ({ecuc(StbM/StbMSynchronizedTimeBase/StbMAllowSystemWideGlobal
Variation TimeMaster)} == TRUE ))&& ({ecuc(StbM/StbMSynchronizedTimeBase/Stb
MSynchronizedTimeBaseIdentifier)} < 128)
Name = {ecuc(StbM/[Link]-NAME)}
Operation GetMasterConfig
Indicates in postbuild use case, if the StbM is actually configured as system wide
Comment
master
{ecuc(StbM/StbMSynchronizedTimeBase/StbMAllowSystemWideGlobalTime
Variation
Master)} != NULL
masterConfig
Type StbM_MasterConfigType
Comment --
Variation --
Possible E_OK
Errors E_NOT_OK
Operation SetBusProtocolParam
Comment Operation is used to set bus specific parameters for a Time Master
({ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)} <
Variation 16) &&({ecuc(StbM/StbMSynchronizedTimeBase)} == {ecuc(EthTSyn/EthTSynGlobal
TimeDomain/EthTSynSynchronizedTimeBaseRef->StbMSynchronizedTimeBase)}))
protocolParams
Type StbM_ProtocolParamType
Parameters Direction IN
Variation --
Possible E_OK
Errors E_NOT_OK
Operation SetGlobalTime
Allows the Customers to set the Global Time that will be sent to the buses and
modify HW registers behind the providers, if supported. This function will be used if a
Comment
Time Master is present in this ECU.
Using SetGlobalTimecan lead to an immediate transmission of the Global Time.
Variation --
timeStamp
Type StbM_TimeStampType
Parameters Direction IN
Comment --
Variation --
userData
Type StbM_UserDataType
Direction IN
Comment --
Variation --
Possible E_OK
Errors E_NOT_OK
Operation SetOffset
Comment Allows the Customers and the Timesync Modules to set the Offset Time.
{ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)} >
Variation 15 &&{ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBase
Identifier)} < 32
timeStamp
Type StbM_TimeStampType
Direction IN
Comment --
Variation --
Parameters
userData
Type StbM_UserDataType
Direction IN
Comment --
Variation --
Possible E_OK
Errors E_NOT_OK
Operation SetRateCorrection
Allows to set the rate of a Synchronized Time Base (being either a Pure Local Time
Comment
Base or not).
Variation --
rateDeviation
Type StbM_RateDeviationType
Parameters
Direction IN
Variation --
Possible E_OK
Errors E_NOT_OK
Operation SetUserData
Comment Allows the Customers to set the User Data that will be sent to the buses.
Variation --
userData
Type StbM_UserDataType
Parameters Direction IN
Variation --
E_OK
Possible Errors
E_NOT_OK
Operation TriggerTimeTransmission
Allows the Customers to force the Timesync Modules to transmit the current Time
Comment
Base due to an incremented timeBaseUpdateCounter
{ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)} <
Variation
32
Possible E_OK
Errors E_NOT_OK
Operation UpdateGlobalTime
Allows the Customers to set the Global Time that will be sent to the buses and
modify HW registers behind the providers, if supported. This function will be used if a
Comment Time Master is present in this ECU.
Using UpdateGlobalTime will not lead to an immediate transmission of the Global
Time.
Variation --
timeStamp
Type StbM_TimeStampType
Direction IN
Parameters
Comment --
Variation --
userData
Type StbM_UserDataType
Direction IN
Comment --
Variation --
Possible E_OK
Errors E_NOT_OK
[Link] GlobalTime_Slave
[SWS_StbM_00247]⌈
Name GlobalTime_Slave_{Name}
Comment --
IsService true
{ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)}
Variation < 128
Name = {ecuc(StbM/[Link]-NAME)}
Operation GetBusProtocolParam
Comment Operation is used to get bus specific parameters for a Time Master or Time Slave
({ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)} <
Variation 16) &&({ecuc(StbM/StbMSynchronizedTimeBase)} == {ecuc(EthTSyn/EthTSynGlobal
TimeDomain/EthTSynSynchronizedTimeBaseRef->StbMSynchronizedTimeBase)}))
protocolParams
Type StbM_ProtocolParamType
Variation --
Possible E_OK
Errors E_NOT_OK
Operation GetCurrentTime
Comment Returns a time value (Local Time Base derived from Global Time Base) in
standard format.
Variation --
timeStamp
Type StbM_TimeStampType
Direction OUT
Comment --
Variation --
Parameters
userData
Type StbM_UserDataType
Direction OUT
Comment --
Variation --
Possible E_OK
Errors E_NOT_OK
Operation GetCurrentTimeExtended
Returns a time value (Local Time Base derived from Global Time Base) in
Comment
extended format.
Variation {ecuc(StbM/StbMGeneral/StbMGetCurrentTimeExtendedAvailable)}
timeStamp
Type StbM_TimeStampExtendedType
Direction OUT
Comment --
Variation --
Parameters
userData
Type StbM_UserDataType
Direction OUT
Comment --
Variation --
Possible E_OK
Errors E_NOT_OK
Operation GetOffsetTimeRecordHead
Reads the header of the table with recorded measurement data belonging to the
Comment
Offset Time Base
(({ecuc(StbM/StbMSynchronizedTimeBase/StbMIsSystemWideGlobalTimeMaster)}
== FALSE) &&({ecuc(StbM/StbMSynchronizedTimeBase/StbMAllowSystemWide
GlobalTimeMaster)} == FALSE)) &&({ecuc(StbM/StbMGeneral/StbMTimeRecording
Variation
Support)} == True) &&({ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronized
TimeBaseIdentifier)} > 15) && {ecuc(StbM/StbMSynchronizedTimeBase/Stb
MSynchronizedTimeBaseIdentifier)} < 32
offsetRecordTableHead
Type StbM_OffsetRecordTableHeadType
Variation --
Possible E_OK
Errors E_NOT_OK
Operation GetRateDeviation
Variation --
rateDeviation
Type StbM_RateDeviationType
Variation --
E_OK
Possible Errors
E_NOT_OK
Operation GetSyncTimeRecordHead
Reads the header of the table with recorded measurement data belonging to the
Comment
Synchronized Time Base
(({ecuc(StbM/StbMSynchronizedTimeBase/StbMIsSystemWideGlobalTimeMaster)}
== FALSE) &&({ecuc(StbM/StbMSynchronizedTimeBase/StbMAllowSystemWide
Variation GlobalTimeMaster)} == FALSE)) &&({ecuc(StbM/StbMGeneral/StbMTimeRecording
Support)} == True) &&({ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronized
TimeBaseIdentifier)} < 16)
syncRecordTableHead
Direction OUT
Variation --
Possible E_OK
Errors E_NOT_OK
Operation GetTimeBaseStatus
Returns detailed status information for a Synchronized (or Pure Local) Time Base
Comment and, if called for an Offset Time Base, for the Offset Time Base and the underlying
Synchronized Time Base.
Variation --
syncTimeBaseStatus
Type StbM_TimeBaseStatusType
Direction OUT
Variation --
Parameters
offsetTimeBaseStatus
Type StbM_TimeBaseStatusType
Direction OUT
Variation --
Possible E_OK
Errors E_NOT_OK
Operation GetTimeLeap
{ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)}
Variation
< 32
timeJump
Type StbM_TimeDiffType
Variation --
Possible E_OK
Errors E_NOT_OK
[Link] StartTimer
[SWS_StbM_00409]⌈
Name StartTimer
IsService true
Variation --
Operation StartTimer
Starts a StbM internal timer, which expires at the given expireTime and which
Comment
triggers a time notification callback.
Variation --
expireTime
Type StbM_TimeStampType
Parameters Direction IN
Comment --
Variation --
Possible E_OK
Errors E_NOT_OK
⌋(RS_TS_00017)
[Link] TimeNotification
[SWS_StbM_00275]⌈
Name TimeNotification
Notification, which indicates, that the timer has expired, which has been set by
Comment
StartTimer
IsService true
Variation --
Operation NotifyTime
Notification, which indicates, that the timer has expired, which has been set by Stb
Comment
M_StartTimer
Variation --
deviationTime
Type StbM_TimeDiffType
Parameters Direction IN
Comment --
Variation --
Possible E_OK
Errors E_NOT_OK
⌋(RS_TS_00035, RS_TS_00017)
[Link] MeasurementNotification
[SWS_StbM_00339]⌈
Name MeasurementNotification_{TB_Name}
Notifies about the availability of a new recorded measurement data block belonging to
Comment
the Time Base.
IsService true
Operation SetOffsetTimeRecordTable
Provides to the recorded snapshot data Block of the table belonging to the Offset
Comment
Time Base.
{ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)} >
Variation 15 &&{ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBase
Identifier)} < 32
offsetRecordTableBlock
Parameters
Type StbM_OffsetRecordTableBlockType
Direction IN
Variation --
Possible E_OK
Errors E_NOT_OK
Operation SetSyncTimeRecordTable
Provides the recorded snapshot data Block of the table belonging to the
Comment
Synchronized Time Base.
{ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)} <
Variation
16
syncRecordTableBlock
Type StbM_SyncRecordTableBlockType
Parameters Direction IN
Variation --
Possible E_OK
Errors E_NOT_OK
⌋(RS_TS_00034)
[Link] TimeBaseProviderNotification_Eth
[SWS_StbM_00461]{DRAFT} ⌈
Name TimeBaseProviderNotification_Eth_{TB_Name} (draft)
Notifies about the availability of a new Ethernet specific data block recorded for the
Comment Time Base.
Tags:[Link]=draft
IsService true
({ecuc(StbM/StbMSynchronizedTimeBase/StbMTimeValidation)} != NULL)
&&({ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)} <
Variation 16) &&({ecuc(StbM/StbMSynchronizedTimeBase)} == {ecuc(EthTSyn/EthTSynGlobal
TimeDomain/EthTSynSynchronizedTimeBaseRef->StbMSynchronizedTimeBase)})
TB_Name ={ecuc(StbM/[Link]-NAME)}
Operation SetMasterTimingData
Comment Provides the recorded data block for the Time Master of the Time Base.
({ecuc(EthTSyn/EthTSynGlobalTimeDomain/EthTSynPortRole/EthTSynGlobalTime
Variation
Master)}!=NULL)
measurementData
Type StbM_EthTimeMasterMeasurementType
Parameters Direction IN
Variation --
Possible E_OK
Errors E_NOT_OK
Operation SetPdelayInitiatorData
Comment Provides the recorded data block for the pDelay Initiator of the Time Base.
(({ecuc(EthTSyn/EthTSynGlobalTimeDomain/EthTSynPortRole/EthTSynGlobal
Variation
TimeSlave)}!=NULL)
measurementData
Type StbM_PdelayInitiatorMeasurementType
Parameters Direction IN
Variation --
Possible E_OK
Errors E_NOT_OK
Operation SetPdelayResponderData
Comment Provides the recorded data block for the pDelay Responder of the Time Base.
(({ecuc(EthTSyn/EthTSynGlobalTimeDomain/EthTSynPortRole/EthTSynGlobal
Variation
TimeMaster)}!=NULL)
measurementData
Type StbM_PdelayResponderMeasurementType
Parameters Direction IN
Variation --
Possible E_OK
Errors E_NOT_OK
Operation SetSlaveTimingData
Comment Provides the recorded data block for the Time Slave of the Time Base.
({ecuc(EthTSyn/EthTSynGlobalTimeDomain/EthTSynPortRole/EthTSynGlobalTime
Variation
Slave)}!=NULL)
measurementData
Type StbM_EthTimeSlaveMeasurementType
Parameters Direction IN
Variation --
Possible E_OK
Errors E_NOT_OK
⌋(RS_TS_00034)
[Link] TimeBaseProviderNotification_Fr
[SWS_StbM_00462]{DRAFT} ⌈
Name TimeBaseProviderNotification_Fr_{TB_Name} (draft)
Notifies about the availability of a new Flexray specific data block recorded for the Time
Comment Base.
Tags:[Link]=draft
IsService true
({ecuc(StbM/StbMSynchronizedTimeBase/StbMTimeValidation)} != NULL)
&&({ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)} <
Variation 16) &&({ecuc(StbM/StbMSynchronizedTimeBase)} == {ecuc(FrTSyn/FrTSynGlobal
TimeDomain/FrTSynSynchronizedTimeBaseRef->StbMSynchronizedTimeBase)})
TB_Name ={ecuc(StbM/[Link]-NAME)}
Operation SetMasterTimingData
Comment Provides the recorded data block for the Time Master of the Time Base.
Variation ({ecuc(FrTSyn/FrTSynGlobalTimeDomain/FrTSynGlobalTimeMaster)}!=NULL)
measurementData
Direction IN
Variation --
E_OK
Possible Errors
E_NOT_OK
Operation SetSlaveTimingData
Comment Provides the recorded data block for the Time Slave of the Time Base.
Variation ({ecuc(FrTSyn/FrTSynGlobalTimeDomain/FrTSynGlobalTimeSlave)}!=NULL)
measurementData
Type StbM_FrTimeSlaveMeasurementType
Parameters Direction IN
Variation --
E_OK
Possible Errors
E_NOT_OK
⌋(RS_TS_00034)
[Link] TimeBaseProviderNotification_Can
[SWS_StbM_00463]{DRAFT} ⌈
Name TimeBaseProviderNotification_Can_{TB_Name} (draft)
Notifies about the availability of a new CAN specific data block recorded for the Time
Comment Base.
Tags:[Link]=draft
IsService true
({ecuc(StbM/StbMSynchronizedTimeBase/StbMTimeValidation)} != NULL)
&&({ecuc(StbM/StbMSynchronizedTimeBase/StbMSynchronizedTimeBaseIdentifier)} <
Variation 16) &&({ecuc(StbM/StbMSynchronizedTimeBase)} == {ecuc(CanTSyn/CanTSynGlobal
TimeDomain/CanTSynSynchronizedTimeBaseRef->StbMSynchronizedTimeBase)})
TB_Name ={ecuc(StbM/[Link]-NAME)}
Operation SetMasterTimingData
Comment Provides the recorded data block for the Time Master of the Time Base.
({ecuc(CanTSyn/CanTSynGlobalTimeDomain/CanTSynGlobalTime
Variation
Master)}!=NULL)
measurementData
Type StbM_CanTimeMasterMeasurementType
Parameters Direction IN
Variation --
Possible E_OK
Errors E_NOT_OK
Operation SetSlaveTimingData
Comment Provides the recorded data block for the Time Slave of the Time Base.
({ecuc(CanTSyn/CanTSynGlobalTimeDomain/CanTSynGlobalTime
Variation
Slave)}!=NULL)
measurementData
Type StbM_CanTimeSlaveMeasurementType
Parameters Direction IN
Variation --
Possible E_OK
Errors E_NOT_OK
⌋(RS_TS_00034)
This chapter specifies the data types which will be used for the service port
interfaces for accessing the Synchronized Time-Base Manager service.
The implementation header defines additionally those data types, which are listed in
chapter 8.1.2, if not included by the application types header.
[Link] StbM_PortIdType
[SWS_StbM_00483]⌈
Name StbM_PortIdType
Kind Structure
clockIdentity
Type uint64
Type uint16
⌋(RS_TS_00034)
[Link] StbM_SynchronizedTimeBaseType
[SWS_StbM_00142]⌈
Name StbM_SynchronizedTimeBaseType
Kind Type
Range 0..2^16-1 -- --
Description Variables of this type are used to represent the kind of synchronized time-base.
Variation --
[Link] StbM_TimeBaseStatusType
[SWS_StbM_00239]⌈
Name StbM_TimeBaseStatusType
Kind Bitfield
Derived
uint8
from
Variation --
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00009)
[Link] StbM_TimeStampShortType
[SWS_StbM_00482]⌈
Name StbM_TimeStampShortType
Kind Structure
nanoseconds
Type uint32
Type uint32
Variables of this type are used for expressing time stamps with a limited range
including relative time and absolute calendar time. The absolute time starts from
Description 1970-01-01. 0 to [Link] s ~ 136 years
0 to 999999999ns [0x3B9A C9FF] invalid value in nanoseconds: [0x3B9A CA00] to
[0x3FFF FFFF] Bit 30 and 31 reserved, default: 0
Variation --
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00034)
[Link] StbM_TimeStampType
[SWS_StbM_00241]⌈
Name StbM_TimeStampType
Kind Structure
timeBaseStatus
Type StbM_TimeBaseStatusType
nanoseconds
Type uint32
Type uint32
secondsHi
Type uint16
Variables of this type are used for expressing time stamps including relative time and
absolute calendar time. The absolute time starts from 1970-01-01. 0 to
Description 281474976710655s == 3257812230d [0xFFFF FFFF FFFF] 0 to 999999999ns
[0x3B9A C9FF] invalid value in nanoseconds: [0x3B9A CA00] to [0x3FFF FFFF] Bit 30
and 31 reserved, default: 0
Variation --
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00036)
144 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
Note: Start of absolute time (1970-01-01) is according to [18], Annex C/C1 (refer to
parameter "approximate epoch" for PTP)
[Link] StbM_TimeStampExtendedType
[SWS_StbM_00242]⌈
Name StbM_TimeStampExtendedType
Kind Structure
timeBaseStatus
Type StbM_TimeBaseStatusType
nanoseconds
seconds
Type uint64
Variables of this type are used for expressing time stamps including relative time and
Description
absolute calendar time. The absolute time starts from 1970-01-01.
Variation --
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00036)
Note: Start of absolute time (1970-01-01) is according to [18], Annex C/C1 (refer to
parameter "approximate epoch" for PTP)
[Link] StbM_TimeDiffType
[SWS_StbM_00300]⌈
Name StbM_TimeDiffType
Kind Type
Derived
sint32
from
Variables of this type are used to express time differences / offsets as signed values
Description
in in nanoseconds
Variation --
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00010)
[Link] StbM_RateDeviationType
[SWS_StbM_00301]⌈
Name StbM_RateDeviationType
Kind Type
Description Variables of this type are used to express a rate deviation in ppm.
Variation --
⌋(RS_TS_00017)
[Link] StbM_UserDataType
[SWS_StbM_00243]⌈
Name StbM_UserDataType
Kind Structure
userDataLength
Type uint8
userByte0
userByte1
Type uint8
userByte2
Type uint8
Variation --
⌋(RS_TS_00014, RS_TS_00015)
[Link] StbM_CustomerIdType
[SWS_StbM_00288]⌈
Name StbM_CustomerIdType
Kind Type
Variation --
[Link] StbM_TimeBaseNotificationType
[SWS_StbM_00287]⌈
Name StbM_TimeBaseNotificationType
Kind Bitfield
Derived
uint32
from
Variation --
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00035, RS_TS_00016)
[Link] StbM_SyncRecordTableHeadType
[SWS_StbM_00331]⌈
Name StbM_SyncRecordTableHeadType
Kind Structure
SynchronizedTimeDomain
Elements
Type uint8
HWfrequency
Type uint32
Comment HW Frequency in Hz
HWprescaler
Type uint32
Variation --
⌋(RS_TS_00034)
[Link] StbM_SyncRecordTableBlockType
[SWS_StbM_00332]⌈
Name StbM_SyncRecordTableBlockType
Kind Structure
GlbSeconds
Type uint32
Seconds of the Local Time Base directly after synchronization with the
Comment
Global Time Base
GlbNanoSeconds
Type uint32
Type StbM_TimeBaseStatusType
Time Base Status of the Local Time Base directly after synchronization
Comment
with the Global Time Base
VirtualLocalTimeLow
Type uint32
RateDeviation
Type StbM_RateDeviationType
LocSeconds
Type uint32
Seconds of the Local Time Base directly before synchronization with the
Comment
Global Time Base
LocNanoSeconds
Type uint32
PathDelay
Type uint32
Variation --
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00034)
[Link] StbM_OffsetRecordTableHeadType
[SWS_StbM_00333]⌈
Name StbM_OffsetRecordTableHeadType
Kind Structure
OffsetTimeDomain
Variation --
⌋(RS_TS_00034)
[Link] StbM_OffsetRecordTableBlockType
[SWS_StbM_00334]⌈
Name StbM_OffsetRecordTableBlockType
Kind Structure
GlbSeconds
Type uint32
GlbNanoSeconds
Type uint32
Elements
Comment Nanoseconds of the Offset Time Base
TimeBaseStatus
Type StbM_TimeBaseStatusType
Time Base Status of the Local Time Base directly after synchronization
Comment
with the Global Time Base
Variation --
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00034)
[Link] StbM_MasterConfigType
[SWS_StbM_91001]⌈
Name StbM_MasterConfigType
Kind Type
Derived
uint8
from
This type indicates if an ECU is configured for a system wide master for a given Time
Description
Base is available or not.
Variation --
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00029)
[Link] StbM_EthTimeMasterMeasurementType
[SWS_StbM_00504]⌈
Name StbM_EthTimeMasterMeasurementType
Kind Structure
sequenceId
Type uint16
sourcePortId
Type StbM_PortIdType
syncEgressTimestamp
preciseOriginTimestamp
Type StbM_TimeStampShortType
correctionField
Type sint64
Description Structure with detailed data for Time Validation of the Time Master on Ethernet
⌋(RS_TS_00034)
[Link] StbM_FrTimeMasterMeasurementType
[SWS_StbM_00505]⌈
Name StbM_FrTimeMasterMeasurementType
Kind Structure
sequenceCounter
Type uint16
referenceTimestamp
Type StbM_VirtualLocalTimeType
Type StbM_TimeStampShortType
segmentId
Type uint8
Description Structure with detailed data for Time Validation of the Time Master on Flexray
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00034)
[Link] StbM_CanTimeMasterMeasurementType
[SWS_StbM_00511]⌈
Name StbM_CanTimeMasterMeasurementType
Kind Structure
sequenceCounter
Type uint16
Type StbM_VirtualLocalTimeType
preciseOriginTimestamp
Type StbM_TimeStampShortType
segmentId
Type uint8
Description Structure with detailed data for Time Validation of the Time Master on CAN
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00034)
[Link] StbM_EthTimeSlaveMeasurementType
[SWS_StbM_00506]⌈
Name StbM_EthTimeSlaveMeasurementType
Kind Structure
sequenceId
Type uint16
sourcePortId
Type StbM_PortIdType
syncIngressTimestamp
Elements
Type StbM_VirtualLocalTimeType
preciseOriginTimestamp
Type StbM_TimeStampShortType
correctionField
Type sint64
pDelay
Type uint32
referenceLocalTimestamp
Type StbM_VirtualLocalTimeType
referenceGlobalTimestamp
Type StbM_TimeStampShortType
Description Structure with detailed data for Time Validation of the Time Slave on Ethernet
⌋(RS_TS_00034)
[Link] StbM_FrTimeSlaveMeasurementType
[SWS_StbM_00507]⌈
Name StbM_FrTimeSlaveMeasurementType
Kind Structure
sequenceCounter
Type uint16
syncIngressTimestamp
Type StbM_VirtualLocalTimeType
preciseOriginTimestampSec
Type StbM_TimeStampShortType
currentCycle
Type uint8
155 of 189 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
Specification of Synchronized Time-Base Manager
AUTOSAR CP R20-11
CurrentMacroticks
Type uint16
FCNT
Type uint8
macrotickDuration
Type uint16
cycleLength
Type uint32
referenceLocalTimestamp
Type StbM_VirtualLocalTimeType
referenceGlobalTimestampSec
Type StbM_TimeStampShortType
segmentId
Type uint8
Description Structure with detailed data for Time Validation of the Time Slave on Flexray
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00034)
[Link] StbM_CanTimeSlaveMeasurementType
[SWS_StbM_00510]⌈
Name StbM_CanTimeSlaveMeasurementType
Kind Structure
sequenceCounter
Type uint16
syncIngressTimestamp
Type StbM_VirtualLocalTimeType
preciseOriginTimestamp
Type StbM_TimeStampShortType
Type StbM_VirtualLocalTimeType
referenceGlobalTimestamp
Type StbM_TimeStampShortType
segmentId
Type uint8
Description Structure with detailed timing data for the Time Slave on CAN
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00034)
[Link] StbM_PdelayInitiatorMeasurementType
[SWS_StbM_00508]⌈
Name StbM_PdelayInitiatorMeasurementType
Kind Structure
sequenceId
Type uint16
requestPortId
Type StbM_PortIdType
responsePortId
Type StbM_PortIdType
requestOriginTimestamp
Type StbM_VirtualLocalTimeType
responseReceiptTimestamp
Type StbM_VirtualLocalTimeType
Elements
Comment Ingress timestamp of Pdelay_Resp in Virtual Local Time
requestReceiptTimestamp
Type StbM_TimeStampShortType
responseOriginTimestamp
Type StbM_TimeStampShortType
referenceLocalTimestamp
Type StbM_VirtualLocalTimeType
Comment Value of the Virtual Local Time of the reference Global Time Tuple
referenceGlobalTimestamp
Type StbM_TimeStampShortType
Value of the local instance of the Global Time of the reference Global
Comment
Time Tuple
pdelay
Type uint32
Description Structure with detailed timing data for the pDelay Initiator
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00034)
[Link] StbM_PdelayResponderMeasurementType
[SWS_StbM_00509]⌈
Name StbM_PdelayResponderMeasurementType
Kind Structure
sequenceId
Type uint16
requestPortId
Type StbM_PortIdType
responsePortId
Type StbM_PortIdType
Type StbM_VirtualLocalTimeType
responseOriginTimestamp
Type StbM_VirtualLocalTimeType
referenceLocalTimestamp
Type StbM_VirtualLocalTimeType
Value of the Virtual Local Time of the reference Global Time Tuple used
Comment
to convert requestReceiptTimestamp and responseOriginTimestamp into
Global Time
referenceGlobalTimestamp
Type StbM_TimeStampShortType
Value of the local instance of the Global Time of the reference Global
Comment Time Tuple used to convert requestReceiptTimestamp and response
OriginTimestamp into Global Time
Description Structure with detailed timing data for the pDelay Responder
Available
Rte_StbM_Type.h
via
⌋(RS_TS_00034)
[Link] StbM_TimeSyncType
[SWS_StbM_91009]⌈
Name StbM_TimeSyncType
Kind Enumeration
Variation --
Available
Rte_StbM_Type.h
via
⌋(RS_TS_20069)
[Link] StbM_ProtocolParamType
[SWS_StbM_91010]⌈
Name StbM_ProtocolParamType
Kind Structure
protocolType
Elements
Type StbM_TimeSyncType
cumulativeScaledRateOffset
Type sint32
Comment The cumulative rate offset of the Time Master acc. to IEEE 802.1AS
gmTimeBaseIndicator
Type uint16
The time base indicator of the current Global Time Master acc. to
Comment
IEEE 802.1AS
lastGmPhaseChange
Type sint32
The phase change of the current Global Time Master acc. to IEEE
Comment
802.1AS
scaledLastGmFreqChange
Type uint32
The scaled last frequency change of the Global Time Master acc. to
Comment
IEEE 802.1AS
This structure defines TimeSync protocol specific parameters relevant for the
Description
individual TimeSync modules (only EthTSyn specific parameters are known so far)
Variation --
Available
Rte_StbM_Type.h
via
⌋(RS_TS_20069)
9 Sequence diagrams
The sequence diagrams in this chapter show the basic operations of the
Synchronized Time-Base Manager.
Please note that the sequence diagrams are an extension for illustrational purposes
to ease understanding of the specification.
«module» «module»
EcuM StbM
StbM_Init()
StbM_Init()
«module» «module»
StbM Os
StbM_MainFunction()
GetScheduleTableStatus(StatusType, ScheduleTableType,
ScheduleTableStatusRefType*)
alt
[ScheduleStatus == SCHEDULETABLE_WAITING or SCHEDULETABLE_RUNNING or SCHEDULETABLE_RUNNING_AND_SYNCHRONOUS]
SyncScheduleTable(ScheduleTableType, GlobalTimeTickType)
SyncScheduleTable()
[else]
StbM_MainFunction()
10 Configuration specification
In general, this chapter defines configuration parameters and their clustering into
containers. In order to support the specification chapter 10.1 describes
fundamentals. It also specifies a template (table) you shall use for the parameter
specification. We intend to leave chapter 10.1 in the specification to guarantee
comprehension.
Chapter 10.2 specifies the structure (containers) and the parameters of the
Synchronized Time-Base Manager. Chapter 10.3 specifies published information of
the module Synchronized Time-Base Manager.
10.2.1 StbM
Included Containers
Container Name Multiplicity Scope / Dependency
This container holds the general parameters of the
StbMGeneral 1
Synchronized Time-base Manager
Synchronized [Link] collects the information about a
StbMSynchronizedTimeBase 1..*
specific time-base provider within the system.
The triggered customer is directly triggered by the
StbMTriggeredCustomer 0..* Synchronized Time-base Manager by getting synchronized
with the current (global) definition of time and passage of time.
StbMTriggeredCustomer:
EcucParamConfContainerDef
+container
lowerMultiplicity = 0
upperMultiplicity = *
StbMDevErrorDetect:
+parameter EcucBooleanParamDef
StbMGeneral:
EcucParamConfContainerDef defaultValue = false
StbMVersionInfoApi:
+parameter
EcucBooleanParamDef
defaultValue = false
StbMMainFunctionPeriod:
+parameter EcucFloatParamDef
min = 0
max = INF
StbMGetCurrentTimeExtendedAvailable:
+parameter EcucBooleanParamDef
lowerMultiplicity = 0
upperMultiplicity = 1
+container
+parameter StbMTimeRecordingSupport:
EcucBooleanParamDef
StbMTimerStartThreshold:
EcucFloatParamDef
+parameter
min = 0.0
max = INF
lowerMultiplicity = 0
upperMultiplicity = 1
StbMEcucPartitionRef: EcucPartition:
+reference +destination EcucParamConfContainerDef
EcucReferenceDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
10.2.2 StbMGeneral
Multiplicity 1
Type EcucBooleanParamDef
Default value false
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
Post-build time --
Scope / Dependency scope: local
No Included Containers
10.2.3 StbMSynchronizedTimeBase
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
NO_NOTIFICATION --
SR_INTERFACE --
Post-Build Variant
false
Multiplicity
Post-Build Variant
false
Value
Multiplicity Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
Multiplicity 1
Type EcucIntegerParamDef (Symbolic Name generated for this parameter)
Range 0 .. 65535
Default value --
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
Post-Build Variant
false
Multiplicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
Description This is the reference to the Synchronized Time-Base this Offset Time-Base
is based on. This reference makes the containing
StbMSynchronizedTimeBase an Offset Time-Base.
Multiplicity 0..1
Type Reference to [ StbMSynchronizedTimeBase ]
Post-Build Variant
false
Multiplicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
Included Containers
Container Name Multiplicity Scope / Dependency
References the hardware reference clock of this Synchronized
StbMLocalTimeClock 0..1
Time Base.
This container holds the configuration of a notification
StbMNotificationCustomer 0..* customer, which is notified is informed about the occurance of
a Time-base related event.
Collects the information relevant for the rate- and offset
StbMTimeCorrection 0..1
correction of a Time Base.
Collects the information relevant for configuration of the
StbMTimeRecording 0..1
precision measurement of a Time Base.
StbMTimeValidation 0..1 Container with Time Validation configuration for Time Base.
StbMStoreTimebaseNonVolatile:
StbMSynchronizedTimeBase: +literal NO_STORAGE:
+parameter EcucEnumerationParamDef
EcucParamConfContainerDef EcucEnumerationLiteralDef
lowerMultiplicity = 0
lowerMultiplicity = 1 upperMultiplicity = 1
upperMultiplicity = *
+literal
STORAGE_AT_SHUTDOWN:
EcucEnumerationLiteralDef
+parameter StbMSynchronizedTimeBaseIdentifier:
EcucIntegerParamDef
min = 0
max = 65535 StbMTimeLeapPastThreshold:
symbolicNameValue = true EcucFloatParamDef
+parameter
min = 0
max = INF
StbMTimeLeapFutureThreshold: lowerMultiplicity = 0
EcucFloatParamDef upperMultiplicity = 1
+parameter
min = 0
max = INF
lowerMultiplicity = 0
upperMultiplicity = 1 StbMAllowSystemWideGlobalTimeMaster:
EcucBooleanParamDef
+parameter
lowerMultiplicity = 0
upperMultiplicity = 1
StbMSyncLossTimeout: EcucFloatParamDef
min = 0
+parameter
max = INF
lowerMultiplicity = 0
upperMultiplicity = 1
StbMIsSystemWideGlobalTimeMaster:
+parameter EcucBooleanParamDef
+reference
StbMOffsetTimeBase: EcucReferenceDef
+destination lowerMultiplicity = 0
upperMultiplicity = 1 StbMStatusNotificationMask:
EcucIntegerParamDef
+parameter min = 0
max = 4294967295
defaultValue = 0
lowerMultiplicity = 0
StbMStatusNotificationCallback: upperMultiplicity = 1
+parameter EcucFunctionNameDef
lowerMultiplicity = 1 +literal
upperMultiplicity = 1 SR_INTERFACE:
EcucEnumerationLiteralDef
+literal CALLBACK_AND_SR_INTERFACE:
StbMClearTimeleapCount: EcucIntegerParamDef EcucEnumerationLiteralDef
+parameter min = 1
max = 65535
defaultValue = 1
lowerMultiplicity = 0
upperMultiplicity = 1 StbMLocalTimeClock:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = 1
StbMTimeCorrection:
+subContainer EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1 StbMTimeRecording:
+subContainer EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
StbMNotificationCustomer:
+subContainer EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = * StbMTimeValidation:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.4 StbMTimeCorrection
Multiplicity 0..1
Type EcucBooleanParamDef
Default value false
Post-Build Variant
false
Multiplicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
Post-build time --
Scope / Dependency scope: local
No Included Containers
StbMSynchronizedTimeBase:
EcucParamConfContainerDef
lowerMultiplicity = 1
upperMultiplicity = *
+subContainer
StbMRateCorrectionMeasurementDuration:
StbMTimeCorrection:
EcucFloatParamDef
EcucParamConfContainerDef
+parameter min = 0.0
lowerMultiplicity = 0
max = INF
upperMultiplicity = 1
defaultValue = 1.0
lowerMultiplicity = 0
upperMultiplicity = 1
StbMRateCorrectionsPerMeasurementDuration:
EcucIntegerParamDef
+parameter
min = 1
max = 65535
defaultValue = 1
lowerMultiplicity = 0
upperMultiplicity = 1
StbMOffsetCorrectionJumpThreshold:
EcucFloatParamDef
+parameter
min = 0.0
max = INF
lowerMultiplicity = 0
upperMultiplicity = 1
StbMOffsetCorrectionAdaptionInterval:
EcucFloatParamDef
+parameter min = 0.0
max = INF
lowerMultiplicity = 0
upperMultiplicity = 1
StbMAllowMasterRateCorrection:
EcucBooleanParamDef
+parameter
lowerMultiplicity = 0
upperMultiplicity = 1
defaultValue = false
StbMMasterRateDeviationMax:
+parameter EcucIntegerParamDef
min = 0
max = 32000
defaultValue = 0
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.5 StbMLocalTimeClock
No Included Containers
StbMSynchronizedTimeBase:
EcucParamConfContainerDef
lowerMultiplicity = 1
upperMultiplicity = *
+subContainer
StbMLocalTimeClock: StbMClockFrequency:
EcucParamConfContainerDef EcucIntegerParamDef
+parameter
lowerMultiplicity = 0 min = 0
upperMultiplicity = 1 max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
StbMClockPrescaler:
EcucIntegerParamDef
+parameter
min = 0
max = 4294967295
lowerMultiplicity = 0
upperMultiplicity = 1
StbMLocalTimeHardware: EthTSynGlobalTimeDomain:
EcucChoiceReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 1 lowerMultiplicity = 1
upperMultiplicity = 1 upperMultiplicity = *
+reference OsCounter:
+destination EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
+destination GptChannelConfiguration:
EcucParamConfContainerDef
upperMultiplicity = *
lowerMultiplicity = 1
10.2.6 StbMTimeRecording
regularExpression --
Post-Build Variant
false
Multiplicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
No Included Containers
StbMSynchronizedTimeBase:
EcucParamConfContainerDef
lowerMultiplicity = 1
upperMultiplicity = *
+subContainer
StbMTimeRecording: StbMSyncTimeRecordTableBlockCount:
EcucParamConfContainerDef +parameter EcucIntegerParamDef
lowerMultiplicity = 0 min = 0
upperMultiplicity = 1 max = 65535
StbMOffsetTimeRecordTableBlockCount:
+parameter EcucIntegerParamDef
min = 0
max = 65535
StbMSyncTimeRecordBlockCallback:
+parameter EcucFunctionNameDef
lowerMultiplicity = 0
upperMultiplicity = 1
StbMOffsetTimeRecordBlockCallback:
+parameter EcucFunctionNameDef
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.7 StbMTimeValidation
No Included Containers
StbMSynchronizedTimeBase:
EcucParamConfContainerDef
lowerMultiplicity = 1
upperMultiplicity = *
+subContainer
StbMTimeValidation: StbMTimeValidationRecordTableBlockCount:
EcucParamConfContainerDef +parameter EcucIntegerParamDef
lowerMultiplicity = 0 min = 0
upperMultiplicity = 1 max = 65535
10.2.8 StbMNotificationCustomer
No Included Containers
StbMSynchronizedTimeBase:
EcucParamConfContainerDef
lowerMultiplicity = 1
upperMultiplicity = *
+subContainer
StbMNotificationCustomerId:
StbMNotificationCustomer: EcucIntegerParamDef
EcucParamConfContainerDef +parameter
min = 0
lowerMultiplicity = 0 max = 65535
upperMultiplicity = * symbolicNameValue = true
StbMTimeNotificationCallback:
+parameter EcucFunctionNameDef
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.9 StbMTriggeredCustomer
Multiplicity
Multiplicity Configuration Pre-compile time X All Variants
Class Link time --
Post-build time --
Configuration Parameters
No Included Containers
StbMSynchronizedTimeBaseRef: StbMSynchronizedTimeBase:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 1
upperMultiplicity = *
StbMTriggeredCustomerPeriod:
+parameter EcucIntegerParamDef
min = 0
max = 4294967295
10.3 Constraints
[SWS_StbM_CONSTR_00001]
If variant is VARIANT-POST-BUILD, StbMAllowSystemWideGlobalTimeMaster
shall be mandatory.
[SWS_StbM_CONSTR_00002]
If variant is VARIANT-POST-BUILD, StbMIsSystemWideGlobalTimeMaster can
only be set to TRUE, if StbMAllowSystemWideGlobalTimeMaster is set to
TRUE.