Autosar Sws Pdurouter
Autosar Sws Pdurouter
Autosar Sws Pdurouter
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
This specification describes the functionality and API for the AUTOSAR PDU Router
(PduR) module.
The PDU Router module provides services for routing of I-PDUs (Interaction Layer
Protocol Data Units) using the following module types:
The PDU Router module is based on a generic approach of interfaced modules. The
module that is interfaced is configured in the PDU Router module configuration. The
listed modules in parenthesis in the previous paragraph are just examples, and not
an exhaustive list. The PDU Router can be easily configured to support other upper
and lower layer modules. This approach also allows to integrate Complex Drivers
(CDDs) as upper or lower layer modules of the PDU Router.
The list of users of the PDU Router module is not fixed. The most common
combination of upper and lower layer pairs is listed below:
Communication Services
<module> Generic NM
Debugging
State Interface
COM
DCM
DLT
Manager
<module>
NM
PDU Router
Multiplexer
IPDU
<module> Transport
Protocol
<module> Interface
The PDU Router module is part of the AUTOSAR Basic SW, and is mandatory
instantiated in every AUTOSAR ECU.
COM Diagnostic
(incl. Signal GW) Communication
Manager
I-PDU I-PDU
N-PDU N-PDU
Communication HW Abstraction
Figure 2: Detailed PDU Router Structure showing FlexRAy, CAN and LIN
The PDU Router routing paths: static routing paths describing the routing
attributes for each I-PDU to be routed. The routing paths can be (if supported)
updated post-build loadable in the programming state of the ECU or selected
when initializing the PDU router by post-build selectable (see section 10.1.1).
The PDU Router Engine: the actual code performing routing actions
according to the PDU Router routing paths. The router engine has to deal
with:
o Route the I-PDU from source to destination(s).
o Translating the source I-PDU ID to the destination (e.g. PduR_Transmit
to CanIf_Transmit, PduR_CanIfTxConfirmation to
Com_TxConfirmation).
I-PDUs are identified by static I-PDU IDs. The PDU Router module determines the
destination of an I-PDU by using the I-PDU ID in a static configuration table. I-PDUs
are used for the data exchange of the modules directly above the PDU Router
module, e.g. the COM module and DCM module. The routing operation of the PDU
Router module does not modify the I-PDU, it simply forwards the I-PDU to the
destination module. In case of TP routing, forwarding of the I-PDU may start before
the full I-PDU is received (“gatewaying-on-the-fly”).
The I-PDU ID is set in the configuration that also implements the API. This will allow
an efficient implementation of look-up tables in each module receiving an I-PDU ID
(e.g. the PDU Router module’s configuration contains the I-PDU ID for the
PduR_CanIfTxConfirmation).
For Network Management data exchange the PDU Router module is bypassed.
The following acronyms and abbreviations have a local scope and are therefore not
contained in the AUTOSAR glossary.
Acronym: Description:
Upper Layer Modules above the PDU Router. This layer usually includes COM and Diagnostic
Modules (Up) Communication Manager (DCM). The upper layer modules are configured in the
configuration.
Lower Layer Modules below the PDU Router. This layer may include CAN, LIN, FlexRay,
Modules (Lo) Ethernet communication interface modules and the respective TP modules.
Modules used are configured in the configuration
PDU Router Module that transfers I-PDUs from one module to another module. The PDU Router
module can be utilized for gateway operations and for internal routing purposes.
gatewaying-on- Gateway capability; routing between two TP modules where forwarding of data is
the-fly started (when a specified threshold is reached) before all data have been received.
If larger amount of data is transported between two interfaces it is desirable to be
able to start the transmission on the destination network before receiving all data
from the source network. This saves memory and time.
multicast Simultaneous transmission of PDUs to a group of receivers, i.e. 1:n routing.
operation
data provision Provision of data to interface modules.
(a) direct data provision: data to be transmitted are provided directly at the transmit
request. The destination communication interface may behave in two ways, either
copy the data directly or defer the copy to a trigger transmit.
(b) trigger transmit data provision: data to be transmitted are not provided at the
transmit request, but will be retrieved by the interface module via a callback function
last-is-best Buffering strategy where the latest value overwrites the last value.
buffering
FIFO buffering Buffer concept, which uses first in first out strategy.
Abbreviation: Description:
I-PDU ID PDU Identifier
I-PDU Interaction Layer PDU. An I-PDU consists of data (buffer), length and I-PDU ID. The
PDU router will mainly route I-PDUs (exception is routing-on-the-fly)
N-PDU Network Layer PDU. Used by transport protocol modules to fragment an I-PDU
L-PDU Data Link Layer PDU. One or more I-PDUs are packed into one L-PDU. The L-PDU
is bus specific, e.g. CAN frame.
SF Single Frame, Transport Protocol term
FF First Frame, Transport Protocol term
CF Consecutive Frame, Transport Protocol term
PDU Protocol Data Unit
BSW Basic Software
<SrcLo> Lower layer communication interface module acting as a source of the I-PDU. The
SrcLo is always one.
<DstLo> Lower layer communication interface module acting as a destination of the I-PDU.
The DstLo may by one to many.
<SrcLoTp> Lower layer transport protocol module acting as a source of the I-PDU. The
SrcLoTp is always one.
<DstLoTp> Lower layer transport protocol module acting as a destination of the I-PDU. The
DstLoTp may by one to many.
<Lo> Lower layer communication interface module
<Up> Upper layer module
<LoTp> Lower layer transport protocol module
15 of 121 Document ID 035: AUTOSAR_SWS_PDURouter
- AUTOSAR confidential -
Specification of PDU Router
AUTOSAR CP Release 4.3.1
Abbreviation: Description:
<module> Any type of module <...>
3 Related documentation
Thus, the specification SWS BSW General shall be considered as additional and
required specification for PDU Router.
4.1 Limitations
The PDU Router module supports fan-out of I-PDUs transmitted from a local module
(e.g. COM module). There are some limitations if the I-PDU shall be transmitted to
more than one destination (i.e. fan-out 1:n; n>1), because the upper layer module is
not aware how many destinations there are:
The Pdu Router reports E_OK for a transmit request from an upper layer if at
least one destination lower layer reports E_OK.
The Pdu Router gives a transmit confirmation to the upper layer when it
receives the last transmit confirmation from destination lower layer.
The Pdu Router returns E_OK for a transmit cancellation requested from the
upper layer only if all destination lower layers return E_OK.
If the I-PDU fan-out is performed by the Pdu Router, this has further consequences
for the Com as upper layer module:
Note that above limitations are not set as requirements since they do not concern
functionality provided by the PDUR module. But implication of the use of the PDUR
module will affect these functionalities.
The PDU Router module has not been specified to work with MOST communication
network. Thus the applicability to multimedia and telematic car domains may be
limited.
The PDU Router module depends on the API and capabilities of the used
communication hardware abstraction layer modules and the used communication
service layer modules. Basically the API functions required by the PDU Router
module are:
Upper layer modules which process I-PDUs originating from communication interface
modules:
<Up>_RxIndication (e.g. Com_RxIndication),
<Up>_TxConfirmation (e.g. Com_TxConfirmation),
<Up>_TriggerTransmit (e.g. Com_TriggerTransmit)
For details refer to the chapter 5.1.6 “Code file structure” in SWS_BSWGeneral.
The code file structure is not defined within this specification completely. However to
allow integration to other modules the following structure is needed.
[SWS_PduR_00216] ⌈The PDU Router module shall provide the functions used by
the different modules in separate header files. ⌋ (SRS_BSW_00415)
Example: If CanIf, CanTp and FrIf are used then the PDU Router module shall
provide PduR_CanIf.h, PduR_CanTp.h and PduR_FrIf.h
Note: The include relations for the PDU Router module are depicted in Figure 3.
[SWS_PduR_00762] ⌈All PDU Router header files shall contain a software and
specification version number. ⌋ (SRS_BSW_00003)
6 Requirements traceability
necessary information
SRS_BSW_00305 Data types naming SWS_PduR_00654, SWS_PduR_00742,
convention SWS_PduR_00743, SWS_PduR_00771
SRS_BSW_00310 API naming convention SWS_PduR_00334, SWS_PduR_00338,
SWS_PduR_00341, SWS_PduR_00362,
SWS_PduR_00365, SWS_PduR_00369,
SWS_PduR_00375, SWS_PduR_00381,
SWS_PduR_00406, SWS_PduR_00482,
SWS_PduR_00504, SWS_PduR_00507,
SWS_PduR_00512, SWS_PduR_00518,
SWS_PduR_00615, SWS_PduR_00617,
SWS_PduR_00767, SWS_PduR_00769,
SWS_PduR_00800
SRS_BSW_00323 All AUTOSAR Basic Software SWS_PduR_00100, SWS_PduR_00221,
Modules shall check passed SWS_PduR_00647, SWS_PduR_00648,
API parameters for validity SWS_PduR_00649, SWS_PduR_00716
SRS_BSW_00334 All Basic Software Modules SWS_PduR_00777
shall provide an XML file that
contains the meta data
SRS_BSW_00335 Status values naming SWS_PduR_00742, SWS_PduR_00777
convention
SRS_BSW_00336 Basic SW module shall be SWS_PduR_00777
able to shutdown
SRS_BSW_00337 Classification of development SWS_PduR_00100
errors
SRS_BSW_00341 Module documentation shall SWS_PduR_00777
contains all needed
informations
SRS_BSW_00343 The unit of time for SWS_PduR_00777
specification and
configuration of Basic SW
modules shall be preferably in
physical time unit
SRS_BSW_00346 All AUTOSAR Basic Software SWS_PduR_00132, SWS_PduR_00292,
Modules shall provide at least SWS_PduR_00801
a basic set of module files
SRS_BSW_00350 All AUTOSAR Basic Software SWS_PduR_00802
Modules shall allow the
enabling/disabling of
detection and reporting of
development errors.
SRS_BSW_00353 All integer type definitions of SWS_PduR_00777
target and compiler specific
scope shall be placed and
organized in a single type
header
SRS_BSW_00357 For success/failure of an API SWS_PduR_00777
call a standard return type
shall be defined
SRS_BSW_00358 The return type of init() SWS_PduR_00334
functions implemented by
AUTOSAR Basic Software
SWS_PduR_00626, SWS_PduR_00627,
SWS_PduR_00629, SWS_PduR_00638,
SWS_PduR_00640, SWS_PduR_00665,
SWS_PduR_00666, SWS_PduR_00667,
SWS_PduR_00669, SWS_PduR_00670,
SWS_PduR_00744, SWS_PduR_00745,
SWS_PduR_00746, SWS_PduR_00783,
SWS_PduR_00784, SWS_PduR_00785,
SWS_PduR_00786, SWS_PduR_00787,
SWS_PduR_00788, SWS_PduR_00793,
SWS_PDUR_00807, SWS_PDUR_00808
SRS_PduR_06020 The PDU Router resource SWS_PduR_00287, SWS_PduR_00619,
usage shall be scalable to SWS_PduR_00764
zero in case no PDU gateway
SRS_PduR_06026 Data buffers for TP shall be SWS_PduR_00299, SWS_PduR_00301,
provided on request SWS_PduR_00317, SWS_PduR_00375,
SWS_PduR_00381, SWS_PduR_00406,
SWS_PduR_00428, SWS_PduR_00429,
SWS_PduR_00482, SWS_PduR_00507,
SWS_PduR_00512, SWS_PduR_00518,
SWS_PduR_00549, SWS_PduR_00551,
SWS_PduR_00625, SWS_PduR_00629,
SWS_PduR_00634, SWS_PduR_00637,
SWS_PduR_00638, SWS_PduR_00673,
SWS_PduR_00687, SWS_PduR_00689,
SWS_PduR_00696, SWS_PduR_00697,
SWS_PduR_00705, SWS_PduR_00707,
SWS_PduR_00708, SWS_PduR_00727,
SWS_PduR_00740, SWS_PduR_00767,
SWS_PduR_00789, SWS_PduR_00790,
SWS_PduR_00791, SWS_PduR_00792,
SWS_PduR_00794, SWS_PduR_00797,
SWS_PduR_00798, SWS_PduR_00799,
SWS_PDUR_00808, SWS_PDUR_00813,
SWS_PDUR_00814, SWS_PDUR_00815
SRS_PduR_06029 The PDU Router shall be able SWS_PduR_00551, SWS_PduR_00631,
to support routing of TP PDUs SWS_PduR_00632, SWS_PduR_00633,
independent from the source SWS_PduR_00701, SWS_PduR_00717,
to more than one destinations SWS_PduR_00724, SWS_PduR_00765,
SWS_PduR_00789, SWS_PduR_00790,
SWS_PduR_00791, SWS_PduR_00792,
SWS_PDUR_00812
SRS_PduR_06030 Routing of non TP PDUs to SWS_PduR_00164, SWS_PduR_00436,
more than one destination SWS_PduR_00633, SWS_PduR_00701,
independent from the source SWS_PduR_00717, SWS_PduR_00723
shall be supported by the
PDU Router
SRS_PduR_06032 The non-TP transmit buffering SWS_PduR_00255, SWS_PduR_00303,
strategy shall be configured SWS_PduR_00306, SWS_PduR_00307,
for each PDU to be routed by SWS_PduR_00369, SWS_PduR_00430,
the PDU Router SWS_PduR_00640, SWS_PduR_00662,
SWS_PduR_00663, SWS_PduR_00665,
SWS_PduR_00666, SWS_PduR_00667,
SWS_PduR_00669, SWS_PduR_00670,
SWS_PduR_00746, SWS_PduR_00783,
SWS_PduR_00784, SWS_PduR_00785,
SWS_PduR_00786, SWS_PduR_00787,
SWS_PduR_00793, SWS_PDUR_00810
SRS_PduR_06049 PDU Buffer Content shall be SWS_PduR_00160
consistent during the time
needed to read this data.
SRS_PduR_06055 The signal gateway shall SWS_PduR_00777
provide a mechanism to route
individual signals between I-
PDUs in a 1:n fashion
SRS_PduR_06056 Signal Groups shall be routed SWS_PduR_00777
SRS_PduR_06061 Routers shall map only SWS_PduR_00777
signals
SRS_PduR_06064 The signal gateway shall be SWS_PduR_00777
scalable to zero size and zero
resource usage when signal
routing is not required
SRS_PduR_06077 Multiple signals of the same SWS_PduR_00777
PDU shall be routed
SRS_PduR_06089 The timeout of a deadline SWS_PduR_00777
monitored signal shall be
ignored by the SigG
SRS_PduR_06097 A configuration shall be SWS_PduR_00280, SWS_PduR_00281,
identified by an unique ID SWS_PduR_00341, SWS_PduR_00771
number
SRS_PduR_06098 Signal Gateway Error shall be SWS_PduR_00777
handled with signal routing
SRS_PduR_06099 Signal Gateway Error shall be SWS_PduR_00777
handled with signal group
routing
SRS_PduR_06103 PDU Router Error shall be SWS_PduR_00221
provided for unknown PDU-ID
SRS_PduR_06104 PDU Router Error shall be SWS_PduR_00207, SWS_PduR_00432,
provided for local reception or SWS_PduR_00623, SWS_PduR_00626,
transmission SWS_PduR_00661, SWS_PduR_00676,
SWS_PduR_00700, SWS_PduR_00701
SRS_PduR_06105 PDU Router Error shall be SWS_PduR_00256, SWS_PduR_00640,
provided in gateway case SWS_PduR_00662, SWS_PduR_00687,
SWS_PduR_00689, SWS_PduR_00705,
SWS_PduR_00732, SWS_PduR_00788,
SWS_PduR_00790, SWS_PduR_00791,
SWS_PduR_00792, SWS_PduR_00799,
SWS_PDUR_00807, SWS_PDUR_00815
SRS_PduR_06106 PDU Router Error shall be SWS_PduR_00670
provided for FIFO handling
SRS_PduR_06114 The PDU Router provides an SWS_PduR_00406, SWS_PduR_00482,
interface (API) for usage by SWS_PduR_00767, SWS_PduR_00769
COM, to use the PDU router
functionality
SRS_PduR_06115 The PDU Router provides an SWS_PduR_00406, SWS_PduR_00482,
interface (API) for usage by SWS_PduR_00767, SWS_PduR_00769
DCM, to use the PDU router
functionality
7 Functional Specification
The PDU Router module is an I-PDU transfer unit placed above interface modules
and transport protocol modules (lower layer modules) and below COM and DCM
(upper layer modules), see Figure 1.
Beside the PDU Router module is the I-PDU Multiplexer (IpduM) module [7] that
provides support for multiplexed I-PDUs. The IpduM has to be considered as an
upper layer module when it calls the PDU Router module to transmit multiplexed I-
PDUs or when it is called by the PDU Router module for the reception or transmit
confirmation of multiplexed I-PDUs or to provide data via trigger transmit. In case the
IpduM calls the PDU Router module to forward a transmit confirmation or a receive
indication to an upper layer (e.g. COM) or when it is called by the PDU Router
module to update an I-PDU belonging to a multiplexed I-PDU it has to be considered
as lower layer module.
From the ECU point of view, the PDU Router module can perform three different
classes of operations:
PDU Reception to local module(s): receive I-PDUs from lower layer
modules and forward them to one or more upper layer modules,
PDU Transmission from local module(s): transmit I-PDUs to one or more
lower layer modules on request of upper layer module,
PDU Gateway:
(1) receive I-PDUs from an interface module and transmit the I-PDUs
immediately via the same or other communication interface module(s)
(2) receive I-PDUs from a transport protocol module and transmit the I-
PDUs via the same or other transport protocol module(s).
The combination PDU Reception and PDU Gateway is allowed. Example: The COM
module is receiving an I-PDU in the same time that it is gatewayed to another lower
layer module.
An I-PDU is identified by the I-PDU ID and/or the symbolic name (i.e. the
SymbolicNameValue of the container of the I-PDU) [6]. For debugging and post-build
the I-PDU ID is required because the I-PDU must be identified after the PDU Router
module is compiled. If the PDU router module is pre-compile (i.e. in source code) the
symbolic names may be used, see Specification of ECU Configuration [6].
Each BSW module that handles I-PDUs and provides an API for I-PDUs must
contain a list of I-PDU IDs [6]. This means that each called module will have a look-
up table identifying the I-PDU.
Example: The COM module calls PduR_ComTransmit (here the PDU Router module
will list the I-PDU ID), the PDU Router module will call CanIf_Transmit (here the
CanIf module configuration will list the I-PDU ID), the CanIf will call
PduR_CanIfTxConfirmation (here the PDU Router module configuration will list the I-
PDU ID), and PDU Router module will call Com_TxConfirmation (here the COM
module configuration will list the I-PDU ID). The example is illustrated in the following
Figure 3 (only I-PDU ID is shown as parameter):
COM
PduR_Transmit(11) Com_TxConfirmation(32)
PduR
CanIf_Transmit(22) PduR_CanIfTxConfirmation(42)
CanIf
[SWS_PduR_00161] ⌈The PDU Router module shall identify routing path uniquely
by the combination of source module I-PDU ID (located in the PDU Router
configuration) and destination I-PDU IDs (located in the called destination module
configurations).⌋ (SRS_PduR_06003)
[SWS_PduR_00766] ⌈The PDU Router module shall convert the I-PDU ID to the
destination module(s) for both transmission path and confirmation/indication path. ⌋
(SRS_PduR_06003)
Example: The COM module transmits an I-PDU to CanIf and LinIf. The
PduR_ComTransmit is called. The PDU Router module will convert the source I-PDU
ID (PDU Router module configuration) to one I-PDU ID for LinIf (LinIf module
configuration) and one I-PDU ID for CanIf (CanIf module configuration). The
PduInfoType value received from the COM module is copied to the CanIf and LinIf
modules without change.
[SWS_PduR_00162] ⌈The PDU Router module shall only route I-PDUs according to
the routing paths given in the configuration. ⌋ (SRS_PduR_06003)
[SWS_PduR_00164] ⌈The PDU Router module shall provide 1:n routing for an I-
PDU received from a communication interface module and routed to one or more
upper layer module(s).
Note: An I-PDU may be received by one or more upper modules in the same time as
gatewayed to one or more communication interfaces, see 7.1.3. ⌋ (SRS_PduR_06012,
SRS_PduR_06030)
[SWS_PduR_00744] ⌈If the I-PDU is received by a local module the PDU Router
shall not check the length of the I-PDU, just forward the indication to the upper layer
module.
32 of 121 Document ID 035: AUTOSAR_SWS_PDURouter
- AUTOSAR confidential -
Specification of PDU Router
AUTOSAR CP Release 4.3.1
Since the PDU Router module will not buffer this I-PDU it does not have to reject I-
PDU that are longer/shorter than configured. ⌋ (SRS_PduR_06012)
Reception of I-PDU through Transport Protocol module may have only one upper
layer module configured by the routing paths.
[SWS_PduR_00673] ⌈The PDU Router module shall provide 1:1 routing for an I-
PDU received from a source transport protocol module and routed to one destination
upper module.
Example: A functional addressed request (in a SF) is received from the CanTp
module and routed to the DCM module. ⌋ (SRS_PduR_06026)
[SWS_PduR_00623] ⌈The PDU Router shall forward the return value of the
<Up>_StartOfReception to the source transport protocol. ⌋ (SRS_PduR_06104)
[SWS_PduR_00207] ⌈If the source transport protocol module reports an error using
33 of 121 Document ID 035: AUTOSAR_SWS_PDURouter
- AUTOSAR confidential -
Specification of PDU Router
AUTOSAR CP Release 4.3.1
PduR_<LoTp>RxIndication, the PDU Router module shall not perform any error
handling other than forwarding the indication to the upper layer module. ⌋
(SRS_PduR_06104)
The transmit operations of the destination lower layer modules are always
asynchronous. This means that a transmission service request returns immediately
after the I-PDU has been passed by the PDU Router module to the destination lower
layer module. If the PDU Router module is notified by destination lower layer
modules via PduR_<Lo>TxConfirmation (communication interface) or
PduR_<LoTp>TxConfirmation (transport protocol) after successful or failed
transmission of the I-PDU, the PDU Router module will forward this indication to the
upper layer module via <Up>_TxConfirmation (communication interface) or
<Up>_TpTxConfirmation (transport protocol).
The transmit operation of the PDU Router module is triggered by a PDU transmit
request from a source upper layer source module and forwards the request to a
destination lower layer module.
[SWS_PduR_00629] ⌈The I-PDU shall not be buffered in the PDU Router module in
case of PDU transmission from a source upper layer module. ⌋ (SRS_PduR_06012,
SRS_PduR_06026)
7.1.2.1 Multicast
The multicast feature is separated to an own section since there are issues using this
feature as described in section 4.1.1.
Further requirements that are directly handled by the PDU Router module:
Note that communication interfaces returning with E_OK will transmit their data either
directly or via trigger transmit.
The other transport protocol modules may return E_NOT_OK, and therefore these
modules will not call the PduR_<LoTp>CopyTxData. Since the source upper layer
module has been informed that at least one transmission was successful, at least
one transport protocol module will call PduR_<LoTp>CopyTxData.
[SWS_PduR_00633] ⌈If there are more than one lower layer destination modules in
a transmission request (1:n, n>1), all of these modules must either be communication
interface modules or transport protocol modules. Not a mix of them. ⌋
(SRS_PduR_06029, SRS_PduR_06030)
Example: Above requirement means basically that the COM module cannot request
a transmission, and then the PDU Router module routes the transmission to CanTp
module and CanIf module using the same I-PDU.
Note: The above requirement even works if not all destinations provide Tx
confirmations.
Implementation note: When the source module requests a transmission and the
PduR will make a multicast (1:n, n>1), all the I-PDUs in the request and the multicast
will have different I-PDU IDs. Therefore the PduR must remember the I-PDU ID from
the transmission request so the transmission can be confirmed correctly.
The confirmation of the transmission of the I-PDU is the same for the direct and
trigger transmit data provisions:
[SWS_PduR_00745] ⌈If the I-PDU is transmitted by an upper layer module the PDU
Router module shall not check the length of the I-PDU. ⌋ (SRS_PduR_06012)
[SWS_PduR_00626] ⌈If singlecast (1:1) the return value of the <Lo>_Transmit call
shall be forwarded to the source upper layer module. ⌋ (SRS_PduR_06012,
SRS_PduR_06104)
The upper layer module must be informed if it has to reset the update-bits or not and
handle the I-PDU counter in a proper way.
[SWS_PduR_00661] ⌈The PDU Router module shall copy the return value from the
<Up>_TriggerTransmit to the lower layer module. ⌋ (SRS_PduR_06104)
[SWS_PduR_00301] ⌈In case of singlecast the PDU Router module shall forward
the confirmation PduR_<LoTp>TxConfirmation from the lower layer transport
protocol module to upper layer module using <Up>_TpTxConfirmation. ⌋
(SRS_PduR_06026)
[SWS_PduR_00432] ⌈In case of singlecast and after calling <Lo>_Transmit then the
PDU Router module shall return with the same return value to the calling
PduR_<Up>Transmit from source upper layer module. ⌋ (SRS_PduR_06104)
Since the 1:n, n>1 routing is made in the PDU Router module the PDU Router
module must request the same data several times from the source upper layer
module. Also the confirmation of the multicast must be handled specifically.
As the upper layer shall copy the same data several times, the PDU Router will use
the RetryInfoPtr [4] in order to query the same data several times. The RetryInfoPtr
contains a state type called TpDataState.
[SWS_PDUR_00812]⌈ After all transport protocols have received their data the
PDU Router module may confirm the data to the upper layer module.⌋ (
SRS_PduR_06029)
The PDU Router module will not take specific actions on errors occurred, the errors
will be forwarded to the source upper layer module. Appropriate error handling is in
the responsibility of the upper layer module.
The PDU Router module supports gatewaying of I-PDUs from one source bus to one
or more destination busses. The difference from a transmission and reception from/to
a local module is that the PDU Router module must be a receiver and transmitter at
the same time, and in some cases also provides buffering for the I-PDU.
This means the PDU Router module shall forward an I-PDU received from one lower
layer module (source network) to lower layer modules (destination networks)
identified by the provided I-PDU ID.
Note that in this section “Src” and “Dst” are used for the configurable APIs. This is
just to be clear which call belongs to the source module and destination module.
[SWS_PDUR_00826]⌈ If using n:1 gatewaying the PduR shall ensure that the
sequence of incoming I-PDUs is preserved on the destination.⌋ ()
There are two flavors of gatewaying an I-PDU depending on the the destination
interface module. The used flavor is controlled by the configuration:
The reason why it must be stored for trigger transmit data provision is that the
destination communication interface may transmit the I-PDU according to a schedule.
Then the communication interface will call the PduR_<DstLo>TriggerTransmit
without a preceding <DstLo>_Transmit call.
It is possible that an I-PDU that will be gatewayed will have different lengths.
Therefore:
[SWS_PduR_00783] ⌈In case the I-PDU is gatewayed without buffering in the PDU
Router, the PDU Router shall forward the length without checking, just calling the
transmit function(s) of the destination modules.⌋ (SRS_PduR_06012, SRS_PduR_06032)
[SWS_PduR_00746] ⌈In case the I-PDU is buffered in the PDU Router module: The
PDU Router module shall copy the data of of the I-PDU up to smallest of the
following values:
the received data length (PduLength of received I-Pdu)
the configured maximum PduLength in the buffer (PduRPduMaxLength). In
this case the rest of the received I-PDU shall be dropped. ⌋ (SRS_PduR_06012,
SRS_PduR_06032)
Note: [SWS_PduR_00746] give the user the possibility to avoid buffer over run when
PduR_<Lo>TriggerTransmit is called. The user needs to configure
PduRMaxPduLength not greater then the length of the destination I-Pdu.
[SWS_PduR_00784] ⌈When the I-PDU is transmitted (direct data provision) from the
PduR buffer to the destination module the PduR shall pass the number of bytes
which was copied to the buffer as SduLength.⌋ (SRS_PduR_06012, SRS_PduR_06032)
The PDU Router module shall not perform any error handling for an I-PDU instance if
an interface module rejects a transmit request which belongs to a gateway operation.
[SWS_PduR_00256] ⌈The PDU Router module shall not retry transmission if the
destination communication interface module returns E_NOT_OK after calling
<DstLo>_Transmit. ⌋ (SRS_PduR_06012, SRS_PduR_06105)
Here the destination returned E_NOT_OK for some reason, will also report this error.
The PDU Router module cannot do anything else than discarding the I-PDU.
In general the PDU Router will gateway the payload only, and will not be aware of
transport protocol details such as SF, FF, CF, PCI etc. But the PduR shall also
support gatewaying of I-PDUs with MetaData, configured using the MetaDataType of
the global PDU. This type of I-PDUs requires no special treatment during interface
routing or forwarding, but for TP routing, the additional information has to be
forwarded separately. The following requirement is relevant both for direct
gatewaying and gatewaying on-the-fly:
For example: A SF received on CAN and shall be transmitted on two LIN busses.
The received SF can carry up to data 6 bytes but a SF on LIN only up to data 5
bytes. Therefore the SF on CAN is limited to data 5 bytes if gatewayed to the two LIN
busses.
Note that an I-PDU transported over transport protocol modules may also be
gatewayed frame by frame directly through the communication interfaces (i.e. by
42 of 121 Document ID 035: AUTOSAR_SWS_PDURouter
- AUTOSAR confidential -
Specification of PDU Router
AUTOSAR CP Release 4.3.1
gatewaying the N-PDUs directly). This requires no special treatment here of the PDU
Router module and can be handled by gatewaying through communication interface
modules, see 7.1.3.1. However, this requires that the source and destination busses
have exactly same packing of N-PDUs (e.g. from CAN to CAN).
The PduR uses two different buffers for gatewaying of transport protocol PDUs: The
pool of large TP buffers configured via PduRRoutingPaths, and the dedicated buffers
configured via PduRDestTxBufferRef. The dedicated buffers are used for single
frame routing and must be large enough to contain the largest possible single frame
of the involved bus systems. The large PduRTpBuffers are used for multi frame
routing, and must be large enough to contain one block of TP data in case of on-the-
fly gatewaying, and for the complete PDU in case of direct gatewaying. The main
reason for having dedicated buffers for single frames is that functional diagnostic
requests and especially OBD request have a very high priority and must not be
delayed by buffer allocation strategies.
[SWS_PDUR_00814] ⌈If not enough data is availalble or not all other destination
transport protocoll modules have called PduR_<DstLoTp>CopyTxData for the
previous frame, the Pdu Router shall return BUFREQ_E_BUSY without copying any
data. ⌋ (SRS_PduR_06026, SRS_PduR_06124)
Implementations may choose to report (via DET) whenever the upper layer reception
was not successful. The gatewaying to lower layers should not be aborted in this
case.
The reception to the upper layers part of direct gatewaying is specified below:
In gatewaying on-the-fly the PDU Router module will start transmission to the
destination transport protocol module when a specific threshold is reached.
If gatewaying on-the-fly is used the Pdu Router shall not support retransmission of
already transmitted data:
7.1.3.2.6 All destination transport protocol modules will confirm transmission of the I-
PDU.
Error handling for I-PDUs gatewayed using transport protocol modules is simple, the
PDU Router module will not do anything and rely that the transport protocol modules
handles the communication errors properly.
Note:
The PDU Router shall not expect a PduR_<SrcLoTp>RxIndication after
PduR_<SrcLoTp>StartOfRecpetion failed.
The PDU Router shall not expect a PduR_<DstLoTp>TxConfirmation after
<LoTp>_Transmit failed.
[SWS_PduR_00804] ⌈In case of gatewaying between TPs, when all destinations fail,
the reception side shall be stopped by returning BUFREQ_E_NOT_OK for the
current call of CopyRxData or StartOfReception.⌋
7.1.3.3 FIFO
It is possible to Gateway an I-PDU using a FIFO queued behavior from one source to
multiple destination lower layer modules. FIFO queues can be used for
Communication Interfaces and Transport Protocols (even with multi N-PDU
messages)
In the following chapter the term “FIFO” or “FIFO queue” is used as a synomym for
the Tx I-Pdu buffer of the PduR.
The FIFO has states and these states may change when calling various PduR API’s
called from different contexes. E.g. a PduR_<SrcLo>RxIndication call could be
interrupted by a PduR_<DstLo>TxConfirmation call. Thus there is a need to protect
those concurrent calls.
If a FIFO is used in case of direct data provision the destination I-PDU must be
configured to call the PduR_<DstLo/DstLoTp>TxConfirmation, see
PduRTransmissionConfirmation.
[SWS_PduR_00793] ⌈If direct data provision is used with a FIFO: The PduR shall
enqueue new data in the FIFO when PduR_<SrcLo/SrcLoTp>RxIndication is called
and the last transmission of the same PDU has not yet been confirmed via PduR_<
DstLo/DstLoTp >TxConfirmation.⌋ (SRS_PduR_06012, SRS_PduR_06032)
Note: In case of the destination module is FrIf the FrIfCounterLimit of the Pdu needs
to be configured > 1 because the new transmit will be called before the counter is
decremented. For LinIf there is no such a constraint, however FIFO queue routing to
sporadic frames is not supported.
Note: The effect of Gateway-on-the-fly using FIFO is that it will be a faster way to
gateway the TP messages. Obviously if the FIFO is not empty then the received
message the message must be stored and not to be forwarded to the desintation TP.
[SWS_PduR_00670] ⌈If the FIFO is flushed the PDU Router shall report
PDUR_E_PDU_INSTANCES_LOST to the DET module. ⌋ (SRS_PduR_06012,
SRS_PduR_06032, SRS_PduR_06106)
[SWS_PduR_00669] ⌈If the FIFO is flushed the new I-PDU delivered by the
PduR_<SrcLo>RxIndication shall be handled as if the FIFO is empty. ⌋
(SRS_PduR_06012, SRS_PduR_06032)
The new I-PDU that causes the FIFO flush will be served and not discarded.
The cancel transmission is optional and enabled in the configuration per module, see
PduRCancelTransmit configuration parameter.
[SWS_PduR_00710] ⌈If the routing path for the requested I-PDU is disabled, then
PduR_<Up>CancelTransmit shall return E_NOT_OK directly without any further
action. ⌋ (SRS_PduR_06122, SRS_PduR_06120)
Following requirements describes the behavior in the PDU Router module when the
PduR_<Up>CancelTransmit is called:
Following requirements describes the behavior in the PDU Router module when the
return value of <Lo>_CancelTransmit or <LoTp>_CancelTransmit is received:
[SWS_PduR_00700] ⌈For a Single Destination the PDU Router module shall return
same return value to the calling upper layer module. ⌋ (SRS_PduR_06122,
SRS_PduR_06104)
[SWS_PduR_00726] ⌈If the routing path for the requested I-PDUs is disabled, then
PduR_<Up>CancelReceive shall return E_NOT_OK directly without any further
action. ⌋ (SRS_PduR_06122, SRS_PduR_06120)
The flow of the I-PDU id on the receiving side is from lower to upper modules. Here
the flow is from upper to lower modules, since the id belongs to an already (partially)
received I-PDU for which the reception shall be canceled.
Zero cost operation is an optimization that may be done where source and
destination modules are single and in source code (one of the modules must be in
source code otherwise the PDU Router must create glue-code for the function call).
For example an ECU with a COM module and a single CAN bus, the
PduR_ComTransmit may directly call the CanIf_Transmit without any logic inside the
PduR Module. The PDU Router becomes a macro layer.
This optimization is only possible where routing paths are of configuration class Pre-
Compile.
[SWS_PduR_00644] ⌈Only one instance of the state machine shall exist in the
PDUR module. ⌋ (SRS_BSW_00406)
PDUR_ONLINE
PDUR_UNINIT
immediate
Powerup
[SWS_PduR_00645] ⌈The PDU Router module shall release all buffers in the
PduR_Init function. ⌋ (SRS_BSW_00406)
A routing path group is a group of I-PDUs that can be disabled and enabled during
runtime. The group contains the destination I-PDUs and not the routing path itself.
The reason is that it is desirable to enable or disable I-PDUs for a specific bus. And a
routing path can multicast an I-PDU to several busses.
Enabling and disabling of routing path groups is typically used by the BswM module.
Example: If a gateway operation is made and the PDU Router module has buffered
an I-PDU and is waiting for the destination communication module to call trigger
transmit, the buffer is cleared and the buffer not available is returned to the
destination communication interface.
Whether a CDD is an upper layer or a lower layer module for the PduR is
configurable via the PduRUpperModule or PduRLowerModule configuration
parameters of the PduRBswModules configuration.
A CDD can require both a communication interface API or a transport protocol API,
depending on the configuration parameters PduRCommunicationInterface and
PduRTransportProtocol of the PduRBswModules configuration. The API functions
provided by the PduR for the CDD interaction contain the CDD’s service prefix as
specified by the apiServicePrefix configuration parameter, see SWS_PduR_00504.
The PduR provides the unique transmit function PduR_<Cdd>Transmit for each
upper layer CDD. When a callout function of the PduR is invoked from a lower layer
module for a Pdu that is transmitted or received by an upper layer CDD, the PduR
invokes the corresponding target function of the CDD.
For a lower layer CDD that requires a communication interface API, the PduR
provides a unique set of communication interface API functions
PduR_<Cdd>RxIndication and – if configured – PduR_<Cdd>TxConfirmation and
PduR_<Cdd>TriggerTransmit, see Section 8.3.3.
For a lower layer CDD that requires a transport protocol API, the PduR provides a
unique set of transport protocol API functions PduR_<Cdd>CopyRxData,
PduR_<Cdd>CopyTxData, PduR_<Cdd>RxIndication,
PduR_<Cdd>StartOfReception and PduR_<Cdd>TxConfirmation, see Section 8.3.4.
When an API function of the PduR is invoked from an upper layer module for a Pdu
that is transmitted or received by a lower layer CDD, the PduR invokes the
corresponding target function of the CDD.
If the source Pdu of a routing path references a Pdu in the Pdu list that is also
referenced by an upper layer CDD, the Pdu is transmitted by the CDD.
If the destination Pdu of a routing path references a Pdu in the Pdu list that is
also referenced by an upper layer CDD, the Pdu is received by the CDD.
If the source Pdu of a routing path references a Pdu in the Pdu list that is also
referenced by a lower layer CDD, the Pdu is received from the CDD.
If the destination Pdu of a routing path references a Pdu in the Pdu list that is
also referenced by a lower layer CDD, the Pdu is transmitted via the CDD.
[SWS_PduR_00119] ⌈If the PDU Router module has not been initialized (state
PDUR_UNINIT), all functions except PduR_Init and PduR_GetVersionInfo shall
report the error PDUR_E_UNINIT via the DET when called, when
PduRDevErrorDetect is enabled. ⌋ (SRS_BSW_00406)
Note:
The standardized module ID is found in the List of Basic Software Modules document
[9]. The parameter PduRBswModuleRef identifies the module used. With this
information the moduleID can be retrieved in the BswModuleDescription.moduleId
7.11 Debugging
8 API specification
The following paragraphs specify the API of the PDU Router module.
In this chapter all types included from the following files are listed:
[SWS_PduR_00333] ⌈
Module Imported Type
ComStack_Types BufReq_ReturnType
PduIdType
PduInfoType
PduLengthType
RetryInfoType
TPParameterType
Std_Types Std_ReturnType
Std_VersionInfoType
⌋ (SRS_BSW_00301)
The following PDU Router types are specified and shall be defined in
PduR_Types.h:
8.2.1 PduR_PBConfigType
[SWS_PduR_00743] ⌈
Name: PduR_PBConfigType
Type: Structure
Range: -- implementation specific
Description: Data structure containing post-build-time configuration data of the PDU Router.
⌋ (SRS_BSW_00400, SRS_BSW_00438, SRS_BSW_00404, SRS_BSW_00305)
[SWS_PduR_00241] ⌈The type PduR_PBConfigType is an external data structure
containing post-build-time configuration data of the PDU Router module which shall
be implemented in PduR_PBcfg.c (see chapter 5.1.1 and 10.2). ⌋ (SRS_BSW_00438,
SRS_BSW_00404)
8.2.2 PduR_PBConfigIdType
[SWS_PduR_00771] ⌈
Name: PduR_PBConfigIdType
Type: uint16
Description: Identification of the post-build configuration currently used for routing I-PDUs. An
ECU may contain several configurations (post-build selectable), each have unique
Id.
⌋ (SRS_BSW_00405, SRS_BSW_00305, SRS_PduR_06097)
8.2.3 PduR_RoutingPathGroupIdType
The routing path group ID is used for identifying a specific group of routing
path destinations. The reason is that the destinations of a 1:n routing path typically
belong to more than one bus, and it shall be possible to enable/disable routing per
bus.
Therefore a routing path group separates 1:n routing paths into 1:1 paths.
[SWS_PduR_00654] ⌈
Name: PduR_RoutingPathGroupIdType
Type: uint16
Description: Identification of a Routing Table
⌋ (SRS_BSW_00305, SRS_PduR_06120)
8.2.4 PduR_StateType
[SWS_PduR_00742] ⌈
Name: PduR_StateType
Type: Enumeration
Range: PDUR_UNINIT -- PDU Router not initialised
PDUR_ONLINE -- PDU Router initialized successfully
Description: States of the PDU Router
⌋ (SRS_BSW_00305, SRS_BSW_00335, SRS_BSW_00406)
8.3.1.1 PduR_Init
[SWS_PduR_00334] ⌈
Service name: PduR_Init
Syntax: void PduR_Init(
const PduR_PBConfigType* ConfigPtr
)
Service ID[hex]: 0xf0
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): ConfigPtr Pointer to post build configuration
Parameters None
(inout):
Parameters (out): None
Return value: None
Description: Initializes the PDU Router
⌋ (SRS_BSW_00101, SRS_BSW_00358, SRS_BSW_00414, SRS_BSW_00310)
Integration note: To avoid problems calling the PDU Router module uninitialized it is
important that the PDU Router module is initialized before interfaced modules.
8.3.1.2 PduR_GetVersionInfo
[SWS_PduR_00338] ⌈
Service name: PduR_GetVersionInfo
Syntax: void PduR_GetVersionInfo(
Std_VersionInfoType* versionInfo
)
Service ID[hex]: 0xf1
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): None
Parameters None
(inout):
Parameters (out): versionInfo Pointer to where to store the version information of this module.
Return value: None
Description: Returns the version information of this module.
⌋ (SRS_BSW_00407, SRS_BSW_00411, SRS_BSW_00310)
8.3.1.3 PduR_GetConfigurationId
[SWS_PduR_00341] ⌈
60 of 121 Document ID 035: AUTOSAR_SWS_PDURouter
- AUTOSAR confidential -
Specification of PDU Router
AUTOSAR CP Release 4.3.1
8.3.1.4 PduR_EnableRouting
[SWS_PduR_00615] ⌈
Service name: PduR_EnableRouting
Syntax: void PduR_EnableRouting(
PduR_RoutingPathGroupIdType id
)
Service ID[hex]: 0xf3
Sync/Async: Synchronous
Reentrancy: Reentrant
id Identification of the routing path group. Routing path groups are defined in the
Parameters (in):
PDU router configuration.
Parameters None
(inout):
Parameters (out): None
Return value: None
Description: Enables a routing path group.
⌋ (SRS_PduR_06120, SRS_BSW_00310) [SWS_PduR_00647] ⌈If the routing path
group id does not exist, then the PDU Router module shall return with no action. ⌋
(SRS_PduR_06120, SRS_BSW_00323)
[SWS_PduR_00648] ⌈If the routing path group id does not exist and the
PduRDevErrorDetect is enabled, the PDU Router module shall report
PDUR_E_ROUTING_PATH_GROUP_ID_INVALID. ⌋ (SRS_PduR_06120,
SRS_BSW_00323)
8.3.1.5 PduR_DisableRouting
[SWS_PduR_00617] ⌈
Service name: PduR_DisableRouting
Syntax: void PduR_DisableRouting(
PduR_RoutingPathGroupIdType id,
boolean initialize
)
61 of 121 Document ID 035: AUTOSAR_SWS_PDURouter
- AUTOSAR confidential -
Specification of PDU Router
AUTOSAR CP Release 4.3.1
[SWS_PduR_00649] ⌈If the routing path table id does not exist and the
PduRDevErrorDetect is enabled, the PDU Router module shall report
PDUR_E_ROUTING_PATH_GROUP_ID_INVALID. ⌋ (SRS_PduR_06120,
SRS_BSW_00323)
Since the API description now has a generic approach, the service ids of the upper
layer API functions are generic as well. To differ between several upper layers, the
PduR uses the module ids of the upper layer modules as the instance id argument in
the Det call
8.3.2.1 PduR_<User:Up>Transmit
[SWS_PduR_00406] ⌈
Service name: PduR_<User:Up>Transmit
Syntax: Std_ReturnType PduR_<User:Up>Transmit(
PduIdType TxPduId,
const PduInfoType* PduInfoPtr
)
Service ID[hex]: 0x49
Sync/Async: Synchronous
Reentrancy: Reentrant for different PduIds. Non reentrant for the same PduId.
TxPduId Identifier of the PDU to be transmitted
Parameters (in):
PduInfoPtr Length of and pointer to the PDU data and pointer to MetaData.
Parameters None
(inout):
Parameters (out): None
Std_ReturnType E_OK: Transmit request has been accepted.
Return value:
E_NOT_OK: Transmit request has not been accepted.
Description: Requests transmission of a PDU.
8.3.2.2 PduR_<User:Up>CancelTransmit
[SWS_PduR_00769] ⌈
Service name: PduR_<User:Up>CancelTransmit
Syntax: Std_ReturnType PduR_<User:Up>CancelTransmit(
PduIdType TxPduId
)
Service ID[hex]: 0x4a
Sync/Async: Synchronous
Reentrancy: Reentrant for different PduIds. Non reentrant for the same PduId.
Parameters (in): TxPduId Identification of the PDU to be cancelled.
Parameters None
(inout):
Parameters (out): None
Std_ReturnType E_OK: Cancellation was executed successfully by the
destination module.
Return value:
E_NOT_OK: Cancellation was rejected by the destination
module.
Description: Requests cancellation of an ongoing transmission of a PDU in a lower layer
communication module.
⌋ (SRS_PduR_06122, SRS_PduR_06114, SRS_PduR_06115, SRS_PduR_06116,
SRS_BSW_00310)
8.3.2.3 PduR_<User:Up>ChangeParameter (obsolete)
[SWS_PduR_00482] ⌈
Service name: PduR_<User:Up>ChangeParameter(obsolete)
Syntax: Std_ReturnType PduR_<User:Up>ChangeParameter(obsolete)(
PduIdType id,
TPParameterType parameter,
uint16 value
)
Service ID[hex]: 0x4b
Sync/Async: Synchronous
Reentrancy: Non Reentrant
id Identification of the PDU which the parameter change shall affect.
Parameters (in): parameter ID of the parameter that shall be changed.
value The new value of the parameter.
Parameters None
(inout):
Parameters (out): None
Std_ReturnType E_OK: The parameter was changed successfully.
Return value:
E_NOT_OK: The parameter change was rejected.
Description: Request to change a specific transport protocol parameter (e.g. block size).
Tags:
atp.Status=obsolete
⌋ (SRS_PduR_06026, SRS_PduR_06114, SRS_PduR_06115, SRS_PduR_06116,
SRS_BSW_00310)
8.3.2.4 PduR_<User:Up>CancelReceive
[SWS_PduR_00767] ⌈
Service name: PduR_<User:Up>CancelReceive
Syntax: Std_ReturnType PduR_<User:Up>CancelReceive(
PduIdType RxPduId
)
Since the API description now has a generic approach, the service ids of the lower
layer API functions are generic as well. To differ between several lower layers, the
PduR uses the module ids of the lower layer modules as the instance id argument in
the Det call.
8.3.3.1 PduR_<User:Lo>RxIndication
[SWS_PduR_00362] ⌈
Service name: PduR_<User:Lo>RxIndication
Syntax: void PduR_<User:Lo>RxIndication(
PduIdType RxPduId,
const PduInfoType* PduInfoPtr
)
Service ID[hex]: 0x42
Sync/Async: Synchronous
Reentrancy: Reentrant for different PduIds. Non reentrant for the same PduId.
RxPduId ID of the received PDU.
Parameters (in): PduInfoPtr Contains the length (SduLength) of the received PDU, a pointer to a
buffer (SduDataPtr) containing the PDU, and the MetaData related to
this PDU.
Parameters None
(inout):
Parameters (out): None
Return value: None
Description: Indication of a received PDU from a lower layer communication interface module.
⌋ (SRS_PduR_06012, SRS_PduR_06116, SRS_PduR_06117, SRS_PduR_06123,
SRS_BSW_00310)
8.3.3.2 PduR_<User:Lo>TxConfirmation
[SWS_PduR_00365] ⌈
Service name: PduR_<User:Lo>TxConfirmation
Syntax: void PduR_<User:Lo>TxConfirmation(
PduIdType TxPduId,
Std_ReturnType result
)
Service ID[hex]: 0x40
64 of 121 Document ID 035: AUTOSAR_SWS_PDURouter
- AUTOSAR confidential -
Specification of PDU Router
AUTOSAR CP Release 4.3.1
Sync/Async: Synchronous
Reentrancy: Reentrant for different PduIds. Non reentrant for the same PduId.
TxPduId ID of the PDU that has been transmitted.
Parameters (in): result E_OK: The PDU was transmitted.
E_NOT_OK: Transmission of the PDU failed.
Parameters None
(inout):
Parameters (out): None
Return value: None
Description: The lower layer communication interface module confirms the transmission of a
PDU, or the failure to transmit a PDU.
⌋ (SRS_PduR_06012, SRS_PduR_06116, SRS_PduR_06117, SRS_PduR_06123,
SRS_BSW_00310)
8.3.3.3 PduR_<User:Lo>TriggerTransmit
[SWS_PduR_00369] ⌈
Service name: PduR_<User:Lo>TriggerTransmit
Syntax: Std_ReturnType PduR_<User:Lo>TriggerTransmit(
PduIdType TxPduId,
PduInfoType* PduInfoPtr
)
Service ID[hex]: 0x41
Sync/Async: Synchronous
Reentrancy: Reentrant for different PduIds. Non reentrant for the same PduId.
Parameters (in): TxPduId ID of the SDU that is requested to be transmitted.
PduInfoPtr Contains a pointer to a buffer (SduDataPtr) to where the SDU
Parameters data shall be copied, and the available buffer size in SduLengh.
(inout): On return, the service will indicate the length of the copied SDU
data in SduLength.
Parameters (out): None
Std_ReturnType E_OK: SDU has been copied and SduLength indicates the
number of copied bytes.
Return value: E_NOT_OK: No SDU data has been copied. PduInfoPtr must not
be used since it may contain a NULL pointer or point to invalid
data.
Description: Within this API, the upper layer module (called module) shall check whether the
available data fits into the buffer size reported by PduInfoPtr->SduLength.
If it fits, it shall copy its data into the buffer provided by PduInfoPtr->SduDataPtr
and update the length of the actual copied data in PduInfoPtr->SduLength.
If not, it returns E_NOT_OK without changing PduInfoPtr.
⌋ (SRS_PduR_06012, SRS_PduR_06032, SRS_PduR_06116, SRS_PduR_06117,
SRS_PduR_06123, SRS_BSW_00310)
Since the API description now has a generic approach, the service ids of the lower
layer transport protocol API functions are generic as well. To differ between several
lower layers, the PduR uses the module ids of the lower layer modules as the
instance id argument in the Det call.
8.3.4.1 PduR_<User:LoTp>CopyRxData
[SWS_PduR_00512] ⌈
65 of 121 Document ID 035: AUTOSAR_SWS_PDURouter
- AUTOSAR confidential -
Specification of PDU Router
AUTOSAR CP Release 4.3.1
Sync/Async: Synchronous
Reentrancy: Reentrant
id Identification of the I-PDU.
info Pointer to a PduInfoType structure containing the payload
data (without protocol information) and payload length of the
first frame or single frame of a transport protocol I-PDU
Parameters (in):
reception, and the MetaData related to this PDU. If neither
first/single frame data nor MetaData are available, this
parameter is set to NULL_PTR.
TpSduLength Total length of the N-SDU to be received.
Parameters None
(inout):
bufferSizePtr Available receive buffer in the receiving module. This
Parameters (out): parameter will be used to compute the Block Size (BS) in the
transport protocol module.
BufReq_ReturnType BUFREQ_OK: Connection has been accepted. bufferSizePtr
indicates the available receive buffer; reception is continued.
If no buffer of the requested size is available, a receive buffer
size of 0 shall be indicated by bufferSizePtr.
Return value: BUFREQ_E_NOT_OK: Connection has been rejected;
reception is aborted. bufferSizePtr remains unchanged.
BUFREQ_E_OVFL: No buffer of the required length can be
provided; reception is aborted. bufferSizePtr remains
unchanged.
Description: This function is called at the start of receiving an N-SDU. The N-SDU might be
fragmented into multiple N-PDUs (FF with one or more following CFs) or might
consist of a single N-PDU (SF). The service shall provide the currently available
maximum buffer size when invoked with TpSduLength equal to 0.
⌋ (SRS_PduR_06026, SRS_PduR_06121, SRS_BSW_00310)
8.3.4.4 PduR_<User:LoTp>CopyTxData
[SWS_PduR_00518] ⌈
Service name: PduR_<User:LoTp>CopyTxData
Syntax: BufReq_ReturnType PduR_<User:LoTp>CopyTxData(
PduIdType id,
const PduInfoType* info,
const RetryInfoType* retry,
PduLengthType* availableDataPtr
)
Service ID[hex]: 0x43
Sync/Async: Synchronous
Reentrancy: Reentrant
id Identification of the transmitted I-PDU.
info Provides the destination buffer (SduDataPtr) and the number
of bytes to be copied (SduLength).
If not enough transmit data is available, no data is copied by
the upper layer module and BUFREQ_E_BUSY is returned.
The lower layer module may retry the call.
An SduLength of 0 can be used to indicate state changes in
the retry parameter or to query the current amount of
Parameters (in):
available data in the upper layer module. In this case, the
SduDataPtr may be a NULL_PTR.
retry This parameter is used to acknowledge transmitted data or
to retransmit data after transmission problems.
In this chapter all interfaces required from other modules are listed.
The PDU router module is modeled as a generic module that can interface to
different upper and lower modules. The approach taken to model this generic
approach is to have a virtual module called GenericComServices. This virtual module
contains a set of APIs that the PDU router will call in upper layer or lower layer
modules. These APIs are generic in the way that they contain a tag <Lo>, <Up> and
<LoTp> that is replaced with the interfaced module. The tag is set by the
configuration in the PduRBSWModules container using the PduRBswModuleRef
reference parameter.
The Pdu Router does not require mandatory interfaces. The required API functions
depend on the configuration.
[SWS_PduR_91001] ⌈
API function Description
Det_ReportRuntimeError Service to report runtime errors. If a callout has been configured then
this callout shall be called.
⌋ (SRS_BSW_00384)
This chapter defines all interfaces which are required to fulfill an optional functionality
of the module.
[SWS_PduR_00424] ⌈
API function Description
(obsolete)<Provider:LoTp>_ChangeParameter Request to change a specific transport protocol
parameter (e.g. block size).
<Provider:Lo>_CancelTransmit Requests cancellation of an ongoing transmission of a
PDU in a lower layer communication module.
<Provider:Lo>_Transmit Requests transmission of a PDU.
69 of 121 Document ID 035: AUTOSAR_SWS_PDURouter
- AUTOSAR confidential -
Specification of PDU Router
AUTOSAR CP Release 4.3.1
9 Sequence diagrams
The goal of this chapter is to make the understanding of the PDU Router easier. For
this purpose sequence diagrams which show different communication scenarios are
used. Please consider that the sequence diagrams are not exhaustive and are only
used to support the functional specification (chapter 7) and API specification
(chapter 8).
Focus of the sequence diagrams is the PDU Router and therefore interactions
between other modules (e.g. between an interface and its driver) are not shown.
Note: The sequence diagrams of the I-PDU Multiplexer are shown in [7]. Depending
on the interaction scenario the IpduM has to be considered as an upper layer or a
lower layer module of the PDU Router.
Note: The diagrams in this chapter are to show specific use-cases. They are not
requirements for an implementation of the PDU Router module.
Note that the PDU Router is not the only customer for the communication interface
modules and I-PDUs. Other modules such as NM and TP modules receive PDUs
directly from the communication interface modules.
Following Figure 5 shows reception of I-PDU from the CanIf module to the COM
module.
PduR_<User:Lo>RxIndication(PduIdType,
const PduInfoType*)
Com_RxIndication(PduIdType,
const PduInfoType*)
copy buffer()
Following Figure 6 shows reception of I-PDU from the FrIf module to the COM
module.
PduR_<User:Lo>RxIndication(PduIdType,
const PduInfoType*)
Com_RxIndication(PduIdType,
const PduInfoType*)
copy buffer()
Following Figure 7 shows reception of I-PDU from the LinIf module to the COM
module.
PduR_<User:Lo>RxIndication(PduIdType,
const PduInfoType*)
Com_RxIndication(PduIdType,
const PduInfoType*)
copy buffer()
Following Figure 8 shows reception of I-PDU from the CanTp module to the DCM
module. The reception is made using the transport protocol APIs.
PduR_CanTpStartOfReception(BufReq_ReturnType,
PduIdType, const PduInfoType*, PduLengthType,
PduLengthType*)
Dcm_StartOfReception(BufReq_ReturnType, PduIdType,
const PduInfoType*, PduLengthType, PduLengthType*)
PduR_CanTpCopyRxData(BufReq_ReturnType,
PduIdType, const PduInfoType*, PduLengthType*)
Dcm_CopyRxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, PduLengthType*)
copy data()
PduR_CanTpCopyRxData(BufReq_ReturnType,
PduIdType, const PduInfoType*, PduLengthType*)
Dcm_CopyRxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, PduLengthType*)
copy data()
PduR_CanTpCopyRxData(BufReq_ReturnType,
PduIdType, const PduInfoType*, PduLengthType*)
Dcm_CopyRxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, PduLengthType*)
copy data()
PduR_CanTpRxIndication(PduIdType, Std_ReturnType)
Dcm_TpRxIndication(PduIdType, Std_ReturnType)
Following Figure 9 shows transmission of I-PDU from the COM module to the CanIf
module.
PduR_ComTransmit(Std_ReturnType,
PduIdType, const PduInfoType*)
copy data()
PduR_<User:lo>TxConfirmation(PduIdType, Std_ReturnType)
Com_TxConfirmation(PduIdType, Std_ReturnType)
Following Figure 10 shows transmission of I-PDU from the COM module to the FrIf
module using trigger transmit.
PduR_ComTransmit(Std_ReturnType,
PduIdType, const PduInfoType*)
FrIf_Transmit(Std_ReturnType,
PduIdType, const PduInfoType *)
set flag()
PduR_<User:Lo>Triggertransmit(PduIdType, PduInfoType*)
Com_TriggerTransmit(Std_ReturnType, PduIdType,
PduInfoType*)
copy buffer()
PduR_<User:Lo>TxConfirmation(PduIdType, Std_ReturnType)
Com_TxConfirmation(PduIdType, Std_ReturnType)
Following Figure 11 shows transmission of I-PDU from the COM module to the LinIf
module using transmit and later trigger transmit functions. In this case the I-PDU is a
LIN sporadic frame.
PduR_ComTransmit(Std_ReturnType,
PduIdType, const PduInfoType*)
LinIf_Transmit(Std_ReturnType,
PduIdType, const PduInfoType*)
PduR_<User:Lo>TriggerTransmit(Std_ReturnType,
PduIdType, PduInfoType*)
Com_TriggerTransmit(Std_ReturnType,
PduIdType, PduInfoType*)
copy buffer()
PduR_<User:Lo>TxConfirmation(PduIdType, Std_ReturnType)
Com_TxConfirmation(PduIdType, Std_ReturnType)
Following Figure 12 shows transmission of I-PDU from the COM module to the LinIf
module using trigger transmit. In this case the I-PDU is all other types except LIN
sporadic frame.
PduR_<User:Lo>TriggerTransmit(PduIdType,
PduInfoType*)
Com_TriggerTransmit(Std_ReturnType,
PduIdType, PduInfoType*)
The TriggerTransmit
will be called based
copy buffer() on the LIN schedule
table
PduR_<User:Lo>TxConfirmation(PduIdType, Std_ReturnType)
Com_TxConfirmation(PduIdType, Std_ReturnType)
Following Figure 13 shows transmission of I-PDU from the DCM module to the
CanTp module using the transport protocol API.
PduR_<User:Up>Transmit(Std_ReturnType,
PduIdType, const PduInfoType*)
CanTp_Transmit(Std_ReturnType,
PduIdType, const PduInfoType*)
Dcm_CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
copy data()
Dcm_CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
copy data()
PduR_CanTpTxConfirmation(PduIdType, Std_ReturnType)
Dcm_TpTxConfirmation(PduIdType, Std_ReturnType)
Following Figure 14 shows transmission of I-PDU from the DCM module to the
CanTp, FrTp and LinTp (LinIf includes the transport protocol module) module using
the transport protocol API.
«module» «module» «module» «module» «module»
Dcm PduR CanTp FrTp :FrTp LinIf
PduR_<User:Up>Transmit(Std_ReturnType,
PduIdType, const PduInfoType*)
CanTp_Transmit(Std_ReturnType, PduIdType,
const PduInfoType*)
PduR_<User:LoTp>CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
Dcm_CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
PduR_<User:LoTp>CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
Dcm_CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
PduR_<User:LoTp>CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
Dcm_CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
PduR_<User:LoTp>TxConfirmation(PduIdType, Std_ReturnType)
PduR_<User:LoTp>TxConfirmation(PduIdType, Std_ReturnType)
Figure 14: – I-PDU transmission on transport protocol on CAN, FlexRay and LIN
Following use-cases shows how the PDU Router modules will gateway I-PDUs.
Following Figure 15 shows how an I-PDU is gatewayed between two CAN networks
(CAN1 and CAN2) using CanIf.
«module» «module»
PduR CanIf
PduR_<User:Lo>RxIndication(PduIdType,
const PduInfoType*) Received IPDU on
CAN bus 1
Transmition of IPDU
copy data()
on CAN bus 2
PduR_<User:Lo>TxConfirmation(PduIdType, Std_ReturnType)
Confirmation of
transmission on
CAN bus 2
Calling CanIf_Transmit
without buffering the IPDU is
possible since CanIf will
always copy the frame
Following Figure 16 shows how an I-PDU is gatewayed between CAN and FlexRay,
using trigger transmit (with buffering and without buffering).
alt
[ImmediateBufferAccess]
PduR_<User:Lo>Triggertransmit(PduIdType, PduInfoType *)
alt
copy buffer()
[NOT ImmediateBufferAccess]
PduR_<User:Lo>TxConfirmation(PduIdType, Std_ReturnType)
copy buffer()
Following Figure 17 shows how an I-PDU is gatewayed from CAN to LIN, using
trigger transmit (LIN sporadic frame and all other LIN frame types).
PduR_<User:Lo>RxIndication(PduIdType,
const PduInfoType*)
The PduR may
buffer more than
one IPDU to be
gatewayed (i.e. a buffer IPDU()
FIFO)
alt
[if LIN sporadic frame] LinIf_Transmit(Std_ReturnType, PduIdType, const PduInfoType*)
[otherwise]
PduR_<User:Lo>Triggertransmit(PduIdType, PduInfoType *)
PduR_<User:Lo>TxConfirmation(PduIdType, Std_ReturnType)
9.3.4 Gateway from CAN to CAN and received by the COM module
Following Figure 18 shows how an I-PDU is gatewayed from CAN1 to CAN2 and
also received locally by the COM module.
Transmisison
copy data() request on CAN2
PduR_<User:Lo>TxConfirmation(PduIdType, Std_ReturnType)
Transmission is
confirmed on
CAN2
Following Figure 19 shows how an (multi N-PDU) I-PDU is gatewayed between two
CAN networks, using transport protocol module.
«module» «module»
PduR CanTp
PduR_<User:LoTp>StartOfReception(BufReq_ReturnType, PduIdType,
const PduInfoType*, PduLengthType, PduLengthType*)
Data is received
from CAN1
The data
received from
CAN1 has copy data()
reached the
CanTp_Transmit(Std_ReturnType, PduIdType, const PduInfoType*)
threshold for
gateway
Start
transmission on
CAN2
copy data()
complete data is
received from
CAN1
And reception is
confirmed
PduR_<User:LoTp>RxIndication(PduIdType, Std_ReturnType)
PduR_<User:LoTp>TxConfirmation(PduIdType, Std_ReturnType)
Transmission is
confirmed on
CAN2
Figure 19: – Gateway of I-PDU (multi N-PDU) between two CAN networks
The following Figure 20 shows how an (multi N-PDU) I-PDU is gatewayed from
J1939Tp to two CAN-Networks, using transport protocol module.
PduR_<User:LoTp>StartOfReception(BufReq_ReturnType, PduIdType,
const PduInfoType*, PduLengthType, PduLengthType*)
Data is received
from J1939Tp
The data
received from copy data()
J1939Tp has
reached the CanTp_Transmit(Std_ReturnType, PduIdType, const PduInfoType*)
threshold for
gateway
PduR_<User:LoTp>CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
Data is requested
for transmission
on CAN1
PduR_<User:LoTp>CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
Data is requested
for transmission
on CAN2
PduR_<User:LoTp>CopyRxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, PduLengthType*)
complete data is
received from copy data()
J1939Tp
And reception is
confirmed
PduR_<User:LoTp>RxIndication(PduIdType, Std_ReturnType)
PduR_<User:LoTp>CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
Last data is
requested for
transmission on
PduR_<User:LoTp>CopyTxData(BufReq_ReturnType, PduIdType,
CAN1 and CAN2
const PduInfoType*, RetryInfoType*, PduLengthType*)
PduR_<User:LoTp>TxConfirmation(PduIdType, Std_ReturnType)
Transmission is
confirmed on
CAN1 and CAN2
PduR_<User:LoTp>TxConfirmation(PduIdType, Std_ReturnType)
Figure 20: – Gateway of I-PDU (multi N-PDU) between J1939Tp and two CanTp
87 of 121 Document ID 035: AUTOSAR_SWS_PDURouter
- AUTOSAR confidential -
Specification of PDU Router
AUTOSAR CP Release 4.3.1
The following use-case, Figure 21, shows an I-PDU (contained in a SF) received
from CAN1 transport protocol and gatewayed to DCM (internal) and gatewayed to
CAN2 transport protocol.
The I-PDU must be buffered in the PDU Router since the DCM module is not aware
of that it will be gatewayed to CAN2. Such gatewaying is controlled by the
configuration and cannot be processed by the DCM.
copy data()
PduR_CanTpRxIndication(PduIdType, Std_ReturnType)
Complete
data
received
Dcm_StartOfReception(BufReq_ReturnType, PduIdType, from CAN1
const PduInfoType*, PduLengthType, PduLengthType*)
Dcm_CopyRxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, PduLengthType*)
copy data()
Dcm_TpRxIndication(PduIdType, Std_ReturnType)
Data is
copy data() requested
on CAN2
PduR_CanTpTxConfirmation(PduIdType, Std_ReturnType)
9.3.8 Gateway Multi-Frame I-PDU from J1939Tp to DCM, CAN and LIN
The following Figure 22 shows how routing of a broadcast TP protocol (e.g. BAM of
J1939Tp) is performed.
PduR_<User:LoTp>StartOfReception(BufReq_ReturnType,
PduIdType, const PduInfoType*, PduLengthType, PduLengthType*)
PduR_<User:LoTp>CopyRxData(BufReq_ReturnType,
PduIdType, const PduInfoType*, PduLengthType*)
copy data()
Transmit
on CAN
Transmit
on LIN
PduR_<User:LoTp>RxIndication(PduIdType,
Std_ReturnType)
Complete data
received from
J1939Tp
Dcm_StartOfReception(BufReq_ReturnType, PduIdType,
const PduInfoType*, PduLengthType, PduLengthType*)
Dcm_CopyRxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, PduLengthType*)
copy data()
Dcm_CopyRxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, PduLengthType*)
copy data()
Dcm_TpRxIndication(PduIdType, Std_ReturnType)
PduR_<User:LoTp>CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
Data is
copy data() requested
on CAN
PduR_<User:LoTp>CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
Data is
copy data() requested
on LIN
PduR_<User:LoTp>CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
copy data()
PduR_<User:LoTp>CopyTxData(BufReq_ReturnType, PduIdType,
const PduInfoType*, RetryInfoType*, PduLengthType*)
copy data()
PduR_<User:LoTp>TxConfirmation(PduIdType, Std_ReturnType)
PduR_<User:LoTp>TxConfirmation(PduIdType, Std_ReturnType)
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 module
PDU Router.
10.1.1 Variants
[SWS_PduR_00295] ⌈The PDU Router module shall support the update of the
routing configuration (i.e. the PDU Router routing tables) at post build-time if this
variant is supported. ⌋ (SRS_PduR_06002, SRS_BSW_00404)
Support of post-build update of the routing table is not always desired. Therefore
post-build update of the routing table is only supported in the variant post-build of the
PDU Router module, see further section 10.1.1.
The post-build comes in two flavors: Selectable and Loadable, there is no restriction
on using any of them in the PDU Router module or even a combination of them.
[SWS_PduR_00296] ⌈If the variant post-build is supported, the update of the routing
tables shall only be possible when the PDU Router module is uninitialized. ⌋
(SRS_PduR_06001, SRS_BSW_00404)
Remark: The process how the update of the routing tables is performed is not
restricted. Most likely a reflashing of the memory segment that holds the table will be
done by the bootloader - a separate program which may be loaded after a reboot to
update the ECU.
91 of 121 Document ID 035: AUTOSAR_SWS_PDURouter
- AUTOSAR confidential -
Specification of PDU Router
AUTOSAR CP Release 4.3.1
Remark: The unique configuration identifier is not used to select one of multiple post-
build configuration sets of the PDU Router module, but for unique identification of the
current PDU Router module post-build configuration, e.g. for Diagnostics or for
checking at runtime that the post-build configurations of related communication
modules match. The configuration identifier can be read via the API
PduR_GetConfigurationId, see section 8.3.1.3.
lowerMultiplicity = 0
upperMultiplicity = * PduRDestPduRRef :
EcucReferenceDef
PduRRoutingPath : +reference
EcucParamConfContainerDef
+destination
PduRSrcPdu :
+subContainer EcucParamConfContainerDef +destination
lowerMultiplicity = 0
PduRDestPdu :
upperMultiplicity = *
EcucParamConfContainerDef
+subContainer upperMultiplicity = *
lowerMultiplicity = 0
PduRRoutingPathGroup :
+subContainer EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
PduRTxBuffer : PduRPduMaxLength :
+subContainer EcucParamConfContainerDef +parameter EcucIntegerParamDef
+container
lowerMultiplicity = 0 min = 1
upperMultiplicity = * max = 4294967295
PduRConfigurationId :
+parameter EcucIntegerParamDef
min = 0
max = 65535
PduRMaxRoutingPathGroupCnt :
EcucIntegerParamDef
+parameter
min = 0
max = 65535
lowerMultiplicity = 0
upperMultiplicity = 1
PduRMaxRoutingPathCnt :
EcucIntegerParamDef
+parameter
min = 0
max = 65535
lowerMultiplicity = 0
upperMultiplicity = 1
10.2.1 PduR
Included Containers
Container Name Multiplicity Scope / Dependency
Each container describes a specific BSW module
(upper/CDD/lower/IpduM) that the PDU Router shall interface
to.
The reason to have it as own configuration container instead of
PduRBswModules 0..*
implication of the routing path is to be able to configure CDDs
properly and to force module's to be used in a post-build
situation even though no routing is made to/from this module
(future configurations may include these modules).
This container is a subcontainer of PduR and specifies the
PduRGeneral 1
general configuration parameters of the PDU Router.
Represents one table of routing paths.
This routing table allows multiple configurations that can be
used to create several routing tables in the same configuration.
PduRRoutingPaths 1
This is mainly used for post-build (e.g. post-build selectable)
but can be used by pre-compile and link-time for variant
handling.
PduR :EcucModuleDef
upperMultiplicity = 1
lowerMultiplicity = 0
+parameter
PduRRetransmission :EcucBooleanParamDef
+parameter
PduRUseTag :EcucBooleanParamDef
+parameter
PduRTxConfirmation :EcucBooleanParamDef
+parameter
PduRCancelTransmit :EcucBooleanParamDef
+parameter
PduRCommunicationInterface :EcucBooleanParamDef
+parameter
PduRTransportProtocol :EcucBooleanParamDef
+parameter
PduRTriggertransmit :EcucBooleanParamDef
+parameter
PduRUpperModule :EcucBooleanParamDef
+parameter
PduRLowerModule :EcucBooleanParamDef
+parameter
PduRChangeParameterApi :EcucBooleanParamDef
+parameter
PduRCancelReceive :EcucBooleanParamDef
Figure 24 - PduRBswModules
10.2.2 PduRBswModules
Class POST-BUILD
Link time --
Post-build time --
Configuration Parameters
Multiplicity 1
Type EcucBooleanParamDef
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
An upper module can also be an lower module (e.g. the IpduM module).
Multiplicity 1
Type EcucBooleanParamDef
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
An upper module can also be an lower module (e.g. the IpduM module).
Multiplicity 1
Type EcucBooleanParamDef
Default value --
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
PduR_<Up>CancelReceive
PduR_<Up>CancelTransmit
The background is that upper layer modules differ in usage of this tag (e.g.
COM is using the tag, DCM is not).
Multiplicity 1
Type EcucBooleanParamDef
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
No Included Containers
PduR :EcucModuleDef
upperMultiplicity = 1
lowerMultiplicity = 0
+container
PduRDevErrorDetect :
PduRGeneral : +parameter EcucBooleanParamDef
EcucParamConfContainerDef
defaultValue = false
PduRVersionInfoApi :
+parameter
EcucBooleanParamDef
defaultValue = false
+parameter
PduRZeroCostOperation :
EcucBooleanParamDef
PduRMetaDataSupport :
+parameter EcucBooleanParamDef
lowerMultiplicity = 0
upperMultiplicity = 1
defaultValue = false
Figure 25 - PduRGeneral
10.2.3 PduRGeneral
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
No Included Containers
upperMultiplicity = * lowerMultiplicity = 0
lowerMultiplicity = 0 upperMultiplicity = 1
+destination
PduRRoutingPathGroup :
EcucParamConfContainerDef
lowerMultiplicity = 0 PduRRoutingPathGroupId :
upperMultiplicity = * EcucIntegerParamDef
+parameter
min = 0
+subContainer
max = 65535
symbolicNameValue = true
lowerMultiplicity = 1
upperMultiplicity = 1
+parameter PduRIsEnabledAtInit :
EcucBooleanParamDef
Figure 26 - PduRRoutingPathGroup
10.2.4 PduRRoutingPathGroup
Enabling and disabling of routing path groups are made using the PduR
API
Post-Build Variant
true
Multiplicity
Multiplicity Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class Link time --
No Included Containers
PduRRoutingPaths :
EcucParamConfContainerDef
PduRSourcePduBlockSize :
PduRSrcPdu : EcucIntegerParamDef
EcucParamConfContainerDef
+parameter
upperMultiplicity = 1
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = * max = 4294967295
min = 1
PduRSrcPduUpTxConf :
+subContainer +parameter EcucBooleanParamDef
defaultValue = true
+reference
PduRSrcPduRef : +destination
+destination EcucReferenceDef Pdu :
EcucParamConfContainerDef
PduRSourcePduHandleId :
EcucIntegerParamDef
+parameter
min = 0
max = 65535
symbolicNameValue = true
+destination
+subContainer +reference PduRDestPduRef :
PduRDestPdu :
EcucReferenceDef
EcucParamConfContainerDef
+parameter
PduRTransmissionConfirmation :
upperMultiplicity = * EcucBooleanParamDef
PduRSrcPduRRef :
lowerMultiplicity = 0 PduRDestPduHandleId :
EcucReferenceDef
EcucIntegerParamDef
min = 0
+reference max = 65535
+destination +parameter
lowerMultiplicity = 0
upperMultiplicity = 1
symbolicNameValue = true
PduRDestPduRRef : +literal
PduRDestPduDataProvision : PDUR_DIRECT :
EcucReferenceDef
EcucEnumerationParamDef EcucEnumerationLiteralDef
+parameter
+reference upperMultiplicity = 1 +literal PDUR_TRIGGERTRANSMIT :
lowerMultiplicity = 0
EcucEnumerationLiteralDef
+subContainer
+parameter
PduRRoutingPath : PduRQueueDepth :
EcucParamConfContainerDef EcucIntegerParamDef
PduRTpThreshold :
EcucIntegerParamDef
upperMultiplicity = * min = 1
lowerMultiplicity = 0 +parameter max = 255
min = 0
max = 65535 lowerMultiplicity = 0
upperMultiplicity = 1 PduRDefaultValueElement :
lowerMultiplicity = 0
EcucIntegerParamDef
upperMultiplicity = 1
+parameter max = 255
PduRDefaultValueElement :
PduRDefaultValue : min = 0
EcucParamConfContainerDef +subContainer EcucParamConfContainerDef
min = 0
PduRDestTxBufferRef :
max = 4294967294
+reference EcucReferenceDef
+subContainer
lowerMultiplicity = 0 +destination
upperMultiplicity = *
PduRTxBuffer :
EcucParamConfContainerDef
PduRRoutingPathGroupRef : PduRRoutingPathGroup :
EcucReferenceDef EcucParamConfContainerDef lowerMultiplicity = 0
+reference +destination upperMultiplicity = *
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
+subContainer
Figure 27 - PduRRoutingPath
10.2.5 PduRRoutingPaths
This routing table allows multiple configurations that can be used to create
Description
several routing tables in the same configuration. This is mainly used for
post-build (e.g. post-build selectable) but can be used by pre-compile and
link-time for variant handling.
Configuration Parameters
Included Containers
Container Name Multiplicity Scope / Dependency
This container is a subcontainer of PduRRoutingPath and
PduRDestPdu 0..*
specifies one destination for the PDU to be routed.
This container is a subcontainer of PduRRoutingTable and
PduRRoutingPath 0..*
specifies the routing path of a PDU.
This container groups routing path destinations. Destinations
are used instead of routing paths since a routing path can be
1:n. It is desirable to be able to enable/disable a specific bus
(i.e. a destination) rather than a routing path. Of course it is
PduRRoutingPathGroup 0..*
possible to create groups that covers specific routing paths as
well.
Enabling and disabling of routing path groups are made using
the PduR API
This container is a subcontainer of PduRRoutingPath and
PduRSrcPdu 0..*
specifies the source of the PDU to be routed.
Specifies a buffer used for gatewaying via communication
PduRTxBuffer 0..*
interfaces or transport protocols.
10.2.6 PduRRoutingPath
Included Containers
Container Name Multiplicity Scope / Dependency
Specifies the default value of the I-PDU. Only required for
gateway operation and if at least one PDU specified by
PduRDefaultValue 0..1
PduRDestPdu uses TriggerTransmit Data provision.
Represented as an array of IntegerParamDef.
10.2.7 PduRDestPdu
One background for this parameter is for the PduR to know when all
modules have confirmed a multicast operation.
Multiplicity 1
Type EcucBooleanParamDef
Default value --
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
10.2.8 PduRSrcPdu
Multiplicity 1
Type Reference to [ Pdu ]
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time --
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
No Included Containers
10.2.9 PduRDefaultValue
Included Containers
Container Name Multiplicity Scope / Dependency
Each value element is represented by the element and the
PduRDefaultValueElement 0..*
position in an array.
10.2.10 PduRDefaultValueElement
Range 0 .. 255
Default value --
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time --
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
No Included Containers
10.2.11 PduRTxBuffer
No Included Containers
This chapter collects a set of notes that describes features of this document.
The buffers needed for gatewaying (communication interface and transport protocol)
are specified per destination in the configuration. Since no specific traffic shaping can
be specified it is assumed that worst case where all I-PDUs are gatewayed at the
same time. It is possible to extend the configuration with parameters that allow more
efficient usage of buffers.
The provided and used APIs of the PDU Router module are not connected to specific
busses. The API names in chapter 8.3 have a generic part (<Up>, <Lo>, etc) that will
be exchanged with the name of the module using or implementing the API.
The way to identify the name is using the reference to an ECUC description, see
Figure 28. The short-name will be used in the referenced ECUC description.
PduR :EcucModuleDef
upperMultiplicity = 1
lowerMultiplicity = 0
+parameter
PduRUseTag :EcucBooleanParamDef
+parameter
PduRTxConfirmation :EcucBooleanParamDef
+parameter
PduRCancelTransmit :EcucBooleanParamDef
+parameter
PduRCommunicationInterface :EcucBooleanParamDef
+parameter
PduRTransportProtocol :EcucBooleanParamDef
+parameter
PduRTriggertransmit :EcucBooleanParamDef
+parameter
PduRUpperModule :EcucBooleanParamDef
+parameter
PduRLowerModule :EcucBooleanParamDef
+parameter
PduRChangeParameterApi :EcucBooleanParamDef
+parameter
PduRCancelReceive :EcucBooleanParamDef
[SWS_PduR_00800] ⌈In case the lower layer module supports both TP and IF, the
infixes Tp and If shall be added to the function names directly in front of the function,
e.g. <Lo>_[Tp]Transmit, PduR_<Lo>[If]TxConfirmation. ⌋ (SRS_PduR_06117,
SRS_PduR_06121, SRS_BSW_00310)
The connection between the generic interface configuration of a BSW module and
the I-PDUs are made using the routing paths and the I-PDU configuration in the
ECUC module.
This chapter shows example structures of routing tables that contain the properties of
each I-PDU. It does not specify the internals of the PDU Router but shall rather serve
as example for better understanding of APIs and I-PDUs.
The first three entries represent normal PDU transmit operations from Com via CanIf
or FrIf respectively, the remaining two entries are related to multicast PDU transmit
operations from COM module to two different CAN busses and COM module to LinIf
and CanIf. For the latter an internal PDU Router function (MultiIf_Transmit) and an
additional routing table is used.
The destination module will confirm the transmission of the I-PDU using the
configured I-PDU id, and it might not be the same as in the transmit call.
The PDU Router configuration generator will take the ECU configuration description
XML file containing the PDU Router configuration as input. And the generator will
produce .c and .h files containing the configuration.
One part of the job made by the generator is to lookup all routing paths and produces
the correct look-up tables and the correct APIs to be used. Here are some examples
how the generator may handle the routing paths. ⌋ (SRS_PduR_06020)
This is an example that shows how an I-PDU received by the CanIf module and
forwarded by the COM module is handled.
In Figure 29 the configuration of CanId, COM and PDU Router is shown. The PDU
Router has a routing path with a source I-PDU (SrcPduRef) and destination I-PDU
(DestPduRef). When following the I-PDU SrcPduRef it is found that the CanIf
PduIdRef is pointing at the same I-PDU in the ECUC. The DestPduRef is followed
and it is found that COM PduIdRef is pointing at the same I-PDU in the ECUC.
ComIPduHandleId : Pdu :
ComIPdu : EcucIntegerParamDef EcucParamConfContainerDef
ComConfig :EcucParamConfContainerDef EcucParamConfContainerDef
Com :EcucModuleDef +parameter lowerMultiplicity = 0
+container upperMultiplicity = 1
+subContainer
lowerMultiplicity = 0 lowerMultiplicity = 0 upperMultiplicity = *
upperMultiplicity = 1 upperMultiplicity = * symbolicNameValue = true
lowerMultiplicity = 0 min = 0
max = 65535
+reference +destination
ComPduIdRef :
EcucReferenceDef
PduRRoutingPaths : PduRSrcPdu :
EcucParamConfContainerDef +reference
EcucParamConfContainerDef +subContainer PduRSrcPduRef :
EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = * +destination
PduRSrcPduRRef :
EcucReferenceDef
PduRRoutingPath : +reference PduRSourcePduHandleId :
EcucParamConfContainerDef EcucIntegerParamDef
+subContainer
+parameter
upperMultiplicity = * min = 0
lowerMultiplicity = 0 max = 65535
+reference
symbolicNameValue = true
PduRDestPduRRef :
EcucReferenceDef
+destination
PduRDestPdu : PduRRoutingPathGroupRef :
+subContainer EcucParamConfContainerDef
+reference EcucReferenceDef
upperMultiplicity = * lowerMultiplicity = 0
lowerMultiplicity = 0 upperMultiplicity = 1
CanIfRxPduId :
EcucIntegerParamDef
CanIfRxPduCfg :
EcucParamConfContainerDef symbolicNameValue = true
+parameter
CanIfInitCfg : upperMultiplicity = 1
CanIf :EcucModuleDef
EcucParamConfContainerDef lowerMultiplicity = 0 lowerMultiplicity = 1
+container +subContainer upperMultiplicity = * min = 0
upperMultiplicity = 1 max = 4294967295
lowerMultiplicity = 0 lowerMultiplicity = 1
upperMultiplicity = 1 +reference
CanIfRxPduRef : +destination
EcucReferenceDef
The CanIfCanRxPduId reveals the I-PDU ID for the source I-PDU and the
ComIPduHandleId reveals the I-PDU ID for the destination I-PDU.
The shortname of the CanIf module and the COM module (and that the I-PDU is
transported on a communication interface module) will generate the routing table and
APIs to be used:
PduR_COM.h
void PduR_ComRxIndication(PduIdType id, PduInfoType* info);
119 of 121 Document ID 035: AUTOSAR_SWS_PDURouter
- AUTOSAR confidential -
Specification of PDU Router
AUTOSAR CP Release 4.3.1
PduR_CanIf.h
void PduR_CanIfRxIndication(PduIdType id, const PduInfoType* info);
This section describes some important behavior when using the post-build variant of
the PDU Router. It contains no requirements, just important issues that need to be
considered.
NVRAM and RAM memory size can potentially grow if a new post-build configuration
is downloaded into the ECU. Estimation at design time must be done to allow such
grow so other areas are not overwritten (in case of RAM) or memory borders are not
crossed.