Communication Gosda
Communication Gosda
Communication Gosda
AUTOSAR
Communication Stack
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Scope of this Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 AUTOSAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 AUTOSAR Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.2 ECU Software Architecture . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Implementation and Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.1 Application Layer and RTE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2 Transmission Modes and Transmission Mode Selection . . . . . . . 24
4.3 Communication Interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1
Introduction
transmission modes of PDUs. Complex device drivers are not scope of this
document, even if they are associated with communication. Within this paper
parts of the Basic Software other than Communication Services, Communi-
cation Hardware Abstraction and Communication Drivers are neglected.
1.2 AUTOSAR
The partnership of automotive manufacturers and suppliers develop and es-
tablish together the AUTomotive Open System ARchitecture (AUTOSAR).
AUTOSAR is a de-facto open industry standard ror automative E/E architec-
tures. The automotive engineering environments change mentioned in chapter
1 makes the members of the automotive industry developing solutions to man-
age the increasing E/E complexity associated with the growth in functional
scope, to improve flexibility, scalability, quality and reliability of their systems
and to detect errors in early design phases [3].
AUTOSAR shall provide an opportunity for seamless tool chain, an enhance-
ment of software quality, the possibility of developers to concentrate on func-
tions with competitive value. More detailed benefits of the AUTOSAR frame-
work can be found in [3] and [4].
Fig. 1.1. Basic AUTOSAR approch with component view (up) and ECU software
architechture and hardware topology (down) [3]
the, with tool support generated, implementation of the VFB from the com-
penent’s view. AUTOSAR offers a methodology described in [7] for creating
the resulting RTE and further software running on an ECU.
values. As visible in figure 1.3 these layers themselfs can be devided by their
purpose.
2.1 Signal
2.3 PDUs
2.3.1 PDU
PDU is the abbreviation of Protocol Data Unit. It contains SDU and PCI.
Each PDU has a static PDU ID which is used to identify PDUs [14]. On
PDU transmission the upper layer sends its PDU to the lower layer, which
interprets this PDU as the SDU of its own PDU. This mapping depicts figure
2.1. Non-TP I-PDUs shall not exceed a length of 8 bytes. This ensures that
an I-PDU can be transmitted in a single CAN message [15].
Fig. 2.1. Packing of SDU into PDU over different layers [8]
2.3.2 SDU
SDU is the abbreviation of Service Data Unit and is a part of a PDU. The
SDU is the data passed by an upper layer with the request to transmit the
data. It is as well the data which is extracted after recaption by the lower
layer and passed to the upper layer [8].
2.3 PDUs 9
2.3.3 PCI
2.3.4 DLC
DLC means Data Length Code and is part of an L-PDU. The DLC describes
the length of the related SDU [16].
PDUs can hold a layer specific prefix to distinguish the PDUs of the different
layers from each other. The PDUs are devided into I-PDUs, L-PDUs and N-
PDUs.
An I-PDU is used for the data exchange of the modules directly above the
PDU Router. These mudules are ATUOSAR COM and AUTOSAR DCM. The
Interaction Layer Protocol Data Unit (I-PDU) is assembled and disassebled in
AUTOSAR COM. It consists of one or more signals [12]. Every I-PDU must
belong to exactly one I-PDU group.
The maximum length of an I-PPDU depends of the maximum length of the L-
PDU of the underlying communication interface because the I-PDUs of COM
are passed via the PDU router directly to the communication interfaces. An
L-PDU is a Data Link Layer Protocol Data Unit which is assembled and
disassembled in AUTOSAR Hardware Abstraction layer. In AUTOSAR the
Data Link Layer is equivalent to the Communication Hardware Abstraction
and Microcontroller Abstraction Layer [13]. The L-PDU consists of Identifier,
DLC and data (L-SDU). The maximum length of a CAN and LIN L-PDU is
8 bytes and for FlexRay the maximum length of the L-PDU is 254 bytes.
An N-PDU is a PDU of the network layer and this denotation is used in the
AUTOSAR TP Layer.
Stopping I-PDU groups shall disable the transmission of I-PDUs which belong
to the I-PDU group and only the Com TriggerTransmit function is processed
because this can not be prohibited by AUTOSAR COM. In an I-PDU group
containing I-PDU groups is started or stopped, the contained groups shall
also be started or stopped.
I-PDU multiplexing is performed by the IPduM (ch. 3.2.3) and means using
the same I-PDU ID transferred from the PDU-Router to the Communication
Hardware Abstraction Layer with more than one unique layout of this I-
PDU [17, p. 19f]. The IPduM always comines only two I-PDUs of COM to a
multiplexed I-PDU because in COM there is one COM I-PDU for the static
part and one COM I-PDU for each layout of the dynamic part of one IPduM I-
PDU. Within COM the static and the dynamic parts are treated as separated
I-PDUs with their own I-PDU IDs. Figure 2.3 shows the possible layout of a
multiplexed I-PDU.
2.4 I-PDU Multiplexing 11
can be updated post-build time in the programming state of the ECU and
are describing the routing attributes for each PDU that shall be routed. The
PDU Router Engine is the actual code thats performs the routing while em-
bracing the routing tables. The supported communication is shown in figure
3.2. In addition to the routing algorithm the PDU Router Enginge provides a
minimum routing capability for routing specific PDUs without using the PDU
Router routing tables. This supports accessing the DCM for activation of the
ECU bootloader even when post-build time configurable PDU Router routing
tables are corrupted. The set of PDUs for the minimum routing capability
can not be changed after build-time [14].
There are three different classes of operations the PDU Router modules per-
forms, which are PDU reception receive I-PDU and send to upper layer, PDU
transmission (transmit I-PDU on request of an upper layer) and PDU gate-
way (receive and I-PDU from an lower layer and immediately send it via the
same or another lower layer module).
The PDU Router provides Gateway functionality on PDU level aka frame-
based Gateway. A special case is routing on-the-fly, which means that the
transfer of TP data is started although not the full TP data is yet buffered.
Therefore the gateway provides to the receifing TP module a smaller buffer
than the overall size of the data and when it is filled, the gateway starts
transmitting these data on the destination bus. The receiving TP module
gets another buffer in parallel to continue receiving the data.
In addition the PDU Router provides routing of PDUs between COM and
CAN/LIN/FlexRay interfaces and between DCM (see: 3.2.8) and TP (see:
3.2.4, 3.3.3) modules, and between the communication interface layers and
between TP modules [15]. Figure 3.2 depicts the different communication
traces including the communication between PDU Router and IPduM.
The routing operation of the PDU Router module does not modify the I-PDU
itself. The I-PDU is simply forwarded to the destination module. To allow the
drectly upper modules DCM and COM and the lower level TP modules and
communication interfaces to communicate with the PDU Router, it provides
an API for all these modules [14]. In addition an interface for the IPduM is
provided. The PDU Router supplies the Indication of incoming multiplexed I-
PDUs, a sending interface for outgoing I-PDUs and a confirmation of I-PDUs
which went out to the IPduM [17]. All these mentioned interfaces are con-
structed in that way, that the operations required to pass the data beween
the upper and lower layers are minimized.
The PDU Router is initiated by a PDU routing trigger which may be gener-
ated by the CAN, LIN, or FlexRay interfaces, the corresponding TP modules,
the service layers COM and DCM or IPduM. A multicast operartion is the
transmission of PDUs to a group of receivers [14].
The Routing Configuration comprehends configuration data that controls the
operation of the PDU Router and Signal Gateway and should be encapsulated
to allow updates. With the configuration data is defined which destination
each PDU of the PDU Router and each Signal of the signal gateway have
16 3 Basic Software Communication Modules
Fig. 3.2. Different possibilities for communication paths relating the PDU Router
[15]. The PDU Router determines the destination of a PDU by using this
static configuration table and the static PDU ID.
The routing layer is statically configurabele per ECU and its size is ECU
specific. If no gateway functionality is needed, the routing layer can be con-
figurated down to zero size.
The PDU Router is not responsible for network management data exchange
because this communication is separated from the PDU Router. It also is not
in authority for signal extraction or conversion mechanisms, data integrity
checking, modifying I-PDUs, PDU payload dependent routing decisions, rout-
ing between TP modules and communication interface modules.
For each communication bus system there is a Transport Layer module within
the services layer except for LIN. The LIN TP is situated within the LIN IF.
It will only be dealt with the CAN TP because describing FlexRay TP and
LIN TP aswell whould exceed the scope of this document. These modules are
specified in [19] and [20].
The CanTp is needed to segment and reassemble CAN I-PDUs with a lenght
greater than 8 bytes. Its main tasks are controlling the data flow, detection of
errors in segmentation sessions, transmit cancellation, segmentation of data in
transmit direction and reassembling of data in receive direction. The CanTp
has an interface to the lower level CanIf and uses a single upper layer module,
the PDU Router. The CanTp module is able to deal with multiple connections,
with its maximum number specified, simultaneously [21]. Figure 3.4 shows the
interaction of the CanTP and its upper and lower layer.
18 3 Basic Software Communication Modules
and uses services of the network management modules. The bus specific net-
work management modules are CAN NM, FlexRay NM and LIN NM. The
AUTOSAR NM Interface can only be applied to communication systems that
support broadcast communication and bus-sleep mode [24]. For network man-
agement data exchange the PDU Router module is bypassed.
The main purpose of the DCM is providing a common API for diagnostic
services. It is used while development, manufactoring or service by external
diagnostic tools [25]. In figure 3.5 there is an overview of the communication
over the DCM. The DCM performs the scheduling of diagnostic PDUs. It acts
as a user by requesting full communication from the ComM if diagnostic shall
be performed [22].
Fig. 3.5. Overview of the communication between the external diagnostic tools and
the onboard AUTOSAR Application [25]
The CanIF is situared in the communication stack between the lower level
CAN Driver and the upper level communication service modules and it repre-
sents the interface to the services of the CAN Driver for the upper communi-
cation layers, which includes managing the different CAN hardware devices.
The CanIf initializes the CAN Driver module during startup phase. It has to
call the CAN Driver modules periodical processing function periodically via
the interface provided by the CAN Driver module. The CanIf has to check
20 3 Basic Software Communication Modules
the validity of state changes for the CAN Driver module, because the CAN
Driver does not check for validity of these changes.
The CAN Driver is part of the lowes layer and offers the CAN Interface
uniform interfaces to use. It hides hardware specific properties of the CAN
Controller as far as possible [29]. The CAN Driver performs the hardware ac-
cess and provides a hardware independent API to the upper layer, the CAN
Interface (CanIf). Services for initiating transmission are offered by the CAN
Driver and it calls the callback funtions of the CanIf module for notifying
events hardware independently. In addition there are services provided by the
CAN Driver module to control the state of all CAN controller belonging to
the same CAN hardware unit. A CAN controller serves exactly one physical
channel. A detailed description of the CAN bus is given in [30]. A CAN hard-
ware unit is represented by one CAN Driver and either on chip or an external
device. It may consist of one or multiple CAN controllers of the same type
and one or multiple CAN RAM areas [29]. A single CAN Driver module can
handle multiple CAN controllers if they belong to the same hardware unit as
shown in figure 3.6.
Fig. 3.6. A CAN hardware unit consisting of two CAN controllers connected to one
physical channel each. [16]
The use of the FlexRay Driver is abstracting from the hardware related im-
plementation details of spedific FlexRay Communication Controllers. A de-
scription of the FlexRay Driver can be found in [31].
The LIN driver is part of the Microcontroller abstraction layer and performs
the hardware access and offers a hardware independent API to the upper
layer. For further information please consult [32].
4
Communication
Fig. 4.1. Mapping of transfer property and transmission mode to send modes of
the VFB [13]
After a send request from an upper layer for a specific signal, the signal is
written to the appropirate I-PDU buffer as defined by configuration and the
selection of the transmission mode of the I-PDUs in done.
24 4 Communication
This function will be, while generating the RTE, mapped to a RTE Write ...
function. Within this funtion there will be either a Com SendSignal or a
Com SendSignalGroup (or Com UpdateShadowSignal) function call, depend-
ing on whether the signal to send was a normal AUTOSAR signal or an
AUTOSAR complex data type. In COM the signal is packed into a PDU
and the signals transferproperty is evaluated to determine the I-PDUs trans-
mission mode. The AUTOSAR COM module calls the PduR ComTransmit
function for forwarding the PDU to the PDU Router. The PDU Router gets
based on the PDU ID and its PDU Router routing table the target of the
PDU and sends it e.g. to the CanIf with the use of CanIf Transmit. The
CanIf calls Can Write from the CAN Driver that will copy the L-PDU into
the CAN hardware. If the PDU was sent on the bus the CAN hardware trig-
gers a transmit interrupt at the CAN Driver. The CAN Driver then calls
CanIf TxConfirmation, the CanIf calls PduR TxConfirmation and the PduR
calls Com TxConfirmation. Sequence diagramms of the transmission, confir-
mation and receive indication operation can be found in ch. 9 in [16, ch. 9],
[33, ch. 9.1, 9.3], [14, ch. 9] and [13, ch. 9].
References