AUTOSAR SWS CANInterface

Download as pdf or txt
Download as pdf or txt
You are on page 1of 217

Specification of CAN Interface

AUTOSAR CP R21-11

Document Title Specification of CAN Interface


Document Owner AUTOSAR
Document Responsibility AUTOSAR
Document Identification No 12

Document Status published


Part of AUTOSAR Standard Classic Platform
Part of Standard Release R21-11

Document Change History


Date Release Changed by Description

AUTOSAR • Support hardware-based


2021-11-25 R21-11 Release timestamping
Management • Minor corrections/clarifications
• Editorial changes
• Introduction of Security Events
AUTOSAR • Rework of Error classification
2020-11-30 R20-11 Release chapters
Management • Removal of pretended networking
• Minor corrections/clarifications
• Update reference to ISO
AUTOSAR 11898-1:2015
2019-11-28 R19-11 Release • Minor corrections
Management • Editorial changes
• Changed Document Status from
Final to published
• BusMirroring (CONC_634)
AUTOSAR • Receive Data Length Check per Pdu
2018-10-31 4.4.0 Release • Remove dummy implementations for
Management Cancel Transmit APIs
• Header File Cleanup
• Introduction of Runtime errors
AUTOSAR • Replace Can_ReturnType with
2017-12-08 4.3.1 Release Std_ReturnType overlay
Management • Minor corrections
• Editorial changes

1 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

AUTOSAR • Remove CCMSM


2016-11-30 4.3.0 Release • Rework MetaData handling
Management • Reliable TxConfirmation
• Error Active/Passive State API

AUTOSAR • Clarified wakeup, buffering, transmit,


2015-07-31 4.2.2 Release and variants
Management • Removed deprecated APIs
• Editorial changes
• Full CAN FD Support
AUTOSAR • Global Time Synchronization over
2014-10-31 4.2.1 Release CAN
Management • Removed
CanIf_CancelTxConfirmation
• Small improvements

AUTOSAR • Removed BSW Exclusive areas


2014-03-31 4.1.3 Release • Set ICOM support to optional
Management • Can_IdType handling
• Small improvements
• Restricted PDU mode changes
AUTOSAR • Removed critical section handling
2013-10-31 4.1.2 Release description in chapter 9
Management • Set CanIfInitRefCfgSet oboslete
• Pretended Networking section
• Small improvements
• CAN FD (without DLC extension)
• Pretended Networking (ICOM)
AUTOSAR • Heavy Duty Vehicle (J1939) support
2013-03-15 4.1.1 • PduModes and PnTxFilter for clean
Administration
wake-up
• Relation between PDUs & HOHs
• Post-build loadable concept

AUTOSAR • Partial Networking Support


2011-12-22 4.0.3 • Improved Transmit Buffering
Administration
• Improved Error Detection

2 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

• Updated chapters "Version


Checking" and "Published
Information"
• Multiple CAN IDs could optionally be
assigned to one I-PDU
• Wake-up validation optionally only
via NM PDUs
• Asynch. mode indication call-backs
instead of synch. mode changes
AUTOSAR • No automatic PDU channel mode
2009-12-18 4.0.1
Administration change when CC mode changes
• TxConfirmation state entered for
BusOff Recovery
• WakeupSourceRefIn and
WakeupSourceRefOut
• PduInfoPtr instead of SduDataPtr
• Introduction of Can_GeneralTypes.h
and Can_HwHandleType
• Transceiver types of chapter 8.
shifted to transceiver SWS
• HOH definition
• abstracted ControllerId and
TransceiverId
• No changing of baudrate via CanIf
and CanIf_ControllerInit
• Dispatcher adapted because of CDD
• TxBuffering: only one buffer per
AUTOSAR L-PDU
2010-02-02 3.1.4
Administration • Wake up mechanism adapted to
environment behavior (network ->
controller/transceiver;
wakeupSource)
• Mode changes made asynchronous
• no complete state machine in CanIf,
just buffered states per controller
• Legal disclaimer revised
AUTOSAR
2008-08-13 3.1.1 Legal disclaimer revised
Administration

AUTOSAR • Replaced chapter 10 content with


2008-02-01 3.0.2 generated tables from AUTOSAR
Administration
MetaModel.

3 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

• Interface abstraction: network


related interface changed into a
controller related one
• Wakeup mechanism completely
reworked, APIs added & changed for
Wakeup
AUTOSAR • Initialization changed (flat
2008-02-01 3.0.2
Administration initialization)
• Scheduled main functions skipped
due to changed BSW Scheduler
responsibility
• Document meta information
extended
• Small layout adaptations made
• Header file structure changed
• Support of mixed mode operation
(Standard CAN & Extended CAN in
parallel on one network) added
• Support of CAN Transceiver API
<User>_DlcErrorNotification deleted
• Pre-compile/Link-Time/Post-Built
definition for configuration
AUTOSAR parameters partly changed
2007-12-21 3.0.1
Administration • Re-entrant interface call allowed for
certain APIs
• Support of AUTOSAR BSW
Scheduler added
• Support of memory mapping added
• Configuration container structure
reworked
• Various of clarification extensions
and corrections
AUTOSAR
2006-05-16 2.0.0 Second Release
Administration
AUTOSAR
2005-05-31 1.0.0 Initial Release
Administration

4 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Disclaimer

This work (specification and/or software implementation) and the material contained in
it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR and the
companies that have contributed to it shall not be liable for any use of the work.
The material contained in this work is protected by copyright and other types of intel-
lectual 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.

5 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Table of Contents
1 Introduction and functional overview 10

2 Acronyms and Abbreviations 13

3 Related documentation 15
3.1 Input documents & related standards and norms . . . . . . . . . . . . 15
3.2 Related specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 Constraints and assumptions 17
4.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Applicability to car domains . . . . . . . . . . . . . . . . . . . . . . . . 17
5 Dependencies to other modules 18
5.1 Upper Protocol Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.2 Initialization: Ecu State Manager . . . . . . . . . . . . . . . . . . . . . 19
5.3 Mode Control: CAN State Manager . . . . . . . . . . . . . . . . . . . . 19
5.4 Lower layers: CAN Driver . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.5 Lower layers: CAN Transceiver Driver . . . . . . . . . . . . . . . . . . 20
5.6 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.7 File structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.7.1 Code file structure . . . . . . . . . . . . . . . . . . . . . . . . 22
5.7.2 Header file structure . . . . . . . . . . . . . . . . . . . . . . . 22
6 Requirements Tracing 23

7 Functional specification 28
7.1 General Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7.2 Hardware object handles . . . . . . . . . . . . . . . . . . . . . . . . . . 29
7.3 Static L-PDUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.4 Dynamic L-PDUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.4.1 Dynamic Transmit L-PDUs . . . . . . . . . . . . . . . . . . . 33
7.4.2 Dynamic receive L-PDUs . . . . . . . . . . . . . . . . . . . . 34
7.5 Physical channel view . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.6 CAN Hardware Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
7.7 BasicCAN and FullCAN reception . . . . . . . . . . . . . . . . . . . . . 37
7.8 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
7.9 Transmit request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
7.10 Transmit data flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
7.11 Transmit buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
7.11.1 General behavior . . . . . . . . . . . . . . . . . . . . . . . . 42
7.11.2 Buffer characteristics . . . . . . . . . . . . . . . . . . . . . . 43
7.11.2.1 Storage of L-PDUs in the transmit L-PDU buffer . . . 43
7.11.2.2 Clearance of transmit L-PDU buffers . . . . . . . . . 44
7.11.2.3 Initialization of transmit L-PDU buffers . . . . . . . . 45
7.11.3 Data integrity of transmit L-PDU buffers . . . . . . . . . . . . 45

6 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.12 Transmit confirmation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46


7.13 Receive data flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
7.14 Receive indication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.15 Read received data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.16 Read Tx/Rx notification status . . . . . . . . . . . . . . . . . . . . . . . 51
7.17 Data integrity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.18 CAN Controller Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
7.18.1 General Functionality . . . . . . . . . . . . . . . . . . . . . . 52
7.18.2 CAN Controller Operation Modes . . . . . . . . . . . . . . . 53
7.18.3 Controller Mode Transitions . . . . . . . . . . . . . . . . . . . 54
7.18.4 Wake-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7.18.4.1 Wake-up detection . . . . . . . . . . . . . . . . . . . 55
7.18.4.2 Wake-up Validation . . . . . . . . . . . . . . . . . . . 55
7.19 PDU channel mode control . . . . . . . . . . . . . . . . . . . . . . . . 56
7.19.1 PDU channel groups . . . . . . . . . . . . . . . . . . . . . . 56
7.19.2 PDU channel modes . . . . . . . . . . . . . . . . . . . . . . . 57
7.19.2.1 CANIF_OFFLINE . . . . . . . . . . . . . . . . . . . . 58
7.19.2.2 CANIF_ONLINE . . . . . . . . . . . . . . . . . . . . 59
7.19.2.3 CANIF_OFFLINE_ACTIVE . . . . . . . . . . . . . . 60
7.20 Software receive filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.20.1 Software filtering concept . . . . . . . . . . . . . . . . . . . . 60
7.20.2 Software filter algorithms . . . . . . . . . . . . . . . . . . . . 62
7.21 Data Length Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
7.22 L-SDU dispatcher to upper layers . . . . . . . . . . . . . . . . . . . . . 62
7.23 Polling mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
7.24 Multiple CAN Driver support . . . . . . . . . . . . . . . . . . . . . . . . 63
7.24.1 Transmit requests by using multiple CAN Drivers . . . . . . . 64
7.24.2 Notification mechanism using multiple CAN Drivers . . . . . 65
7.25 Partial Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
7.26 CAN FD Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
7.27 Security Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
7.28 Error classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
7.28.1 Development Errors . . . . . . . . . . . . . . . . . . . . . . . 70
7.28.2 Runtime Errors . . . . . . . . . . . . . . . . . . . . . . . . . . 71
7.28.3 Transient Faults . . . . . . . . . . . . . . . . . . . . . . . . . 71
7.28.4 Production Errors . . . . . . . . . . . . . . . . . . . . . . . . 71
7.28.5 Extended Production Errors . . . . . . . . . . . . . . . . . . . 72
8 API specification 73
8.1 Imported types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
8.2 Type definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
8.2.1 CanIf_ConfigType . . . . . . . . . . . . . . . . . . . . . . . . 73
8.2.2 CanIf_PduModeType . . . . . . . . . . . . . . . . . . . . . . 74
8.2.3 CanIf_NotifStatusType . . . . . . . . . . . . . . . . . . . . . . 74
8.3 Function definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
8.3.1 CanIf_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

7 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

8.3.2 CanIf_DeInit . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.3.3 CanIf_SetControllerMode . . . . . . . . . . . . . . . . . . . . 76
8.3.4 CanIf_GetControllerMode . . . . . . . . . . . . . . . . . . . . 77
8.3.5 CanIf_GetControllerErrorState . . . . . . . . . . . . . . . . . 78
8.3.6 CanIf_Transmit . . . . . . . . . . . . . . . . . . . . . . . . . . 79
8.3.7 CanIf_ReadRxPduData . . . . . . . . . . . . . . . . . . . . . 81
8.3.8 CanIf_ReadTxNotifStatus . . . . . . . . . . . . . . . . . . . . 82
8.3.9 CanIf_ReadRxNotifStatus . . . . . . . . . . . . . . . . . . . . 83
8.3.10 CanIf_SetPduMode . . . . . . . . . . . . . . . . . . . . . . . 84
8.3.11 CanIf_GetPduMode . . . . . . . . . . . . . . . . . . . . . . . 85
8.3.12 CanIf_GetVersionInfo . . . . . . . . . . . . . . . . . . . . . . 85
8.3.13 CanIf_SetDynamicTxId . . . . . . . . . . . . . . . . . . . . . 86
8.3.14 CanIf_SetTrcvMode . . . . . . . . . . . . . . . . . . . . . . . 87
8.3.15 CanIf_GetTrcvMode . . . . . . . . . . . . . . . . . . . . . . . 88
8.3.16 CanIf_GetTrcvWakeupReason . . . . . . . . . . . . . . . . . 89
8.3.17 CanIf_SetTrcvWakeupMode . . . . . . . . . . . . . . . . . . 91
8.3.18 CanIf_CheckWakeup . . . . . . . . . . . . . . . . . . . . . . 92
8.3.19 CanIf_CheckValidation . . . . . . . . . . . . . . . . . . . . . 93
8.3.20 CanIf_GetTxConfirmationState . . . . . . . . . . . . . . . . . 94
8.3.21 CanIf_ClearTrcvWufFlag . . . . . . . . . . . . . . . . . . . . 95
8.3.22 CanIf_CheckTrcvWakeFlag . . . . . . . . . . . . . . . . . . . 96
8.3.23 CanIf_SetBaudrate . . . . . . . . . . . . . . . . . . . . . . . 96
8.3.24 CanIf_GetControllerRxErrorCounter . . . . . . . . . . . . . . 97
8.3.25 CanIf_GetControllerTxErrorCounter . . . . . . . . . . . . . . 98
8.3.26 CanIf_EnableBusMirroring . . . . . . . . . . . . . . . . . . . 99
8.3.27 CanIf_GetCurrentTime . . . . . . . . . . . . . . . . . . . . . 100
8.3.28 CanIf_EnableEgressTimeStamp . . . . . . . . . . . . . . . . 100
8.3.29 CanIf_GetEgressTimeStamp . . . . . . . . . . . . . . . . . . 101
8.3.30 CanIf_GetIngressTimeStamp . . . . . . . . . . . . . . . . . . 102
8.4 Callback notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
8.4.1 CanIf_TriggerTransmit . . . . . . . . . . . . . . . . . . . . . . 103
8.4.2 CanIf_TxConfirmation . . . . . . . . . . . . . . . . . . . . . . 104
8.4.3 CanIf_RxIndication . . . . . . . . . . . . . . . . . . . . . . . 105
8.4.4 CanIf_ControllerBusOff . . . . . . . . . . . . . . . . . . . . . 106
8.4.5 CanIf_ConfirmPnAvailability . . . . . . . . . . . . . . . . . . 107
8.4.6 CanIf_ClearTrcvWufFlagIndication . . . . . . . . . . . . . . . 108
8.4.7 CanIf_CheckTrcvWakeFlagIndication . . . . . . . . . . . . . 109
8.4.8 CanIf_ControllerModeIndication . . . . . . . . . . . . . . . . 110
8.4.9 CanIf_TrcvModeIndication . . . . . . . . . . . . . . . . . . . 111
8.4.10 CanIf_ControllerErrorStatePassive . . . . . . . . . . . . . . . 112
8.4.11 CanIf_ErrorNotification . . . . . . . . . . . . . . . . . . . . . 113
8.5 Scheduled functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
8.6 Expected interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
8.6.1 Mandatory interfaces . . . . . . . . . . . . . . . . . . . . . . 114
8.6.2 Optional interfaces . . . . . . . . . . . . . . . . . . . . . . . . 114
8.6.3 Configurable interfaces . . . . . . . . . . . . . . . . . . . . . 116

8 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

8.6.3.1 <User_TriggerTransmit> . . . . . . . . . . . . . . . . 117


8.6.3.2 <User_TxConfirmation> . . . . . . . . . . . . . . . . 118
8.6.3.3 <User_RxIndication> . . . . . . . . . . . . . . . . . . 120
8.6.3.4 <User_ValidateWakeupEvent> . . . . . . . . . . . . 121
8.6.3.5 <User_ControllerBusOff> . . . . . . . . . . . . . . . 123
8.6.3.6 <User_ConfirmPnAvailability> . . . . . . . . . . . . . 124
8.6.3.7 <User_ClearTrcvWufFlagIndication> . . . . . . . . . 125
8.6.3.8 <User_CheckTrcvWakeFlagIndication> . . . . . . . . 126
8.6.3.9 <User_ControllerModeIndication> . . . . . . . . . . 127
8.6.3.10 <User_TrcvModeIndication> . . . . . . . . . . . . . . 129
9 Sequence diagrams 131
9.1 Transmit request (single CAN Driver) . . . . . . . . . . . . . . . . . . . 131
9.2 Transmit request (multiple CAN Drivers) . . . . . . . . . . . . . . . . . 132
9.3 Transmit confirmation (interrupt mode) . . . . . . . . . . . . . . . . . . 134
9.4 Transmit confirmation (polling mode) . . . . . . . . . . . . . . . . . . . 135
9.5 Transmit confirmation (with buffering) . . . . . . . . . . . . . . . . . . . 136
9.6 Trigger Transmit Request . . . . . . . . . . . . . . . . . . . . . . . . . . 137
9.7 Receive indication (interrupt mode) . . . . . . . . . . . . . . . . . . . . 139
9.8 Receive indication (polling mode) . . . . . . . . . . . . . . . . . . . . . 141
9.9 Read received data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
9.10 Start CAN network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
9.11 BusOff notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
9.12 BusOff recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
10 Configuration specification 150
10.1 Containers and configuration parameters . . . . . . . . . . . . . . . . . 150
10.1.1 CanIf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
10.1.2 CanIfPrivateCfg . . . . . . . . . . . . . . . . . . . . . . . . . 152
10.1.3 CanIfPublicCfg . . . . . . . . . . . . . . . . . . . . . . . . . . 155
10.1.4 CanIfInitCfg . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
10.1.5 CanIfTxPduCfg . . . . . . . . . . . . . . . . . . . . . . . . . . 169
10.1.6 CanIfRxPduCfg . . . . . . . . . . . . . . . . . . . . . . . . . 178
10.1.7 CanIfRxPduCanIdRange . . . . . . . . . . . . . . . . . . . . 186
10.1.8 CanIfDispatchCfg . . . . . . . . . . . . . . . . . . . . . . . . 186
10.1.9 CanIfCtrlCfg . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
10.1.10 CanIfCtrlDrvCfg . . . . . . . . . . . . . . . . . . . . . . . . . 198
10.1.11 CanIfTrcvDrvCfg . . . . . . . . . . . . . . . . . . . . . . . . . 200
10.1.12 CanIfTrcvCfg . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
10.1.13 CanIfInitHohCfg . . . . . . . . . . . . . . . . . . . . . . . . . 203
10.1.14 CanIfHthCfg . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
10.1.15 CanIfHrhCfg . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
10.1.16 CanIfHrhRangeCfg . . . . . . . . . . . . . . . . . . . . . . . 208
10.1.17 CanIfBufferCfg . . . . . . . . . . . . . . . . . . . . . . . . . . 211
10.1.18 CanIfSecurityEventRefs . . . . . . . . . . . . . . . . . . . . . 213
A Not applicable requirements 217

9 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

1 Introduction and functional overview


This specification describes the functionality, API and the configuration for the
AUTOSAR Basic Software module CAN Interface.
As depicted in Figure 1.1 the CAN Interface module is located between the low level
CAN device drivers (CAN Driver [1] and Transceiver Driver [2]) and the upper commu-
nication service layers (i.e. CAN State Manager [3], CAN Network Management [4],
CAN Transport Protocol [5], PDU Router [6]). It represents the interface to the services
of the CAN Driver for the upper communication layers.
The CAN Interface module provides a unique interface to manage different CAN hard-
ware device types like CAN Controllers and CAN Transceivers used by the defined
ECU hardware layout. Thus multiple underlying internal and external CAN Controller-
s/CAN Transceivers can be controlled by the CAN State Managers module based on a
physical CAN channel related view.

10 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Figure 1.1: AUTOSAR CAN Layer Model (see [7])

The CAN Interface module consists of all CAN hardware independent tasks, which
belongs to the CAN communication device drivers of the corresponding ECU. Those
functionality is implemented once in the CAN Interface module, so that underlying CAN
device drivers only focus on access and control of the corresponding specific CAN
hardware device.
CanIf fulfils main control flow and data flow requirements of the PDU Router and
upper layer communication modules of the AUTOSAR COM stack: transmit request
processing, transmit confirmation / receive indication / error notification and start /
stop of a CAN Controller and thus waking up / participating on a network. Its data
processing and notification API is based on CAN L-SDUs, whereas APIs for control
and mode handling provides a CAN Controller related view.
In case of Transmit Requests CanIf completes the L-PDU transmission with cor-
responding parameters and relays the CAN L-PDU via the appropriate CanDrv to the

11 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CAN Controller. At reception CanIf distributes the Received L-PDUs as L-


-SDUs to the upper layer. The assignment between Receive L-SDU and upper layer is
statically configured. At transmit confirmation CanIf is responsible for the notification
of upper layers about successful transmission.
The CAN Interface module provides CAN communication abstracted access to the
CAN Driver and CAN Transceiver Driver services for control and supervision of the
CAN network. The CAN Interface forwards downwards the status change requests
from the CAN State Manager to the lower layer CAN device drivers, and upwards
the CAN Driver / CAN Transceiver Driver events are forwarded by the CAN Interface
module to e.g. the corresponding NM module.

12 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

2 Acronyms and Abbreviations


The glossary below includes acronyms and abbreviations relevant to the CAN Interface
module that are not included in the [8, AUTOSAR glossary].
Abbreviation / Acronym: Description:
CAN Protocol Data Unit. Consists of an identifier, Data Length
CAN L-PDU
and data (SDU) Visible to the CAN driver.
CAN Service Data Unit. Data that are transported inside the CAN
CAN L-SDU L-PDU. Visible to the upper layers of the CAN interface (e.g. PDU
Router).
CanDrv CAN Driver module
CAN FD CAN with Flexible Data-Rate
CanId CAN Identifier
CanIf CAN Interface module
CanNm CAN Network Management module
CanSm CAN State Manager module
CanTp CAN Transport Layer module
CanTrcv CAN Transceiver Driver module
CanTSyn Global Time Synchronization over CAN
ComM Communication Manager module
DCM Diagnostic Communication Manager module
EcuM ECU State Manager module
HOH CAN hardware object handle
HRH CAN hardware receive handle
HTH CAN hardware transmit handle
J1939Nm J1939 Network Management module
J1939Tp J1939 Transport Layer module
PduR PDU Router module
PN Partial Networking
SchM Scheduler Module

Abbreviation / Acronym: Description:


Fixed sized memory area for a single data unit (e.g. CAN ID, Data
Buffer Length, SDU, etc.) is stored at a dedicated memory address in
RAM.
Describes the complete CAN network:
• Participating nodes
CAN communication matrix
• Definition of all CAN PDUs (Identifier, Data Length)
• Source and Sinks for PDUs
A CAN Controller is a CPU on-chip or external standalone hard-
CAN Controller ware device. One CAN Controller is connected to one physical
channel.
CAN Device Driver Generic term of CAN Driver and CAN Transceiver Driver.
A CAN Hardware Unit may consist of one or multiple CAN Con-
trollers of the same type and one, two or multiple CAN RAM
CAN Hardware Unit areas. The CAN Hardware Unit is located on-chip or as exter-
nal device. The CAN hardware unit is represented by one CAN
Driver.

13 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

This is not really a state machine, which may be influenced by


transmission requests. This is an image of the current abstracted
CanIf Controller mode state ma-
state of an appropriate CAN Controller. The state transitions can
chine
only be realized by upper layer modules like the CanSm or by
external events like e.g. if a BusOff occurred.
CanIf Receive L-PDU / CanIf Rx
L-PDU of which the direction is set to "lower to upper layer".
L-PDU
CanIf Receive L-PDU buffer / Single element RAM buffer located in the CAN Interface module
CanIfRxBuffer to store whole receive L-PDUs.
CanIf Transmit L-PDU / CanIf Tx
L-PDU of which the direction is set to "upper to lower layer".
L-PDU
Single CanIfTxBuffer element located in the CanIf to store one
CanIf Transmit L-PDU buffer / or multiple CanIf Tx L-PDUs. If the buffersize of a single CanI-
CanIfTxBuffer fTxBuffer element is set to 0, a CanIfTxBuffer element is only
used to refer a HTH.
A CAN hardware object is defined as a PDU buffer inside the
Hardware object / HW object
CAN RAM of the CAN Hardware Unit / CAN Controller.
The Hardware Receive Handle (HRH) is defined and provided by
Hardware Receive Handle the CAN Driver. Each HRH typically represents just one hard-
(HRH) ware object. The HRH is used as a parameter by the CAN Inter-
face Layer for i.e. software filtering.
The Hardware Transmit Handle (HTH) is defined and provided by
Hardware Transmit Handle the CAN Driver. Each HTH typically represents just one or multi-
(HTH) ple CAN hardware objects that are configured as CAN hardware
transmit buffer pool.
Transmission of a high-priority L-PDU is prevented by the pres-
Inner priority inversion ence of a pending low-priority L-PDU in the same transmit hard-
ware object.
Code that the Integrator needs to add to an AUTOSAR System,
to adapt non-standardized functionalities. Examples are Call-
Integration Code outs of the ECU State Manager and Callbacks of various other
BSW modules. The I/O Hardware Abstraction is called Integra-
tion Code, too.
This is a data storage procedure, whereas always the elements
Lowest In - First Out / LOFO
with the lowest values will be extracted.
Group of CAN L-PDUs, which belong to just one underlying net-
L-PDU channel group
work. Usually they are handled by one upper layer module.
A time gap occurs between two consecutive transmit L-PDUs. In
this case a lower priority L-PDU from another node can prevent
Outer priority inversion sending the own higher priority L-PDU. Here the higher priority L-
PDU cannot participate in arbitration during network access be-
cause the lower priority L-PDU already won the arbitration.
A physical channel represents an interface from a CAN Controller
Physical channel to the CAN Network. Different physical channels of the CAN
Hardware Unit may access different networks.
Transmit request to the CAN Interface module from a upper layer
Tx request
module of the CanIf

14 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

3 Related documentation

3.1 Input documents & related standards and norms

References
[1] Specification of CAN Driver
AUTOSAR_SWS_CANDriver
[2] Specification of CAN Transceiver Driver
AUTOSAR_SWS_CANTransceiverDriver
[3] Specification of CAN State Manager
AUTOSAR_SWS_CANStateManager
[4] Specification of CAN Network Management
AUTOSAR_SWS_CANNetworkManagement
[5] Specification of CAN Transport Layer
AUTOSAR_SWS_CANTransportLayer
[6] Specification of PDU Router
AUTOSAR_SWS_PDURouter
[7] Layered Software Architecture
AUTOSAR_EXP_LayeredSoftwareArchitecture
[8] Glossary
AUTOSAR_TR_Glossary
[9] General Specification of Basic Software Modules
AUTOSAR_SWS_BSWGeneral
[10] General Requirements on Basic Software Modules
AUTOSAR_SRS_BSWGeneral
[11] Requirements on CAN
AUTOSAR_SRS_CAN
[12] ISO 11898-1:2015 – Road vehicles – Controller area network (CAN)
[13] Specification of ECU State Manager
AUTOSAR_SWS_ECUStateManager
[14] Specification of ECU Configuration
AUTOSAR_TPS_ECUConfiguration

15 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

3.2 Related specification


AUTOSAR provides a General Specification on Basic Software modules [9, SWS BSW
General], which is also valid for CAN Interface.
Thus, the specification SWS BSW General shall be considered as additional and re-
quired specification for CAN Interface.

16 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4 Constraints and assumptions

4.1 Limitations
The CAN Interface can be used for CAN communication only and is specifically de-
signed to operate with one or multiple underlying CAN Drivers and CAN Transceiver
Drivers. Several CAN Driver modules covering different CAN Hardware Units are rep-
resented by just one generic interface as specified in the CAN Driver specification [1].
As well in the same manner several CAN Transceiver Driver modules covering different
CAN Transceiver devices are represented by just one generic interface as specified in
the CAN Transceiver Driver specification [2, Specification of CAN Transceiver Driver].
Other protocols than CAN (i.e. LIN or FlexRay) are not supported.
Please be aware that an active PnTxFilter ensures that the first messages on bus
is CanIfTxPduPnFilterPdu. In case that CanIfTxPduPnFilterPdu is the NM-PDU the
COM-Stack start up takes care that the PduGroups are disabled until successful trans-
mission of that PDU. However, transmit requests for other PDUs (i.e. initially started
PDUs, TP-PDUs, XCP-PDUs) will be rejected until the configured PDU was sent. Only
the very first PDU which initiates the Wake-up of the Network has to be the CanIfTx-
PduPnFilterPdu. In case communication is ongoing and there is an successful recep-
tion of frame with PnTxFilter enabled, PnTxFilter shall be disabled. The PnTxFilter is
in this case not needed since an Ack will be provided by an already active Node.

4.2 Applicability to car domains


The CAN Interface can be used for all domain applications when the CAN protocol is
used.

17 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

5 Dependencies to other modules


This section describes the relations to other modules within the AUTOSAR basic soft-
ware architecture. It contains brief descriptions of configuration information and ser-
vices, which are required by the CAN Interface Layer from other modules (see Figure
5.1).

Figure 5.1: CANIF dependencies in AUTOSAR BSW

18 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

5.1 Upper Protocol Layers


Inside the AUTOSAR BSW architecture the upper layers of the CAN Interface mod-
ule (Abbr.: CanIf) are represented by the PDU Router module (Abbr.: PduR), CAN
Network Management module (Abbr.: CanNm), CAN Transport Layer module (Abbr.:
CanTp), CAN State Manager module (Abbr.: CanSm), ECU State Manager module
(Abbr.: EcuM), Complex Driver modules (Abbr.: CDD), Universal Calibration Protocol
module (Abbr.: XCP), Global Time Synchronization over CAN (Abbr.: CanTSyn), J1939
Transport Layer module (Abbr.: J1939Tp) and J1939 Network Management module
(Abbr.: J1939Nm).
The AUTOSAR BSW architecture indicates that the application data buffers are lo-
cated in the upper layer, to which they belong. Direct access to these buffers is pro-
hibited. The buffer location is passed by the CanIf from or to the CAN Driver module
(Abbr.: CanDrv) during transmission and reception. During execution of these trans-
mission/reception indication services buffer location is passed. Data integrity is guar-
anteed by use of lock mechanisms each time the buffer has been accessed. See
section 7.17 “Data integrity”.
The API used by the CanIf consists of notification services as basic agents for the
transfer of CAN related data (i.e. Data Length) to the target upper layer. The call
parameters of these services points to the information buffered in the CanDrv or they
refer directly to the CAN Hardware.
In addition, the CanIf supports a callout to the Bus Mirroring module, to report the
content of received and transmitted frames.

5.2 Initialization: Ecu State Manager


The EcuM initializes the CanIf (refer to [3, Specification of ECU State Manager]).

5.3 Mode Control: CAN State Manager


The CanSm module is responsible for mode control management of all supported CAN
Controllers and CAN Transceivers.

5.4 Lower layers: CAN Driver


The main lower layer CAN device driver is represented by the CanDrv (see [1, Specifi-
cation of CAN Driver]). The CanIf has a close relation to the CanDrv as a result of its
position in the AUTOSAR Basic Software Architecture.
The CanDrv provides a hardware abstracted access to the CAN Controller only, but
control of operation modes is done in CanSm only.

19 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

The CanDrv detects and processes events of the CAN Controllers and notifies those
to the CanIf.
The CanIf passes operation mode requests of the CanSm to the corresponding under-
lying CAN Controllers.
CanDrv provides a normalized L-PDU to ensure hardware independence of CanIf.
The pointer to this normalized L-PDU points either to a temporary buffer (for e.g. data
normalizing) or to the CAN hardware dependent CanDrv. For CanIf the kind of L-PDU
buffer is invisible.
The CanIf provides notification services used by the CanDrv in all notifications sce-
narios, for example: transmit confirmation (subsection 8.4.2 “CanIf_TxConfirmation”,
see [SWS_CANIF_00007]), receive indication (subsection 8.4.3 “CanIf_RxIndication”,
see [SWS_CANIF_00006]) and notification of a controller mode change (subsection
8.4.8, see [SWS_CANIF_00699]).
In case of using multiple CanDrv serving different interrupt vectors these callback ser-
vices mentioned above must be re-entrant, refer to section 7.24 “Multiple CAN Driver
support”. Reentrancy of callback functions is specified in section 8.4.
The callback services called by the CanDrv are declared and implemented inside the
CanIf. The callback services called by the CanIf are declared and placed inside the
appropriate upper communication service layer, for example PduR, CanNm, CanTp.
The CanIf structure is specified in section 5.7 “File structure”.
The number of configured CAN Controllers does not necessarily belong to the number
of used CAN Transceivers. In case multiple CAN Controllers of a different types operate
on the same CAN network, one CAN Transceiver and CanTrcv is sufficient, whereas
dependent to the type of the CAN Controller devices one or two different CanDrv are
needed (see section 7.5 “Physical channel view”).

5.5 Lower layers: CAN Transceiver Driver


The second available lower layer CAN device driver is represented by the CanTrcv
(see [2, Specification of CAN Transceiver Driver]).
Each CanTrcv itself does operation mode control of the CAN Transceiver device. The
CanIf just maps all APIs of several underlying CanTrcvs to a unique one, thus CanSm
is able to trigger a transition of the corresponding CAN Transceiver modes. No control
or handling functionality belonging to CanTrcv is done inside the CanIf.
The CanIf maps the following services of all underlying CanTrcvs to one unique inter-
face. These are further described in the CAN Transceiver Driver SWS (see [2, Specifi-
cation of CAN Transceiver Driver]):
• Unique CanTrcv mode request and read services to manage the operation modes
of each underlying CAN Transceiver device.

20 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

• Read service for CAN Transceiver wake up reason support.


• Mode request service to enable/disable/clear wake up event state of each used
CAN transceiver (CanIf_SetTrcvMode(), see [SWS_CANIF_00287]).

5.6 Configuration
The CanIf design is optimized to manage CAN protocol specific capabilities and han-
dling of the used underlying CAN Controller.
The CanIf is capable to change the CAN configuration without a re-build. Therefore, the
function CanIf_Init() (see [SWS_CANIF_00001]) retrieves the required CAN con-
figuration information from configuration containers and parameters, which are speci-
fied (linked as references, or additional parameters) in chapter 10, see Figure 10.1.
This section gives a summary of the retrieved information, e.g.:
• Number of CAN Controllers. The number of CAN Controllers is necessary for
dispatching of transmit and receive L-PDUs and for the control of the status of
the available CAN Drivers (see CanIfCtrlDrvCfg).
• Number of Hardware Object Handles. To supervise transmit requests the CAN
Interface needs to know the number of HTHs and the assignments between each
HTH and the corresponding CAN Controller (see CanIfHthCanCtrlIdRef;
CanIfHthIdSymRef).
• Range of received CAN IDs passing hardware acceptance filter for each hard-
ware object. The CAN Interface uses fixed assignments between HRHs and
L-PDUs to be received in the corresponding hardware object to conduct a search
algorithm (see section 7.20 “Software receive filter”, see CanIfHrhSoftware-
Filter, CanIfHrhCanCtrlIdRef, CanIfHrhIdSymRef)
CanIf needs information about all used upper communication service layers and L-
-SDUs to be dispatched. The following information has to be set up at configuration
time for integration of CanIf inside the AUTOSAR COM stack:
• Transmitting upper layer module and transmit I-PDU for each transmit L-SDU.
=> Used for dispatching of transmit confirmation services
(see CanIfTxPduId).
• Receiving upper layer module and receive I-PDU for each receive L-SDU.
=> Used for L-SDU dispatching during receive indication
(see CanIfRxPduId).
The CanIf needs the description of the controller and the own ECU, which is connected
to one or multiple CAN networks. The following information is therefore retrieved from
the CAN communication matrix, part of the AUTOSAR system configuration (see
CanIfTxPduCfg, CanIfRxPduCfg):

21 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

• All L-PDUs received on each physical channel of this ECU.


=> Used for software filtering and receive L-SDU dispatch
• All L-SDUs that shall be transmitted by each physical channel on this ECU.
=> Used for the transmit request and Transmit L-PDU dispatch
• Properties of these L-PDUs (ID, Data Length).
=> Used for software filtering, receive indication services, Data Length Check
• Transmitter for each transmitted L-SDU (i.e. PduR, CanNm, CanTp).
=> Used for the transmit confirmation services
• Receiver for each receive L-SDU (i.e. PduR, CanNm, CanTp)
=> Used for the L-PDU dispatch
• Symbolic L-PDU/L-SDU name.
=> Used for the representation of Rx/Tx data buffer addresses

5.7 File structure

5.7.1 Code file structure

[SWS_CANIF_00378] dCanIf shall access the location of the API of all used underly-
ing CanDrvs for link time configuration by a set of function pointers for each CanDrv.c
()
The values for the function pointers for each CanDrv are given at link time.

5.7.2 Header file structure

[SWS_CANIF_00672] dThe header file CanIf.h only contains extern declarations of


constants, global data and services that are specified in CanIf.c()
Constants, global data types and functions that are only used by CanIf internally, are
declared within CanIf.c.
[SWS_CANIF_00903] dCanIf shall include the header file Mirror.h if Bus Mirroring
is enabled (see CanIfBusMirroringSupport).c(SRS_Can_01172)

22 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

6 Requirements Tracing
The following tables references the requirements specified in [10] as well as [11] and
links to the fulfillment of these. Please note that if column ’Satisfied by’ is empty for a
specific requirement this means that this requirement is not fulfilled by this document.
Requirement Description Satisfied by
[RS_Ids_00810] Basic SW security events [SWS_CANIF_00913]
[SWS_CANIF_00915]
[SWS_CANIF_00916]
[SWS_CANIF_00917]
[SWS_CANIF_00918]
[SWS_CANIF_00919]
[SWS_CANIF_00920]
[SWS_CANIF_00921]
[SWS_CANIF_91008]
[SWS_CANIF_91009]
[SWS_CANIF_91010]
[SRS_BSW_00007] All Basic SW Modules written in C language [SWS_CANIF_00999]
shall conform to the MISRA C 2012 Standard.
[SRS_BSW_00010] The memory consumption of all Basic SW [SWS_CANIF_00999]
Modules shall be documented for a defined
configuration for all supported platforms.
[SRS_BSW_00101] The Basic Software Module shall be able to [SWS_CANIF_00001]
initialize variables and hardware in a separate
initialization function
[SRS_BSW_00159] All modules of the AUTOSAR Basic Software [SWS_CANIF_00999]
shall support a tool based configuration
[SRS_BSW_00164] The Implementation of interrupt service routines [SWS_CANIF_00999]
shall be done by the Operating System, complex
drivers or modules
[SRS_BSW_00167] All AUTOSAR Basic Software Modules shall [SWS_CANIF_00999]
provide configuration rules and constraints to
enable plausibility checks
[SRS_BSW_00168] SW components shall be tested by a function [SWS_CANIF_00999]
defined in a common API in the Basis-SW
[SRS_BSW_00170] The AUTOSAR SW Components shall provide [SWS_CANIF_00999]
information about their dependency from faults,
signal qualities, driver demands
[SRS_BSW_00172] The scheduling strategy that is built inside the [SWS_CANIF_00999]
Basic Software Modules shall be compatible
with the strategy used in the system
[SRS_BSW_00306] AUTOSAR Basic Software Modules shall be [SWS_CANIF_00999]
compiler and platform independent
[SRS_BSW_00307] Global variables naming convention [SWS_CANIF_00999]
[SRS_BSW_00308] AUTOSAR Basic Software Modules shall not [SWS_CANIF_00999]
define global data in their header files, but in the
C file
[SRS_BSW_00309] All AUTOSAR Basic Software Modules shall [SWS_CANIF_00999]
indicate all global data with read-only purposes
by explicitly assigning the const keyword
[SRS_BSW_00312] Shared code shall be reentrant [SWS_CANIF_00064]

23 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SRS_BSW_00323] All AUTOSAR Basic Software Modules shall [SWS_CANIF_00311]


check passed API parameters for validity [SWS_CANIF_00313]
[SWS_CANIF_00319]
[SWS_CANIF_00320]
[SWS_CANIF_00325]
[SWS_CANIF_00326]
[SWS_CANIF_00331]
[SWS_CANIF_00336]
[SWS_CANIF_00341]
[SWS_CANIF_00346]
[SWS_CANIF_00352]
[SWS_CANIF_00353]
[SWS_CANIF_00364]
[SWS_CANIF_00398]
[SWS_CANIF_00404]
[SWS_CANIF_00410]
[SWS_CANIF_00416]
[SWS_CANIF_00417]
[SWS_CANIF_00419]
[SWS_CANIF_00429]
[SWS_CANIF_00535]
[SWS_CANIF_00536]
[SWS_CANIF_00537]
[SWS_CANIF_00538]
[SWS_CANIF_00648]
[SWS_CANIF_00649]
[SWS_CANIF_00650]
[SWS_CANIF_00656]
[SWS_CANIF_00657]
[SWS_CANIF_00774]
[SWS_CANIF_00860]
[SWS_CANIF_00869]
[SWS_CANIF_00898]
[SWS_CANIF_00899]
[SWS_CANIF_00907]
[SWS_CANIF_00908]
[SWS_CANIF_00909]
[SWS_CANIF_00910]
[SWS_CANIF_00912]
[SRS_BSW_00325] The runtime of interrupt service routines and [SWS_CANIF_00135]
functions that are running in interrupt context
shall be kept short
[SRS_BSW_00328] All AUTOSAR Basic Software Modules shall [SWS_CANIF_00999]
avoid the duplication of code
[SRS_BSW_00330] It shall be allowed to use macros instead of [SWS_CANIF_00999]
functions where source code is used and
runtime is critical
[SRS_BSW_00334] All Basic Software Modules shall provide an [SWS_CANIF_00999]
XML file that contains the meta data
[SRS_BSW_00336] Basic SW module shall be able to shutdown [SWS_CANIF_00999]
[SWS_CANIF_91002]
[SRS_BSW_00341] Module documentation shall contains all needed [SWS_CANIF_00999]
informations

24 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SRS_BSW_00348] All AUTOSAR standard types and constants [SWS_CANIF_00142]


shall be placed and organized in a standard
type header file
[SRS_BSW_00353] All integer type definitions of target and compiler [SWS_CANIF_00142]
specific scope shall be placed and organized in
a single type header
[SRS_BSW_00358] The return type of init() functions implemented [SWS_CANIF_00001]
by AUTOSAR Basic Software Modules shall be
void
[SRS_BSW_00361] All mappings of not standardized keywords of [SWS_CANIF_00142]
compiler specific scope shall be placed and
organized in a compiler specific type and
keyword header
[SRS_BSW_00373] The main processing function of each [SWS_CANIF_00999]
AUTOSAR Basic Software Module shall be
named according the defined convention
[SRS_BSW_00378] AUTOSAR shall provide a boolean type [SWS_CANIF_00999]
[SRS_BSW_00405] BSW Modules shall support multiple [SWS_CANIF_00001]
configuration sets
[SRS_BSW_00407] Each BSW module shall provide a function to [SWS_CANIF_00158]
read out the version information of a dedicated
module implementation
[SRS_BSW_00411] All AUTOSAR Basic Software Modules shall [SWS_CANIF_00158]
apply a naming rule for enabling/disabling the
existence of the API
[SRS_BSW_00414] Init functions shall have a pointer to a [SWS_CANIF_00001]
configuration structure as single parameter
[SRS_BSW_00416] The sequence of modules to be initialized shall [SWS_CANIF_00999]
be configurable
[SRS_BSW_00417] Software which is not part of the SW-C shall [SWS_CANIF_00999]
report error events only after the DEM is fully
operational.
[SRS_BSW_00423] BSW modules with AUTOSAR interfaces shall [SWS_CANIF_00999]
be describable with the means of the SW-C
Template
[SRS_BSW_00424] BSW module main processing functions shall [SWS_CANIF_00999]
not be allowed to enter a wait state
[SRS_BSW_00425] The BSW module description template shall [SWS_CANIF_00999]
provide means to model the defined trigger
conditions of schedulable objects
[SRS_BSW_00426] BSW Modules shall ensure data consistency of [SWS_CANIF_00999]
data which is shared between BSW modules
[SRS_BSW_00427] ISR functions shall be defined and documented [SWS_CANIF_00999]
in the BSW module description template
[SRS_BSW_00428] A BSW module shall state if its main processing [SWS_CANIF_00999]
function(s) has to be executed in a specific order
or sequence
[SRS_BSW_00429] Access to OS is restricted [SWS_CANIF_00999]
[SRS_BSW_00432] Modules should have separate main processing [SWS_CANIF_00999]
functions for read/receive and write/transmit
data path
[SRS_BSW_00433] Main processing functions are only allowed to [SWS_CANIF_00999]
be called from task bodies provided by the BSW
Scheduler

25 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SRS_Can_01001] The CAN Interface implementation and interface [SWS_CANIF_00023]


shall be independent from underlying CAN
Controller and CAN Transceiver
[SRS_Can_01003] The appropriate higher communication stack [SWS_CANIF_00012]
shall be notified by the CAN Interface about an
occurred reception
[SRS_Can_01005] The CAN Interface shall perform a check for [SWS_CANIF_00026]
correct DLC of received PDUs
[SRS_Can_01008] The CAN Interface shall provide a transmission [SWS_CANIF_00005]
request service
[SRS_Can_01009] The CAN Interface shall provide a transmission [SWS_CANIF_00007]
confirmation dispatcher
[SRS_Can_01011] The CAN Interface shall provide a transmit [SWS_CANIF_00068]
buffer
[SRS_Can_01014] The CAN State Manager shall offer a network [SWS_CANIF_00999]
configuration independent interface for upper
layers
[SRS_Can_01018] The CAN Interface shall allow the configuration [SWS_CANIF_00030]
of its software reception filter Pre-Compile-Time
as well as Link-Time and Post-Build-Time
[SRS_Can_01020] The TX-Buffer shall be statically configurable [SWS_CANIF_00063]
[SRS_Can_01021] CAN The CAN Interface shall implement an [SWS_CANIF_00001]
interface for initialization
[SRS_Can_01022] The CAN Interface shall support the selection of [SWS_CANIF_00001]
configuration sets
[SRS_Can_01027] The CAN Interface shall provide a service to [SWS_CANIF_00003]
change the CAN Controller mode.
[SRS_Can_01028] The CAN Interface shall provide a service to [SWS_CANIF_00229]
query the CAN controller state
[SRS_Can_01029] The CAN Interface shall report bus-off state of a [SWS_CANIF_00014]
device to an upper layer
[SRS_Can_01114] Data Consistency of L-PDUs to transmit shall be [SWS_CANIF_00033]
guaranteed
[SRS_Can_01125] The CAN stack shall ensure not to lose [SWS_CANIF_00194]
messages in receive direction
[SRS_Can_01126] The CAN stack shall be able to produce 100% [SWS_CANIF_00381]
bus load [SWS_CANIF_00382]
[SWS_CANIF_00881]
[SRS_Can_01129] The CAN Interface module shall provide a [SWS_CANIF_00194]
procedural interface to read out data of single
CAN messages by upper layers (Polling
mechanism)
[SRS_Can_01130] Receive Status Interface of CAN Interface [SWS_CANIF_00202]
[SWS_CANIF_00230]
[SRS_Can_01131] The CAN Interface module shall provide the [SWS_CANIF_00230]
possibility to have polling and callback
notification mechanism in parallel
[SRS_Can_01136] The CAN Interface module shall provide a [SWS_CANIF_00179]
service to check for validation of a CAN wake-up
event
[SRS_Can_01139] The CAN Interface and Driver shall offer a CAN [SWS_CANIF_00999]
Controller specific interface for initialization
[SRS_Can_01140] The CAN Interface shall support both Standard [SWS_CANIF_00281]
(11bit) and Extended (29bit) Identifiers [SWS_CANIF_00877]

26 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SRS_Can_01141] The CAN Interface shall support both Standard [SWS_CANIF_00243]


(11bit) and Extended (29bit) Identifiers at same [SWS_CANIF_00877]
time on one network
[SRS_Can_01151] The CAN Interface shall provide a service to [SWS_CANIF_00286]
check for a CAN Wake-up event.
[SRS_Can_01162] The CAN Interface shall support classic CAN [SWS_CANIF_00877]
and CAN FD frames
[SRS_Can_01168] The CAN Interface shall implement an interface [SWS_CANIF_91002]
for de-initialization
[SRS_Can_01169] The CAN interface shall provide a function to [SWS_CANIF_91001]
return the current CAN controller error state
[SRS_Can_01172] The CAN Interface shall provide a function to [SWS_CANIF_00903]
provide received and transmitted frames to the [SWS_CANIF_00904]
Bus Mirroring [SWS_CANIF_00905]
[SWS_CANIF_00906]
[SWS_CANIF_00911]
[SRS_Can_01181] The CAN Driver shall support hardware-based [SWS_CANIF_91011]
timestamping [SWS_CANIF_91012]
[SWS_CANIF_91013]
[SWS_CANIF_91014]

27 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7 Functional specification

7.1 General Functionality


The services of CanIf can be divided into the following main groups:
• Initialization
• Transmit request services
• Transmit confirmation services
• Reception indication services
• Controller mode control services
• PDU mode control services
Possible applications of CanIf:
i. Interrupt Mode
CanDrv processes interrupts triggered by the CAN Controller. CanIf, which
is event based, is notified when an event occurs. In this case the relevant CanIf
services are called within the corresponding ISRs in CanDrv.
ii. Polling Mode
CanDrv is triggered by the SchM and performs subsequent processes (Polling
Mode). In this case Can_MainFunction_<Write/Read/BusOff/Wakeup/
Transceiver>() must be called periodically within a defined time interval.
CanIf is notified by CanDrv about events (Reception, Transmission, BusOff,
Timeout), that occurred in one of the CAN Controllers, equally to the interrupt
driven operation. CanDrv is responsible for the update of the corresponding infor-
mation which belongs to the occurred event in the CAN Controller, for example
reception of a L-PDU.
iii. Mixed Mode: interrupt and polling driven CanDrv
The functionality can be divided between interrupt driven and polling driven opera-
tion mode depending on the used CAN Controllers.
Examples: Polling driven FullCAN reception and interrupt driven BasicCAN recep-
tion, polling driven transmit and interrupt driven reception, etc.
This specification describes a unique interface, which is valid for all three types of
operation modes. Summarized, CanIf works in the same way, either if any events are
processed on interrupt, task level or mixed. The only difference is the call context and
probably the way of interruption of the notifications: pre-emptive or co-operative. All
services are performed in accordance with the configuration.
The following paragraphs describe the functionality of CanIf.

28 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.2 Hardware object handles


Hardware Object Handles (HOH) for transmission (HTH) as well as for reception (
HRH) represent an abstract reference to a CAN mailbox structure, that contains CAN
related parameters such as CanId, DLC and data. Based on the CAN hardware buffer
abstraction each Hardware Object is referenced in CanIf independent of the CAN
hardware buffer layout. The HOH is used as a parameter in the calls of CanDrv’s
interface services and is provided by CanDrv’s configuration and used by CanDrv as
identifier for communication buffers of the CAN mailbox.
CanIf acts only as user of the Hardware Object Handle, but does not interpret it
on the basis of hardware specific information. CanIf therefore remains independent
of hardware.
[SWS_CANIF_00023] dCanIf shall avoid direct access to hardware specific commu-
nication buffers and shall access it exclusively via CanDrv interface services.c(SRS_-
Can_01001)
Rationale for [SWS_CANIF_00023]: CanIf remains independent of hardware, be-
cause CanDrv interfaces are called with HOH parameters, which abstract from the
concrete CAN hardware buffer properties.
Each CAN Controller can provide multiple CAN Transmit Hardware Objects
in the CAN mailbox. These can be logically linked to one entire pool of Hardware
Objects (multiplexed Hardware Objects) and thus addressed by one HTH.
[SWS_CANIF_00662] dCanIf shall use two types of HOHs to enable access to Can-
Drv:
• Hardware Transmit Handle (HTH) and
• Hardware Receive Handle (HRH).
c()
[SWS_CANIF_00291] dDefinition of HRH: The HRH shall be a handle referencing a
logical Hardware Receive Object of the CAN Controller mailbox.c()
[SWS_CANIF_00665] dThe HRH shall enable CanIf to use BasicCAN or a FullCAN
reception method of the referenced reception unit and to indicate a Received L-SDU to
a target upper layer module.c()
[SWS_CANIF_00663] dIf the HRH references a reception unit configured for BasicCAN
reception, software filtering shall be enabled in CanIf.c()
[SWS_CANIF_00664] dIf multiple HRHs are used, each HRH shall belong at least to a
single or fixed group of Rx L-SDU (CanRxPduIds).c()

29 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

The HRH can be configured to receive


• one single CanId (FullCAN)
• a group of single CanIds (BasicCAN)
• a range/area of CanIds (BasicCAN) or
• all CanIds.

Figure 7.1: Mapping between PDU Ids and HW object handles

30 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00292] dDefinition of HTH: The HTH shall be a handle referencing a


logical Hardware Transmit Object of the CAN Controller mailbox.c()
[SWS_CANIF_00666] dThe HTH shall enable CanIf to use BasicCAN or FullCAN
transmission method of the referenced transmission unit and to confirm a transmitted
L-SDU to a target upper layer module.c()
[SWS_CANIF_00466] dEach CanIf Tx L-PDU shall statically be assigned to one
CanIfBufferCfg configuration container at configuration time (see CanIfTxP-
duBufferRef).c()
Rationale for [SWS_CANIF_00466]: CanIf Tx L-PDUs do not refer HTHs, but Can-
IfBufferCfg, which in turn do refer HTHs.
[SWS_CANIF_00667] dIf multiple HTHs are used, each HTH shall belong to a single or
fixed group of Tx L-PDU (CanTxPduIds).c()
[SWS_CANIF_00115] dCanIf shall be able to use all HRHs and HTHs of one CanDrv
as common, single numbering area starting with zero.c()
The dedicated HRHs and HTHs are derived from the configuration set of CanDrv. The
definition of HTH/HRH inside the numbering area and Hardware Objects is up to
CanDrv.

7.3 Static L-PDUs


CanIf offers general access to the CAN L-SDU related data for upper layers. At-
tributes of the following table are represented as configuration parameters and are
specified in chapter 10:
CAN Interface specific attributes CAN Protocol Control Information (PCI)
Method of SW filtering CAN Identifier (CanId)
CanIfPrivateSoftwareFilterType CanIfTxPduCanId, range of CanIds per PDU
(see CanIfRxPduCanIdRange),
CanIfRxPduCanId, CanIfRxPduCanIdMask
Direction of L-PDU (Tx, Rx) CanIfTxPduId, Type of CAN Identifier (StandardCAN,
CanIfRxPduId) ExtendedCAN) referenced from CanDrv via
CanIfHthIdSymRef, CanIfHrhIdSymRef
HTH/HRH of the CAN Controller Data Length and Data Length Code (DLC)
CanIfRxPduDataLength
Target ID for the corresponding upper layer Reference to the PDU data (see [1,
CanIfTxPduUserTxConfirmationUL, Specification of CAN Driver])
CanIfRxPduUserRxIndicationUL
Type of Transmit L-PDU (STATIC, DYNAMIC)
CanIfTxPduType
Type of Tx/Rx L-PDU (FullCAN, BasicCAN)
CanIfHthIdSymRef, CanIfHrhIdSymRef

31 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CanIf supports activation and deactivation of all L-PDUs belonging to one CAN Con-
troller for transmission as well as for reception (see 7.19.2, see CanIf_SetPdu-
Mode(), [SWS_CANIF_00008]). For L-PDU mode control refer to section 7.19.
Each L-PDU is associated with an upper layer module in order to ensure correct dis-
patching during reception, transmission confirmation, and data access. Each upper
layer module can use the L-PDUs to serve different CAN Controllers simultane-
ously.
According to the PDU architecture defined for the entire AUTOSAR communication
stack (see [7, Layered Software Architecture]), the usage of L-PDUs is split in two
different ways:
• For transmission request and transmission/reception polling API the upper layer
module uses the L-SDU ID (CanTxPduId/CanRxPduId) defined by CanIf as
parameter.
• For all callback APIs, which are invoked by CanIf at upper layer modules, CanIf
passes the target PduId defined by each upper layer module as parameter.
The principle is that the caller must use the defined target L-PDU/L-SDU Id of the
callee.
If power on initialization is not performed and upper layer performs transmit requests
to CanIf, no L-SDUs are transmitted to lower layer and DET shall be invoked. Thus,
no un-initialized data can be transmitted on the network. Behavior of L-PDU/L-SDU
transmitting function is specified in detail in subsection 8.3.6.

7.4 Dynamic L-PDUs


CanIf shall support the ability to filter incoming messages using the CanIfRxPdu-
CanIdMask. The filtering shall be done by comparing the incoming CanId with the
stored CanIfRxPduCanId after applying the CanIfRxPduCanIdMask to both IDs.
This should be done after the filtering of regular CanIds without mask, to allow for
separate handling of some of the CanIds that fall into the range defined by the mask
or a CanId based range.
Additionally, DYNAMIC Tx and Rx L-SDUs shall be supported, where the CanId resides
in the MetaData of the L-SDU.
During transmission of dynamic L-SDUs, when a CanIfTxPduCanIdMask is defined,
the variable parts of the CanId provided via the MetaData must be merged with the
CanId by using this mask. When no CanIfTxPduCanIdMask and no CanIfTxPdu-
CanId are configured, the MetaData shall be used directly as CanId.
During reception of dynamic L-SDUs, the received CanId shall be placed in the L-SDU
MetaData. The content of the MetaData is independent of the CanIfRxPduCanId-
Mask parameter.

32 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00844] dCanIf shall support dynamic L-PDUs, where the CanId or


relevant parts of the CanId are placed in the MetaData of a L-SDU.c()

7.4.1 Dynamic Transmit L-PDUs

Definition of dynamic Transmit L-PDUs: L-PDUs which allow reconfiguration of the


CanId during runtime (CanIfTxPduType) or where the ID or parts thereof are pro-
vided as MetaData of the L-SDU.
The usage of all other L-PDU elements are equal to normal static Transmit L-PDUs:
• The transmit confirmation notification CanIfTxPduUserTxConfirmationUL
cannot be reconfigured as it belongs to the L-PDU.
• The Data Length and the pointer to the data buffer are both determined by the
upper layer module at call of CanIf_Transmit().
The function CanIf_SetDynamicTxId() (see [SWS_CANIF_00189]) reconfigures
the CanId of a dynamic L-PDU with CanIfTxPduType.
[SWS_CANIF_00188] dCanIf shall process the two most significant bits of the CanId
(see [1, Specification of CAN Driver], definition of Can_IdType [SWS_Can_00416]) to
determine which type of CanId is used and thus how the dynamic Transmit L-PDU
shall be transmitted.c()
[SWS_CANIF_00673] dThe CanIf shall guarantee data consistency of the CanId
in case of running function CanIf_SetDynamicTxId(). This service may be in-
terrupted by a pre-emptive call of CanIf_Transmit() affecting the same L-PDU,
see [SWS_CANIF_00064].c()
[SWS_CANIF_00855] dIf CanIfTxPduCanIdMask and CanIfTxPduCanId are omit-
ted, the CanId is directly taken from the MetaData.c()
[SWS_CANIF_00856] dCanIfTxPduCanIdMask shall be ignored when meta data
configuration does not contain CAN_ID_32 for this L-SDU.c()
[SWS_CANIF_00854] dIf the MetaDataItem CAN_ID_32, CanIfTxPduCanIdMask
and CanIfTxPduCanId are available, CanIfTxPduCanIdMask defines the bits in
CanIfTxPduCanId and the bits of the Can_IdType derived from CanIfTxPdu-
CanIdType that shall appear in the actual CanId, the other bits are taken from the
MetaData.c()
Note: The resulting ID could be calculated in the following way: (CanIfTxPduCanId &
CanIfTxPduCanIdMask) | (<dynamic ID parts> & ∼CanIfTxPduCanIdMask)
[SWS_CANIF_00857] dCanIf_Init() (see [SWS_CANIF_00085]) initializes the
CanIds of the dynamic Transmit L-PDUs with CanIfTxPduType to the value con-
figured via CanIfTxPduCanId.c()

33 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.4.2 Dynamic receive L-PDUs

Definition of dynamic Receive L-PDUs: L-PDUs that correspond to a set of CanIds,


where the actually received CanId is provided to upper layers as part of the PDU data.
[SWS_CANIF_00847] dConfiguration shall ensure that dynamic Receive L-PDUs
use an ID range or a mask and that the MetaDataItem CAN_ID_32 is configured
for the L-SDU. Besides, the software filtering must be enabled for these L-SDUs.c()
[SWS_CANIF_00848] dUpon reception of a dynamic L-SDU, CanIf shall place the
CanId in the MetaDataItem of type CAN_ID_32.c()

7.5 Physical channel view


A physical channel is linked with one CAN Controller and one CAN Transceiver,
whereas one or multiple physical channels may be connected to a single network.
The CanIf provides services to control all CAN devices like CAN Controllers and CAN
Transceivers of all supported ECU’s CAN channel. Those APIs are used by the CanSm
to provide a network view to the ComM (see [3]) used to perform wake up and sleep
request for all physical channels connected to a single network.
The CanIf passes status information provided by the CanDrv and CanTrcv separately
for each physical channel as status information for the CanSm (<User_Controller-
BusOff>(), refer to [SWS_CANIF_00014]).
[SWS_CANIF_00653] dThe CanIf shall provide a ControllerId, which abstracts
from the different Controllers of the different CanDrv instances. The range of the Con-
trollerIds within the CanIf shall start with ’0’. It shall be configurable via CanIfC-
trlId.c()
Example:
CanIf CanDrv A CanDrv B
ControllerId 0 Controller 0
ControllerId 1 Controller 1
ControllerId 2 Controller 0

[SWS_CANIF_00655] dThe CanIf shall provide a TransceiverId, which abstracts


from the different Transceivers of the different CanTrcv instances. The range of the
TransceiverIds within the CanIf shall start with ’0’. It shall be configurable via
CanIfTrcvId.c()
Example:
CanIf CanDrv A CanDrv B
TransceiverId 0 Transceiver 0
TransceiverId 1 Transceiver 1
TransceiverId 2 Transceiver 0

34 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

During the notification process the CanIf maps the original CAN Controller or CAN
Transceiver parameter from the Driver module to the CanSm. This mapping is done as
the referenced CAN Controller or CAN Transceiver parameters are configured with the
abstracted CanIf parameters ControllerId or TransceiverId.

Figure 7.2: Physical channel view definition example A

The CanIf supports multiple physical CAN channels. These have to be distinguished
by the CanSm for network control. The CanIf API provides request and read control
for multiple underlying physical CAN channels.
Moreover the CanIf does not distinguish between dedicated types of CAN physical
layers (i.e. Low-Speed CAN or High-Speed CAN), to which one or multiple CAN Con-
trollers are connected.

35 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Figure 7.3: Physical channel view definition example B

7.6 CAN Hardware Unit


The CAN Hardware Unit combines one or multiple CAN Controller modules of the
same type, which may be located on-chip or as external standalone devices. Each
CAN Hardware Unit is served by the corresponding CanDrv.
If different types of CAN Controllers are used, also different types of CanDrvs have
to be applied with a unified API to CanIf. CanIf collects information about number
and types of CAN Controllers and their Hardware Objects at configuration time.
This allows transparent and hardware independent access to the CAN Controllers
from upper layer modules using HOHs (refer to section 7.2 “Hardware object handles”
and section 7.24 “Multiple CAN Driver support”).
Figure 7.4 shows a CAN Hardware Unit consisting of two CAN Controllers of the same
type connected to two physical channels:

36 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Figure 7.4: Typical CAN Hardware Unit

7.7 BasicCAN and FullCAN reception


CanIf distinguishes between BasicCAN and FullCAN handling for activation of soft-
ware acceptance filtering.
A CAN mailbox (Hardware Object) for FullCAN operation only enables transmission
or reception of single CanIds. Accordingly, BasicCAN operation of one Hardware
Object enables to transmit or receive a range of CanIds.
A Hardware Receive Object for configured BasicCAN reception is able to receive
a range of CanIds, which pass its hardware acceptance filter. This range may exceed
the list of predefined Rx L-PDUs to be received by this HRH. Therefore, CanIf subse-
quently shall execute software filtering to pass only the predefined list of Rx L-PDUs
to the corresponding upper layer modules. For more details please refer to section
7.20 “Software receive filter”.

37 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00467] dCanIf shall configure and store an order on HTHs and


HRHs for all HOHs derived from the configuration containers CanIfHthCfg and Can-
IfHrhCfg.c()
[SWS_CANIF_00468] dCanIf shall reference a hardware acceptance filter for each
HOH derived from the configuration parameters CanIfHthIdSymRef and Can-
IfHrhIdSymRef.c()
The main difference between BasicCAN and FullCAN operation is in the need of a
software acceptance filtering mechanism (see section 7.20 “Software receive filter”).
[SWS_CANIF_00469] dCanIf shall give the possibility to configure and store a soft-
ware acceptance filter for each HRH of type BasicCAN configured by parameter Can-
IfHrhSoftwareFilter.c()
[SWS_CANIF_00211] dCanIf shall execute the software acceptance filter from
[SWS_CANIF_00469] for the HRH passed by callback function CanIf_RxIndica-
tion().c()
BasicCAN and FullCAN objects may coexist in a single configuration setup. Multiple
BasicCAN and FullCAN receive objects can be used, if provided by the underlying CAN
Controllers.
[SWS_CANIF_00877] dIf CanIf receives a L-PDU (see CanIf_RxIndication()
), it shall perform the following comparisons to select the correct reception L-SDU
configured in CanIfRxPduCfg:
• compare CanIfRxPduCanId with the passed Mailbox->CanId (Can_Id-
Type) excluding the two most significant bits
• compare CanIfRxPduCanIdType with the two most significant bits of the
passed Mailbox->CanId (Can_IdType)
c(SRS_Can_01140, SRS_Can_01141, SRS_Can_01162)
Basically, CanIf supports reception either of Standard CAN IDs or Extended CAN IDs
on one Physical CAN Channel by the parameters CanIfTxPduCanIdType and
CanIfRxPduCanIdType.
[SWS_CANIF_00281] dCanIf shall accept and handle StandardCAN IDs and Ex-
tendedCAN IDs on the same Physical Channel (= mixed mode operation).c(SRS_-
Can_01140)
In a mixed mode operation Standard CAN IDs and Extended CAN IDs can be used
mixed at the same time on the same CAN network. Mixed mode operation can be
accomplished, if the BasicCAN/FullCAN Hardware Objects have been configured
separately for either StandardCAN or ExtendedCAN operation using configuration pa-
rameters CanIfTxPduCanIdType and CanIfRxPduCanIdType. In case of mixed
mode operation the software acceptance filter algorithm (see section 7.20 “Software
receive filter”) must be able to deal with both type of CanIds.

38 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00281] is an optional feature. This feature can be realized by different


variants of implementations, no configuration options are available.

7.8 Initialization
The EcuM calls the CanIf’s function CanIf_Init() for initialization of the entire CanIf
(see [SWS_CANIF_00001]). All global variables and data structures are initialized
including flags and buffers during the initialization process. The EcuM executes initial-
ization of CanDrvs and CanTrcvs separately by call of their corresponding initialization
services (refer to [1] and [2, Specification of CAN Transceiver Driver]).
The CanIf expects that the CAN Controller remains in STOPPED mode like af-
ter power-on reset after the initialization process has been completed. In this
mode the CanIf and CanDrv are neither able to transmit nor receive CAN L-PDUs
(see [SWS_CANIF_00001]).
If re-initialization of the entire CAN modules during runtime is required, the EcuM shall
invoke the CanSm (see [3]) to initiate the required state transitions of the CAN Con-
troller by call of CAN Interface module’s API service CanIf_SetControllerMode
(). The CanIf maps the calls from CanSm to calls of the respective CanDrvs (see
subsection 8.6.3).

7.9 Transmit request


CanIf’s transmit request function CanIf_Transmit() ([SWS_CANIF_00005]) is a
common interface for upper layers to transmit L-PDUs on the CAN network. The up-
per communication layer modules initiate the transmission only via CanIf’s services
without direct access to CanDrv. The initiated Transmit Request is successfully
completed, if CanDrv could write the L-PDU data into the CAN hardware transmit ob-
ject.
Upper layer modules use the API service CanIf_Transmit() to initiate a transmit
request (refer to subsection 8.3.6 “CanIf_Transmit”).
CanIf performs following actions for L-PDU transmission at call of the service
CanIf_Transmit():
• Check, initialization status of CanIf
• Identify CanDrv (only if multiple CanDrvs are used)
• Determine HTH for access to the CAN hardware transmit object
• Call Can_Write() of CanDrv
The transmission is successfully completed, if the transmit request service CanIf_-
Transmit() returns E_OK.

39 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00382] dIf an L-PDU is requested to be transmitted via a PDU channel


mode, which equals CANIF_OFFLINE, the CanIf shall report the runtime error code
CANIF_E_STOPPED to the Det_ReportRuntimeError() service of the DET and
CanIf_Transmit() shall return E_NOT_OK.c(SRS_Can_01126)
Note for [SWS_CANIF_00382]: See subsection 7.19.2 “PDU channel modes”.
If the call of Can_Write() returns with CAN_BUSY, please refer to section 7.12 “Trans-
mit confirmation” for further details.

7.10 Transmit data flow


The Transmit Request service CanIf_Transmit() is based on L-PDUs. The
access to the L-SDU specific data is organized by the following parameters:
• Transmit L-PDU => L-SDU ID
• Reference to a data structure, which contains L-SDU related data: Pointer to the
L-SDU, pointer to the MetaData and L-SDU length.
The reference to the L-SDU data structure is used as a parameter in several CanIf’s
API services, e.g. CanIf_Transmit() or the callback service <User_RxIndica-
tion>(). In case the L-PDU is configured for triggered transmission, the L-SDU
pointer is a null pointer.

40 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Upper layers call


    CanIf_Transmit()

Call of Can_Write()
 

CAN Hardware is
free? [No]

Trigger-transmit
PDU?

[Yes]

[No] [Yes]

«datastore» «datastore» «datastore»


Copy data into CAN Copy data into Queue transmit
  hardware transmit buffer request

       


Set transmit request in
CAN controller

CanIf_Transmit() returns with E_OK

Figure 7.5: Transmit data flow

CanIf stores information about the available hardware objects configured for trans-
mission purposes. The function CanIf_Transmit() maps the CanTxPduId to the
corresponding HTH and calls the function Can_Write() (see [SWS_CANIF_00318]).
[SWS_CANIF_00904] dIf Bus Mirroring is enabled globally (see CanIfBusMirror-
ingSupport) and has been activated with a call to CanIf_EnableBusMirroring
() for a CAN Controller, the CanIf shall store the content of each frame before it
is transmitted on that controller with Can_Write().c(SRS_Can_01172)
Note: The frame content should only be provided to the Bus Mirroring module when it
was actually sent. Therefore, the content has to be stored so that it can be provided to
the Bus Mirroring module from within the CanIf_TxConfirmation().

41 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.11 Transmit buffering

7.11.1 General behavior

At the scope of CanIf the transmit process starts with the call of CanIf_Transmit()
and it ends with invocation of upper layer module’s callback service <User_TxCon-
firmation>(). During the transmit process CanIf, CanDrv and the CAN Mailbox
altogether shall store the L-PDU to be transmitted only once at a single location. De-
pending on the transmit method, these are:
• The CAN hardware transmit object or
• The Transmit L-PDU Buffer inside CanIf, if transmit buffering is enabled.
For triggered transmission, CanIf only has to store the transmit request for the given
L-PDU but not its data. The data is fetched just in time by means of the trigger transmit
function when the HTH is free (again). A single Tx L-PDU, requested for transmission,
shall never be stored twice. This behavior corresponds to the usual way of periodic
communication on the CAN network.
If transmit buffering is enabled, CanIf will store a Tx L-PDU in a CanIf Trans-
mit L-PDU Buffer (CanIfBufferCfg), if it is rejected by CanDrv at Transmit
Request.
Basically, the overall buffer in CanIf for buffering Tx L-PDUs consits of one or multi-
ple CanIfBufferCfg (see CanIfBufferCfg). Whereas each CanIfBufferCfg is
assigned to one or multiple dedicated CanIfBufferHthRef (see CanIfBuffer-
HthRef) and can be configured to buffer one or multiple Tx L-PDUs. But as al-
ready mentioned above only one instance per Tx L-PDU can be buffered in the overall
amount of CanIfBufferCfg.
The behavior of CanIf during L-PDU transmission differs whether transmit buffering
is enabled in the configuration setup for the corresponding Tx L-PDU, or not. If trans-
mit buffering is disabled and a transmit request to CanDrv fails (CAN Controller
mailbox is in use, BasicCAN), the L-PDU is not copied to the CAN Controller’s
mailbox and CanIf_Transmit() returns the value E_NOT_OK. If transmit buffering is
enabled and a transmit request to CanDrv fails, depending on the CanIfTxBuffer
configuration the L-PDU can be stored in a CanIfTxBuffer. In this case the API
CanIf_Transmit() returns the value E_OK although the transmission could not be
performed. In this case CanIf takes care of the outstanding transmission of the L-
-PDU via CanIf_TxConfirmation() callback and the upper layer doesn’t have to
retry the transmit request.
The number of available transmit CanIf Tx L-PDU Buffers can be configured
completely independent from the number of used Transmit L-PDUs defined in the
CAN network description file for this ECU.
As per [SWS_CANIF_00835] a Tx L-PDU refers HTHs via the CanIfBufferCfg con-
figuration container (see CanIfBufferCfg). This is valid if transmit buffering is not

42 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

needed as well. In this case, the buffer size (see CanIfBufferSize) of the Can-
IfBufferCfg has to be set to 0. Then CanIfBufferCfg configuration container is
only used to refer a HTH.

7.11.2 Buffer characteristics

CanIfTxPduBufferRef, CanIfBufferCfg, CanIfBufferHthRef and CanIf-


BufferSize describe the possible CanIfBufferCfg configurations.

7.11.2.1 Storage of L-PDUs in the transmit L-PDU buffer

CanIf tries to store a new Transmit L-PDU or its Transmit Request in the
Transmit L-PDU Buffer only, if CanDrv return CAN_BUSY during a call of Can_-
Write() (see [SWS_CANIF_00381]).
[SWS_CANIF_00063] dThe CanIf shall support buffering of a CAN L-PDU for Ba-
sicCAN transmission in the CanIf, if parameter CanIfPublicTxBuffering (see
CanIfPublicTxBuffering) is enabled.c(SRS_Can_01020)
[SWS_CANIF_00849] dFor dynamic Transmit L-PDUs, also the CanId has to be
stored in the CanIfTxBuffer.c()
[SWS_CANIF_00381] dIf transmit buffering is enabled (see [SWS_CANIF_00063])
and if the call of Can_Write() for a PDU configured for direct transmission returns
with CAN_BUSY, CanIf shall check if it is possible to buffer the CanIf Tx L-PDU,
which was requested to be transmitted via Can_Write() in a CanIfTxBuffer.c
(SRS_Can_01126)
When the call of Can_Write() returns with CAN_BUSY, CanDrv has rejected the
requested transmission of the L-PDU (see [1]) because there is no free hardware object
available at time of the transmit request (Tx request).
[SWS_CANIF_00895] dIf the rejected data length exceeds the configured size, CanIf
shall:
• buffer the configured amount of data and discard the rest
• and report runtime error code CANIF_E_DATA_LENGTH_MISMATCH to the
Det_ReportRuntimeError() service of the DET.
c()
[SWS_CANIF_00881] dIf transmit buffering is enabled (see [SWS_CANIF_00063])
and if the call of Can_Write() for a PDU configured for triggered transmission returns
with CAN_BUSY, CanIf shall check if it is possible to buffer the Transmit Request,
which was requested to be transmitted via Can_Write() in a CanIfTxBuffer.c
(SRS_Can_01126)

43 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00835] dWhen CanIf checks whether it is possible to buffer


a CanIf Tx L-PDU or a Transmit Request (see [SWS_CANIF_00381],
[SWS_CANIF_00881]), this shall only be possible, if the CanIf Tx L-PDU is as-
signed (see CanIfTxPduBufferRef) to a CanIfBufferCfg (see CanIfBuffer-
Cfg), which is configured with a buffer size (see CanIfBufferSize) bigger than
zero.c()
The buffer size of any CanIfTxBuffer is only configurable bigger than zero, if transmit
buffering is enabled. Additionally the buffer size of a single CanIfTxBuffer is only
configurable bigger than zero if the CanIfTxBuffer is not assigned to a FullCAN HTH
(see CanIfBufferSize).
[SWS_CANIF_00836] dIf it is possible to buffer a CanIf Tx L-PDU or a Transmit
Request, because the buffer size of the assigned CanIfTxBuffer is bigger than zero
(see [SWS_CANIF_00835]), CanIf shall buffer a CanIf Tx L-PDU or the Transmit
Request in a free buffer element of the assigned CanIfTxBuffer, if the CanIf Tx
L-PDU or the Transmit Request is not already buffered in the CanIfTxBuffer.c()
[SWS_CANIF_00068] dIf it is possible to buffer a CanIf Tx L-PDU or a Transmit
Request, because the buffer size of the assigned CanIfTxBuffer is bigger than
zero (see [SWS_CANIF_00835]), CanIf shall overwrite direct transmitted CanIf Tx
L-PDU in the assigned CanIfTxBuffer, if the CanIf Tx L-PDU is already buffered
in the CanIfTxBuffer when Can_Write() returns CAN_BUSY.c(SRS_Can_01011)
Note: There is nothing to do for already stored Transmit Requests
(see [SWS_CANIF_00068]) due to the fact the data will be catched by CanDrv di-
rectly (using CanIf_TriggerTransmit()). Therefore, the latest data will be sent
automatically.
If the order of various transmit requests of different L-PDUs shall be kept, transmit
requests of upper layer modules must be connected to previous transmit confirmation
notifications. This means that a subsequent L-PDU is requested for transmission by the
upper layer modules only, if the transmit confirmation of the previous one was notified
by CanIf.
Note: Additionally the order of transmit requests can differ depending on the number
of configured hardware transmit objects.
[SWS_CANIF_00837] dIf the buffer size is greater zero, all buffer elements are busy
and CanIf_Transmit() is called with a new L-PDU (no other instance of the same
L-PDU is already stored in the buffer), then the new L-PDU or its Transmit Request
shall not be stored and CanIf_Transmit() shall return E_NOT_OK.c()

7.11.2.2 Clearance of transmit L-PDU buffers

[SWS_CANIF_00386] dCanIf shall evaluate during transmit confirmation


(see [SWS_CANIF_00007]), whether pending CanIf Tx L-PDUs or Transmit

44 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Requests are stored within the CanIfTxBuffers, which are assigned to the new
free Hardware Transmit Object (see [SWS_CANIF_00466]).c()
[SWS_CANIF_00668] dIf pending CanIf Tx L-PDUs or Transmit Requests are
available in the CanIfTxBuffers as per [SWS_CANIF_00386], then CanIf shall
call Can_Write() for that pending CanIf Tx L-PDU or Transmit Requests (of
the one assigned to the new Hardware Transmit Object) with the highest priority
(see [SWS_CANIF_00070]).c()
[SWS_CANIF_00070] dCanIf shall transmit L-PDUs or Transmit Requests stored
in the Transmit L-PDU Buffers in priority order (see [12, ISO 11898-1:2015]) per
each HTH. CanIf shall not differentiate between L-PDUs and Transmit Requests.c
()
[SWS_CANIF_00183] dWhen CanIf calls the function Can_Write() for prioritized
L-PDUs and Transmit Requests stored in CanIfTxBuffer and the return value of
Can_Write() is E_OK, then CanIf shall remove this L-PDU or Transmit Request
from the Transmit L-PDU Buffer immediately, before the transmit confirmation re-
turns.c()
The behavior specified in [SWS_CANIF_00183] simplifies the choice of the new trans-
mit L-PDU stored in the Transmit L-PDU Buffer.

7.11.2.3 Initialization of transmit L-PDU buffers

[SWS_CANIF_00387] dWhen function CanIf_Init() is called, CanIf shall initialize


every Transmit L-PDU Buffer assigned to CanIf.c()
The requirement [SWS_CANIF_00387] is necessary to prevent transmission of old
data after restart of the CAN Controller.

7.11.3 Data integrity of transmit L-PDU buffers

[SWS_CANIF_00033] dCanIf shall protect against concurrent access to Trans-


mit L-PDU Buffers for transmit L-PDUs and Transmit Requests.c(SRS_Can_-
01114)
This may be realized by using exclusive areas defined within the BSW Scheduler.
These exclusive areas can e.g. configured, that all interrupts will be disabled while
the exclusive area is entered. The corresponding services from the BSW Scheduler
module are SchM_Enter_CanIf() and SchM_Exit_CanIf().
Rationale: for [SWS_CANIF_00033]: pre-emptive accesses to the Transmit L-PDU
Buffer cannot always be avoided. Such Transmit L-PDU Buffer access like
storing a new L-PDU or removing transmitted L-PDU may occur preemptively.

45 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.12 Transmit confirmation


If a previous transmit request is completed successfully, CanDrv notifies it to CanIf
by the call of CanIf_TxConfirmation() ([SWS_CANIF_00007]).
[SWS_CANIF_00905] dIf Bus Mirroring is enabled globally (see CanIfBusMirror-
ingSupport) and has been activated with a call to CanIf_EnableBusMirroring
() for a CAN Controller, the CanIf shall call Mirror_ReportCanFrame() for
each frame transmission on that controller that is confirmed with CanIf_TxConfir-
mation(), providing the stored content and the actual CAN ID.c(SRS_Can_01172)
[SWS_CANIF_00383] dWhen callback notification CanIf_TxConfirma-
tion() is called, CanIf shall identify the upper layer communication layer
(see [SWS_CANIF_00414]), which is linked to the successfully transmitted L-
-PDU, and shall notify it about the performed transmission by call of CanIf’s transmit
confirmation service <User_TxConfirmation>(E_OK).c()
Note for [SWS_CANIF_00383]: See section 7.12 “Transmit confirmation”.
The callback service <User_TxConfirmation>() is implemented by the notified
upper layer module.
An upper communication layer module can be designed or configured in a way, that
transmit confirmations can be processed with single or multiple callback services for
different L-PDUs or groups of L-PDUs. All that services are called by CanIf at transmit
confirmation of the corresponding L-PDU transmission request. The Transmit L-PDU
enables to dispatch different confirmation services associated to the target upper layer
module. This assignment is made statically during configuration.
One transmit L-PDU can only be assigned to one single transmit confirmation callback
service. Please refer to subsubsection 8.6.3.2 “<User_TxConfirmation>”.
[SWS_CANIF_00740] dIf CanIfPublicTxConfirmPollingSupport is enabled,
CanIf shall buffer the information about a received TxConfirmation per CAN Con-
troller, if the controller mode of that controller is in state CAN_CS_STARTED.c()

7.13 Receive data flow


According to the AUTOSAR Basic Software Architecture the received data will be eval-
uated and processed in the upper layer communication stacks (i.e. AUTOSAR COM,
CanNm, CanTp, DCM). This means, upper layer modules may neither work with (i.e.
change) buffers of CanDrv (Rx) nor do they have access to buffers of CanIf (Tx).
CanIf provides internal buffering in the receive path only if CanIfPublicReadRxP-
duDataApi is set to TRUE (refer to section 7.15). Tx buffering is addressed in section
7.11 and dynamic L-PDUs are concerned in section 7.4.

46 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

In case of a new reception of an L-PDU CanDrv calls CanIf_RxIndication() (refer


to [SWS_CANIF_00006]) of CanIf. The access to the L-PDU specific data is orga-
nized by these parameters:
• Hardware Receive Handle (HRH)
• Received CAN Identifier (CanId)
• Received Data Length
• Reference to Received L-PDU
The Received L-PDU is hardware dependent (nibble and byte ordering, access type)
and allocated to the lowest layer in the communication system - to CanDrv. HRH serves
as a link between CanDrv and the upper layer module using the L-PDU. The HRH
identifies one CAN hardware receive object, where a new CAN L-PDU was received.
After the indication of a received L-PDU by CanDrv (CanIf_RxIndication() is
called) the CanIf shall proceed as described in 7.14 Receive indication. CanIf is
not able to recognize, whether CanDrv uses temporary buffering or a direct hardware
access. It expects normalized L-PDU data in calls of the CanIf_RxIndication().
The CAN hardware receive object is locked until the end of the copy process to the tem-
porary or upper layer module buffer. The hardware object will be immediately released
after CanIf_RxIndication() of CanIf returns to avoid loss of data.
CanDrv, CanIf and the upper layer module, which belongs to the received L-PDU,
access the same temporary intermediate buffer, which can be located either in the CAN
hardware receive object of the CAN Controller or as temporary buffer in CanDrv.

47 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Receive Interrupt
   

Data [Yes] «datastore»


   normalization Temporary buffer in CAN
necessary? Driver

[No]

   Call CanIf_RxIndication()

Rx L-PDU [Yes]
received in Software filtering
BasicCAN ?

[No]

[Yes]
Data Length
Check enabled? [L-PDU passed]

[No]
Data Length [No]
Check failed ?

[Yes]

[L-PDU not
Call Det_ReportRuntimeError() with passed]
error code
CANIF_E_INVALID_DATA_LENGTH

Call <User_RxIndication>() to
upper layers

«datastore»
    Copy data to L-PDU
buffer

<User_RxIndication>() returns
CanIf_RxIndication() returns

Figure 7.6: Receive data flow

7.14 Receive indication


A call of CanIf_RxIndication() (see [SWS_CANIF_00006]) references in its pa-
rameters a newly received CAN L-PDU. If the function CanIf_RxIndication() is

48 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

called, the CanIf evaluates the CAN L-PDU for acceptance and prepares the L-SDU
for later access by the upper communication layers. The CanIf notifies upper layer
modules about this asynchronous event using <User_RxIndication>() (see sub-
subsection 8.6.3.3 “<User_RxIndication>”, [SWS_CANIF_00012]), if configured and if
this CAN L-PDU is successfully detected and accepted for further processing. The
detailed requirements for this behavior follow here.
[SWS_CANIF_00906] dIf Bus Mirroring is enabled globally (see CanIfBusMirror-
ingSupport) and has been activated with a call to CanIf_EnableBusMirroring
() for a CAN Controller, the CanIf shall call Mirror_ReportCanFrame() for
each frame reception on that controller that is indicated with CanIf_RxIndication
().c(SRS_Can_01172)
[SWS_CANIF_00389] dIf the function CanIf_RxIndication() is called, the CanIf
shall process the Software Filtering on the received L-PDU, if configured (see multi-
plicity of CanIfHrhRangeCfg equals 0..∗). If Software Filtering rejects the received
L-PDU, the CanIf shall end the receive indication for that call of CanIf_RxIndica-
tion().c()
Note for [SWS_CANIF_00389]: See 7.20.
[SWS_CANIF_00390] dIf CanIf accepts an L-PDU received via CanIf_RxIndica-
tion() during Software Filtering (see [SWS_CANIF_00389]), CanIf shall process
the Data Length check afterwards, if configured (see CanIfPrivateDataLength-
Check and CanIfRxPduDataLengthCheck).c()
For further details, please refer to section 7.21 “Data Length Check”.
[SWS_CANIF_00297] dIf CanIf has accepted a L-PDU received via CanIf_-
RxIndication() during Data Length Check (see [SWS_CANIF_00390]), CanIf
shall copy the number of bytes according to the configured Data Length (see
ECUC_CanIf_00599) to the static receive buffer, if configured for that L-PDU
(see [SWS_CANIF_00198], ECUC_CanIf_00600).c()
[SWS_CANIF_00851] dIf MetaData is configured for a received L-SDU, CanIf shall
copy the PDU payload to the static receive buffer and the CAN ID to the Meta-
DataItem of type CAN_ID_32.c()
[SWS_CANIF_00056] dIf CanIf accepts a L-PDU received via CanIf_-
RxIndication() during Data Length Check (see [SWS_CANIF_00390],
[SWS_CANIF_00026]), CanIf shall identify if a target upper layer module was
configured (see configuration descrption of [SWS_CANIF_00012], CanIfRxPdu-
UserRxIndicationUL, CanIfRxPduUserRxIndicationName) to be called with
its providing receive indication service for the received L-SDU.c()
[SWS_CANIF_00135] dIf a target upper layer module was configured to be called with
its providing receive indication service (see [SWS_CANIF_00056]), the CanIf shall call
this configured receive indication callback service (see CanIfRxPduUserRxIndi-
cationName) and shall provide the parameters required for upper layer notification

49 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

callback functions (see [SWS_CANIF_00012]) based on the parameters of CanIf_-


RxIndication().c(SRS_BSW_00325)
Note: A single receive L-PDU can only be assigned to a single receive indication call-
back service (refer to multiplicity of CanIfRxPduUserRxIndicationName).
Overview: CanIf performs the following steps at a call of CanIf_RxIndication():
• Software Filtering (only BasicCAN), if configured
• Data Length Check, if configured
• buffer received L-SDU if configured
• call upper layer receive indication callback service, if configured.

7.15 Read received data


The read received data API CanIf_ReadRxPduData() (see [SWS_CANIF_00194])
is a common interface for upper layer modules to read CAN L-SDUs recently received
from the CAN network. The upper layer modules initiate the receive request only via
CanIf services without direct access to CanDrv. The initiated receive request is suc-
cessfully completed, if CanIf wrote the received L-SDU into the upper layer module
I-PDU buffer.
The function CanIf_ReadRxPduData() makes reading out data without dependence
of reception event (RxIndication) possible. When it is enabled at configuration time
(see CanIfPublicReadRxPduDataApi), not necessarily a receive indication service
for the same L-SDU has to be configured (see CanIfRxPduUserRxIndicationUL).
If needed, the receive indication can be enabled, too.
By this way the type of mechanism to receive L-SDUs (in the upper layer modules
of CanIf) can be chosen at configuration time by the parameter CanIfRxPduUser-
RxIndicationUL and parameter CanIfRxPduReadData according to the needs of
the upper layer module, to which the corresponding receive L-SDU belongs to. For
details please refer to section 9.9 “Read received data”.
[SWS_CANIF_00198] dIf the configuration parameter CanIfPublicReadRxPdu-
DataApi is set to TRUE, CanIf shall store each received L-SDU, at which CanI-
fRxPduReadData is enabled, into a receive L-SDU buffer. This means that if the con-
figuration parameter CanIfRxPduReadData is set to TRUE, CanIf has to allocate a
receive L-SDU buffer for this receive L-SDU.c()
[SWS_CANIF_00199] dAfter call of CanIf_RxIndication() and passing of soft-
ware filtering and Data Length Check, CanIf shall store the received L-SDU in this
receive L-SDU buffer. During the call of CanIf_ReadRxPduData() the assigned
receive L-SDU buffer containing a recently received L-SDU, CanIf shall avoid pre-
emptive receive L-SDU buffer access events (refer to [SWS_CANIF_00064]) to that
receive L-SDU buffer.c()

50 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.16 Read Tx/Rx notification status


In addition to the notification callback functions CanIf provides the API service
CanIf_ReadTxNotifStatus() (see [SWS_CANIF_00202]) to read the transmit
confirmation status of any transmit L-SDU and the API service CanIf_ReadRxNo-
tifStatus() is provided to read the receive indication status of any receive L-SDU.
CanIf’s API services CanIf_ReadTxNotifStatus() (see [SWS_CANIF_00202])
and CanIf_ReadRxNotifStatus() (see [SWS_CANIF_00230]) can be en-
abled/disabled globally or per L-SDU at pre-compile time configuration using the con-
figuration parameters CanIfPublicReadTxPduNotifyStatusApi, CanIfPubli-
cReadRxPduNotifyStatusApi, CanIfTxPduReadNotifyStatus, and CanI-
fRxPduReadNotifyStatus.
[SWS_CANIF_00472] dIf configuration parameter CanIfPublicReadTxPduNoti-
fyStatusApi is set to TRUE, CanIf shall store the current notification status for each
transmit L-SDU.c()
[SWS_CANIF_00473] dIf configuration parameter CanIfPublicReadRxPduNoti-
fyStatusApi is set to TRUE, CanIf shall store the current notification status for each
receive L-SDU.c()
Rationale for [SWS_CANIF_00391] and [SWS_CANIF_00393] respectively
[SWS_CANIF_00392] and [SWS_CANIF_00394]: This ’read-and-consume’ be-
havior ensures, that at least one successful transmit or receive event occurred after
last call of this service.

7.17 Data integrity


[SWS_CANIF_00064] Shared code shall be reentrant dCanIf shall protect preemp-
tive events, which access shared resources, that could be changed during CanIf’s
event handling, against each other.c(SRS_BSW_00312)
Rationale: An attempt to update the data in the upper layer module buffers as well
as in CanIf’s internal buffers has to be done with respect to possible changes done
in the context of an interrupt service routine or other preemptive events. Preemptive
events probably occur either from preemptive tasks, multiple CAN interrupts, if multiple
physical channels i.e. for gateways are used, or in case of other peripherals or net-
work systems interrupts, which have the needs to transmit and receive L-PDUs on the
network.
Handling of shared transmit and receive L-PDU/L-SDU buffers are critical issues for the
implementation of CanIf. Therefore CanIf shall ensure data integrity and thus use
appropriate mechanisms for access to shared resources like transmission/reception
L-PDU/L-SDU buffers. Preemptive events, i.e. transmission and reception event from
other CAN Controllers could compromise data integrity by writing into the same
L-PDU/L-SDU buffer.

51 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CanIf can e.g. use CanDrv services to enable (Can_EnableControllerInter-


rupts()) and disable (Can_Disable-ControllerInterrupts()) CAN interrupts
and its notifications at entry and exit of the critical sections separately for each CAN
Controller. If there are common resources for multiple CAN Controllers, the
entire CAN Interrupts must be locked. These sections must not take a long time in
order to prevent serious performance degradation. Thus copying of data, change of
static variables, counters and semaphores should be carried out inside these critical
sections. It is up to the implementation to use appropriate mechanisms to guarantee
data integrity, interrupt ability and reentrancy.
The transmit request API CanIf_Transmit() must be able to operate re-entrant to
allow multiple transmit request calls caused by different preemptive events of different
L-PDUs/L-SDUs. CanDrv’s transmit request API Can_Write() operates re-entrant
as well.

7.18 CAN Controller Mode

7.18.1 General Functionality

CanIf provides services for controlling the communication mode of all supported
CAN Controllers represented by the underlying CanDrv. This means that all CAN
Controllers are controlled by the corresponding provided API services to request
and read the current controller mode.
The CAN Controller status may be changed at request of the upper layer by the
calling of CanIf_SetControllerMode() service. The request is passed by CanIf
via the CanDrv API to the addressed CAN Controller.
The consistent management of all CAN Controllers connected at one CAN network
is the task of CanSm. By this way CanSm is responsible to set all CAN Controllers
of one CAN network sequentially to sleep mode or to wake them up.
CanIf accepts every state transition request by calling the function CanIf_SetCon-
trollerMode() or CanIf_ControllerBusOff(). CanIf does not decide if a re-
quested mode transition of the CAN Controller is valid or not. CanIf only interacts
with CanDrv by fetching the current mode and execution of requested mode transi-
tions.
This network related state machine is implemented in CanSm. Refer to [3]. CanIf only
stores the requested mode and executes the requested transition.
Hint: As optimisation to avoid frequent requests to CanDrv for internal use the
last state indicated by CanIf_ControllerModeIndication() and Can_GetCon-
trollerMode() could be stored per controller.
Hint: It has to be regarded that not only CanSm is able to request CAN Controller Mode
changes.

52 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.18.2 CAN Controller Operation Modes

According to the requested operation mode by CanSm, CanIf forwards request Can-
Drvs.
[SWS_CANIF_00677] dIf a controller mode referenced by ControllerId is in state
CAN_CS_STOPPED and if the PduIdType parameter in a call of CanIf_Transmit()
is assigned to that CAN Controller, then the call of CanIf_Transmit() does not
result in a call of Can_Write() (see [SWS_CANIF_00317]) and returns E_NOT_OK.c
()
[SWS_CANIF_00485] dIf a controller mode referenced by ControllerId enters state
CAN_CS_STOPPED, then CanIf shall clear the CanIf transmit buffers assigned to the
CAN Controller corresponding.c()
[SWS_CANIF_00739] dIf a controller mode referenced by ControllerId enters state
CAN_CS_STOPPED, then CanIf shall inform corresponding upper layer modules about
failed transmission by calling <User_TxConfirmation>(id, E_NOT_OK) for every
outstanding TxConfirmation assigned to that CAN Controller. If CanIfPublicTx-
ConfirmPollingSupport is enabled, CanIf shall also clear the information about
a TxConfirmation (see [SWS_CANIF_00740]).c()
Note: This ensures, that for each PDU, which shall be transmitted via CanIf_Trans-
mit(), either a positive or negative <User_TxConfirmation>() is called.
[SWS_CANIF_00724] dWhen callback CanIf_ControllerBusOff(Control-
lerId) is called, the CanIf shall call CanSM_ControllerBusOff(Control-
lerId) of the CanSm or a CDD (see [SWS_CANIF_00559], [SWS_CANIF_00560]).c
()
Note for [SWS_CANIF_00724]: See subsubsection 8.6.3.9 “<User_ControllerMod-
eIndication>”.
[SWS_CANIF_00711] dWhen callback CanIf_ControllerModeIndication
(ControllerId, ControllerMode) is called, CanIf shall call CanSm_Con-
trollerModeIndication(ControllerId, ControllerMode) of the CanSm or
a CDD (see [SWS_CANIF_00691], [SWS_CANIF_00692]).c()
Note for [SWS_CANIF_00711]: See subsubsection 8.6.3.9 “<User_ControllerMod-
eIndication>”.
[SWS_CANIF_00712] dWhen callback CanIf_TrcvModeIndication
(Transceiver, TransceiverMode) is called, CanIf shall call CanSM_-
TransceiverModeIndication(TransceiverId, TransceiverMode) of the
CanSm or a CDD (see [SWS_CANIF_00697], [SWS_CANIF_00698]).c()
Note for [SWS_CANIF_00712]: See subsubsection 8.6.3.9 “<User_ControllerMod-
eIndication>”.

53 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.18.3 Controller Mode Transitions

The API for state change requests to the CAN Controller behaves in an asyn-
chronous manner with asynchronous notification via callback services.
The real transition to the requested mode occurs asynchronously based on setting of
transition requests in the CAN controller hardware, e.g. request for sleep transition
CAN_CS_SLEEP. After successful change to e.g. CAN_CS_SLEEP mode CanDrv calls
function CanIf_ControllerModeIndication() and CanIf in turn calls function
<User_ControllerModeIndication>(). If CAN transitions very fast, CanIf_-
ControllerModeIndication() can be called during CanIf_SetController-
Mode(). This is implementation specific.
Unsuccessful or no mode transitions of the CAN Controllers have to be tracked by
upper layer modules. Mode transitions CAN_CS_STARTED and CAN_CS_STOPPED are
treated similar.
Upper layer modules of CanIf can poll the current Controller Mode by CanIf_Get-
ControllerMode().
Not all types of CAN Controllers support Sleep and Wake-Up Mode. These
modes are then encapsulated by CanDrv by providing hardware independent oper-
ation modes via its interface, which has to be managed by CanIf.
Note: It is possible that during transition from CAN_CS_STOPPED to CAN_CS_SLEEP
CAN Controller may indicate a wake-up interrupt to the ECU Integration Code.
CanIf distinguishes between internal initiated CAN controller wake-up request (inter-
nal request) and network wake-up request (external request). The internal request is
initiated by call of CanIf’s function CanIf_SetControllerMode(ControllerId,
CAN_CS_STARTED) and it is an internal asynchronous request. The external request
is a CAN controller event, which is notified by CanDrv or CanTrcv to the ECU Inte-
gration Code. For details see respective UML diagram in the chapter "CAN Wakeup
Sequences" of document [13].

7.18.4 Wake-up

The ECU supports wake-up over CAN network, regardless of the used wake-up
method (directly about CAN Controller or CAN Transceiver), only if the CAN
Controller and CAN Transceiver are set to some kind of "listen for wake-up"
mode. This is usually a Sleep Mode, where the usual communication is disabled. Only
this mode ensures that the CAN Controller is stopped. Thus, the wake-up interrupt
can be enabled.

54 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.18.4.1 Wake-up detection

If wake-up support is enabled (see ECUC_CanIf_00843) CanIf is notified by the Inte-


gration Code about a detected CAN wake-up by the service CanIf_CheckWakeup()
(see CAN Wakeup Sequences of [13]).
In case of a CAN bus "wake-up" event the function CanIf_CheckWakeup(Wakeup-
Source) may be called during execution of EcuM_CheckWakeup(WakeupSource)
(see wake-up sequence diagrams of EcuM). CanIf in turn checks by configured input
reference to EcuMWakeupSource in CanDrvs, which CanDrvs have to be checked.
CanIf gets this information via reference CanIfCtrlCanCtrlRef.
The Communication Service, which is called, belongs to the service defined during
configuration (see CanIfDispatchCfg). In this way EcuM as well as CanSm are able
to change CAN Controller States and to control the system behavior concerning the
BusOff recovery or wake-up procedure.
[SWS_CANIF_00395] dWhen CanIf_CheckWakeup(EcuM_WakeupSourceType
WakeupSource) is invoked, CanIf shall query CanDrvs / CanTrcvs via CanTrcv_-
CheckWakeup() or Can_CheckWakeup(), which exact CAN hardware device
caused the bus wake-up.c()
Note: It is implementation specific, which controllers and transceivers are queried.
CanIf just has to find out the exact CAN hardware device.
[SWS_CANIF_00720] dIf at least one function call of Can_CheckWakeup() or
CanTrcv_CheckWakeup() returns E_OK to CanIf, then CanIf_CheckWakeup()
shall return E_OK.c()
[SWS_CANIF_00678] dIf all calls of Can_CheckWakeup() or CanTrcv_Check-
Wakeup() return E_NOT_OK to CanIf, then CanIf_CheckWakeup() shall return
E_NOT_OK.c()

7.18.4.2 Wake-up Validation

Note: When a CAN Controller / CAN Transceiver detects a bus wake-up event,
then this will be notified to the ECU State Manager directly. If such a wake-up event
needs to be validated, the EcuM (or a CDD) switches on the corresponding CAN Con-
troller (CanIf_SetControllerMode()) and CAN Transceiver (CanIf_Set-
TrcvMode()) (For more details see chapter 9 of [13]).
Attention: CanIf notifies the upper layer modules about received messages after the
PDU Channel Mode has been set to CANIF_ONLINE or CANIF_TX_OFFLINE. Thus,
it is necessary that the PDU Channel Mode is not set to CANIF_ONLINE or CANIF_-
TX_OFFLINE if wake-up validation is required.
Note: As per [SWS_CAN_00411] and CAN Controller State Diagram (see [1]) a direct
transition from mode CAN_CS_SLEEP to CAN_CS_STARTED is not allowed.

55 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00286] dIf CanIfPublicWakeupCheckValidSupport equals TRUE,


CanIf enables the detection for CAN wake-up validation. Therefore, CanIf stores the
event of the first valid call of CanIf_RxIndication() of a CAN Controller which
has been set to CAN_CS_STARTED. The first call of CanIf_RxIndication() is valid:
• only for received NM messages if CanIfPublicWakeupCheckValidByNM is
TRUE
• for all received messages corresponding to a configured Rx PDU if CanIfPub-
licWakeupCheckValidByNM is FALSE.
c(SRS_Can_01151)
[SWS_CANIF_00179] d<User_ValidateWakeupEvent>(sources) shall be
called during CanIf_CheckValidation(WakeupSource), whereas sources is
set to WakeupSource, if the event of the first called CanIf_RxIndication() is
stored in CanIf at the corresponding CAN Controller.c(SRS_Can_01136)
Note: The parameter of the function <User_ValidateWakeupEvent>() is of type:
• sources: EcuM_WakeupSourceType (see [13])
[SWS_CANIF_00756] dWhen controller mode is set to CAN_CS_SLEEP the stored
event from previous wake-up (first call of CanIf_RxIndication) shall be cleared
(see [SWS_CANIF_00179]).c()

7.19 PDU channel mode control

7.19.1 PDU channel groups

Each L-PDU is assigned to one dedicated physical CAN channel connected to one
CAN Controller and one CAN network. By this way all L-PDUs belonging to one
Physical Channel can be controlled on the view of handling logically single L-PDU
channel groups. Those logical groups represent all L-PDUs of one ECU connected to
one underlying CAN network.
Figure 7.7 below shows one possible usage of L-PDU channel group and its relation to
the upper layers and/or networks.
An L-PDU can only be assigned to one channel group.
Typical users like PduR or the Network Management are responsible for controlling the
PDU operation modes.

56 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Figure 7.7: Channel PDU groups

7.19.2 PDU channel modes

CanIf provides the services CanIf_SetPduMode() and CanIf_GetPduMode() to


prevent the processing of
• all Transmit L-PDUs belonging to one logical channel,
• all Transmit L-PDUs and Receive L-PDUs belonging to one logical channel.
Changing the PDU channel mode is only allowed in case corresponding controller
mode equals CAN_CS_STARTED (refer to [SWS_CANIF_00874]).
While CANIF_ONLINE and CANIF_OFFLINE affecting the whole communicatoin the
PDU channel modes CANIF_TX_OFFLINE and CANIF_TX_OFFLINE_ACTIVE en-
able/disable transmission path seperately.
CanIf provides information about the current PDU channel mode via the service
CanIf_GetPduMode().

57 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Figure 7.8: PDU channel mode control

Figure 7.8 shows a diagram with possible PDU channel modes. Each L-PDU chan-
nel can be in CANIF_OFFLINE (no communication), CANIF_TX_OFFLINE (passive
mode => listen without sending), CANIF_TX_OFFLINE_ACTIVE (simulated transmis-
sion with listening), and CANIF_ONLINE (full communication). The default state is the
CANIF_OFFLINE mode.

7.19.2.1 CANIF_OFFLINE

[SWS_CANIF_00864] dDuring initialization CanIf shall switch every channel to


CANIF_OFFLINE.c()
[SWS_CANIF_00865] dIf CanIf_SetControllerMode(ControllerId, CAN_-
CS_SLEEP) is called, CanIf shall set the PDU channel mode of the corresponding
channel to CANIF_OFFLINE.c()
[SWS_CANIF_00073] dFor Physical Channels switching to CANIF_OFFLINE
mode CanIf shall:
• prevent forwarding of transmit requests CanIf_Transmit() of associated L-
-PDUs to CanDrv (return E_NOT_OK to the calling upper layer modules),
• clear the corresponding CanIf transmit buffers,
• prevent invocation of receive indication callback services of the upper layer mod-
ules,
• prevent invocation of transmit confirmation callback services of the upper layer
modules.
c()
[SWS_CANIF_00866] dIf CanIf_SetControllerMode(ControllerId, CAN_-
CS_STOPPED) or CanIf_ControllerBusOff(ControllerId) is called, CanIf

58 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

shall set the PDU channel mode of the corresponding channel to CANIF_TX_OF-
FLINE.c()
[SWS_CANIF_00489] dFor Physical Channels switching to CANIF_TX_OFFLINE
mode CanIf shall:
• prevent forwarding of transmit requests CanIf_Transmit() of associated L-
-PDUs to CanDrv (return E_NOT_OK to the calling upper layer modules),
• clear the corresponding CanIf transmit buffers,
• prevent invocation of transmit confirmation callback services of the upper layer
modules.
• enable invocation of receive indication callback services of the upper layer mod-
ules.
c()
The BusOff notification is implicitly suppressed in case of CANIF_OFFLINE and
CANIF_TX_OFFLINE due to the fact, that no L-PDUs can be transmitted and thus
the CAN Controller is not able to go in BusOff mode by newly requested L-PDUs
for transmission.
[SWS_CANIF_00118] dIf those Transmit L-PDUs, which are already waiting for
transmission in the CAN Transmit Hardware Object, will be transmitted imme-
diately after change to CANIF_TX_OFFLINE or CANIF_OFFLINE mode and a subse-
quent BusOff event occurs, CanIf does not prohibit execution of the BusOff notifica-
tion <User_ControllerBusOff>(ControllerId).c()
The wake-up notification is not affected concerning PDU channel mode changes.

7.19.2.2 CANIF_ONLINE

[SWS_CANIF_00075] dFor Physical Channels switching to CANIF_ONLINE mode


CanIf shall:
• enable forwarding of transmit requests CanIf_Transmit() of associated L-
-PDUs to CanDrv,
• enable invocation of receive indication callback services of the upper layer mod-
ules,
• enable invocation of transmit confirmation callback services of the upper layer
modules.
c()

59 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.19.2.3 CANIF_OFFLINE_ACTIVE

If CanIfTxOfflineActiveSupport = TRUE CanIf provides simulation of suc-


cessful transmission by CANIF_TX_OFFLINE_ACTIVE mode. This mode is enabled
by call of CanIf_SetPduMode(ControllerId, CANIF_TX_OFFLINE_ACTIVE)
and only affects the transmission path.
[SWS_CANIF_00072] dFor every L-PDU assigned to a channel which is in CANIF_-
TX_OFFLINE_ACTIVE mode CanIf shall call the transmit confirmation callback ser-
vices of the upper layer modules immediately instead of buffering or forwarding of the
L-PDUs to CanDrv during the call of CanIf_Transmit().c()
Note: During CANIF_TX_OFFLINE_ACTIVE mode the upper layer has to handle the
execution of the transmit confirmations. The transmit confirmation handling is executed
immediately at the end of the transmit request (see [SWS_CANIF_00072]).
Rational: This functionality is useful to realize special operating modes (i.e. diagnosis
passive mode) to avoid bus traffic without impact to the notification mechanism. This
mode is typically used for diagnostic usage.

7.20 Software receive filter


Not all L-PDUs, which may pass the hardware acceptance filter and therefore are
successful received in BasicCAN Hardware Objects, are defined as Receive L-
-PDUs and thus needed from the corresponding ECU. CanIf optionally filters out
these L-PDUs and prohibits further software processing.
Certain software filter algorithms are provided to optimize software filter runtime. The
approach of software filter mechanisms is to find out the corresponding L-PDU from the
HRH and CanId currently being processed. After the L-PDU is found, CanIf accepts
the reception and enables upper layers to access L-SDU information directly.

7.20.1 Software filtering concept

The configuration tool handles the information about hardware acceptance filter set-
tings. The most important settings are the number of the L-PDU hardware objects
and their range. The outlet range defines, which Receive L-PDUs belongs to each
Hardware Receive Object. The following definitions are possible:
• a single Receive L-PDU (FullCAN reception),
• a list of Receive L-PDUs or
• one or multiple ranges of Receive L-PDUs can be linked to a Hardware Re-
ceive Object (BasicCAN reception).

60 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

For definition of range reception it is necessary to define at least one Rx L-PDU where
the CanId or the complete ID range is inside the defined range.
[SWS_CANIF_00645] dA range of CanIds which shall pass the software receive filter
shall either be defined by its upper limit (see CanIfHrhRangeRxPduUpperCanId)
and lower limit (see CanIfHrhRangeRxPduLowerCanId) CanId, or by a base ID
(see CanIfHrhRangeBaseId) and a mask that defines the relevant bits of the base
ID (see CanIfHrhRangeMask).c()
Note: Software receive filtering is optional (see multiplicity of 0..∗ in Can-
IfHrhRangeCfg).
[SWS_CANIF_00646] dEach configurable range of CanIds
(see [SWS_CANIF_00645]), which shall pass the software receive filter, shall
be configurable either for Standard CAN IDs or Extended CAN IDs via Can-
IfHrhRangeRxPduRangeCanIdType.c()
Receive L-PDUs are provided as constant structures statically generated from the
communication matrix. They are arranged according to the corresponding hardware
acceptance filter, so that there is one single list of receive CanIds for every Hardware
Receive Object (HRH). The corresponding list can be derived by the HRH, if multiple
BasicCAN objects are used. The subsequent filtering is the search through one list of
multiple CanIds by comparing them with the new received CanId. In case of a hit the
Receive L-PDU is derived from the found CanId.
[SWS_CANIF_00030] dIf the CanId of the received L-PDU in the HRH is configured to
be received, then CanIf shall accept this L-PDU and the software filtering algorithm
shall derive the corresponding Receive L-PDU from the found CanId.c(SRS_Can_-
01018)

Figure 7.9: Software filtering example

[SWS_CANIF_00852] dIf a range is (partly) contained in another range, or a single


CanId is contained in a range, the software filter shall select the L-PDU based on the
following assumptions:
• A single CanId is always more relevant than a range.
• A smaller range is more relevant than a larger range.
c()

61 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.20.2 Software filter algorithms

The choice of suitable software search algorithms it is up to the implementation of


CanIf. According to the wide range of possible receive BasicCAN operations provided
by the CAN Controller it is recommended to offer several search algorithms like
linear search, table search and/or hash search variants to provide the most optimal
solution for most use cases.

7.21 Data Length Check


The received Data Length value is compared with the configured Data Length value
of the received L-PDU. The configured Data Length value shall be derived from the
size of used bytes inside this L-PDU. The configured Data Length value may not be
necessarily that Data Length value defined in the CAN communication matrix and used
by the sender of this CAN L-PDU.
[SWS_CANIF_00026] dCanIf shall accept all received L-PDUs
(see [SWS_CANIF_00390]) with a Data Length value equal or greater then the
configured Data Length value (see CanIfRxPduDataLength).c(SRS_Can_01005)
[SWS_CANIF_00902] dThe Data Length Check shall be processed if it is enabled
globally (see CanIfPrivateDataLengthCheck) and not disabled individually per
PDU (see CanIfRxPduDataLengthCheck).c()
Hint: If the Data Length Check is disabled globally, it can’t be enabled individually per
PDU.
[SWS_CANIF_00168] dIf the Data Length Check rejects a received L-PDU
(see [SWS_CANIF_00026]), CanIf shall report runtime error code CANIF_E_IN-
VALID_DATA_LENGTH to the Det_ReportRuntimeError() service of the DET
module.c()
[SWS_CANIF_00829] dCanIf shall pass the received (see [SWS_CANIF_00006])
length value to the target upper layer module (see [SWS_CANIF_00135]), if the Data
Length Check is passed.c()
[SWS_CANIF_00830] dCanIf shall pass the received (see [SWS_CANIF_00006])
length value to the target upper layer module (see [SWS_CANIF_00135]), if the Data
Length Check is not configured (see CanIfPrivateDataLengthCheck and CanI-
fRxPduDataLengthCheck)c()

7.22 L-SDU dispatcher to upper layers


Rationale: At transmission side the L-SDU dispatcher has to find out the correspond-
ing Tx confirmation callback service of the target upper layer module. At reception side
each L-SDU belongs to one single upper layer module as destination. This relation is

62 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

assigned statically at configuration time. The task of the L-SDU dispatcher inside of
CanIf is to find out the customer for a received L-SDU and to dispatch the indica-
tions towards the found upper layer. These transmit confirmation as well as receive
indication notification services may exist several times with different names defined in
the notified upper layer modules. Those notification services are statically configured,
depending on the layers that have to be served.

7.23 Polling mode


The polling mode provides handling of transmit, receive and error events occurred
in the CAN hardware without the usage of hardware interrupts. Thus the CanIf and
the CanDrv provides notification services for detection and execution corresponding
hardware events. In polling mode the behavior of these CanIf notification services
does not change. By this way upper layer modules are abstracted from the strategy to
detect hardware events. If different CanDrvs are in use, the calling frequency has to
be harmonized during configuration setup and system integration.
These notification services are able to detect new events that occurred in the CAN
hardware objects since its last execution. The CanIf’s notification services for forward-
ing of detected events by the CanDrv are the same like for interrupt operation (see
section 8.4 “Callback notifications”).
The user has to consider, that the CanIf has to be able to perform notification ser-
vices triggered by interrupt on interrupt level as well as to perform invoked notification
services on task level. If any access to the CAN controller’s mailbox is blocked, subse-
quent transmit buffering takes place (refer section 7.11 “Transmit buffering”).
The Polling and Interrupt mode can be configured for each underlying CAN controller.

7.24 Multiple CAN Driver support


CanIf needs a specific mapping to cover multiple CanDrv to provide a common inter-
face to upper layers. Thus, CanIf must dispatch all actions up-down to the APIs of the
corresponding CanDrv and underlying CAN Controller(s). For the way down-up
CanIf has to provide adequate callback notifications to differentiate between multiple
CanDrvs.
Each CanDrv supports a certain number of underlying CAN Controllers and a fixed
number of HTHs/HRHs. Each CanDrv has an own numbering area, which starts always
at zero for CAN Controllers and HTHs. CanIf has to derive the corresponding
CanDrv from the L-SDU passed in the APIs. The parameters have to be translated
accordingly: i.e. L-SDU => HTH/HRH, CanId, Data Length."
The support for multiple CanDrvs can be enabled and disabled by the configuration
parameter CanIfPublicMultipleDrvSupport.

63 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.24.1 Transmit requests by using multiple CAN Drivers

Each Transmit L-PDU enables CanIf to derive the corresponding CAN Con-
troller and implicitly CanDrv serving the affected Hardware Unit. Resolving of
these dependencies is possible because of the construction of the CAN Controller
Handle: it combines CanDrv Handle and the corresponding CAN Controller in the
Hardware Unit.
At configuration time a CAN Controller Handle will be mapped to each CAN Con-
troller. The sequence diagram Figure 7.10 below demonstrates two transmit re-
quests directed to different CanDrvs. CanIf needs only to select the corresponding
CanDrv in order to call the correct API service.
Note: Figure 7.10 and the following table serve only as an example. Finally, it is up to
the implementation to access the correct APIs of underlying CanDrvs.
CanIf User «mod... Can_99_Ext1: «Peripheral» Can_99_Ext2: «Peripheral»
CanIf Can CanController A: Can CanController B:
CanController CanController

alt CAN Controller A/B

[CAN Controller A used]

CanIf_Transmit(Std_ReturnType, PduIdType, const PduInfoType*)

Can_Write(Std_ReturnType, Can_HwHandleType,
const Can_PduType*)
Copy L-PDU in CAN
Hardware A()

Copy L-PDU in CAN


Hardware A()

Can_Write()

CanIf_Transmit()

[CAN Controller B used]

CanIf_Transmit(Std_ReturnType, PduIdType, const PduInfoType*)

Can_Write(Std_ReturnType, Can_HwHandleType,
const Can_PduType*)
Copy L-PDU in CAN
Hardware B()

Copy L-PDU in CAN


Hardware B()
Can_Write()

CanIf_Transmit()

Figure 7.10: Transmission request with multiple CAN Drivers - simplified

Operations called Description


CanIf_Transmit Upper layer initiates a transmit request. The PduId is used for
(PduId_1, tracing the requested CAN Controller and then to serving the
PduInfoPtr_1) Hardware Unit.
The number of the Hardware Unit is relevant for the dispatch
as it is used as index for the array with pointer to functions. At first
the number of the PDU channel group will be extracted from the
PduId_1. Each PDU channel group refers to a CAN channel and
thus as well the Hardware Unit Number and the CAN Controller
Number.

64 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

The Hardware Unit Number points on an instance of CanDrv and


therefore refers all API services configured for the used
Hardware Unit(s). One of these services is the requested
transmit service.
Can_Write (Hth, Request for transmission to the corresponding CAN_Driver
PduInfoPtr) serving i.e. CAN Controller #0 within the "A" Hardware Unit.
Hardware request All L-PDU data will be set in the Hardware of i.e. CAN
Controller #0 within Hardware Unit "A" and the transmit
request enabled.
CanIf_Transmit Upper layer initiates Transmit Request. The PduId leads to
(PduId_2, another CAN Controller and then to another Hardware
PduInfoPtr_2) Unit.
The number of the Hardware Unit is relevant for the dispatch
as it is used as index for the array with pointer to functions. At first
the number of the PDU channel group will be extracted from the
PduId_2. Each PDU channel group refers to a CAN channel and
thus as well to the Hardware Unit Number and to the CAN
Controller Number.
The Hardware Unit Number points on an instance of CanDrv and
therefore refers all API services configured for the used
Hardware Unit(s). One of these services is the requested
transmit service.
Can_Write (Hth, Request for transmission to the corresponding CAN_Driver
PduInfoPtr_2) serving i.e. CAN Controller #1 within the "B" Hardware Unit.
Hardware request All L-PDU data will be set in the Hardware of i.e. CAN
Controller #1 within Hardware Unit "B" and the transmit
request enabled.

7.24.2 Notification mechanism using multiple CAN Drivers

Even if multiple CanDrvs are used in a single ECU Every notification callback service
invoked by CanDrvs at the CanIf exists only once. This means, that CanIf has to
identify calling CanDrv using the passed parameters. CanIf identifies the calling
CanDrv from the ControllerId within the Mailbox (Can_HwType) structure.

65 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CanIf User «module» Can_99_Ext1: Can_99_Ext2: «Peripheral»


CanIf Can Can CanController

Receive
Interrupt()

CanIf_RxIndication(const Can_HwType*,
const PduInfoType*)

Received L-PDU
validation check (SW
Filtering, Data Length
<User_RxIndication>(PduIdType, Check)
const PduInfoType*)

Copy
Data()

Copy
Data()

<User_RxIndication>()
CanIf_RxIndication()
Receive
Interrupt()

Receive
Interrupt()

CanIf_RxIndication(const Can_HwType*,
const PduInfoType*)

Received L-PDU validation check


(SW Filtering, Data Length Check)
<User_RxIndication>(PduIdType,
const PduInfoType*)
Copy
data()

Copy
data()

<User_RxIndication>()

CanIf_RxIndication()
Receive
Interrupt()

Figure 7.11: Receive interrupt with multiple CanDrvs - simplified

Operations called Description


Receive Interrupt CAN Controller 1 signals a successful reception and triggers a
receive interrupt. The ISR of CanDrv A is invoked.
CanIf_RxIndication The reception is indicated to CanIf by calling of
(Mailbox_1, CanIf_RxIndication(). The pointer Mailbox_1 identifies
PduInfoPtr_1) the HRH and its corresponding CAN Controller, which contains
the received L-PDU specified by PduInfoPtr_1.
Validation check (SW Filter- The Software Filtering checks, whether the Received L-PDU will
ing, Data Length Check) be processed on a local ECU. If not, the Received L-SDU is not
indicated to upper layers and further processing is suppressed.
If the L-PDU is found, the Data Length of the Received L-PDU
is compared with the expected, statically configured one for the
received L-PDU.
<User_RxIndication> The corresponding receive indication service of the upper layer is
(CanRxPduId_1, called. This signals a successful reception to the target upper
CanPduInfoPtr_1) layer. The parameter CanRxPduId_1 specifies the ID of the
received L-SDU. The second parameter is the reference on
PduInfoType which provides access to the buffer containing the
L-SDU.

66 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Receive Interrupt The CAN Controller 2 signals a successful reception and


triggers a receive interrupt. The ISR of CanDrv B is invoked.
CanIf_RxIndication The reception is indicated to CanIf by calling of
(Mailbox_2, CanIf_RxIndication(). The pointer Mailbox_2 identifies
PduInfoPtr_2) the HRH and its corresponding CAN Controller, which contains
the received L-PDU specified by PduInfoPtr_2.
Validation check (SW Filter- The Software Filtering checks, whether the Received L-PDU will
ing, Data Length Check) be processed on a local ECU. If not, the Received L-SDU is not
indicated to upper layers and further processing is suppressed.
If the L-PDU is found, the Data Length of the Received L-PDU
is compared with the expected, statically configured one for the
received L-PDU.
<User_RxIndication> The corresponding receive indication service of the upper layer is
(CanRxPduId_2, called. This signals a successful reception to the target upper
CanPduInfoPtr_2) layer. The parameter CanRxPduId_2 specifies the ID of the
received L-SDU. The second parameter is the reference on
PduInfoType which provides access to the buffer containing the
L-SDU.

7.25 Partial Networking


[SWS_CANIF_00747] dIf Partial Networking (PN) is enabled (see CanIfPublicPn-
Support), CanIf shall support a PnTxFilter per CAN Controller which overlays
the PDU channel modes.c()
[SWS_CANIF_00748] dThe PnTxFilter of [SWS_CANIF_00747] shall only have
an effect and transition its modes (enabled/disabled) if more than zero Tx L-PDUs
per CAN Controller are configured as CanIfTxPduPnFilterPdu (see CanIfTx-
PduPnFilterPdu).c()
[SWS_CANIF_00863] dPnTxFilter shall be enabled during initialization (ref. to
[SWS_CANIF_00747] and [SWS_CANIF_00748]).c()
[SWS_CANIF_00749] dIf CanIf_SetControllerMode(ControllerId, CAN_-
CS_SLEEP) is called the PnTxFilter of the corresponding CAN Controller shall
be enabled (ref. to [SWS_CANIF_00748] and [SWS_CANIF_00747]).c()
[SWS_CANIF_00750] dIf the PnTxFilter of a CAN Controller is enabled, CanIf
shall block all Tx requests to that CAN Controller (return E_NOT_OK when CanIf_-
Transmit() is called), except if the requested Tx L-PDUs is one of the configured
CanIfTxPduPnFilterPdus of that CAN Controller. These CanIfTxPduPnFil-
terPdus shall always be passed to the corresponding CAN Driver.c()
[SWS_CANIF_00751] dIf CanIf_TxConfirmation() is called, the corre-
sponding PnTxFilter shall be disabled (ref. to [SWS_CANIF_00747] and
[SWS_CANIF_00748]).c()

67 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00896] dIf CanIf_RxIndication() is called and PnTxFilter is en-


abled, the corresponding PnTxFilter shall be disabled (ref. to [SWS_CANIF_00747]
and [SWS_CANIF_00748]).c()
[SWS_CANIF_00752] dIf the PnTxFilter of a CAN Controller is disabled, CanIf
shall behave as requested via CanIf_SetPduMode() (see [SWS_CANIF_00008]).c
()
[SWS_CANIF_00878] dIf CanIf_SetPduMode(ControllerId, CANIF_TX_OF-
FLINE) is called and Partial Networking is enabled (ref. to CanIfPublicPnSup-
port) the PnTxFilter of the corresponding CAN Controller shall be enabled (ref.
to [SWS_CANIF_00748] and [SWS_CANIF_00747]).c()

7.26 CAN FD Support


For performance reasons some CAN Controllers allow to use a Flexible Data-Rate
feature called CAN FD (see [12, ISO 11898-1:2015]). Besides, the higher baud rate for
the payload CAN FD also supports an extended payload which allows the transmission
of up to 64 bytes. If these features are available depends on the general CAN FD
support by the CAN Controller and if the CAN Controller is in CAN FD mode
(valid CanControllerFdBaudrateConfig).
If an L-SDU shall be sent as CAN FD or conventional CAN 2.0 frame depends on
the configured CanIfTxPduCanIdType. CanIf indicates this to CanDrv utilizing
the second most significant bit of PduInfo->id (Can_IdType) passed while calling
Can_Write().
Note: If CanDrv is not in CAN FD mode (no CanControllerFdBaudrateConfig,
the L-PDU will be sent as conventional CAN 2.0 frame as long as the SduLength <=
8 bytes.
Note: The arbitration phase of conventional CAN 2.0 frames and CAN FD frames does
not differ if the same CanId is used. Therefore, even when using CAN FD frames each
CanId must not be used more than once.
Which kind of frame was received by CanDrv is also indicated utilizing the second most
significant bit of the Can_IdType passed with CanIf_RxIndication() (Mailbox-
->CanId). Based on this information CanIf decides how to map to the configured
L-SDU (CanIfRxPduCfg) as described in [SWS_CANIF_00877].
Note: If upper layers don’t care if a message was received by conventional CAN 2.0
frame or CAN FD frame, it is possible to use only one CanIfRxPduCfg for both types
(see CanIfRxPduCanIdType). This might allow local optimization. However, from a
system point of view, the format for each frame has to be configured. Otherwise the
sender wouldn’t know which kind of frame shall be transmitted.

68 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.27 Security Events


[SWS_CANIF_91010] Security events for CanIf d
Name Description ID
CANIF_SEV_TX_ERROR_DETECTED A transmission related error was detected. Depending on 19
the context data this could indicate suspicious CAN activity.
CANIF_SEV_RX_ERROR_DETECTED A reception related error was detected. Depending on the 20
context data this could indicate suspicious CAN activity.
CANIF_SEV_ERRORSTATE_PASSIVE The CAN controller transitioned to state passive. 21
CANIF_SEV_ERRORSTATE_BUSOFF The CAN controller transitioned to state busoff. 22

c(RS_Ids_00810)
[SWS_CANIF_00913] dIf security event reporting has been enabled for the CanIf
module (CanIfEnableSecurityEventReporting = true) the respective security
events shall bereported to the IdsM via the interfaces defined in AUTOSAR_SWS_-
BSWGeneral.c(RS_Ids_00810)
[SWS_CANIF_00915] dIf CanIf_ErrorNotification() is called by CanDrv, the
function shall evaluate whether a Tx related error was detected. If this is the case the
CanIfshall report the security event CANIF_SEV_TX_ERROR_DETECTED.
The context data is structured as follows:
Context Data (2 Byte)
• ControllerID (1 Byte)
• CanError (1 Byte)
– CAN_ERROR_BIT_MONITORING1 (0x1)
– CAN_ERROR_BIT_MONITORING0 (0x2)
– CAN_ERROR_BIT (0x3)
– CAN_ERROR_CHECK_ACK_FAILED (0x4)
– CAN_ERROR_ACK_DELIMITER (0x5)
– CAN_ERROR_ARBITRATION_LOST (0x6)
– CAN_ERROR_OVERLOAD (0x7)
c(RS_Ids_00810)
[SWS_CANIF_00916] dIf CanIf_ErrorNotification() is called by CanDrv, the
function shall evaluate whether a Rx related error was detected. If this is the case the
CanIf shall report the security event CANIF_SEV_RX_ERROR_DETECTED.
The context data is structured as follows:
Context Data (2 Byte)
• ControllerID (1 Byte)
• CanError (1 Byte)

69 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

– CAN_ERROR_CHECK_FORM_FAILED (0x8)
– CAN_ERROR_CHECK_STUFFING_FAILED (0x9)
– CAN_ERROR_CHECK_CRC_FAILED (0xA)
– CAN_ERROR_BUS_LOCK (0xB)
c(RS_Ids_00810)
[SWS_CANIF_00917] dIf CanIf_ControllerErrorStatePassive() is called by
CanDrv, the CanIf shall report the security event CANIF_SEV_ERRORSTATE_PAS-
SIVE in following cases:
• TxErrorCounter > 127 and TxErrorCounter <= 255
• RxErrorCounter > 127 and TxErrorCounter <= 255
The context data is structured as follows:
Context Data (2 Byte)
• ControllerID (1 Byte)
• ErrorCounterThreshold (1 Byte)
– TxErrorCounter > 127 AND RxErrorCounter > 127(0x0)
– TxErrorCounter > 127 AND RxErrorCounter < 127 (0x1)
– RxErrorCounter > 127 AND TxErrorCounter < 127 (0x2)
c(RS_Ids_00810)
[SWS_CANIF_00918] dIf CanIf_ControllerBusOff is called by CanDrv, the CanIf shall
report the security event CANIF_SEV_ERRORSTATE_BUSOFF. The context data is
structured as follows:
Context Data (1 Byte)
• Controller ID (1 Byte)
c(RS_Ids_00810)

7.28 Error classification

7.28.1 Development Errors

[SWS_CANIF_91006] d

70 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Type of error Related error code Error value


API service called with invalid CAN ID CANIF_E_PARAM_CANID 10
API service called with invalid hardware object CANIF_E_PARAM_HOH 12
API service called with invalid PDU ID CANIF_E_PARAM_LPDU 13
API service called with invalid controller ID CANIF_E_PARAM_CONTROLLERID 15
API service called with invalid wakeup source CANIF_E_PARAM_WAKEUPSOURCE 16
API service called with invalid transceiver ID CANIF_E_PARAM_TRCV 17
API service called with invalid transceiver mode CANIF_E_PARAM_TRCVMODE 18
API service called with invalid transceiver wakeup CANIF_E_PARAM_TRCVWAKEUPMODE 19
mode
API service called with invalid pointer CANIF_E_PARAM_POINTER 20
API service called with invalid controller mode CANIF_E_PARAM_CTRLMODE 21
API service called with invalid PDU mode CANIF_E_PARAM_PDU_MODE 22
API services called with invalid parameter CANIF_E_PARAM_CAN_ERROR 23
API service used without module initialization CANIF_E_UNINIT 30
Transmit PDU ID invalid CANIF_E_INVALID_TXPDUID 50
Receive PDU ID invalid CANIF_E_INVALID_RXPDUID 60
CAN Interface initialisation failed CANIF_E_INIT_FAILED 80

c()

7.28.2 Runtime Errors

[SWS_CANIF_91007] d
Type of error Related error code Error value
Failed Data Length Check CANIF_E_INVALID_DATA_LENGTH 61
Data Length CANIF_E_DATA_LENGTH_MISMATCH 62
Transmit requested on offline PDU channel CANIF_E_STOPPED 70
Message length was exceeding the maximum CANIF_E_TXPDU_LENGTH_EXCEEDED 90
length

c()

7.28.3 Transient Faults

There are no transient faults.

7.28.4 Production Errors

There are no production errors.

71 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

7.28.5 Extended Production Errors

There are no extended production errors.

72 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

8 API specification

8.1 Imported types


In this chapter all types included from the following modules are listed.
[SWS_CANIF_00142] d
Module Header File Imported Type

Can Can_GeneralTypes.h Can_ControllerStateType


Can_GeneralTypes.h Can_ErrorStateType
Can_GeneralTypes.h Can_ErrorType
Can_GeneralTypes.h Can_HwHandleType
Can_GeneralTypes.h Can_HwType
Can_GeneralTypes.h Can_IdType
Can_GeneralTypes.h Can_PduType
Can_GeneralTypes.h Can_TimeStampType (draft)
CanTrcv Can_GeneralTypes.h CanTrcv_TrcvModeType
Can_GeneralTypes.h CanTrcv_TrcvWakeupModeType
Can_GeneralTypes.h CanTrcv_TrcvWakeupReasonType
ComStack_Types ComStack_Types.h PduIdType
ComStack_Types.h PduInfoType
ComStack_Types.h PduLengthType
EcuM EcuM.h EcuM_WakeupSourceType
IdsM IdsM_Types.h IdsM_SecurityEventIdType
Std Std_Types.h Std_ReturnType
Std_Types.h Std_VersionInfoType

c(SRS_BSW_00348, SRS_BSW_00353, SRS_BSW_00361)

8.2 Type definitions

8.2.1 CanIf_ConfigType

[SWS_CANIF_00144] d
Name CanIf_ConfigType
Kind Structure
Elements implementation specific
Type –
Comment The contents of the initialization data structure are CAN interface
specific
5

73 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Description This type defines a data structure for the post build parameters of the CAN interface for all
underlying CAN drivers. At initialization the CanIf gets a pointer to a structure of this type to get
access to its configuration data, which is necessary for initialization.
Available via CanIf.h

c()
[SWS_CANIF_00523] dThe initialization data structure for a specific CanIf_Config-
Type shall include the definition of CanIf public parameters and the definition for each
L-PDU/L-SDU.c()
Note: The definition of CanIf public parameters and the definition for each L-PDU/
L-SDU are specified in chapter 10.

8.2.2 CanIf_PduModeType

[SWS_CANIF_00137] d
Name CanIf_PduModeType
Kind Enumeration
Range CANIF_OFFLINE 0x00 = 0 Transmit and receive path of the
corresponding channel are disabled => no
communication mode
CANIF_TX_OFFLINE 0x01 Transmit path of the corresponding channel is
disabled. The receive path is enabled.
CANIF_TX_OFFLINE_ 0x02 Transmit path of the corresponding channel is
ACTIVE in offline active mode (see SWS_
CANIF_00072). The receive path is enabled.
This mode requires CanIfTxOfflineActive
Support = TRUE.
CANIF_ONLINE 0x03 Transmit and receive path of the
corresponding channel are enabled => full
operation mode
Description The PduMode of a channel defines its transmit or receive activity. Communication direction
(transmission and/or reception) of the channel can be controlled separately or together by upper
layers.
Available via CanIf.h

c()

8.2.3 CanIf_NotifStatusType

[SWS_CANIF_00201] d
Name CanIf_NotifStatusType
Kind Enumeration
5

74 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Range CANIF_TX_RX_ – The requested Rx/Tx CAN L-PDU was
NOTIFICATION successfully transmitted or received.
CANIF_NO_NOTIFICATION 0x00 No transmit or receive event occurred for the
requested L-PDU.
Description Return value of CAN L-PDU notification status.
Available via CanIf.h

c()

8.3 Function definitions


[SWS_CANIF_00661] dAll CanIf API services other than CanIf_Init() and
CanIf_GetVersionInfo() shall not execute their normal operation and return E_-
NOT_OK unless the CanIf has been initialized with a preceding call of CanIf_Init
().c()

8.3.1 CanIf_Init

[SWS_CANIF_00001] d
Service Name CanIf_Init
Syntax void CanIf_Init (
const CanIf_ConfigType* ConfigPtr
)

Service ID [hex] 0x01


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) ConfigPtr Pointer to configuration parameter set, used e.g. for post build
parameters
Parameters (inout) None
Parameters (out) None
Return value None
Description This service Initializes internal and external interfaces of the CAN Interface for the further
processing.
Available via CanIf.h

c(SRS_BSW_00405, SRS_BSW_00101, SRS_BSW_00358, SRS_BSW_00414,


SRS_Can_01021, SRS_Can_01022)
Note: All underlying CAN controllers and transceivers still remain not operational.
Note: The service CanIf_Init() is called only by the EcuM.
[SWS_CANIF_00085] dThe service CanIf_Init() shall initialize the global variables
and data structures of the CanIf including flags and buffers.c()

75 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

8.3.2 CanIf_DeInit

[SWS_CANIF_91002] d
Service Name CanIf_DeInit
Syntax void CanIf_DeInit (
void
)

Service ID [hex] 0x02


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) None
Return value None
Description De-initializes the CanIf module.
Available via CanIf.h

c(SRS_Can_01168, SRS_BSW_00336)
Note: General behavior and constraints on de-initialization functions are specified by
[SWS_BSW_00152], [SWS_BSW_00072], [SWS_BSW_00232], [SWS_BSW_00233].
Caveat: Caller of the CanIf_DeInit() function has to be sure there are no on-going
transmissions/receptions, nor any pending transmission confirmations.

8.3.3 CanIf_SetControllerMode

[SWS_CANIF_00003] d
Service Name CanIf_SetControllerMode
Syntax Std_ReturnType CanIf_SetControllerMode (
uint8 ControllerId,
Can_ControllerStateType ControllerMode
)

Service ID [hex] 0x03


Sync/Async Asynchronous
Reentrancy Reentrant (Not for the same controller)
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller, which is requested for mode transition.
ControllerMode Requested mode transition
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: Controller mode request has been accepted
E_NOT_OK: Controller mode request has not been accepted
Description This service calls the corresponding CAN Driver service for changing of the CAN controller
mode.
5

76 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Available via CanIf.h

c(SRS_Can_01027)
Note: The service CanIf_SetControllerMode() initiates a transition to the re-
quested CAN controller mode ControllerMode of the CAN controller which is as-
signed by parameter ControllerId.
[SWS_CANIF_00308] dThe service CanIf_SetControllerMode() shall call
Can_SetControllerMode(Controller, Transition) for the requested CAN
controller.c()
[SWS_CANIF_00311] dIf parameter ControllerId of CanIf_SetController-
Mode() has an invalid value, the CanIf shall report development error code CANIF_-
E_PARAM_CONTROLLERID to the Det_ReportError service of the DET module,
when CanIf_SetControllerMode() is called.c(SRS_BSW_00323)
[SWS_CANIF_00774] dIf parameter ControllerMode of CanIf_SetController-
Mode() has an invalid value (not CAN_CS_STARTED, CAN_CS_SLEEP or CAN_CS_-
STOPPED), the CanIfshall report development error code CANIF_E_PARAM_CTRLMODE
to the Det_ReportError service of the DET module, when CanIf_SetCon-
trollerMode() is called.c(SRS_BSW_00323)
Note: The ID of the CAN controller is published inside the configuration description of
the CanIf.

8.3.4 CanIf_GetControllerMode

[SWS_CANIF_00229] d
Service Name CanIf_GetControllerMode
Syntax Std_ReturnType CanIf_GetControllerMode (
uint8 ControllerId,
Can_ControllerStateType* ControllerModePtr
)

Service ID [hex] 0x04


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller, which is requested for current operation mode.
Parameters (inout) None
Parameters (out) ControllerModePtr Pointer to a memory location, where the current mode of the CAN
controller will be stored.
Return value Std_ReturnType E_OK: Controller mode request has been accepted.
E_NOT_OK: Controller mode request has not been accepted.
Description This service calls the corresponding CAN Driver service for obtaining the current status of the
CAN controller.
5

77 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Available via CanIf.h

c(SRS_Can_01028)
[SWS_CANIF_00313] dIf parameter ControllerId of CanIf_GetController-
Mode() has an invalid, the CanIf shall report development error code CANIF_-
E_PARAM_CONTROLLERID to the Det_ReportError service of the DET, when
CanIf_GetControllerMode() is called.c(SRS_BSW_00323)
[SWS_CANIF_00656] dIf parameter ControllerModePtr of CanIf_GetCon-
trollerMode() has an invalid value, the CanIf shall report development error code
CANIF_E_PARAM_POINTER to the Det_ReportError service of the DET, when
CanIf_GetControllerMode() is called.c(SRS_BSW_00323)
Note: The ID of the CAN controller module is published inside the configuration de-
scription of the CanIf.

8.3.5 CanIf_GetControllerErrorState

[SWS_CANIF_91001] d
Service Name CanIf_GetControllerErrorState
Syntax Std_ReturnType CanIf_GetControllerErrorState (
uint8 ControllerId,
Can_ErrorStateType* ErrorStatePtr
)

Service ID [hex] 0x4b


Sync/Async Synchronous
Reentrancy Non Reentrant for the same ControllerId
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller, which is requested for ErrorState.
Parameters (inout) None
Parameters (out) ErrorStatePtr Pointer to a memory location, where the error state of the CAN
controller will be stored.
Return value Std_ReturnType E_OK: Error state request has been accepted.
E_NOT_OK: Error state request has not been accepted.
Description This service calls the corresponding CAN Driver service for obtaining the error state of the CAN
controller.
Available via CanIf.h

c(SRS_Can_01169)
[SWS_CANIF_00898] dIf parameter ControllerId of CanIf_GetCon-
trollerErrorState() has an invalid value, the CanIf shall report develop-
ment error code CANIF_E_PARAM_CONTROLLERID to the Det_ReportError
service of the DET, when CanIf_GetControllerErrorState() is called.c
(SRS_BSW_00323)

78 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00899] dIf parameter ErrorStatePtr of CanIf_GetCon-


trollerErrorState() is a null pointer, the CanIf shall report development
error code CANIF_E_PARAM_POINTER to the Det_ReportError service of the
DET, when CanIf_GetControllerErrorState() is called.c(SRS_BSW_00323)

8.3.6 CanIf_Transmit

[SWS_CANIF_00005] d
Service Name CanIf_Transmit
Syntax Std_ReturnType CanIf_Transmit (
PduIdType TxPduId,
const PduInfoType* PduInfoPtr
)

Service ID [hex] 0x49


Sync/Async Synchronous
Reentrancy Reentrant for different PduIds. Non reentrant for the same PduId.
Parameters (in) TxPduId Identifier of the PDU to be transmitted
PduInfoPtr Length of and pointer to the PDU data and pointer to MetaData.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: Transmit request has been accepted.
E_NOT_OK: Transmit request has not been accepted.
Description Requests transmission of a PDU.
Available via CanIf.h

c(SRS_Can_01008)
Note: The corresponding CAN Controller and HTH have to be resolved by the Tx-
PduId.
[SWS_CANIF_00317] dThe service CanIf_Transmit() shall not accept a transmit
request, if the controller mode referenced by ControllerId is different to CAN_CS_-
STARTED and the channel mode at least for the transmit path is not online or offline
active.c()
[SWS_CANIF_00318] dCanIf_Transmit() shall call Can_Write() with the hard-
ware transmit handle corresponding to the provided TxPduId and a Can_PduType
structure where:
• swPduHandle is set to the CanTxPduId used in the corresponding CanIf_-
TxConfirmation() call
• length is set to the value provided as PduInfoPtr->SduLength, possibly
reduced according to [SWS_CANIF_00894]
• id is set to the CAN ID associated with the TxPduId
• sdu is set to the pointer provided as PduInfoPtr->SduDataPtr

79 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

c()
Note: PduInfoPtr is a pointer to a L-SDU user memory, CAN Identifier, L-SDU han-
dle and Data Length (see [1, Specification of CAN Driver]).
[SWS_CANIF_00243] dCanIf shall set the two most significant bits (’IDentifier Ex-
tension flag’ (see [12, ISO 11898-1:2015]) and ’CAN FD flag’) of the CanId (
PduInfoPtr->id) before CanIf passes the predefined CanId to CanDrv at call
of Can_Write() (see [1, Specification of CAN Driver], definition of Can_IdType
[SWS_Can_00416]). The CanId format type of each CAN L-PDU can be configured
by CanIfTxPduCanIdType, refer to CanIfTxPduCanIdType.c(SRS_Can_01141)
[SWS_CANIF_00882] dCanIf_Transmit() shall accept a NULL pointer as PduIn-
foPtr->SduDataPtr, if the PDU is configured for triggered transmission: CanIfTx-
PduTriggerTransmit = TRUE.c()
[SWS_CANIF_00162] dIf the call of Can_Write() returns E_OK the transmit request
service CanIf_Transmit() shall return E_OK.c()
Note: If the call of Can_Write() returns E_NOT_OK, then the transmit request service
CanIf_Transmit() shall return E_NOT_OK. If the transmit request service CanIf_-
Transmit() returns E_NOT_OK, then the upper layer module is responsible to repeat
the transmit request.
[SWS_CANIF_00319] dIf parameter TxPduId of CanIf_Transmit() has an invalid
value, CanIf shall report development error code CANIF_E_INVALID_TXPDUID to
the Det_ReportError service of the DET, when CanIf_Transmit() is called.c
(SRS_BSW_00323)
[SWS_CANIF_00320] dIf parameter PduInfoPtr of CanIf_Transmit() has an in-
valid value, CanIf shall report development error code CANIF_E_PARAM_POINTER to
the Det_ReportError service of the DET module, when CanIf_Transmit() is
called.c(SRS_BSW_00323)
[SWS_CANIF_00893] dWhen CanIf_Transmit() is called with PduInfoPtr->Sd-
uLength exceeding the maximum length of the PDU referenced by TxPduId:
• SduLength > 8 if the Can_IdType indicates a classic CAN frame
• SduLength > 64 if the Can_IdType indicates a CAN FD frame
CanIf shall report runtime error code CANIF_E_DATA_LENGTH_MISMATCH to the
Det_ReportRuntimeError() service of the DET.c()
Note: Besides static configured transmissions there are dynamic transmissions, too.
Therefore, the valid data length is always passed by PduInfoPtr->SduLength.
Furthermore, even the frame type might change via CanIf_SetDynamicTxId().
[SWS_CANIF_00893] ensures that not matching transmit requests can be detected
via DET.

80 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00894] dWhen CanIf_Transmit() is called with PduInfoPtr->Sd-


uLength exceeding the length of the global PDU (see [ECUC_EcuC_00078]) refer-
enced by TxPduId and CanIfTxPduTruncation is enabled, CanIf shall transmit
data up to the length of the global PDU (see [ECUC_EcuC_00078]) and discard the
rest.c()
[SWS_CANIF_00900] dWhen CanIf_Transmit() is called with PduInfoPtr->Sd-
uLength exceeding the length of the global PDU (see [ECUC_EcuC_00078]) refer-
enced by TxPduId and CanIfTxPduTruncation is disabled, CanIf shall report
the runtime error CANIF_E_TXPDU_LENGTH_EXCEEDED and return E_NOT_OK with-
out further actions.c()
Note: During the call of CanIf_Transmit() the buffer of PduInfoPtr is controlled
by CanIf and this buffer should not be accessed for read/write from another call con-
text. After return of this call the ownership changes to the upper layer.

8.3.7 CanIf_ReadRxPduData

[SWS_CANIF_00194] d
Service Name CanIf_ReadRxPduData
Syntax Std_ReturnType CanIf_ReadRxPduData (
PduIdType CanIfRxSduId,
PduInfoType* CanIfRxInfoPtr
)

Service ID [hex] 0x06


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) CanIfRxSduId Receive L-SDU handle specifying the corresponding CAN L-SDU
ID and implicitly the CAN Driver instance as well as the
corresponding CAN controller device.
Parameters (inout) None
Parameters (out) CanIfRxInfoPtr Contains the length (SduLength) of the received PDU, a pointer
to a buffer (SduDataPtr) containing the PDU, and the MetaData
related to this PDU.
Return value Std_ReturnType E_OK: Request for L-SDU data has been accepted
E_NOT_OK: No valid data has been received
Description This service provides the Data Length and the received data of the requested CanIfRxSduId to
the calling upper layer.
Available via CanIf.h

c(SRS_Can_01125, SRS_Can_01129)
[SWS_CANIF_00324] dThe function CanIf_ReadRxPduData() shall not accept a
request and return E_NOT_OK, if the corresponding controller mode refrenced by Con-
trollerId is different to CAN_CS_STARTED and the channel mode is in the receive
path online.c()

81 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00325] dIf parameter CanIfRxSduId of CanIf_ReadRxPduData()


has an invalid value, e.g. not configured to be stored within CanIf via CanIfRxP-
duReadData, CanIf shall report development error code CANIF_E_INVALID_RX-
PDUID to the Det_ReportError service of the DET, when CanIf_ReadRxPdu-
Data() is called.c(SRS_BSW_00323)
[SWS_CANIF_00326] dIf parameter CanIfRxInfoPtr of CanIf_ReadRxPduData
() has an invalid value, CanIf shall report development error code CANIF_E_-
PARAM_POINTER to the Det_ReportError service of the DET module, when
CanIf_ReadRxPduData() is called.c(SRS_BSW_00323)
[SWS_CANIF_00329] dCanIf_ReadRxPduData() shall not be used for CanIfRxS-
duId, which are defined to receive multiple CAN-Ids (range reception).c()
Note: During the call of CanIf_ReadRxPduData() the buffer of CanIfRxInfoPtr is
controlled by CanIf and this buffer should not be accessed for read/write from another
call context. After return of this call the ownership changes to the upper layer.
[SWS_CANIF_00330] dConfiguration of CanIf_ReadRxPduData(): This API can be
enabled or disabled at pre-compile time configuration by the configuration parameter
CanIfPublicReadRxPduDataApi.c()

8.3.8 CanIf_ReadTxNotifStatus

[SWS_CANIF_00202] d
Service Name CanIf_ReadTxNotifStatus
Syntax CanIf_NotifStatusType CanIf_ReadTxNotifStatus (
PduIdType CanIfTxSduId
)

Service ID [hex] 0x07


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) CanIfTxSduId L-SDU handle to be transmitted. This handle specifies the
corresponding CAN L-SDU ID and implicitly the CAN Driver
instance as well as the corresponding CAN controller device.
Parameters (inout) None
Parameters (out) None
Return value CanIf_NotifStatusType Current confirmation status of the corresponding CAN Tx L-PDU.
Description This service returns the confirmation status (confirmation occurred or not) of a specific static or
dynamic CAN Tx L-PDU, requested by the CanIfTxSduId.
Available via CanIf.h

c(SRS_Can_01130)
Note: This function notifies the upper layer about any transmit confirmation event to
the corresponding requested L-SDU.

82 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00393] dIf configuration parameters CanIfPublicReadTxPduNoti-


fyStatusApi and CanIfTxPduReadNotifyStatus for the transmitted L-SDU are
set to TRUE, and if CanIf_ReadTxNotifStatus() is called, the CanIf shall reset
the notification status for the transmitted L-SDU.c()
[SWS_CANIF_00331] dIf parameter CanIfTxSduId of CanIf_ReadTxNotifSta-
tus() is out of range or if no status information was configured for this CAN Tx
L-SDU, CanIf shall report development error code CANIF_E_INVALID_TXPDUID to
the Det_ReportError service of the DET when CanIf_ReadTxNotifStatus
() is called.c(SRS_BSW_00323)
[SWS_CANIF_00335] dConfiguration of CanIf_ReadTxNotifyStatus(): This API
can be enabled or disabled at pre-compile time configuration globally by the parameter
CanIfPublicReadTxPduNotifyStatusApi.c()

8.3.9 CanIf_ReadRxNotifStatus

[SWS_CANIF_00230] d
Service Name CanIf_ReadRxNotifStatus
Syntax CanIf_NotifStatusType CanIf_ReadRxNotifStatus (
PduIdType CanIfRxSduId
)

Service ID [hex] 0x08


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) CanIfRxSduId Receive L-SDU handle specifying the corresponding CAN L-SDU
ID and implicitly the CAN Driver instance as well as the
corresponding CAN controller device.
Parameters (inout) None
Parameters (out) None
Return value CanIf_NotifStatusType Current indication status of the corresponding CAN Rx L-PDU.
Description This service returns the indication status (indication occurred or not) of a specific CAN Rx
L-PDU, requested by the CanIfRxSduId.
Available via CanIf.h

c(SRS_Can_01130, SRS_Can_01131)
Note: This function notifies the upper layer about any receive indication event to the
corresponding requested L-SDU.
[SWS_CANIF_00394] dIf configuration parameters CanIfPublicReadRxPduNoti-
fyStatusApi and CanIfRxPduReadNotifyStatus are set to TRUE, and if
CanIf_ReadRxNotifStatus() is called, then CanIf shall reset the notification sta-
tus for the received L-SDU.c()
[SWS_CANIF_00336] dIf parameter CanIfRxSduId of CanIf_ReadRxNotifSta-
tus() is out of range or if status for CanRxPduId was requested whereas CanIfRx-
PduReadData is disabled or if no status information was configured for this CAN Rx

83 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

L-SDU, CanIf shall report development error code CANIF_E_INVALID_RXPDUID to


the Det_ReportError service of the DET, when CanIf_ReadRxNotifStatus
() is called.c(SRS_BSW_00323)
Note: The function CanIf_ReadRxNotifStatus() must not be used for CanI-
fRxSduIds, which are defined to receive multiple CAN-Ids (range reception).
[SWS_CANIF_00340] dConfiguration of CanIf_ReadRxNotifStatus(): This API
can be enabled or disabled at pre-compile time configuration globally by the parameter
CanIfPublicReadRxPduNotifyStatusApi.c()

8.3.10 CanIf_SetPduMode

[SWS_CANIF_00008] d
Service Name CanIf_SetPduMode
Syntax Std_ReturnType CanIf_SetPduMode (
uint8 ControllerId,
CanIf_PduModeType PduModeRequest
)

Service ID [hex] 0x09


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) ControllerId All PDUs of the own ECU connected to the corresponding CanIf
ControllerId, which is assigned to a physical CAN controller are
addressed.
PduModeRequest Requested PDU mode change
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: Request for mode transition has been accepted.
E_NOT_OK: Request for mode transition has not been accepted.
Description This service sets the requested mode at the L-PDUs of a predefined logical PDU channel.
Available via CanIf.h

c()
Note: The channel parameter denoting the predefined logical PDU channel can be
derived from parameter ControllerId of function CanIf_SetPduMode().
[SWS_CANIF_00341] dIf CanIf_SetPduMode() is called with invalid Control-
lerId, CanIf shall report development error code CANIF_E_PARAM_CONTROL-
LERID to the Det_ReportError service of the DET module.c(SRS_BSW_00323)
[SWS_CANIF_00860] dIf CanIf_SetPduMode() is called with invalid PduMod-
eRequest, CanIf shall report development error code CANIF_E_PARAM_PDU_MODE
to the Det_ReportError service of the DET module.c(SRS_BSW_00323)

84 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00874] dThe service CanIf_SetPduMode() shall not accept any re-


quest and shall return E_NOT_OK, if the controller mode referenced by ControllerId
is not in state CAN_CS_STARTED.c()

8.3.11 CanIf_GetPduMode

[SWS_CANIF_00009] d
Service Name CanIf_GetPduMode
Syntax Std_ReturnType CanIf_GetPduMode (
uint8 ControllerId,
CanIf_PduModeType* PduModePtr
)

Service ID [hex] 0x0a


Sync/Async Synchronous
Reentrancy Reentrant (Not for the same channel)
Parameters (in) ControllerId All PDUs of the own ECU connected to the corresponding CanIf
ControllerId, which is assigned to a physical CAN controller are
addressed.
Parameters (inout) None
Parameters (out) PduModePtr Pointer to a memory location, where the current mode of the
logical PDU channel will be stored.
Return value Std_ReturnType E_OK: PDU mode request has been accepted
E_NOT_OK: PDU mode request has not been accepted
Description This service reports the current mode of a requested PDU channel.
Available via CanIf.h

c()
[SWS_CANIF_00346] dIf CanIf_GetPduMode() is called with invalid Control-
lerId, CanIf shall report development error code CANIF_E_PARAM_CONTROL-
LERID to the Det_ReportError service of the DET module.c(SRS_BSW_00323)
[SWS_CANIF_00657] dIf CanIf_GetPduMode() is called with invalid PduModePtr,
CanIf shall report development error code CANIF_E_PARAM_POINTER to the Det_-
ReportError service of the DET module.c(SRS_BSW_00323)

8.3.12 CanIf_GetVersionInfo

[SWS_CANIF_00158] d
Service Name CanIf_GetVersionInfo
Syntax void CanIf_GetVersionInfo (
Std_VersionInfoType* VersionInfo
)
5

85 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Service ID [hex] 0x0b
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) VersionInfo Pointer to where to store the version information of this module.
Return value None
Description This service returns the version information of the called CAN Interface module.
Available via CanIf.h

c(SRS_BSW_00407, SRS_BSW_00411)

8.3.13 CanIf_SetDynamicTxId

[SWS_CANIF_00189] d
Service Name CanIf_SetDynamicTxId
Syntax void CanIf_SetDynamicTxId (
PduIdType CanIfTxSduId,
Can_IdType CanId
)

Service ID [hex] 0x0c


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) CanIfTxSduId L-SDU handle to be transmitted. This handle specifies the
corresponding CAN L-SDU ID and implicitly the CAN Driver
instance as well as the corresponding CAN controller device.
CanId Standard/Extended CAN ID of CAN L-SDU that shall be
transmitted as FD or conventional CAN frame.
Parameters (inout) None
Parameters (out) None
Return value None
Description This service reconfigures the corresponding CAN identifier of the requested CAN L-PDU.
Available via CanIf.h

c()
Note: CanIf_SetDynamicTxId() may be interrupted by CanIf_Transmit()
called by several modules in the communication stack. Therefore precautions for
preventing inconsistency need to be considered.
[SWS_CANIF_00352] dIf parameter CanIfTxSduId of CanIf_SetDynamicTxId
() has an invalid value, CanIf shall report development error code CANIF_E_IN-
VALID_TXPDUID to the Det_ReportError service of the DET module, when
CanIf_SetDynamicTxId() is called.c(SRS_BSW_00323)

86 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00353] dIf parameter CanId of CanIf_SetDynamicTxId() has an


invalid value, CanIf shall report development error code CANIF_E_PARAM_CANID to
the Det_ReportError service of the DET module, when CanIf_SetDynamic-
TxId() is called.c(SRS_BSW_00323)
[SWS_CANIF_00355] dIf CanIf was not initialized before calling CanIf_SetDynam-
icTxId(), then the function CanIf_SetDynamicTxId() shall not execute a recon-
figuration of Tx CanId.c()
[SWS_CANIF_00357] dConfiguration of CanIf_SetDynamicTxId(): This function
shall be pre compile time configurable On/Off by the configuration parameter CanIf-
PublicSetDynamicTxIdApi.c()

8.3.14 CanIf_SetTrcvMode

[SWS_CANIF_00287] d
Service Name CanIf_SetTrcvMode
Syntax Std_ReturnType CanIf_SetTrcvMode (
uint8 TransceiverId,
CanTrcv_TrcvModeType TransceiverMode
)

Service ID [hex] 0x0d


Sync/Async Asynchronous
Reentrancy Non Reentrant
Parameters (in) TransceiverId Abstracted CanIf TransceiverId, which is assigned to a CAN
transceiver, which is requested for mode transition
TransceiverMode Requested mode transition
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: Transceiver mode request has been accepted.
E_NOT_OK: Transceiver mode request has not been accepted.
Description This service changes the operation mode of the tansceiver TransceiverId, via calling the
corresponding CAN Transceiver Driver service.
Available via CanIf.h

c()
Note: For more details, please refer to the [2, Specification of CAN Transceiver Driver].
[SWS_CANIF_00358] dThe function CanIf_SetTrcvMode() shall call the function
CanTrcv_SetOpMode(Transceiver, OpMode) on the corresponding requested
CAN Transceiver Driver module.c()
Note: The parameters of the service CanTrcv_SetOpMode() are of type:
• OpMode: CanTrcv_TrcvModeType(desired operation mode)
• Transceiver: uint8 (Transceiver to which function call has to be applied)

87 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

(see [2, Specification of CAN Transceiver Driver])


[SWS_CANIF_00538] dIf parameter TransceiverId of CanIf_SetTrcvMode()
has an invalid value, the CanIf shall report development error code CANIF_E_PARAM_-
TRCV to the Det_ReportError service of the DET, when CanIf_SetTrcvMode
() is called.c(SRS_BSW_00323)
Note: The mode of a transceiver can only be changed to CANTRCV_TRCVMODE_-
STANDBY, when the former mode of the transceiver has been CANTRCV_TRCVMODE_-
NORMAL (see [2]). But this is not checked by the CanIf.
Note: The mode of a transceiver can only be changed to CANTRCV_TRCVMODE_-
SLEEP, when the former mode of the transceiver has been CANTRCV_TRCVMODE_-
STANDBY (see [2]). But this is not checked by the CanIf.
[SWS_CANIF_00648] dIf parameter TransceiverMode of CanIf_SetTrcvMode()
has an invalid value (not CANTRCV_TRCVMODE_STANDBY, CANTRCV_TRCVMODE_-
SLEEP or CANTRCV_TRCVMODE_NORMAL), the CanIf shall report development error
code CANIF_E_PARAM_TRCVMODE to the Det_ReportError service of the DET
module, when CanIf_SetTrcvMode() is called.c(SRS_BSW_00323)
Note: The function CanIf_SetTrcvMode() should be applicable to all CAN
transceivers with all values of TransceiverMode independent, if the transceiver hard-
ware supports these modes or not. This is to ease up the view of the CanIf to the
assigned physical CAN channel.
[SWS_CANIF_00362] dConfiguration of CanIf_SetTrcvMode(): The number of
supported transceiver types for each network is set up in the configuration phase (see
CanIfTrcvCfg and CanIfTrcvDrvCfg). If no transceiver is used, this function may
be omitted. Therefore, if no transceiver is configured in LT or PB class the API shall
return with E_NOT_OK.c()

8.3.15 CanIf_GetTrcvMode

[SWS_CANIF_00288] d
Service Name CanIf_GetTrcvMode
Syntax Std_ReturnType CanIf_GetTrcvMode (
uint8 TransceiverId,
CanTrcv_TrcvModeType* TransceiverModePtr
)

Service ID [hex] 0x0e


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) TransceiverId Abstracted CanIf TransceiverId, which is assigned to a CAN
transceiver, which is requested for current operation mode.
Parameters (inout) None
5

88 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Parameters (out) TransceiverModePtr Requested mode of requested network the Transceiver is
connected to.
Return value Std_ReturnType E_OK: Transceiver mode request has been accepted.
E_NOT_OK: Transceiver mode request has not been accepted.
Description This function invokes CanTrcv_GetOpMode and updates the parameter TransceiverModePtr
with the value OpMode provided by CanTrcv.
Available via CanIf.h

c()
Note: For more details, please refer to the [2, Specification of CAN Transceiver Driver].
[SWS_CANIF_00363] dThe function CanIf_GetTrcvMode() shall call the function
CanTrcv_GetOpMode(Transceiver, OpMode) on the corresponding requested
CAN Transceiver Driver module.c()
Note: The parameters of the function CanTrcv_GetOpMode are of type:
• OpMode: CanTrcv_TrcvModeType (desired operation mode)
• Transceiver: uint8 (Transceiver to which API call has to be applied)
(see [2, Specification of CAN Transceiver Driver])
[SWS_CANIF_00364] dIf parameter TransceiverId of CanIf_GetTrcvMode()
has an invalid value, the CanIf shall report development error code CANIF_E_PARAM_-
TRCV to the Det_ReportError service of the DET module, when CanIf_GetTr-
cvMode() is called.c(SRS_BSW_00323)
[SWS_CANIF_00650] dIf parameter TransceiverModePtr of CanIf_GetTrcv-
Mode() has an invalid value, the CanIf shall report development error code CANIF_-
E_PARAM_POINTER to the Det_ReportError service of the DET module, when
CanIf_GetTrcvMode() was called.c(SRS_BSW_00323)
[SWS_CANIF_00367] dConfiguration of CanIf_GetTrcvMode(): The number of
supported transceiver types for each network is set up in the configuration phase (see
CanIfTrcvCfg and CanIfTrcvDrvCfg). If no transceiver is used, this function may
be omitted. Therefore, if no transceiver is configured in LT or PB class the API shall
return with E_NOT_OK.c()

8.3.16 CanIf_GetTrcvWakeupReason

[SWS_CANIF_00289] d
Service Name CanIf_GetTrcvWakeupReason
5

89 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Syntax Std_ReturnType CanIf_GetTrcvWakeupReason (
uint8 TransceiverId,
CanTrcv_TrcvWakeupReasonType* TrcvWuReasonPtr
)

Service ID [hex] 0x0f


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) TransceiverId Abstracted CanIf TransceiverId, which is assigned to a CAN
transceiver, which is requested for wake up reason.
Parameters (inout) None
Parameters (out) TrcvWuReasonPtr provided pointer to where the requested transceiver wake up
reason shall be returned
Return value Std_ReturnType E_OK: Transceiver wake up reason request has been accepted.
E_NOT_OK: Transceiver wake up reason request has not been
accepted.
Description This service returns the reason for the wake up of the transceiver TransceiverId, via calling the
corresponding CAN Transceiver Driver service.
Available via CanIf.h

c()
Note: The ability to detect and differentiate the possible wake up reasons depends
strongly on the CAN transceiver hardware. For more details, please refer to the [2,
Specification of CAN Transceiver Driver].
[SWS_CANIF_00368] dThe function CanIf_GetTrcvWakeupReason() shall call
CanTrcv_GetBusWuReason(Transceiver, Reason) on the corresponding re-
quested CanTrcv.c()
Note: The parameters of the function CanTrcv_GetBusWuReason() are of type:
• Reason: CanTrcv_TrcvWakeupReasonType
• Transceiver: uint8 (Transceiver to which API call has to be applied)
(see [2, Specification of CAN Transceiver Driver])
[SWS_CANIF_00537] dIf parameter TransceiverId of CanIf_GetTrcvWake-
upReason() has an invalid value, the CanIf shall report development error code
CANIF_E_PARAM_TRCV to the Det_ReportError service of the DET module,
when CanIf_GetTrcvWakeupReason() is called.c(SRS_BSW_00323)
[SWS_CANIF_00649] dIf parameter TrcvWuReasonPtr of CanIf_GetTrcvWake-
upReason() has an invalid value, the CanIf shall report development error code
CANIF_E_PARAM_POINTER to the Det_ReportError service of the DET mod-
ule, when CanIf_GetTrcvWakeupReason() is called.c(SRS_BSW_00323)
Note: Please be aware, that if more than one network is available, each network may
report a different wake-up reason. E.g. if an ECU uses CAN, a wake-up by CAN may
occur and the incoming data may cause an internal wake-up for another CAN network.

90 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

The service CanIf_GetTrcvWakeupReason() has a "per network" view and does


not vote the more important reason or sequence internally. The same may be true if
e.g. one transceiver controls the power supply and the other is just powered or un-
powered. Then one may be able to return CANIF_TRCV_WU_POWER_ON, whereas the
other may state e.g. CANIF_TRCV_WU_RESET. It is up to the calling module to decide,
how to handle the wake-up information.
[SWS_CANIF_00371] dConfiguration of CanIf_GetTrcvWakeupReason(): The
number of supported transceiver types for each network is set up in the configura-
tion phase (see CanIfTrcvCfg and CanIfTrcvDrvCfg). If no transceiver is used,
this function may be omitted. Therefore, if no transceiver is configured in LT or PB
class the API shall return with E_NOT_OK.c()

8.3.17 CanIf_SetTrcvWakeupMode

[SWS_CANIF_00290] d
Service Name CanIf_SetTrcvWakeupMode
Syntax Std_ReturnType CanIf_SetTrcvWakeupMode (
uint8 TransceiverId,
CanTrcv_TrcvWakeupModeType TrcvWakeupMode
)

Service ID [hex] 0x10


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) TransceiverId Abstracted CanIf TransceiverId, which is assigned to a CAN
transceiver, which is requested for wake up notification mode
transition.
TrcvWakeupMode Requested transceiver wake up notification mode
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: Will be returned, if the wake up notifications state has
been changed to the requested mode.
E_NOT_OK: Will be returned, if the wake up notifications state
change has failed or the parameter is out of the allowed range.
The previous state has not been changed.
Description This function shall call CanTrcv_SetTrcvWakeupMode.
Available via CanIf.h

c()
Note: For more details, please refer to [2, Specification of CAN Transceiver Driver].
[SWS_CANIF_00372] dThe function CanIf_SetTrcvWakeupMode() shall call
CanTrcv_SetWakeupMode(Transceiver, TrcvWakeupMode) on the corre-
sponding requested CanTrcv.c()
Info: The parameters of the function CanTrcv_SetWakeupMode() are of type:

91 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

• TrcvWakeupMode: CanTrcv_TrcvWakeupModeType (see [2, Specification of


CAN Transceiver Driver])
• Transceiver: uint8 (Transceiver to which API call has to be applied)
(see [2, Specification of CAN Transceiver Driver])
Note: The following three paragraphs are already described in the Specification of
CanTrcv (see [2]). They describe the behavior of a CanTrcv in the respective
transceiver wake-up mode, which is requested in parameter TrcvWakeupMode.
CANIF_TRCV_WU_ENABLE:
If the CanTrcv has a stored wake-up event pending for the addressed CanNetwork,
the notification is executed within or immediately after the function CanTrcv_SetTr-
cvWakeupMode() (depending on the implementation).
CANIF_TRCV_WU_DISABLE:
No notifications for wake-up events for the addressed CanNetwork are passed
through the CanTrcv. The transceiver device and the underlying communication driver
has to buffer detected wake-up events and raise the event(s), when the wake-up noti-
fication is enabled again.
CANIF_TRCV_WU_CLEAR:
If notification of wake-up events is disabled (see description of mode CANIF_-
TRCV_WU_DISABLE), detected wake-up events are buffered. Calling CanIf_Set-
TrcvWakeupMode() with parameter CANIF_TRCV_WU_CLEAR clears these bufferd
events. Clearing of wake-up events has to be used, when the wake-up notification is
disabled to clear all stored wake-up events under control of the higher layers of the
CanTrcv.
[SWS_CANIF_00535] dIf parameter TransceiverId of CanIf_SetTrcvWakeup-
Mode() has an invalid value, the CanIf shall report development error code CANIF_-
E_PARAM_TRCV to the Det_ReportError service of the DET module, when
CanIf_SetTrcvWakeupMode() is called.c(SRS_BSW_00323)
[SWS_CANIF_00536] dIf parameter TrcvWakeupMode of CanIf_SetTrcvWakeup-
Mode() has an invalid value, the CanIf shall report development error code CANIF_-
E_PARAM_TRCVWAKEUPMODE to the Det_ReportError service of the DET mod-
ule, when CanIf_SetTrcvWakeupMode() is called.c(SRS_BSW_00323)
[SWS_CANIF_00373] dConfiguration of CanIf_SetTrcvWakeupMode(): The num-
ber of supported transceiver types for each network is set up in the configuration phase
(see CanIfTrcvCfg and CanIfTrcvDrvCfg). If no transceiver is used, this function
may be omitted. Therefore, if no transceiver is configured in LT or PB class the API
shall return with E_NOT_OK.c()

8.3.18 CanIf_CheckWakeup

[SWS_CANIF_00219] d

92 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Service Name CanIf_CheckWakeup


Syntax Std_ReturnType CanIf_CheckWakeup (
EcuM_WakeupSourceType WakeupSource
)

Service ID [hex] 0x11


Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) WakeupSource Source device, which initiated the wake up event: CAN controller
or CAN transceiver
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: Will be returned, if the check wake up request has been
accepted
E_NOT_OK: Will be returned, if the check wake up request has
not been accepted
Description This service checks, whether an underlying CAN driver or a CAN transceiver driver already
signals a wakeup event.
Available via CanIf.h

c()
Note: Integration Code calls this function
[SWS_CANIF_00398] dIf parameter WakeupSource of CanIf_CheckWakeup() has
an invalid value, CanIf shall report development error code CANIF_E_PARAM_WAKE-
UPSOURCE to the Det_ReportError service of the DET, when CanIf_Check-
Wakeup() is called.c(SRS_BSW_00323)
Note: The call context of CanIf_CheckWakeup() is either on interrupt level (interrupt
mode) or on task level (polling mode).

8.3.19 CanIf_CheckValidation

[SWS_CANIF_00178] d
Service Name CanIf_CheckValidation
Syntax Std_ReturnType CanIf_CheckValidation (
EcuM_WakeupSourceType WakeupSource
)

Service ID [hex] 0x12


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) WakeupSource Source device which initiated the wake-up event and which has to
be validated: CAN controller or CAN transceiver
Parameters (inout) None
Parameters (out) None
5

93 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Return value Std_ReturnType E_OK: Will be returned, if the check validation request has been
accepted.
E_NOT_OK: Will be returned, if the check validation request has
not been accepted.
Description This service is performed to validate a previous wakeup event.
Available via CanIf.h

c()
Note: Integration Code calls this function
[SWS_CANIF_00404] dIf parameter WakeupSource of CanIf_CheckValidation
() has an invalid value, the CanIf shall report development error code CANIF_E_-
PARAM_WAKEUPSOURCE to the Det_ReportError service of the DET module,
when CanIf_CheckValidation() is called.c(SRS_BSW_00323)
Note: The call context of CanIf_CheckValidation() is either on interrupt level
(interrupt mode) or on task level (polling mode).
Caveat: The corresponding CAN controller and transceiver must be switched
on via CanTrcv_SetOpMode(Transceiver, CANTRCV_TRCVMODE_NORMAL) and
Can_SetControllerMode(Controller, CAN_CS_STARTED) and the corre-
sponding mode indications must have been called.
[SWS_CANIF_00408] dConfiguration of CanIf_CheckValidation(): If no valida-
tion is needed, this API can be omitted by disabling of CanIfPublicWakeupCheck-
ValidSupport.c()

8.3.20 CanIf_GetTxConfirmationState

[SWS_CANIF_00734] d
Service Name CanIf_GetTxConfirmationState
Syntax CanIf_NotifStatusType CanIf_GetTxConfirmationState (
uint8 ControllerId
)

Service ID [hex] 0x19


Sync/Async Synchronous
Reentrancy Reentrant (Not for the same controller)
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller
Parameters (inout) None
Parameters (out) None
Return value CanIf_NotifStatusType Combined TX confirmation status for all TX PDUs of the CAN
controller
Description This service reports, if any TX confirmation has been done for the whole CAN controller since
the last CAN controller start.
5

94 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Available via CanIf.h

c()
[SWS_CANIF_00736] dIf parameter ControllerId of CanIf_GetTxConfirma-
tionState() has an invalid value, the CanIf shall report development error code
CANIF_E_PARAM_CONTROLLERID to the Det_ReportError service of the DET
module, when CanIf_GetTxConfirmationState() is called.c()
Note: The call context of CanIf_GetTxConfirmationState() is on task level
(polling mode).
[SWS_CANIF_00738] dConfiguration of CanIf_GetTxConfirmationState(): If
BusOff Recovery of CanSm doesn’t need the status of the Tx confirmations
(see [SWS_CANIF_00740]), this API can be omitted by disabling of CanIfPublic-
TxConfirmPollingSupport.c()

8.3.21 CanIf_ClearTrcvWufFlag

[SWS_CANIF_00760] d
Service Name CanIf_ClearTrcvWufFlag
Syntax Std_ReturnType CanIf_ClearTrcvWufFlag (
uint8 TransceiverId
)

Service ID [hex] 0x1e


Sync/Async Asynchronous
Reentrancy Reentrant for different CAN transceivers
Parameters (in) TransceiverId Abstract CanIf TransceiverId, which is assigned to the designated
CAN transceiver.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: Request has been accepted
E_NOT_OK: Request has not been accepted
Description Requests the CanIf module to clear the WUF flag of the designated CAN transceiver.
Available via CanIf.h

c()
[SWS_CANIF_00766] dWithin CanIf_ClearTrcvWufFlag() the function
CanTrcv_ClearTrcvWufFlag() shall be called.c()
[SWS_CANIF_00769] dIf parameter TransceiverId of CanIf_ClearTrcvWuf-
Flag() has an invalid value, the CanIf shall report development error code CANIF_-
E_PARAM_TRCV to the Det_ReportError service of the DET module, when
CanIf_ClearTrcvWufFlag() is caled.c()

95 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00771] dConfiguration of CanIf_ClearTrcvWufFlag(): Whether


the CanIf supports this function shall be pre compile time configurable On/Off by the
configuration parameter CanIfPublicPnSupport.c()

8.3.22 CanIf_CheckTrcvWakeFlag

[SWS_CANIF_00761] d
Service Name CanIf_CheckTrcvWakeFlag
Syntax Std_ReturnType CanIf_CheckTrcvWakeFlag (
uint8 TransceiverId
)

Service ID [hex] 0x1f


Sync/Async Asynchronous
Reentrancy Reentrant for different CAN transceivers
Parameters (in) TransceiverId Abstract CanIf TransceiverId, which is assigned to the designated
CAN transceiver.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: Request has been accepted
E_NOT_OK: Request has not been accepted
Description Requests the CanIf module to check the Wake flag of the designated CAN transceiver.
Available via CanIf.h

c()
[SWS_CANIF_00765] dWithin CanIf_CheckTrcvWakeFlag() the function
CanTrcv_CheckWakeFlag() shall be called.c()
[SWS_CANIF_00770] dIf parameter TransceiverId of CanIf_CheckTrcvWake-
Flag() has an invalid value, the CanIf shall report development error code CANIF_-
E_PARAM_TRCV to the Det_ReportError service of the DET module, when
CanIf_CheckTrcvWakeFlag() is caled.c()
[SWS_CANIF_00813] dConfiguration of CanIf_CheckTrcvWakeFlag(): Whether
the CanIf supports this function shall be pre compile time configurable On/Off by the
configuration parameter CanIfPublicPnSupport.c()

8.3.23 CanIf_SetBaudrate

[SWS_CANIF_00867] d
Service Name CanIf_SetBaudrate
5

96 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Syntax Std_ReturnType CanIf_SetBaudrate (
uint8 ControllerId,
uint16 BaudRateConfigID
)

Service ID [hex] 0x27


Sync/Async Synchronous
Reentrancy Reentrant for different ControllerIds. Non reentrant for the same ControllerId.
Parameters (in) ControllerId Abstract CanIf ControllerId which is assigned to a CAN controller,
whose baud rate shall be set.
BaudRateConfigID references a baud rate configuration by ID (see CanController
BaudRateConfigID)
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: Service request accepted, setting of (new) baud rate
started
E_NOT_OK: Service request not accepted
Description This service shall set the baud rate configuration of the CAN controller. Depending on
necessary baud rate modifications the controller might have to reset.
Available via CanIf.h

c()
[SWS_CANIF_00868] dThe service CanIf_SetBaudrate() shall call Can_-
SetBaudrate(Controller, BaudRateConfigID) for the requested CAN Con-
troller.c()
[SWS_CANIF_00869] dIf CanIf_SetBaudrate() is called with invalid Control-
lerId, CanIf shall report development error code CANIF_E_PARAM_CONTROL-
LERID to the Det_ReportError service of the DET module.c(SRS_BSW_00323)
Note: The parameter BaudRateConfigID of CanIf_SetBaudrate() is not
checked by CanIf. This has to be done by responsible CanDrv.
Note: The call context of CanIf_SetBaudrate() is on task level (polling mode).
[SWS_CANIF_00871] dIf CanIf supports changing baud rate and thus CanIf_Set-
Baudrate(), shall be configurable via CanIfSetBaudrateApi.c()

8.3.24 CanIf_GetControllerRxErrorCounter

[SWS_CANIF_91003] d
Service Name CanIf_GetControllerRxErrorCounter
Syntax Std_ReturnType CanIf_GetControllerRxErrorCounter (
uint8 ControllerId,
uint8* RxErrorCounterPtr
)
5

97 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Service ID [hex] 0x4d
Sync/Async Synchronous
Reentrancy Non Reentrant for the same ControllerId
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller.
Parameters (inout) None
Parameters (out) RxErrorCounterPtr Pointer to a memory location, where the current Rx error counter
of the CAN controller will be stored.
Return value Std_ReturnType E_OK: Rx error counter available.
E_NOT_OK: Wrong ControllerId, or Rx error counter not
available.
Description This service calls the corresponding CAN Driver service for obtaining the Rx error counter of
the CAN controller.
Available via CanIf.h

c()
[SWS_CANIF_00907] dIf parameter ControllerId of CanIf_GetControllerRx-
ErrorCounter() has an invalid value, the CanIf shall report development error code
CANIF_E_PARAM_CONTROLLERID to the Det_ReportError service of the DET,
when CanIf_GetControllerRxErrorCounter() is called.c(SRS_BSW_00323)
[SWS_CANIF_00908] dIf parameter RxErrorCounterPtr of CanIf_GetCon-
trollerRxErrorCounter() is a null pointer, the CanIf shall report development
error code CANIF_E_PARAM_POINTER to the Det_ReportError service of the
DET, when CanIf_GetControllerRxErrorCounter() is called.c(SRS_BSW_-
00323)

8.3.25 CanIf_GetControllerTxErrorCounter

[SWS_CANIF_91004] d
Service Name CanIf_GetControllerTxErrorCounter
Syntax Std_ReturnType CanIf_GetControllerTxErrorCounter (
uint8 ControllerId,
uint8* TxErrorCounterPtr
)

Service ID [hex] 0x4e


Sync/Async Synchronous
Reentrancy Non Reentrant for the same ControllerId
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller.
Parameters (inout) None
Parameters (out) TxErrorCounterPtr Pointer to a memory location, where the current Tx error counter
of the CAN controller will be stored.
Return value Std_ReturnType E_OK: Tx error counter available.
E_NOT_OK: Wrong ControllerId, or Tx error counter not
available.
5

98 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Description This service calls the corresponding CAN Driver service for obtaining the Tx error counter of
the CAN controller.
Available via CanIf.h

c()
[SWS_CANIF_00909] dIf parameter ControllerId of CanIf_GetControllerTx-
ErrorCounter() has an invalid value, the CanIf shall report development error code
CANIF_E_PARAM_CONTROLLERID to the Det_ReportError service of the DET,
when CanIf_GetControllerTxErrorCounter() is called.c(SRS_BSW_00323)
[SWS_CANIF_00910] dIf parameter TxErrorCounterPtr of CanIf_GetCon-
trollerTxErrorCounter() is a null pointer, the CanIf shall report development
error code CANIF_E_PARAM_POINTER to the Det_ReportError service of the
DET, when CanIf_GetControllerTxErrorCounter() is called.c(SRS_BSW_-
00323)

8.3.26 CanIf_EnableBusMirroring

[SWS_CANIF_91005] d
Service Name CanIf_EnableBusMirroring
Syntax Std_ReturnType CanIf_EnableBusMirroring (
uint8 ControllerId,
boolean MirroringActive
)

Service ID [hex] 0x4c


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller.
MirroringActive TRUE: Mirror_ReportCanFrame will be called for each frame
received or transmitted on the given controller. FALSE: Mirror_
ReportCanFrame will not be called for the given controller.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: Mirroring mode was changed.
E_NOT_OK: Wrong ControllerId, or mirroring globally disabled
(see CanIfBusMirroringSupport).
Description Enables or disables mirroring for a CAN controller.
Available via CanIf.h

c()
[SWS_CANIF_00911] dIf Bus Mirroring is not enabled (see CanIfBusMirroring-
Support), the API CanIf_EnableBusMirroring() can be omitted.c(SRS_Can_-
01172)

99 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00912] dIf parameter ControllerId of CanIf_EnableBusMirror-


ing() has an invalid value, the CanIf shall report development error code CANIF_-
E_PARAM_CONTROLLERID to the Det_ReportError service of the DET, when
CanIf_EnableBusMirroring() is called.c(SRS_BSW_00323)

8.3.27 CanIf_GetCurrentTime

[SWS_CANIF_91014]{DRAFT} d
Service Name CanIf_GetCurrentTime (draft)
Syntax Std_ReturnType CanIf_GetCurrentTime (
uint8 Controller,
Can_TimeStampType* timeStampPtr
)

Service ID [hex] 0x51


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) Controller Index of the addresses CAN controller.
Parameters (inout) None
Parameters (out) timeStampPtr current time stamp
Return value Std_ReturnType E_OK: successful
E_NOT_OK: failed
Description This service calls the corresponding CAN Driver service to retrieve the current time value out of
the HW registers.
Tags: atp.Status=draft
Available via CanIf.h

c(SRS_Can_01181)
[SWS_CANIF_00922]{DRAFT} dIf development error detection is enabled: the func-
tion shall check that the service CanIf_Init() was previously called. If the check
fails, the function shall raise the development error CANIF_E_UNINITc()
[SWS_CANIF_00923]{DRAFT} dIf development error detection is enabled: the func-
tion shall check the parameter Controller for being valid. If the check fails, the
function shall raise the development error CANIF_E_PARAM_CONTROLLERID.c()
[SWS_CANIF_00924]{DRAFT} dIf development error detection is enabled: the func-
tion shall check the parameter timeStampPtr for being valid. If the check fails, the
function shall raise the development error CANIF_E_PARAM_POINTER.c()
[SWS_CANIF_00925]{DRAFT} dThe function shall be pre compile time configurable
On/Off by the configuration parameter: CanIfGlobalTimeSupportc()

8.3.28 CanIf_EnableEgressTimeStamp

[SWS_CANIF_91011]{DRAFT} d

100 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Service Name CanIf_EnableEgressTimeStamp (draft)


Syntax void CanIf_EnableEgressTimeStamp (
PduIdType TxPduId
)

Service ID [hex] 0x52


Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) TxPduId L-PDU handle of CAN L-PDU for which the time stamping shall
be enabled.
Parameters (inout) None
Parameters (out) None
Return value None
Description This service calls the corresponding CAN Driver service to activate egress time stamping on a
dedicated message object.
Tags: atp.Status=draft
Available via CanIf.h

c(SRS_Can_01181)
[SWS_CANIF_00926]{DRAFT} dIf development error detection is enabled: the func-
tion shall check that the service CanIf_Init() was previously called. If the check
fails, the function shall raise the development error CANIF_E_UNINITc()
[SWS_CANIF_00927]{DRAFT} dIf development error detection is enabled: the func-
tion shall check the parameter TxPduId for being valid. If the check fails, the function
shall raise the development error CANIF_E_PARAM_LPDU.c()
[SWS_CANIF_00928]{DRAFT} dThe function shall be pre compile time configurable
On/Off by the configuration parameter: CanIfGlobalTimeSupportc()

8.3.29 CanIf_GetEgressTimeStamp

[SWS_CANIF_91012]{DRAFT} d
Service Name CanIf_GetEgressTimeStamp (draft)
Syntax Std_ReturnType CanIf_GetEgressTimeStamp (
PduIdType TxPduId,
Can_TimeStampType* timeStampPtr
)

Service ID [hex] 0x53


Sync/Async Synchronous
Reentrancy Non Reentrant for the same TxPduId, Reentrant for different TxPduId
Parameters (in) TxPduId L-PDU handle of CAN L-PDU for which the time stamp shall be
returned.
Parameters (inout) None
Parameters (out) timeStampPtr current time stamp
5

101 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Return value Std_ReturnType E_OK: successful
E_NOT_OK: failed
Description This service calls the corresponding CAN Driver service to read back the egress time stamp on
a dedicated message object. It needs to be called within the TxConfirmation() function.
Tags: atp.Status=draft
Available via CanIf.h

c(SRS_Can_01181)
[SWS_CANIF_00929]{DRAFT} dIf development error detection is enabled: the func-
tion shall check that the service CanIf_Init() was previously called. If the check
fails, the function shall raise the development error CANIF_E_UNINITc()
[SWS_CANIF_00930]{DRAFT} dIf development error detection is enabled: the func-
tion shall check the parameter TxPduId for being valid. If the check fails, the function
shall raise the development error CANIF_E_PARAM_LPDU.c()
[SWS_CANIF_00931]{DRAFT} dIf development error detection is enabled: the func-
tion shall check the parameter timeStampPtr for being valid. If the check fails, the
function shall raise the development error CANIF_E_PARAM_POINTER.c()
[SWS_CANIF_00932]{DRAFT} dThe function shall be pre compile time configurable
On/Off by the configuration parameter: CanIfGlobalTimeSupportc()

8.3.30 CanIf_GetIngressTimeStamp

[SWS_CANIF_91013]{DRAFT} d
Service Name CanIf_GetIngressTimeStamp (draft)
Syntax Std_ReturnType CanIf_GetIngressTimeStamp (
PduIdType RxPduId,
Can_TimeStampType* timeStampPtr
)

Service ID [hex] 0x54


Sync/Async Synchronous
Reentrancy Non Reentrant for the same RxPduId, Reentrant for different RxPduIds
Parameters (in) RxPduId ID of the received I-PDU for which the time stamp shall be
returned.
Parameters (inout) None
Parameters (out) timeStampPtr current time stamp
Return value Std_ReturnType E_OK: successful
E_NOT_OK: failed
Description This service calls the corresponding CAN Driver service to reads back the ingress time stamp
on a dedicated message object. It needs to be called within the RxIndication() function.
Tags: atp.Status=draft
Available via CanIf.h

c(SRS_Can_01181)

102 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00933]{DRAFT} dIf development error detection is enabled: the func-


tion shall check that the service CanIf_Init() was previously called. If the check
fails, the function shall raise the development error CANIF_E_UNINITc()
[SWS_CANIF_00934]{DRAFT} dIf development error detection is enabled: the func-
tion shall check the parameter RxPduId for being valid. If the check fails, the function
shall raise the development error CANIF_E_PARAM_LPDU.c()
[SWS_CANIF_00935]{DRAFT} dIf development error detection is enabled: the func-
tion shall check the parameter timeStampPtr for being valid. If the check fails, the
function shall raise the development error CANIF_E_PARAM_POINTER.c()
[SWS_CANIF_00936]{DRAFT} dThe function shall be pre compile time configurable
On/Off by the configuration parameter: CanIfGlobalTimeSupportc()

8.4 Callback notifications


This is a list of functions provided for other modules.

8.4.1 CanIf_TriggerTransmit

[SWS_CANIF_00883] d
Service Name CanIf_TriggerTransmit
Syntax Std_ReturnType CanIf_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.
Parameters (inout) PduInfoPtr Contains a pointer to a buffer (SduDataPtr) to where the SDU
data shall be copied, and the available buffer size in SduLengh.
On return, the service will indicate the length of the copied SDU
data in SduLength.
Parameters (out) None
Return value Std_ReturnType E_OK: SDU has been copied and SduLength indicates the
number of copied bytes.
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.
Available via CanIf.h

c()

103 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00884] dCanIf shall only provide the API function CanIf_Trigger-


Transmit() if TriggerTransmit support is enabled (CanIfTriggerTransmitSup-
port = TRUE).c()
[SWS_CANIF_00885] dThe function CanIf_TriggerTransmit() shall call the cor-
responding <User_TriggerTransmit>() function, passing the translated TxPduId
and the pointer to the PduInfo structure (PduInfoPtr). Upon return, CanIf_Trig-
gerTransmit() shall return the return value of its <User_TriggerTransmit>().c
()

8.4.2 CanIf_TxConfirmation

[SWS_CANIF_00007] d
Service Name CanIf_TxConfirmation
Syntax void CanIf_TxConfirmation (
PduIdType CanTxPduId
)

Service ID [hex] 0x13


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) CanTxPduId L-PDU handle of CAN L-PDU successfully transmitted. This ID
specifies the corresponding CAN L-PDU ID and implicitly the
CAN Driver instance as well as the corresponding CAN controller
device.
Parameters (inout) None
Parameters (out) None
Return value None
Description This service confirms a previously successfully processed transmission of a CAN TxPDU.
Available via CanIf_Can.h

c(SRS_Can_01009)
Note: The service CanIf_TxConfirmation() is implemented in CanIf and called
by the CanDrv after the CAN L-PDU has been transmitted on the CAN network.
Note: Due to the fact CanDrv does not support the HandleId concept as described
in [14, Specification of ECU Configuration]: Within the service CanIf_TxConfirma-
tion(), CanDrv uses PduInfo->swPduHandle as CanTxPduId, which was pre-
served from Can_Write(Hth, *PduInfo).
[SWS_CANIF_00391] dIf configuration parameters CanIfPublicReadTxPduNoti-
fyStatusApi and CanIfTxPduReadNotifyStatus for the Transmitted L-PDU
are set to TRUE, and if CanIf_TxConfirmation() is called, CanIf shall set the
notification status for the Transmitted L-PDU.c()

104 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00410] dIf parameter CanTxPduId of CanIf_TxConfirmation()


has an invalid value, CanIf shall report development error code CANIF_E_PARAM_-
LPDU to the Det_ReportError service of the DET module, when CanIf_TxCon-
firmation() is called.c(SRS_BSW_00323)
[SWS_CANIF_00412] dIf CanIf was not initialized before calling CanIf_TxConfir-
mation(), CanIf shall not call the service <User_TxConfirmation>() and shall
not set the Tx confirmation status, when CanIf_TxConfirmation() is called.c()
Note: The call context of CanIf_TxConfirmation() is either on interrupt level (in-
terrupt mode) or on task level (polling mode).
[SWS_CANIF_00414] dConfiguration of CanIf_TxConfirmation(): Each Tx L-
-PDU (see CanIfTxPduCfg) has to be configured with a corresponding transmit con-
firmation service of an upper layer module (see [SWS_CANIF_00011]) which is called
in CanIf_TxConfirmation().c()

8.4.3 CanIf_RxIndication

[SWS_CANIF_00006] d
Service Name CanIf_RxIndication
Syntax void CanIf_RxIndication (
const Can_HwType* Mailbox,
const PduInfoType* PduInfoPtr
)

Service ID [hex] 0x14


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Mailbox Identifies the HRH and its corresponding CAN Controller
PduInfoPtr Pointer to the received L-PDU
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates a successful reception of a received CAN Rx L-PDU to the CanIf after
passing all filters and validation checks.
Available via CanIf_Can.h

c()
Note: The service CanIf_RxIndication() is implemented in CanIf and called by
CanDrv after a CAN L-PDU has been received.
[SWS_CANIF_00415] dWithin the service CanIf_RxIndication() the CanIf
routes this indication to the configured upper layer target service(s).c()
[SWS_CANIF_00392] dIf configuration parameters CanIfPublicReadRxPduNoti-
fyStatusApi and CanIfRxPduReadNotifyStatus for the Received L-PDU are

105 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

set to TRUE, and if CanIf_RxIndication() is called, the CanIf shall set the notifi-
cation status for the Received L-PDU.c()
[SWS_CANIF_00416] dIf parameter Mailbox->Hoh of CanIf_RxIndication()
has an invalid value, CanIf shall report development error code CANIF_E_PARAM_-
HOH to the Det_ReportError service of the DET module, when CanIf_RxIndica-
tion() is called.c(SRS_BSW_00323)
[SWS_CANIF_00417] dIf parameter Mailbox->CanId of CanIf_RxIndication()
has an invalid value, CanIf shall report development error code CANIF_E_PARAM_-
CANID to the Det_ReportError service of the DET module, when CanIf_RxIndi-
cation() is called.c(SRS_BSW_00323)
Note: If CanIf_RxIndication() is called with invalid PduInfoPtr->
SduLength, runtime error CANIF_E_INVALID_DATA_LENGTH is reported
(see [SWS_CANIF_00168]).
[SWS_CANIF_00419] dIf parameter PduInfoPtr or Mailbox of CanIf_RxIndi-
cation() has an invalid value, CanIf shall report development error code CANIF_-
E_PARAM_POINTER to the Det_ReportError service of the DET module, when
CanIf_RxIndication() is called.c(SRS_BSW_00323)
[SWS_CANIF_00421] dIf CanIf was not initialized before calling CanIf_RxIndica-
tion(), CanIf shall not execute Rx indication handling, when CanIf_RxIndica-
tion(), is called.c()
Note: The call context of CanIf_RxIndication() is either on interrupt level (inter-
rupt mode) or on task level (polling mode).
[SWS_CANIF_00423] dConfiguration of CanIf_RxIndication(): Each Rx L-PDU
(see CanIfRxPduCfg) has to be configured with a corresponding receive indica-
tion service of an upper layer module (see [SWS_CANIF_00012]) which is called in
CanIf_RxIndication().c()

8.4.4 CanIf_ControllerBusOff

[SWS_CANIF_00218] d
Service Name CanIf_ControllerBusOff
Syntax void CanIf_ControllerBusOff (
uint8 ControllerId
)

Service ID [hex] 0x16


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) ControllerId Abstract CanIf ControllerId which is assigned to a CAN controller,
where a BusOff occured.
5

106 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates a Controller BusOff event referring to the corresponding CAN Controller
with the abstract CanIf ControllerId.
Available via CanIf_Can.h

c()
Note: The callback service CanIf_ControllerBusOff() is called by CanDrv and
implemented in CanIf. It is called in case of a mode change notification of the CanDrv.
[SWS_CANIF_00429] dIf parameter ControllerId of CanIf_ControllerBusOff
() has an invalid value, CanIf shall report development error code CANIF_E_-
PARAM_CONTROLLERID to the Det_ReportError service of the DET module, when
CanIf_ControllerBusOff() is called.c(SRS_BSW_00323)
[SWS_CANIF_00431] dIf CanIf was not initialized before calling CanIf_Con-
trollerBusOff(), CanIf shall not execute BusOff notification, when CanIf_Con-
trollerBusOff(), is called.c()
Note: The call context of CanIf_ControllerBusOff() is either on interrupt level
(interrupt mode) or on task level (polling mode).
[SWS_CANIF_00433] dConfiguration of CanIf_ControllerBusOff(): ID of the
CAN Controller is published inside the configuration description of the CanIf (see
CanIfCtrlCfg).c()
Note: This service always has to be available, so there does not exist an appropriate
configuration parameter.

8.4.5 CanIf_ConfirmPnAvailability

[SWS_CANIF_00815] d
Service Name CanIf_ConfirmPnAvailability
Syntax void CanIf_ConfirmPnAvailability (
uint8 TransceiverId
)

Service ID [hex] 0x1a


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) TransceiverId Abstract CanIf TransceiverId, which is assigned to a CAN
transceiver, which was checked for PN availability.
Parameters (inout) None
Parameters (out) None
5

107 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Return value None
Description This service indicates that the transceiver is running in PN communication mode referring to the
corresponding CAN transceiver with the abstract CanIf TransceiverId.
Available via CanIf_CanTrcv.h

c()
[SWS_CANIF_00753] dIf CanIf_ConfirmPnAvailability() is called, CanIf
calls <User_ConfirmPnAvailability>().c()
Note: CanIf passes the delivered parameter TransceiverId to the upper layer mod-
ule.
[SWS_CANIF_00816] dIf parameter TransceiverId of CanIf_ConfirmPnAvail-
ability() has an invalid value, CanIf shall report development error code CANIF_-
E_PARAM_TRCV to the Det_ReportError service of the DET module, when
CanIf_ConfirmPnAvailability() is called.c()
[SWS_CANIF_00817] dIf CanIf was not initialized before calling CanIf_ConfirmP-
nAvailability(), CanIf shall not execute notification, when CanIf_ConfirmP-
nAvailability() is called.c()
Note: The call context of CanIf_ConfirmPnAvailability() is either on interrupt
level (interrupt mode) or on task level (polling mode).
[SWS_CANIF_00754] dConfiguration of CanIf_ConfirmPnAvailability(): This
function shall be pre compile time configurable ON/OFF by the configuration parameter
CanIfPublicPnSupport.c()

8.4.6 CanIf_ClearTrcvWufFlagIndication

[SWS_CANIF_00762] d
Service Name CanIf_ClearTrcvWufFlagIndication
Syntax void CanIf_ClearTrcvWufFlagIndication (
uint8 TransceiverId
)

Service ID [hex] 0x20


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) TransceiverId Abstract CanIf TransceiverId, which is assigned to a CAN
transceiver, for which this function was called.
Parameters (inout) None
Parameters (out) None
Return value None
5

108 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Description This service indicates that the transceiver has cleared the WufFlag referring to the
corresponding CAN transceiver with the abstract CanIf TransceiverId.
Available via CanIf_CanTrcv.h

c()
[SWS_CANIF_00757] dIf CanIf_ClearTrcvWufFlagIndication() is called,
CanIf calls <User_ClearTrcvWufFlagIndication>().c()
Note: CanIf passes the delivered parameter TransceiverId to the upper layer mod-
ule.
[SWS_CANIF_00805] dIf parameter TransceiverId of CanIf_ClearTrcvWuf-
FlagIndication() has an invalid value, CanIf shall report development error code
CANIF_E_PARAM_TRCV to the Det_ReportError service of the DET module, when
CanIf_ClearTrcvWufFlagIndication() is called.c()
[SWS_CANIF_00806] dIf CanIf was not initialized before calling CanIf_ClearTr-
cvWufFlagIndication(), CanIf shall not execute notification, when CanIf_-
ClearTrcvWufFlagIndication() is called.c()
Note: The call context of CanIf_ClearTrcvWufFlagIndication() is either on
interrupt level (interrupt mode) or on task level (polling mode).
[SWS_CANIF_00808] dConfiguration of CanIf_ClearTrcvWufFlagIndication
(): This function shall be pre compile time configurable ON/OFF by the configuration
parameter CanIfPublicPnSupport.c()

8.4.7 CanIf_CheckTrcvWakeFlagIndication

[SWS_CANIF_00763] d
Service Name CanIf_CheckTrcvWakeFlagIndication
Syntax void CanIf_CheckTrcvWakeFlagIndication (
uint8 TransceiverId
)

Service ID [hex] 0x21


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) TransceiverId Abstract CanIf TransceiverId, which is assigned to a CAN
transceiver, for which this function was called.
Parameters (inout) None
Parameters (out) None
Return value None
5

109 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Description This service indicates that the check of the transceiver’s wake-up flag has been finished by the
corresponding CAN transceiver with the abstract CanIf TransceiverId. This indication is used to
cope with the asynchronous transceiver communication.
Available via CanIf_CanTrcv.h

c()
[SWS_CANIF_00759] dIf CanIf_CheckTrcvWakeFlagIndication() is called,
CanIf calls <User_CheckTrcvWakeFlagIndication>().c()
Note: CanIf passes the delivered parameter TransceiverId to the upper layer mod-
ule.
[SWS_CANIF_00809] dIf parameter TransceiverId of CanIf_CheckTrcvWake-
FlagIndication() has an invalid value, CanIf shall report development error code
CANIF_E_PARAM_TRCV to the Det_ReportError service of the DET module, when
CanIf_CheckTrcvWakeFlagIndication() is called.c()
[SWS_CANIF_00810] dIf the CanIf was not initialized before calling CanIf_Check-
TrcvWakeFlagIndication(), CanIf shall not execute notification, when CanIf_-
CheckTrcvWakeFlagIndication() is called.c()
Note: The call context of CanIf_CheckTrcvWakeFlagIndication() is either on
interrupt level (interrupt mode) or on task level (polling mode).
[SWS_CANIF_00812] dConfiguration of CanIf_CheckTrcvWakeFlagIndication
(): This function shall be pre compile time configurable ON/OFF by the configuration
parameter CanIfPublicPnSupport.c()

8.4.8 CanIf_ControllerModeIndication

[SWS_CANIF_00699] d
Service Name CanIf_ControllerModeIndication
Syntax void CanIf_ControllerModeIndication (
uint8 ControllerId,
Can_ControllerStateType ControllerMode
)

Service ID [hex] 0x17


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) ControllerId Abstract CanIf ControllerId which is assigned to a CAN controller,
which state has been transitioned.
ControllerMode Mode to which the CAN controller transitioned
Parameters (inout) None
Parameters (out) None
5

110 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Return value None
Description This service indicates a controller state transition referring to the corresponding CAN controller
with the abstract CanIf ControllerId.
Available via CanIf_Can.h

c()
Note: The callback service CanIf_ControllerModeIndication() is called by
CanDrv and implemented in CanIf. It is called in case of a state transition notification
of the CanDrv.
[SWS_CANIF_00700] dIf parameter ControllerId of CanIf_ControllerMod-
eIndication() has an invalid value, CanIf shall report development error code
CANIF_E_PARAM_CONTROLLERID to the Det_ReportError service of the DET
module, when CanIf_ControllerModeIndication() is called.c()
[SWS_CANIF_00702] dIf CanIf was not initialized before calling CanIf_Con-
trollerModeIndication(), CanIf shall not execute state transition notification,
when CanIf_ControllerModeIndication() is called.c()
Note: The call context of CanIf_ControllerModeIndication() is either on inter-
rupt level (interrupt mode) or on task level (polling mode).

8.4.9 CanIf_TrcvModeIndication

[SWS_CANIF_00764] d
Service Name CanIf_TrcvModeIndication
Syntax void CanIf_TrcvModeIndication (
uint8 TransceiverId,
CanTrcv_TrcvModeType TransceiverMode
)

Service ID [hex] 0x22


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) TransceiverId Abstract CanIf TransceiverId, which is assigned to a CAN
transceiver, which state has been transitioned.
TransceiverMode Mode to which the CAN transceiver transitioned
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates a transceiver state transition referring to the corresponding CAN
transceiver with the abstract CanIf TransceiverId.
Available via CanIf_CanTrcv.h

c()

111 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Note: The callback service CanIf_TrcvModeIndication() is called by CanDrv


and implemented in CanIf. It is called in case of a state transition notification of the
CanDrv.
[SWS_CANIF_00706] dIf parameter TransceiverId of CanIf_TrcvModeIndica-
tion() has an invalid value, CanIf shall report development error code CANIF_E_-
PARAM_TRCV to the Det_ReportError service of the DET module, when CanIf_-
TrcvModeIndication() is called.c()
[SWS_CANIF_00708] dIf CanIf was not initialized before calling CanIf_TrcvMod-
eIndication(), CanIf shall not execute state transition notification, when CanIf_-
TrcvModeIndication() is called.c()
Note: The call context of CanIf_TrcvModeIndication() is either on interrupt level
(interrupt mode) or on task level (polling mode).
[SWS_CANIF_00710] dConfiguration of CanIf_TrcvModeIndication(): ID of the
CAN Transceiver is published inside the configuration description of CanIf via pa-
rameter CanIfTrcvId.c()
[SWS_CANIF_00730] dConfiguration of CanIf_TrcvModeIndication(): If
transceivers are not supported (CanIfTrcvDrvCfg is not configured, see CanIfTr-
cvDrvCfg), CanIf_TrcvModeIndication() shall not be provided by CanIf.c()

8.4.10 CanIf_ControllerErrorStatePassive

[SWS_CANIF_91008] d
Service Name CanIf_ControllerErrorStatePassive
Syntax void CanIf_ControllerErrorStatePassive (
uint8 ControllerId,
uint16 RxErrorCounter,
uint16 TxErrorCounter
)

Service ID [hex] 0x4f


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller.
RxErrorCounter Value of the Rx error counter
TxErrorCounter Value of the Tx error counter
Parameters (inout) None
Parameters (out) None
Return value void –
Description The function derives the ErrorCounterTreshold from RxErrorCounter/ TxErrorCounter values
and reports it to the IdsM as security event CANIF_SEV_ERRORSTATE_PASSIVE to the IdsM.
It also prepares the context data for the respective security event.
Available via CanIf_Can.h

c(RS_Ids_00810)

112 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00919] dIf parameter ControllerId of CanIf_Con-


trollerErrorStatePassive() has an invalid value, the CanIf shall report
development error code CANIF_E_PARAM_CONTROLLERID to the Det_ReportEr-
ror service of the DET module when CanIf_ControllerErrorStatePassive()
is called.c(RS_Ids_00810)

8.4.11 CanIf_ErrorNotification

[SWS_CANIF_91009] d
Service Name CanIf_ErrorNotification
Syntax void CanIf_ErrorNotification (
uint8 ControllerId,
Can_ErrorType Can_ErrorType
)

Service ID [hex] 0x50


Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller.
Can_ErrorType Reported CAN error
Parameters (inout) None
Parameters (out) None
Return value void –
Description The function shall derive the bus error source rx or tx from the parameter CanError and report
the bus error as security event CANIF_SEV_TX_ERROR_DETECTED or CANIF_SEV_RX_
ERROR_DETECTED. It also prepares the context data for the respective security event.
Available via CanIf_Can.h

c(RS_Ids_00810)
[SWS_CANIF_00920] dIf parameter ControllerId of CanIf_ErrorNotifica-
tion() has an invalid value, the CanIf shall report development error code CANIF_-
E_PARAM_CONTROLLERID to the Det_ReportError service of the DET module,
when CanIf_ErrorNotification() is called.c(RS_Ids_00810)
[SWS_CANIF_00921] dIf parameter CanError of CanIf_ErrorNotification()
has an invalid value, the CanIf shall report development error code CANIF_E_-
PARAM_CAN_ERROR to the Det_ReportError service of the DET module, when
CanIf_ErrorNotification() is called.c(RS_Ids_00810)

8.5 Scheduled functions


Note: CanIf does not have scheduled functions or needs some.

113 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

8.6 Expected interfaces


In this chapter all interfaces required from other modules are listed.

8.6.1 Mandatory interfaces

Note: This section defines all interfaces, which are required to fulfill the core function-
ality of the module.
[SWS_CANIF_00040] d
API Function Header File Description
Can_GetControllerErrorState Can.h This service obtains the error state of the CAN
controller.
Can_GetControllerRxErrorCounter Can.h Returns the Rx error counter for a CAN controller.
This value might not be available for all CAN
controllers, in which case E_NOT_OK would be
returned.
Please note that the value of the counter might not
be correct at the moment the API returns it, because
the Rx counter is handled asynchronously in
hardware. Applications should not trust this value for
any assumption about the current bus state.
Can_GetControllerTxErrorCounter Can.h Returns the Tx error counter for a CAN controller.
This value might not be available for all CAN
controllers, in which case E_NOT_OK would be
returned.
Please note that the value of the counter might not
be correct at the moment the API returns it, because
the Tx counter is handled asynchronously in
hardware. Applications should not trust this value for
any assumption about the current bus state.
Can_SetControllerMode Can.h This function performs software triggered state
transitions of the CAN controller State machine.
Can_Write Can.h This function is called by CanIf to pass a CAN
message to CanDrv for transmission.
Det_ReportRuntimeError Det.h Service to report runtime errors. If a callout has
been configured then this callout shall be called.
SchM_Enter_CanIf_<ExclusiveArea> SchM_<Mip>.h Invokes the SchM_Enter function to enter a module
local exclusive area.
SchM_Exit_CanIf_<ExclusiveArea> SchM_<Mip>.h Invokes the SchM_Exit function to exit an exclusive
area.

c()

8.6.2 Optional interfaces

This section defines all interfaces, which are required to fulfill an optional functionality
of the module.
[SWS_CANIF_00294] d

114 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

API Function Header File Description


Can_CheckWakeup Can.h This function checks if a wakeup has occurred for
the given controller.
Can_SetBaudrate Can.h This service shall set the baud rate configuration of
the CAN controller. Depending on necessary baud
rate modifications the controller might have to reset.
CanNm_RxIndication CanNm.h Indication of a received PDU from a lower layer
communication interface module.
CanNm_TxConfirmation CanNm.h The lower layer communication interface module
confirms the transmission of a PDU, or the failure to
transmit a PDU.
CanSM_CheckTransceiverWakeFlag CanSM_CanIf.h This callback function indicates the CanIf_Check
Indication TrcvWakeFlag API process end for the notified CAN
Transceiver.
CanSM_ClearTrcvWufFlagIndication CanSM_CanIf.h This callback function shall indicate the CanIf_Clear
TrcvWufFlag API process end for the notified CAN
Transceiver.
CanSM_ConfirmPnAvailability CanSM_CanIf.h This callback function indicates that the transceiver
is running in PN communication mode.
CanSM_ControllerBusOff CanSM_CanIf.h This callback function notifies the CanSM about a
bus-off event on a certain CAN controller, which
needs to be considered with the specified bus-off
recovery handling for the impacted CAN network.
CanSM_ControllerModeIndication CanSM_CanIf.h This callback shall notify the CanSM module about a
CAN controller mode change.
CanSM_TransceiverModeIndication CanSM_CanIf.h This callback shall notify the CanSM module about a
CAN transceiver mode change.
CanTp_RxIndication CanTp.h Indication of a received PDU from a lower layer
communication interface module.
CanTp_TxConfirmation CanTp.h The lower layer communication interface module
confirms the transmission of a PDU, or the failure to
transmit a PDU.
CanTrcv_CheckWakeFlag CanTrcv.h Requests to check the status of the wakeup flag
from the transceiver hardware.
CanTrcv_CheckWakeup CanTrcv.h Service is called by underlying CANIF in case a
wake up interrupt is detected.
CanTrcv_GetBusWuReason CanTrcv.h Gets the wakeup reason for the Transceiver and
returns it in parameter Reason.
CanTrcv_GetOpMode CanTrcv.h Gets the mode of the Transceiver and returns it in
OpMode.
CanTrcv_SetOpMode CanTrcv.h Sets the mode of the Transceiver to the value Op
Mode.
CanTrcv_SetWakeupMode CanTrcv.h Enables, disables or clears wake-up events of the
Transceiver according to TrcvWakeupMode.
CanTSyn_RxIndication CanTSyn.h Indication of a received PDU from a lower layer
communication interface module.
CanTSyn_TxConfirmation CanTSyn.h The lower layer communication interface module
confirms the transmission of a PDU, or the failure to
transmit a PDU.
Det_ReportError Det.h Service to report development errors.
EcuM_ValidateWakeupEvent EcuM.h After wakeup, the ECU State Manager will stop the
process during the WAKEUP VALIDATION state/
sequence to wait for validation of the wakeup
event.This API service is used to indicate to the ECU
Manager module that the wakeup events indicated
in the sources parameter have been validated.
5

115 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
API Function Header File Description
IdsM_SetSecurityEventWithContext IdsM.h This API is the application interface to report
Data security events with context data to the IdsM.
J1939Nm_RxIndication J1939Nm.h Indication of a received PDU from a lower layer
communication interface module.
J1939Nm_TxConfirmation J1939Nm.h The lower layer communication interface module
confirms the transmission of a PDU, or the failure to
transmit a PDU.
J1939Tp_RxIndication J1939Tp.h Indication of a received PDU from a lower layer
communication interface module.
J1939Tp_TxConfirmation J1939Tp.h The lower layer communication interface module
confirms the transmission of a PDU, or the failure to
transmit a PDU.
Mirror_ReportCanFrame Mirror.h Reports a received or transmitted CAN frame. All
received CAN frames that pass the hardware
acceptance filter are reported, independent of the
software filter configuration. Transmitted CAN
frames are reported when the transmission is
confirmed.
PduR_CanIfRxIndication PduR_CanIf.h Indication of a received PDU from a lower layer
communication interface module.
PduR_CanIfTxConfirmation PduR_CanIf.h The lower layer communication interface module
confirms the transmission of a PDU, or the failure to
transmit a PDU.
Xcp_CanIfRxIndication Xcp.h Indication of a received PDU from a lower layer
communication interface module.
Xcp_CanIfTxConfirmation Xcp.h The lower layer communication interface module
confirms the transmission of a PDU, or the failure to
transmit a PDU.

c()

8.6.3 Configurable interfaces

In this section all interfaces are listed, where the target function of any upper layer
to be called has to be set up by configuration. These callback services are specified
and implemented in the upper communication modules, which use CanIf according to
the AUTOSAR BSW architecture. The specific callback notification is specified in the
corresponding SWS document (see chapter 3 “Related documentation”).
As far the interface name is not specified to be mandatory, no callback is performed,
if no API name is configured. This section describes only the content of notification of
the callback, the call context inside CanIf and exact time by the call event.
<User_NotificationName> - This condition is applied for such interface services
which will be implemented in the upper layer and called by CanIf. This condition
displays the symbolic name of the functional group in a callback service in the corre-
sponding upper layer module. Each upper layer module can define no, one or several
callback services for the same functionality (i.e. transmit confirmation). The dispatch
is ensured by the L-SDU ID.
The upper layer module provides the Service ID of the following functions.

116 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

8.6.3.1 <User_TriggerTransmit>

[SWS_CANIF_00886] d
Service Name <User_TriggerTransmit>
Syntax Std_ReturnType <User_TriggerTransmit> (
PduIdType TxPduId,
PduInfoType* PduInfoPtr
)

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.
Parameters (inout) PduInfoPtr Contains a pointer to a buffer (SduDataPtr) to where the SDU
data shall be copied, and the available buffer size in SduLengh.
On return, the service will indicate the length of the copied SDU
data in SduLength.
Parameters (out) None
Return value Std_ReturnType E_OK: SDU has been copied and SduLength indicates the
number of copied bytes.
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.
Available via configurable

c()
Note: This callback service is called by CanIf and implemented in the corresponding
upper layer module. It is called in case of a Trigger Transmit request of CanDrv.
Note: The call context of <User_TriggerTransmit>() is either on interrupt level
(interrupt mode) or on task level (polling mode).
[SWS_CANIF_00888] dConfiguration of <User_TriggerTransmit>(): The upper
layer module, which provides the TriggerTransmit callback service, has to be con-
figured by CanIfTxPduUserTxConfirmationUL (see CanIfTxPduUserTxCon-
firmationUL). If no upper layer modules are configured, no TriggerTransmit call-
back service is executed and therefore Trigger Transmit functionality is not supported
for that PDU.c()
[SWS_CANIF_00889] dConfiguration of <User_TriggerTransmit>(): The name
of the API <User_TriggerTransmit>() which is called by CanIf shall be con-
figured for CanIf by parameter CanIfTxPduUserTriggerTransmitName (see
CanIfTxPduUserTriggerTransmitName).c()
Note: If CanIfTxPduTriggerTransmit is not specified or FALSE, no upper layer
modules have to be configured for Trigger Transmit. Therefore, <User_Trigger-
Transmit>() will not be called and CanIfTxPduUserTxConfirmationUL as well
as CanIfTxPduUserTriggerTransmitName need not to be configured.

117 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00890] dConfiguration of <User_TriggerTransmit>(): If CanI-


fTxPduUserTxConfirmationUL is set to PDUR, CanIfTxPduUserTrigger-
TransmitName must be PduR_CanIfTriggerTransmit.c()
[SWS_CANIF_00891] dConfiguration of <User_TriggerTransmit>(): If CanI-
fTxPduUserTxConfirmationUL is set to CDD, the name of the API <User_Trig-
gerTransmit>() has to be configured via parameter CanIfTxPduUserTrigger-
TransmitName.c()

8.6.3.2 <User_TxConfirmation>

[SWS_CANIF_00011] d
Service Name <User_TxConfirmation>
Syntax void <User_TxConfirmation> (
PduIdType TxPduId,
Std_ReturnType result
)

Sync/Async Synchronous
Reentrancy Reentrant for different PduIds. Non reentrant for the same PduId.
Parameters (in) TxPduId ID of the PDU that has been transmitted.
result E_OK: The PDU was transmitted. E_NOT_OK: Transmission of
the PDU failed.
Parameters (inout) None
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.
Available via configurable

c()
Note: This callback service is called by CanIf and implemented in the corresponding
upper layer module. It is called in case of a transmit confirmation of CanDrv.
Note: This type of confirmation callback service is mainly designed for PduR, CanNm,
and CanTp, but not exclusive.
Note: Parameter TxPduId is derived from <User> configuration.
Note: The call context of <User_TxConfirmation>() is either on interrupt level
(interrupt mode) or on task level (polling mode).
[SWS_CANIF_00438] dConfiguration of <User_TxConfirmation>(): The upper
layer module, which provides this callback service, has to be configured by CanI-
fTxPduUserTxConfirmationUL. If no upper layer modules are configured for trans-
mit confirmation using <User_TxConfirmation>(), no transmit confirmation is ex-
ecuted.c()

118 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00542] dConfiguration of <User_TxConfirmation>(): The name of


the API <User_TxConfirmation>() which is called by CanIf shall be configured
for CanIf by parameter CanIfTxPduUserTxConfirmationName.c()
Note: If transmit confirmations are not necessary or no upper layer modules are con-
figured for transmit confirmations and thus <User_TxConfirmation>() shall not be
called, CanIfTxPduUserTxConfirmationUL and CanIfTxPduUserTxConfir-
mationName need not to be configured.
[SWS_CANIF_00439] dConfiguration of <User_TxConfirmation>(): If CanIfTx-
PduUserTxConfirmationUL is set to PDUR, CanIfTxPduUserTxConfirmation-
Name must be PduR_CanIfTxConfirmation.c()
[SWS_CANIF_00543] dConfiguration of <User_TxConfirmation>(): If CanIfTx-
PduUserTxConfirmationUL is set to CAN_NM, CanIfTxPduUserTxConfirma-
tionName must be CanNm_TxConfirmation.c()
Hint (Dependency to another module):
If at least one CanIf Tx L-SDU is configured with CanNm_TxConfirmation(), which
means CanIfTxPduUserTxConfirmationUL equals CAN_NM, the CanNm config-
uration parameter CANNM_IMMEDIATE_TXCONF_ENABLED must be set to FALSE
(for CanNm related details see [4, Specification of CAN Network Management],
[SWS_CANNM_00284]).
[SWS_CANIF_00858] dConfiguration of <User_TxConfirmation>(): If CanIfTx-
PduUserTxConfirmationUL is set to J1939NM, CanIfTxPduUserTxConfirma-
tionName must be J1939Nm_TxConfirmation.c()
[SWS_CANIF_00544] dConfiguration of <User_TxConfirmation>(): If CanIfTx-
PduUserTxConfirmationUL is set to J1939TP, CanIfTxPduUserTxConfirma-
tionName must be J1939Tp_TxConfirmation.c()
[SWS_CANIF_00550] dConfiguration of <User_TxConfirmation>(): If CanIfTx-
PduUserTxConfirmationUL is set to CAN_TP, CanIfTxPduUserTxConfirma-
tionName must be CanTp_TxConfirmation.c()
[SWS_CANIF_00556] dConfiguration of <User_TxConfirmation>(): If CanIfTx-
PduUserTxConfirmationUL is set to XCP, CanIfTxPduUserTxConfirmation-
Name must be Xcp_CanIfTxConfirmation.c()
[SWS_CANIF_00551] dConfiguration of <User_TxConfirmation>(): If CanIfTx-
PduUserTxConfirmationUL is set to CDD, the name of the API <User_TxCon-
firmation>() has to be configured via parameter CanIfTxPduUserTxConfir-
mationName.c()
[SWS_CANIF_00879] dConfiguration of <User_TxConfirmation>(): If CanIfTx-
PduUserTxConfirmationUL is set to CAN_TSYN, CanIfTxPduUserTxConfirma-
tionName must be CanTSyn_TxConfirmation.c()

119 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

8.6.3.3 <User_RxIndication>

[SWS_CANIF_00012] d
Service Name <User_RxIndication>
Syntax void <User_RxIndication> (
PduIdType RxPduId,
const PduInfoType* PduInfoPtr
)

Sync/Async Synchronous
Reentrancy Reentrant for different PduIds. Non reentrant for the same PduId.
Parameters (in) RxPduId ID of the received PDU.
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 (inout) None
Parameters (out) None
Return value None
Description Indication of a received PDU from a lower layer communication interface module.
Available via configurable

c(SRS_Can_01003)
Note: This service indicates a successful reception of an L-SDU to the upper layer
module after passing all filters and validation checks.
Note: This callback service is called by CanIf and implemented in the configured
upper layer module (e.g. PduR, CanNm, CanTp, etc.) if configured accordingly (see
CanIfRxPduUserRxIndicationUL).
Note: Until <User_RxIndication>() returns, CanIf will not access <PduIn-
foPtr>. The <PduInfoPtr> is only valid and can be used by upper layers, until
the indication returns. CanIf guarantees that the number of configured bytes for this
<PduInfoPtr> is valid.
Note: The call context of <User_RxIndication>() is either on interrupt level (inter-
rupt mode) or on task level (polling mode).
[SWS_CANIF_00441] dConfiguration of <User_RxIndication>(): The upper layer
module, which provides this callback service, has to be configured by CanIfRxPdu-
UserRxIndicationUL.c()
[SWS_CANIF_00552] dConfiguration of <User_RxIndication>(): The name of
the API <User_RxIndication>() which will be called by CanIf shall be configured
for CanIf by parameter CanIfRxPduUserRxIndicationName.c()
Note: If receive indications are not necessary or no upper layer modules are configured
for receive indications and thus <User_RxIndication>() shall not be called, Can-
IfRxPduUserRxIndicationUL and CanIfRxPduUserRxIndicationName need
not to be configured.

120 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00442] dConfiguration of <User_RxIndication>(): If CanIfRxP-


duUserRxIndicationUL is set to PDUR, CanIfRxPduUserRxIndicationName
must be PduR_CanIfRxIndication.c()
[SWS_CANIF_00445] dConfiguration of <User_RxIndication>(): If CanIfRxP-
duUserRxIndicationUL is set to CAN_NM, CanIfRxPduUserRxIndicationName
must be CanNm_RxIndication.c()
The value passed to CanNm via the API parameter CanNmRxPduId refers to the CanNm
channel handle within the CanNm module (for CanNm related details see [4, Specifica-
tion of CAN Network Management]).
[SWS_CANIF_00859] dConfiguration of <User_RxIndication>(): If CanIfRxP-
duUserRxIndicationUL is set to J1939NM, CanIfRxPduUserRxIndication-
Name must be J1939Nm_RxIndication.c()
[SWS_CANIF_00448] dConfiguration of <User_RxIndication>(): If CanIfRxP-
duUserRxIndicationUL is set to CAN_TP, CanIfRxPduUserRxIndicationName
must be CanTp_RxIndication.c()
[SWS_CANIF_00554] dConfiguration of <User_RxIndication>(): If CanIfRxP-
duUserRxIndicationUL is set to J1939TP, CanIfRxPduUserRxIndication-
Name must be J1939Tp_RxIndication.c()
[SWS_CANIF_00555] dConfiguration of <User_RxIndication>(): If CanIfRx-
PduUserRxIndicationUL is set to XCP, CanIfRxPduUserRxIndicationName
must be Xcp_CanIfRxIndication.c()
[SWS_CANIF_00557] dConfiguration of <User_RxIndication>(): If CanIfRxP-
duUserRxIndicationUL is set to CDD the name of the API has to be configured via
parameter CanIfRxPduUserRxIndicationName.c()
[SWS_CANIF_00880] dConfiguration of <User_RxIndication>(): If CanIfRxP-
duUserRxIndicationUL is set to CAN_TSYN, CanIfRxPduUserRxIndication-
Name must be CanTSyn_RxIndication.c()

8.6.3.4 <User_ValidateWakeupEvent>

[SWS_CANIF_00532] d
Service Name <User_ValidateWakeupEvent>
Syntax void <User_ValidateWakeupEvent> (
EcuM_WakeupSourceType sources
)

Sync/Async Synchronous
Reentrancy Non Reentrant (defined within providing upper layer module)
5

121 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
Parameters (in) sources Validated CAN wakeup events. Every CAN controller or CAN
transceiver can be a separate wakeup source.
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates if a wake up event initiated from the wake up source (CAN controller or
transceiver) after a former request to the CAN Driver or CAN Transceiver Driver module is valid.
Available via configurable

c()
Note: This callback service is mainly implemented in and used by the ECU State Man-
ager module (see [13, Specification of ECU State Manager]).
Note: The CanIf calls this callback service. It is implemented by the configured up-
per layer module. It is called only during the call of CanIf_CheckValidation() if
a first CAN L-PDU reception event after a wake up event has been occurred at the
corresponding CAN Controller.
Note: The call context of <User_ValidateWakeupEvent>() is either on interrupt
level (interrupt mode) or on task level (polling mode).
Note: The callback service <User_ValidateWakeupEvent>() is in general re-
entrant for multiple CAN Controller usage, but not for the same CAN Controller
[SWS_CANIF_00659] dConfiguration of <User_ValidateWakeupEvent>(): If no
validation is needed, this API can be omitted by disabling CanIfPublicWake-
upCheckValidSupport.c()
[SWS_CANIF_00456] dConfiguration of <User_ValidateWakeupEvent>(): The
upper layer module which provides this callback service has to be configured by Can-
IfDispatchUserValidateWakeupEventUL, but:
• If no upper layer modules are configured for wake up notification using <User_-
ValidateWakeupEvent>(), no wake up notification needs to be configured.
CanIfDispatchUserValidateWakeupEventUL needs not to be configured.
• If wake up is not supported (CanIfCtrlWakeupSupport and CanIfTr-
cvWakeupSupport equal FALSE, CanIfDispatchUserValidateWakeu-
pEventUL is not configurable.
c()
[SWS_CANIF_00563] dConfiguration of <User_ValidateWakeupEvent>(): If
CanIfDispatchUserValidateWakeupEventUL is set to ECUM, CanIfDis-
patchUserValidateWakeupEventName must be EcuM_ValidateWakeu-
pEvent.c()
[SWS_CANIF_00564] dConfiguration of <User_ValidateWakeupEvent>(): If
CanIfDispatchUserValidateWakeupEventUL is set to CDD the name of the API

122 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

has to be configured via parameter CanIfDispatchUserValidateWakeupEvent-


Name.c()

8.6.3.5 <User_ControllerBusOff>

[SWS_CANIF_00014] d
Service Name <User_ControllerBusOff>
Syntax void <User_ControllerBusOff> (
uint8 ControllerId
)

Sync/Async Synchronous
Reentrancy Non Reentrant (defined within providing upper layer module)
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller, at which a BusOff occurred.
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates a bus-off event to the corresponding upper layer module (mainly the CAN
State Manager module).
Available via configurable

c(SRS_Can_01029)
Note: This callback service is mainly implemented in and used by CanSm (see [3,
Specification of CAN State Manager]).
Note: This callback service is called by CanIf and implemented by the configured up-
per layer module. It is called in case of a BusOff notification via CanIf_Controller-
BusOff() of the CanDrv. The delivered parameter ControllerId of the service
CanIf_ControllerBusOff() is passed to the upper layer module.
Note: The call context of <User_ControllerBusOff>() is either on interrupt level
(interrupt mode) or on task level (polling mode).
Note: The callback service <User_ControllerBusOff>() is in general re-entrant
for multiple CAN Controller usage, but not for the same CAN Controller.
Note: Before re-initialization/restart during BusOff recovery is executed <User_Con-
trollerBusOff>() is performed only once in case of multiple BusOff events at CAN
Controller.

Configuration of <User_ControllerBusOff>()

[SWS_CANIF_00450] dConfiguration of <User_ControllerBusOff>(): The upper


layer module which provides this callback service has to be configured by CanIfDis-
patchUserCtrlBusOffUL.c()

123 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00558] dConfiguration of <User_ControllerBusOff>(): The name


of the API <User_ControllerBusOff>() which will be called by CanIf shall be
configured for CanIf by parameter CanIfDispatchUserCtrlBusOffName.c()
[SWS_CANIF_00524] dConfiguration of <User_ControllerBusOff>(): At least
one upper layer module and hence an API of <User_ControllerBusOff>() has
mandatorily to be configured, which CanIf can call in case of an occurred call of
CanIf_ControllerBusOff().c()
[SWS_CANIF_00559] dConfiguration of <User_ControllerBusOff>(): If Can-
IfDispatchUserCtrlBusOffUL is set to CAN_SM, CanIfDispatchUserCtrlBu-
sOffName must be CanSM_ControllerBusOff.c()
[SWS_CANIF_00560] dConfiguration of <User_ControllerBusOff>(): If Can-
IfDispatchUserCtrlBusOffUL is set to CDD the name of the API has to be config-
ured via parameter CanIfDispatchUserCtrlBusOffName.c()

8.6.3.6 <User_ConfirmPnAvailability>

[SWS_CANIF_00821] d
Service Name <User_ConfirmPnAvailability>
Syntax void <User_ConfirmPnAvailability> (
uint8 TransceiverId
)

Sync/Async Synchronous
Reentrancy Non Reentrant (defined within providing upper layer module)
Parameters (in) TransceiverId Abstract CanIf TransceiverId, which is assigned to a CAN
transceiver, which was checked for PN availability.
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates that the CAN transceiver is running in PN communication mode.
Available via configurable

c()
Note: This callback service is mainly implemented in and used by CanSm (see [3,
Specification of CAN State Manager]).
Note: The call context of <User_ConfirmPnAvailability>() is either on interrupt
level (interrupt mode) or on task level (polling mode).
Note: The callback service <User_ConfirmPnAvailability>() is in general re-
entrant for multiple CAN Controller usage, but not for the same CAN Controller

124 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00823] dConfiguration of <User_ConfirmPnAvailability>():


The upper layer module, which is called (see [SWS_CANIF_00753]), has to be config-
urable by CanIfDispatchUserConfirmPnAvailabilityUL if CanIfPublicPn-
Support equals True.c()
[SWS_CANIF_00824] dConfiguration of <User_ConfirmPnAvailability>()
: The name of <User_ConfirmPnAvailability>() shall be configurable
by CanIfDispatchUserConfirmPnAvailabilityName if CanIfPublicPnSup-
port equals True.c()
[SWS_CANIF_00825] dConfiguration of <User_ConfirmPnAvailability>(): It
shall be configurable by CanIfPublicPnSupport, if CanIf supports this service (
False: not supported, True: supported)c()
[SWS_CANIF_00826] dConfiguration of <User_ConfirmPnAvailability>(): If
CanIfDispatchUserConfirmPnAvailabilityUL is set to CAN_SM, CanIfDis-
patchUserConfirmPnAvailabilityName must be CanSM_ConfirmPnAvail-
ability.c()
[SWS_CANIF_00827] dConfiguration of <User_ConfirmPnAvailability>(): If
CanIfDispatchUserConfirmPnAvailabilityUL is set to CDD, the name of
the service has to be configurable via parameter CanIfDispatchUserConfirmP-
nAvailabilityName.c()

8.6.3.7 <User_ClearTrcvWufFlagIndication>

[SWS_CANIF_00788] d
Service Name <User_ClearTrcvWufFlagIndication>
Syntax void <User_ClearTrcvWufFlagIndication> (
uint8 TransceiverId
)

Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) TransceiverId Abstracted CanIf TransceiverId, for which this function was called.
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates that the CAN transceiver has cleared the WufFlag. This function is called
in CanIf_ClearTrcvWufFlagIndication.
Available via configurable

c()
Note: This callback service is mainly implemented in and used by CanSm (see [3,
Specification of CAN State Manager]).

125 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Note: The call context of <User_ClearTrcvWufFlagIndication>() is either on


interrupt level (interrupt mode) or on task level (polling mode).
Note: The callback service <User_ClearTrcvWufFlagIndication>() is in gen-
eral re-entrant for multiple CAN Controller usage, but not for the same CAN Controller
[SWS_CANIF_00794] dConfiguration of <User_ClearTrcvWufFlagIndication>
(): The upper layer module, which is called (see [SWS_CANIF_00757]), has to be
configurable by CanIfDispatchUserClearTrcvWufFlagIndicationUL if Can-
IfPublicPnSupport equals True.c()
[SWS_CANIF_00795] dConfiguration of <User_ClearTrcvWufFlagIndication>
(): The name of <User_ClearTrcvWufFlagIndication>() shall be config-
urable by CanIfDispatchUserClearTrcvWufFlagIndicationName if CanIf-
PublicPnSupport equals True.c()
[SWS_CANIF_00796] dConfiguration of <User_ClearTrcvWufFlagIndication>
(): It shall be configurable by CanIfPublicPnSupport, if CanIf supports this ser-
vice (False: not supported, True: supported)c()
[SWS_CANIF_00797] dConfiguration of <User_ClearTrcvWufFlagIndication>
(): If CanIfDispatchUserClearTrcvWufFlagIndicationUL is set to CAN_SM,
CanIfDispatchUserClearTrcvWufFlagIndicationName must be CanSM_-
ClearTrcvWufFlagIndication.c()
[SWS_CANIF_00798] dConfiguration of <User_ClearTrcvWufFlagIndication>
(): If CanIfDispatchUserClearTrcvWufFlagIndicationUL is set to CDD, the
name of the service has to be configurable via parameter CanIfDispatchUser-
ClearTrcvWufFlagIndicationName.c()

8.6.3.8 <User_CheckTrcvWakeFlagIndication>

[SWS_CANIF_00814] d
Service Name <User_CheckTrcvWakeFlagIndication>
Syntax void <User_CheckTrcvWakeFlagIndication> (
uint8 TransceiverId
)

Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) TransceiverId Abstracted CanIf TransceiverId, for which this function was called.
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates that the wake up flag in the CAN transceiver is set. This function is called
in CanIf_CheckTrcvWakeFlagIndication.
Available via configurable

126 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

c()
Note: This callback service is mainly implemented in and used by CanSm (see [3,
Specification of CAN State Manager]).
Note: The call context of <User_CheckTrcvWakeFlagIndication>() is either on
interrupt level (interrupt mode) or on task level (polling mode).
Note: The callback service <User_CheckTrcvWakeFlagIndication>() is in gen-
eral re-entrant for multiple CAN Controller usage, but not for the same CAN Controller
[SWS_CANIF_00800] dConfiguration of <User_CheckTrcvWakeFlagIndica-
tion>(): The upper layer module, which is called (see [SWS_CANIF_00759]), has
to be configurable by CanIfDispatchUserCheckTrcvWakeFlagIndicationUL if
CanIfPublicPnSupport equals True.c()
[SWS_CANIF_00801] dConfiguration of <User_CheckTrcvWakeFlagIndica-
tion>(): The name of <User_CheckTrcvWakeFlagIndication>() shall be con-
figurable by CanIfDispatchUserCheckTrcvWakeFlagIndicationName if Can-
IfPublicPnSupport equals True.c()
[SWS_CANIF_00802] dConfiguration of <User_CheckTrcvWakeFlagIndica-
tion>(): It shall be configurable by CanIfPublicPnSupport, if CanIf supports
this service (False: not supported, True: supported)c()
[SWS_CANIF_00803] dConfiguration of <User_CheckTrcvWakeFlagIndica-
tion>(): If CanIfDispatchUserCheckTrcvWakeFlagIndicationUL is set to
CAN_SM, CanIfDispatchUserCheckTrcvWakeFlagIndicationName must be
CanSM_CheckTransceiverWakeFlagIndication.c()
[SWS_CANIF_00804] dConfiguration of <User_CheckTrcvWakeFlagIndica-
tion>(): If CanIfDispatchUserCheckTrcvWakeFlagIndicationUL is set to
CDD, the name of the service has to be configurable via parameter CanIfDis-
patchUserCheckTrcvWakeFlagIndicationName.c()

8.6.3.9 <User_ControllerModeIndication>

[SWS_CANIF_00687] d
Service Name <User_ControllerModeIndication>
Syntax void <User_ControllerModeIndication> (
uint8 ControllerId,
Can_ControllerStateType ControllerMode
)

Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) ControllerId Abstracted CanIf ControllerId which is assigned to a CAN
controller, at which a controller state transition occurred.
5

127 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

4
ControllerMode Notified CAN controller mode
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates a CAN controller state transition to the corresponding upper layer module
(mainly the CAN State Manager module).
Available via configurable

c()
Note: The upper layer module provides the Service ID.
Note: This callback service is mainly implemented in and used by CanSm (see [3,
Specification of CAN State Manager]).
Note: The CanIf calls this callback service. It is implemented by the configured up-
per layer module. It is called in case of a state transition notification via CanIf_-
ControllerModeIndication() of the CanDrv. The delivered parameter Con-
trollerId of the service CanIf_ControllerModeIndication() is passed to
the upper layer module. The delivered parameter ControllerMode of the service
CanIf_ControllerModeIndication() is mapped to the appropriate parameter
ControllerMode of <User_ControllerModeIndication>().
Note: For different upper layer users different service names shall be used.
Note: The call context of <User_ControllerModeIndication>() is on task level
(polling mode).
Note: The callback service <User_ControllerModeIndication>() is in general
re-entrant for multiple CAN Controller usage, but not for the same CAN Controller
[SWS_CANIF_00689] dConfiguration of <User_ControllerModeIndication>()
: The upper layer module which provides this callback service has to be configured by
CanIfDispatchUserCtrlModeIndicationUL.c()
[SWS_CANIF_00690] dConfiguration of <User_ControllerModeIndication>()
: The name of <User_ControllerModeIndication>() which is called by CanIf
shall be configured for CanIf by parameter CanIfDispatchUserCtrlModeIndi-
cationName. This is only necessary if state transition notifications are configured via
CanIfDispatchUserCtrlModeIndicationUL.c()
[SWS_CANIF_00691] dConfiguration of <User_ControllerModeIndication>()
: If CanIfDispatchUserCtrlModeIndicationUL is set to CAN_SM, CanIfDis-
patchUserCtrlModeIndicationName must be CanSM_ControllerModeIndi-
cation.c()
[SWS_CANIF_00692] dConfiguration of <User_ControllerModeIndication>()
: If CanIfDispatchUserCtrlModeIndicationUL is set to CDD the name of the
function has to be configured via parameter CanIfDispatchUserCtrlModeIndi-
cationName.c()

128 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

8.6.3.10 <User_TrcvModeIndication>

[SWS_CANIF_00693] d
Service Name <User_TrcvModeIndication>
Syntax void <User_TrcvModeIndication> (
uint8 TransceiverId,
CanTrcv_TrcvModeType TransceiverMode
)

Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) TransceiverId Abstracted CanIf TransceiverId which is assigned to a CAN
transceiver, at which a transceiver state transition occurred.
TransceiverMode Notified CAN transceiver mode
Parameters (inout) None
Parameters (out) None
Return value None
Description This service indicates a CAN transceiver state transition to the corresponding upper layer
module (mainly the CAN State Manager module).
Available via configurable

c()
Note: The upper layer module provides the Service ID.
Note: This callback service is mainly implemented in and used by CanSm (see [3,
Specification of CAN State Manager]).
Note: The CanIf calls this callback service. It is implemented by the configured upper
layer module. It is called in case of a state transition notification via CanIf_TrcvMod-
eIndication() of the CanTrcv. The delivered parameter Transceiver of the ser-
vice CanIf_TrcvModeIndication() is mapped (as configured) to the appropriate
parameter TransceiverId which will be passed to the upper layer module. The de-
livered parameter TransceiverMode of the service CanIf_TrcvModeIndication
() is mapped to the appropriate parameter TransceiverMode of <User_TrcvMod-
eIndication>().
Note: For different upper layer users different service names shall be used.
[SWS_CANIF_00694] dCaveats of <User_TrcvModeIndication>():
• The CanTrcv must be initialized after Power ON.
• The call context is either on task level (polling mode).
• This callback service is in general re-entrant for multiple CAN Transceiver us-
age, but not for the same CAN Transceiver.
c()

129 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

[SWS_CANIF_00695] dConfiguration of <User_TrcvModeIndication>(): The up-


per layer module which provides this callback service has to be configured by Can-
IfDispatchUserTrcvModeIndicationUL, but:
• If no upper layer modules are configured for transceiver mode indications using
<User_TrcvModeIndication>(), no transceiver mode indication needs to be
configured. CanIfDispatchUserTrcvModeIndicationUL needs not to be
configured.
• If transceivers are not supported (CanIfTrcvDrvCfg is not configured, Can-
IfDispatchUserTrcvModeIndicationUL is not configurable.
c()
If no upper layer modules are configured for state transition notifications using
<User_TrcvModeIndication>(), no state transition notification needs to be con-
figured.
[SWS_CANIF_00696] dConfiguration of <User_TrcvModeIndication>(): The
name of <User_TrcvModeIndication>() which will be called by CanIf shall be
configured for CanIf by parameter CanIfDispatchUserTrcvModeIndication-
Name. This is only necessary if state transition notifications are configured via Can-
IfDispatchUserTrcvModeIndicationUL.c()
[SWS_CANIF_00697] dConfiguration of <User_TrcvModeIndication>(): If
CanIfDispatchUserTrcvModeIndicationUL is set to CAN_SM, CanIfDis-
patchUserTrcvModeIndicationName must be CanSM_TransceiverMod-
eIndication.c()
[SWS_CANIF_00698] dConfiguration of <User_TrcvModeIndication>(): If Can-
IfDispatchUserTrcvModeIndicationUL is set to CDD the name of the API has
to be configured via parameter CanIfDispatchUserTrcvModeIndicationName.c
()

130 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

9 Sequence diagrams
The following sequence diagrams show the interactions between CanIf and CanDrv.

9.1 Transmit request (single CAN Driver)


CanIf User «module» «module» «module» «Peripheral»
SchM CanIf Can CanController

CanIf_Transmit(Std_ReturnType, PduIdType, const PduInfoType*)

Can_Write(Std_ReturnType, Can_HwHandleType,
const Can_PduType*)

alt CAN Controller


Copy L-PDU into CAN Hardware()
[CAN controller hardware object is free]

Copy L-PDU into CAN Hardware()


Can_Write()

[CAN controller hardware object is busy]

Can_Write()

Insert L-PDU in transmit buffer()

CanIf_Transmit()

Figure 9.1: Transmission request with a single CAN Driver

Activity Description
Transmission request The upper layer initiates a transmit request via the service
CanIf_Transmit(). The parameter CanTxPduId identifies the
requested L-SDU. The service performs following steps:
• validation of the input parameter
• definition of the CAN Controller to be used
The second parameter *PduInfoPtr is a pointer on the structure
with transmit L-SDU related data such as SduLength and
*SduDataPtr.
Start transmission CanIf_Transmit() requests a transmission and calls the
CanDrv service Can_Write() with corresponding processing of
the HTH.
Hardware request Can_Write() writes all L-PDU data in the CAN Hardware (if it is
free) and sets the hardware request for transmission.
E_OK from Can_Write Can_Write() returns E_OK to CanIf_Transmit().
service
CAN_BUSY from Can_Write If CanDrv detects, there are no free hardware objects available, it
service returns CAN_BUSY to CanIf.
Copying into the buffer The L-PDU of the rejected transmit request will be inserted in the
transmit buffer of CanIf until the next transmit confirmation.
E_OK from CanIf CanIf_Transmit() returns E_OK to the upper layer.

131 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

9.2 Transmit request (multiple CAN Drivers)


CanIf User «module» «module» Can_99_Ext1: «Peripheral» Can_99_Ext2: «Peripheral»
SchM CanIf Can CanController A: Can CanController B:
CanController CanController

alt CAN Controller A/B

[CAN Controller A used]


CanIf_Transmit(Std_ReturnType, PduIdType, const PduInfoType*)

Can_Write(Std_ReturnType, Can_HwHandleType,
const Can_PduType*)

alt CAN Controller A hardware status


Copy L-PDU in CAN
[CAN controller hardware object is free] Hardware A()

Copy L-PDU in CAN


Hardware A()
Can_Write()

[CAN controller hardware object in busy]


Can_Write()

Insert L-PDU in transmit buffer()

CanIf_Transmit()

[CAN Controller B used]

CanIf_Transmit(Std_ReturnType, PduIdType, const PduInfoType*)

Can_Write(Std_ReturnType, Can_HwHandleType,
const Can_PduType*)

alt CAN Controller B hardware status


Copy L-PDU in CAN
[CAN Conroller hardware object is free] Hardware B()

Copy L-PDU in CAN


Hardware B()
Can_Write()

[CAN controller hardware object is busy]


Can_Write()

Insert L-PDU in
transmit buffer()

CanIf_Transmit()

Figure 9.2: Transmission request with multiple CAN Drivers

First transmit request:


Activity Description
Transmission request A The upper layer initiates a transmit request via the service
CanIf_Transmit(). The parameter CanTxPduId identifies the
requested L-SDU. The service performs following steps:
• validation of the input parameter
• definition of the CAN Controller to be used (here:
Can_99_Ext1)
The second parameter *PduInfoPtr is a pointer on the structure
with transmit L-SDU related data such as SduLength and
*SduDataPtr.

132 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Start transmission CanIf_Transmit() requests a transmission and calls the


CanDrv Can_99_Ext1 service Can_Write_99_Ext1() with
corresponding processing of the HTH.
Hardware request Can_Write_99_Ext1() writes all L-PDU data in the CAN
Hardware of Controller A (if it is free) and sets the hardware
request for transmission.
E_OK from Can_Write Can_Write_99_Ext1() returns E_OK to CanIf_Transmit().
service
CAN_BUSY from Can_Write If CanDrv Can_99_Ext1 detects, there are no free hardware
service objects available, it returns CAN_BUSY to CanIf.
Copying into the buffer The L-PDU of the rejected transmit request will be inserted in the
transmit buffers of CanIf until the next transmit confirmation.
E_OK from CanIf CanIf_Transmit() returns E_OK to the upper layer.

Second transmit request:


Activity Description
Transmission request B The upper layer initiates a transmit request via the service
CanIf_Transmit(). The parameter CanTxPduId identifies the
requested L-SDU. The service performs following steps:
• validation of the input parameter
• definition of the CAN Controller to be used (here:
Can_99_Ext2)
The second parameter *PduInfoPtr is a pointer on the structure
with transmit L-SDU related data such as SduLength and
*SduDataPtr.
Start transmission CanIf_Transmit() starts a transmission and calls the CanDrv
Can_99_Ext2 service Can_Write_99_Ext2() with
corresponding processing of the HTH.
Hardware request Can_Write_99_Ext2() writes all L-PDU data in the CAN
Hardware of Controller B (if it is free) and sets the hardware
request for transmission.
E_OK from Can_Write Can_Write_99_Ext2() returns E_OK to CanIf_Transmit().
service
CAN_BUSY from Can_Write If CanDrv Can_99_Ext2 detects, there are no free hardware
service objects available, it returns CAN_BUSY to CanIf.
Copying into the buffer The L-PDU of the rejected transmit request will be inserted in the
transmit buffers of CanIf until the next transmit confirmation.
E_OK from CanIf CanIf_Transmit() returns E_OK to the upper layer.

133 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

9.3 Transmit confirmation (interrupt mode)


CanIf User «module» «module» «Peripheral»
CanIf Can CanController

Transmit Interrupt
()

CanIf_TxConfirmation(PduIdType)

<User_TxConfirmation>(PduIdType, Std_ReturnType)

<User_TxConfirmation>()
CanIf_TxConfirmation()
Transmit Interrupt()

Figure 9.3: Transmit confirmation interrupt driven

Activity Description
Transmit interrupt The acknowledged CAN frame signals a successful transmission to
the receiving CAN Controller and triggers the transmit interrupt.
Confirmation to CanIf CanDrv calls the service CanIf_TxConfirmation(). The
parameter CanTxPduId specifies the L-PDU previously sent by
Can_Write().
CanDrv must store the all in HTHs pending L-PDU Ids in an array
organized per HTH to avoid new search of the L-PDU ID for call of
CanIf_TxConfirmation().
Confirmation to upper layer Calling of the corresponding upper layer confirmation service
<User_TxConfirmation>(id, E_OK). It signals a successful
L-SDU transmission to the upper layer.

134 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

9.4 Transmit confirmation (polling mode)


CanIf User «module» «module» «Peripheral»
CanIf Can CanController

BSW Scheduler

loop Cyclic Task of Interface


Can_MainFunction_Write()
Check for pending TX
confirmations()

Check for pending TX


confirmations()

alt Pending Tx confirmation


[Tx confirmation is pending ]
CanIf_TxConfirmation(PduIdType)

<User_TxConfirmation>(PduIdType, Std_ReturnType)

<User_TxConfirmation>()

CanIf_TxConfirmation()

[No Tx confirmation is pending]

Can_MainFunction_Write()

Figure 9.4: Transmit confirmation polling driven

Activity Description
Cyclic Task CanDrv The service Can_MainFunction_Write() is called by the BSW
Scheduler.
Check for pending transmit Can_MainFunction_Write() checks the underlying CAN
confirmations Controller(s) about pending transmit confirmations of
previously succeeded transmit events.
Transmit Confirmation The acknowledged CAN frame signals a successful transmission
to the sending CAN Controller.
Confirmation to CanIf CanDrv calls the service CanIf_TxConfirmation(). The
parameter CanTxPduId specifies the L-PDU previously sent by
Can_Write().
CanDrv must store the all in HTHs pending L-PDU Ids in an array
organized per HTH to avoid new search of the L-PDU ID for call of
CanIf_TxConfirmation().
Confirmation to upper layer Calling of the corresponding upper layer confirmation service
<User_TxConfirmation>(id, E_OK). It signals a successful
L-SDU transmission to the upper layer.

135 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

9.5 Transmit confirmation (with buffering)


CanIf User «module» «module» «module» «Peripheral»
SchM CanIf Can CanController

Transmit Confirmation Interrupt()

CanIf_TxConfirmation(PduIdType)

check transmit
buffers for other
pending L-PDU()

alt Transmit Buffering


Can_Write(Std_ReturnType,
[Buffer is filled] Can_HwHandleType, const Can_PduType*)
Write L-PDU into CAN Hardware()

Write L-PDU into CAN Hardware()


Can_Write()

Remove L-PDU successfully


requested for transmission
from transmit buffer()

[Buffer is empty]

<User_TxConfirmation>(PduIdType, Std_ReturnType)

<User_TxConfirmation>()
CanIf_TxConfirmation()
Transmit Confirmation Interrupt()

Figure 9.5: Transmit confirmation with buffering

Activity Description
Transmit interrupt Acknowledged CAN frame signals successful transmission to
receiving CAN Controller and triggers transmit interrupt.
Confirmation to CanIf CanDrv calls service CanIf_TxConfirmation(). Parameter
CanTxPduId specifies the L-PDU previously transmitted by
Can_Write(). CanDrv must store the all in HTHs pending L-PDU
Ids in an array organized per HTH to avoid new search of the
L-PDU ID for call of CanIf_TxConfirmation().
Check of transmit buffers The transmit buffers of CanIf checked, whether a pending L-PDU
is stored or not.
Transmit request passed to In case of pending L-PDUs in the transmit buffers the highest
CanDrv priority order the latest L-PDU is requested for transmission by
Can_Write(). It signals a successful L-PDU transmission to the
upper layer. Thus Can_Write() can be called re-entrant.
Remove transmitted L-PDU The L-PDU pending for transmission is removed from the
from transmit buffers transmission buffers by CanIf.
Confirmation to the upper Calling of the corresponding upper layer confirmation service
layer <User_TxConfirmation>(id, E_OK). It signals a successful
L-SDU transmission to the upper layer.

136 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

9.6 Trigger Transmit Request


«peripheral» CanIfUser «module» «module»
CanController CanIf Can

CanIf_Transmit(Std_ReturnType,
PduIdType, const PduInfoType*)
Can_Write(Std_ReturnType,
Can_HwHandleType, const Can_PduType*)

alt Controller HW Status CanIf_TriggerTransmit(Std_ReturnType,


PduIdType, PduInfoType*)
[Controller HW object free]

<CanIfUser>_CanIfTriggerTransmit(Std_ReturnType,
PduIdType, PduInfoType*)
  
 
Copy L-Pdu into CAN hardware

Copy L-PDU into CAN hardware

CanIf_TriggerTransmit()

Can_Write()

[Controller HW object busy] Can_Write()

    

CanIf_Transmit()

Figure 9.6: Trigger Transmit Request

137 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Activity Description
Transmission request The upper layer initiates a transmit request via the service
CanIf_Transmit(). The parameter CanTxPduId identifies the
requested L-SDU. The service performs following steps:
• validation of the input parameter
• definition of the CAN Controller to be used
The second parameter *PduInfoPtr is a pointer to the structure
with the size (SduLength) of the L-SDU to be transmitted. The
actual SDU data has not been passed by the upper layer. Hence,
the pointer *SduDataPtr points to NULL.
Start transmission CanIf_Transmit() requests a transmission and calls the
CanDrv service Can_Write() with corresponding processing of
the HTH.
Trigger transmission If the CAN hardware is free Can_Write() requests the SDU data
from CanIf by its service CanIf_TriggerTransmit() passing
the L-SDUs corresponding ID and a pointer to the CAN hardware’s
buffer. CanIf forwards the trigger transmit request to the
corresponding upper layer (CanIfUser). CanIf passes the buffer
pointer received by CanDrv. The CanIfUser finally copies the
SDU data to the buffer provided by CanIf (the CAN hardware
buffer) and returns status and number of bytes effectively written.
E_OK from Can_Write() Can_Write() returns E_OK to CanIf_Transmit().
service
CAN_BUSY from If CanDrv detects, there are no free hardware objects available, it
Can_Write() service returns CAN_BUSY to CanIf.
Queuing of transmission The Transmit Request for the L-PDU, which has been rejected
request by CanDrv, is queued by CanIf until the next transmit
confirmation.
E_OK from CanIf CanIf_Transmit() returns E_OK to the upper layer.

138 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

9.7 Receive indication (interrupt mode)


CanIf User «module» «module» «Peripheral»
CanIf Can CanController

Receive Interrupt()

Invalidation of hardware object()

Invalidation of hardware object()

alt Temporary buffer usage

[Temp. buffer used = Data normalization necessary]


Copy received L-PDU into temporary buffer()

Copy received L-PDU into temporary buffer()

[Temp. buffer not used = Data normalization not necessary]

CanIf_RxIndication(const Can_HwType*,
const PduInfoType*)

    Software filtering (optional)


   
    and L-PDU assignment
 
[CAN L-PDU ID was found]:
Data Length Check (optional)

<User_RxIndication>(PduIdType,    


const PduInfoType*)  ! "

alt Temporary buffer usage

[Temp. buffer used = Data normalization necessary]


Copy Data()

Copy Data()

[Temp. buffer not used = Data normalization not necessary] Copy Data()

Copy Data()

<User_RxIndication>()

CanIf_RxIndication()

Validation of hardware object()

Validation of hardware object()

Receive
Interrupt()

Figure 9.7: Receive indication interrupt driven

Activity Description
Receive Interrupt The CAN Controller indicates a successful reception and
triggers a receive interrupt.
Invalidation of CAN The CPU (CanDrv) get exclusive access rights to the CAN mailbox
hardware object, provide or at least to the corresponding hardware object, where new data
CPU access to CAN were received.
mailbox

139 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Buffering, normalizing The L-PDU is normalized and is buffered in the temporary buffer
located in CanDrv. Each CanDrv owns such a temporary buffer
for every Physical Channel only if normalizing of the data is
necessary.
Indication to CanIf The reception is indicated to CanIf by calling of
CanIf_RxIndication(). The HRH specifies the CAN RAM
Hardware Object and the corresponding CAN Controller,
which contains the received L-PDU. The temporary buffer is
referenced to CanIf by PduInfoPtr->SduDataPtr.
Software Filtering The Software Filtering checks, whether the received L-PDU will be
processed on a local ECU. If not, the received L-PDU is not
indicated to upper layers. Further processing is suppressed.
Data Length Check If the L-PDU is found, the Data Length of the received L-PDU is
compared with the expected, statically configured one for the
received L-PDU.
Receive Indication to the The corresponding receive indication service of the upper layer is
upper layer called. This signals a successful reception to the target upper
layer. The parameter RxPduId specifies the L-SDU, the second
parameter is the reference on the temporary buffer within the
L-SDU.
During is execution of this service the CAN hardware buffers must
be unlocked for CPU access/locked for CAN Controller access.
Validation of CAN hardware The CAN Controller get back exclusive access rights to the
object, allow access of CAN CAN mailbox or at least to the corresponding hardware object,
Controller to CAN where new data were already being copied into the upper layer
mailbox buffer.

140 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

9.8 Receive indication (polling mode)


CanIf User «module» «module» «Peripheral»
CanIf Can CanController

BSW Scheduler

loop Cyclic Task of Interface


Can_MainFunction_Read()
Check for pending Rx
indication()

alt Pending Rx indication Invalidation of hardware


[Rx indication pending] object()

alt Temporary buffer usage


[Temp. buffer used = Data normalization necessary] Copy received L-PDU into
temporary buffer()

[Temp. buffer not used = Data normalization not necessary]

CanIf_RxIndication(const Can_HwType*,
const PduInfoType*)

Software filtering (optional)


and L-PDU assignment
   
   
   
  [CAN L-PDU ID was found]:
Data Length Check (optional)

<User_RxIndication>(PduIdType,
const PduInfoType*)
  
  ! "

alt Temporary buffer usage

[Temp. buffer used = Data normalization necessary]


Copy data()

[Temp. buffer not used = Data normalization not necessary]


Copy data()

<User_RxIndication>()

CanIf_RxIndication()
Validation of hardware
object()

[No Rx indication pending]

Can_MainFunction_Read()

Figure 9.8: Receive indication polling driven

141 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Activity Description
Cyclic Task CanDrv The service Can_MainFunction_Read() is called by the BSW
Scheduler.
Check for new received Can_MainFunction_Read() checks the underlying CAN
L-PDU Controller(s) about new received L-PDUs.
Invalidation of CAN In case of a new receive event the CPU (CanDrv) get exclusive
hardware object, provide access rights to the CAN mailbox or at least to the corresponding
CPU access to CAN hardware object, where new data were received.
mailbox
Buffering, normalizing In case of a new receive event the L-PDU is normalized and is
buffered in the temporary buffer located in CanDrv. Each CanDrv
owns such a temporary buffer for every Physical Channel only
if normalizing of the data is necessary.
Indication to CanIf The reception is indicated to CanIf by calling of
CanIf_RxIndication(). The HRH specifies the CAN RAM
Hardware Object and the corresponding CAN Controller,
which contains the received L-PDU. The temporary buffer is
referenced to CanIf by PduInfoPtr->SduDataPtr.
Software Filtering The Software Filtering checks, whether the received L-PDU will be
processed on a local ECU. If not, the received L-PDU is not
indicated to upper layers. Further processing is suppressed.
Data Length Check If the L-PDU is found, the Data Length of the received L-PDU is
compared with the expected, statically configured one for the
received L-PDU.
Receive Indication to the If configured, the corresponding receive indication service of the
upper layer upper layer is called. This signals a successful reception to the
target upper layer. The parameter RxPduId specifies the L-SDU,
the second parameter is the reference on the temporary buffer
within the L-SDU.
During is execution of this service the CAN hardware buffers must
be unlocked for CPU access/locked for CAN Controller access.
Validation of CAN hardware The CAN Controller get back exclusive access rights to the
object, allow access of CAN CAN mailbox or at least to the corresponding hardware object,
Controller to CAN where new data were already being copied into the upper layer
mailbox buffer.

142 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

9.9 Read received data


CanIf User «module» «module» «module» «Peripheral»
SchM CanIf Can CanController

Receive
Interrupt()

Invalidation of hardware
object()

Invalidation of hardware
object()
CanIf_RxIndication(const Can_HwType*,
const PduInfoType*)

& 
   [L-PDU reception in BasicCAN]:
  !  Software filtering and L-PDU
 ' assignment()

[CAN L-PDU ID was found]:


Data Length Check()

Copy data to CANIF receive L-PDU


buffer()
()   *   
      
Copy data to CANIF receive L-PDU
 +, 
buffer()

Set Indication
Flag()
<User_RxIndication>(PduIdType,
const PduInfoType*)

<User_RxIndication>()
CanIf_RxIndication()
Validation of hardware
object()

Validation of hardware
object()
Receive
Interrupt()
CanIf_ReadRxNotifStatus(CanIf_NotifStatusType, PduIdType)

Read Indication
        ! flag()
"#$%   
    Reset Indication
flag()
CanIf_ReadRxNotifStatus()

CanIf_ReadRxPduData(Std_ReturnType, PduIdType,
PduInfoType**)

Read data from


CANIF Rx buffer()
CanIf_ReadRxPduData()

Figure 9.9: Read received data

Activity Description
Receive Interrupt The CAN Controller indicates a successful reception and
triggers a receive interrupt.
Invalidation of CAN The CPU (CanDrv) get exclusive access rights to the CAN mailbox
hardware object, provide or at least to the corresponding hardware object, where new data
CPU access to CAN were received.
mailbox

143 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Buffering, normalizing The L-PDU is normalized and is buffered in the temporary buffer
located in CanDrv. Each CanDrv owns such a temporary buffer
for every Physical Channel only if normalizing of the data is
necessary.
Indication to CanIf The reception is indicated to CanIf by calling of
CanIf_RxIndication(). The HRH specifies the CAN RAM
Hardware Object and the corresponding CAN Controller,
which contains the received L-PDU. The temporary buffer is
referenced to CanIf by PduInfoPtr->SduDataPtr.
Software Filtering The Software Filtering checks, whether the received L-PDU will be
processed on a local ECU. If not, the received L-PDU is not
indicated to upper layers. Further processing is suppressed.
Data Length Check If the L-PDU is found, the Data Length of the received L-PDU is
compared with the expected, statically configured one for the
received L-PDU.
Copy data The data is copied out of the CAN hardware into the receive CAN
L-PDU buffers in CanIf. During access the CAN hardware buffers
must be unlocked for CPU access/locked for CAN Controller
access.
Indication Flag Set indication status flag for the received L-PDU in CanIf.
Receive Indication to the The corresponding receive indication service of the upper layer is
upper layer called. This signals a successful reception to the target upper
layer. The parameter RxPduId specifies the L-SDU, the second
parameter is the reference on the temporary buffer within the
L-SDU.
Validation of CAN hardware The CAN Controller get back exclusive access rights to the
object, allow access of CAN CAN mailbox or at least to the corresponding hardware object,
Controller to CAN where new data were already being copied into the upper layer
mailbox buffer.
Read indication status Times later the upper layer can read the indication status by call of
CanIf_ReadRxNotifStatus(). This service can also be used
for transmit L-PDUs. Then it return the confirmation status.
Reset indication status Before CanIf_ReadRxNotifStatus() returns, the indication
status is reset.
Read received data Times later the upper layer can read the received data by call of
CanIf_ReadRxPduData().
Read CanIf Rx buffer CanIf_ReadRxPduData() reads the data from CanIf Rx buffer.
E_OK from CanIf If CanIf_ReadRxPduData() was successful, the request returns
E_OK with valid PduInfoPtr.

144 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

9.10 Start CAN network


CanIf User «module» «module» «Peripheral»
CanIf Can CanController

loop Requesting CAN controller mode consecutively. If mode changed -> CanIf_ControllerModeIndication()

Can_MainFunction_Mode()

CanIf_SetControllerMode(Std_ReturnType, uint8,
Can_ControllerStateType)
Can_SetControllerMode(Std_ReturnType, uint8,
Can_ControllerStateType)

Disable Wakeup
interrupt, if supported()

request CAN controller mode transition to START()

alt CAN Controller Mode Can_SetControllerMode returns with E_OK()


[STOPPED] CanIf_SetControllerMode returns with E_OK() CAN controller mode
changes to START
CanIf_ControllerModeIndication(uint8,
Can_ControllerStateType)

<User_ControllerModeIndication>(uint8,      


Can_ControllerStateType)       
        
<User_ControllerModeIndication>()
CanIf_ControllerModeIndication()          

[STOPPED with direct indication]


CanIf_ControllerModeIndication(Controller, ControllerMode)

<User_ControllerModeIndication>(uint8,
Can_ControllerStateType)
           
        
<User_ControllerModeIndication>() !!   "        
CanIf_ControllerModeIndication()  
Can_SetControllerMode returns with E_OK()
CanIf_ControllerMode returns with E_OK()

[STARTED] CanIf_ControllerModeIndication(uint8,
Can_ControllerStateType)

<User_ControllerModeIndication>(uint8,
Can_ControllerStateType)
<User_ControllerModeIndication>()
CanIf_ControllerModeIndication()

Can_SetControllerMode returns with E_OK()


CanIf_SetControllerMode returns with E_OK()

[SLEEP]
Can_SetControllerMode returns with E_NOT_OK()
CanIf_SetControllerMode returns with E_NOT_OK() " #     #   $   "
        

Figure 9.10: Start CAN network

This sequence diagram resembles "Stop CAN network" or "Sleep CAN network".
Activity Description
Loop requesting CAN The Can_MainFunction_Mode() is triggered consecutively. It
controller mode checks the HW if a controller mode has changed. If so, it is notified
consecutively. via a function call of CanIf_ControllerModeIndication
(Controller, ControllerMode).

145 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

The upper layer requests " The upper layer calls CanIf_SetControllerMode
STARTED" mode of the (ControllerId, CAN_CS_STARTED) to request STARTED
desired CAN controller mode for the requested CAN controller.
CanDrv disables wake up This is only done in case of requesting "STARTED" mode. If "
interrupts, if supported SLEEP" mode of CAN controller is requested, here the wake up
interrupts are enabled. In case of "STOPPED", nothing happens.
CanDrv requests the CAN During function call Can_SetControllerMode(Controller,
controller to transition into Can_ControllerStateType), the CanDrv enters the request
the requested mode ( into the hardware of the CAN controller. This may mean that the
CAN_CS_STARTED). controller mode transitions directly, but it could mean that it takes a
few milliseconds until the controller changes its state. It depends
on the controllers.
The following reaction depends on the controller and its current operation mode
CAN controller was in The former request Can_SetControllerMode() returns and
STOPPED mode informs CanIf about a successful request which in turn returns the
upper layer request CanIf_SetControllerMode(). The
Can_MainFunction_Mode() detects the successful mode
transition of the CAN controller and inform the CanIf
asynchronously via CanIf_ControllerModeIndication
(Controller, CAN_CS_STARTED).
CAN controller was in During the former request Can_SetControllerMode() the
STOPPED mode and the function CanIf_ControllerModeIndication(Controller,
CAN controller transitions CAN_CS_STARTED) is called to inform the CanIf directly about the
very fast so that mode successful mode transition. When
indication is called during CanIf_ControllerModeIndication(Controller,
transition request CAN_CS_STARTED) returned, the request
Can_SetControllerMode() returns and informs CanIf about a
successful request which in turn returns the upper layer request
CanIf_SetControllerMode().
CAN controller was in During the former request Can_SetControllerMode() the
STARTED mode function CanIf_ControllerModeIndication(Controller,
CAN_CS_STARTED) is called to inform the CanIf directly about the
successful mode transition (because the mode was already
started). When CanIf_ControllerModeIndication
(Controller, CAN_CS_STARTED) returned, the request
Can_SetControllerMode() returns and informs CanIf about a
successful request which in turn returns the upper layer request
CanIf_SetControllerMode().
CAN controller was in This transition is not allowed -> E_NOT_OK.
SLEEP mode

146 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

9.11 BusOff notification


<User_ControllerBusOff> «module» «module» «Peripheral»
CanIf Can CanController

BusOff Detection()

Set CAN Controller to STOPPED mode, if


necessary()

Set CAN Controller to STOPPED mode, if


necessary()

CanIf_ControllerBusOff(uint8)

  
Reset     
transmit    
<User_ControllerBusOff>(uint8)    
queue()
   

<User_ControllerBusOff>()
CanIf_ControllerBusOff()

BusOff Detection()

Figure 9.11: BusOff notification

Activity Description
BusOff detection interrupt The CAN controller signals a BusOff event.
Stop CAN controller CAN controller is set to STOPPED mode by the CAN Driver, if
necessary.
BusOff indication to CAN BusOff is notified to the CanIf by calling of
Interface CanIf_ControllerBusOff()
BusOff indication to upper BusOff is notified to the upper layer by calling of
layer (CanSM) <User_ControllerBusOff>()

147 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

9.12 BusOff recovery


<User_ControllerBusOff> «module» «module» «Peripheral»
CanIf Can CanController

loop Requesting CAN controller mode consecutively. If mode changed -> CanIf_ControllerModeIndication().

Can_MainFunction_Mode()

opt CAN controller


BusOff Detection()
[BUSSOFF]
Set CAN controller to STOPPED mode, if necessary()

Set CAN controller to STOPPED mode, if necessary()

[STOPPED]
CanIf_ControllerBusOff(uint8)

Reset transmit        


queue()       
<User_ControllerBusOff>(uint8)    

<User_ControllerBusOff>()
CanIf_ControllerBusOff()
BusOff Detection()

CanIf_SetControllerMode(Std_ReturnType, uint8, Can_ControllerStateType)         


         
  
Can_SetControllerMode(Std_ReturnType, uint8,
Can_ControllerStateType)
Reset CAN controller, if necessary()

request CAN controller mode transition to START()

Can_SetContollerMode()
CanIf_SetControllerMode()

CanIf_ControllerModeIndication(uint8,
Can_ControllerStateType)

<User_ControllerModeIndication>(uint8,
Can_ControllerStateType)

<User_ControllerModeIndication>()
CanIf_ControllerModeIndication()

Figure 9.12: BusOff recovery

148 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Activity Description
BusOff detection interrupt The CAN controller signals a BusOff event.
Stop CAN controller CAN controller is set to STOPPED mode by the CanDrv, if
necessary
BusOff indication to CanIf BusOff is notified to the CanIf by calling of
CanIf_ControllerBusOff(). The transmit buffers inside
CanIf will be reset.
BusOff indication to upper BusOff is notified to the upper layer by calling of
layer <User_ControllerBusOff>()
Upper Layer (CanSM) After a time specified by the BusOff Recovery algorithm the
initiates BusOff Recovery Recovery process itself in initiated by
CanIf_SetControllerMode(ControllerId,
CAN_CS_STARTED).
Restart of CAN controller The driver restarts the CAN controller by call of
Can_SetControllerMode(Controller, CAN_CS_STARTED)
.
CAN controller started CanDrv informs CanIf about the successful start by calling
CanIf_ControllerModeIndication(). CanIf informs in turn
upper layers about the mode change.

149 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

10 Configuration specification
In general, this chapter defines configuration parameters and their clustering into
containers. For general information about the definition of containers and param-
eters, refer to the [9, chapter 10.1 "Introduction to configuration specification" in
SWS_BSWGeneral].
section 10.1 specifies the structure (containers) and the parameters of the CanIf.

10.1 Containers and configuration parameters


The following chapters summarize all configuration parameters. The detailed meanings
of the parameters describe chapter 7 “Functional specification” and chapter 8 “API
specification”.
The listed configuration items can be derived from a network description database,
which is based on the EcuConfigurationTemplate. The configuration tool shall extract
all information to configure the CanIf.
The CanIf has access to the CanDrv configuration data. All public CanDrv configura-
tion data are described in [1, Specification of CAN Driver].

150 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CanIf: EcucModuleDef CanIfPrivateCfg:


+container
upperMultiplicity = 1 EcucParamConfContainerDef
lowerMultiplicity = 0

CanIfHthCfg:
EcucParamConfContainerDef
CanIfPublicCfg:
+container EcucParamConfContainerDef CanIfInitHohCfg: +subContainer lowerMultiplicity = 0
EcucParamConfContainerDef upperMultiplicity = *
upperMultiplicity = 1
lowerMultiplicity = 1 lowerMultiplicity = 0
upperMultiplicity = *
+subContainer +subContainer
CanIfInitCfg: EcucParamConfContainerDef
CanIfHrhCfg:
lowerMultiplicity = 1 EcucParamConfContainerDef
upperMultiplicity = 1 CanIfRxPduCfg:
+container EcucParamConfContainerDef lowerMultiplicity = 0
+subContainer
upperMultiplicity = *
lowerMultiplicity = 0
upperMultiplicity = *

+subContainer +subContainer
CanIfTxPduCfg:
EcucParamConfContainerDef CanIfHrhRangeCfg:
EcucParamConfContainerDef
CanIfDispatchCfg: lowerMultiplicity = 0
+container EcucParamConfContainerDef lowerMultiplicity = 0
upperMultiplicity = *
upperMultiplicity = *

CanIfCtrlCfg: EcucParamConfContainerDef
CanIfCtrlDrvCfg:
EcucParamConfContainerDef +subContainer upperMultiplicity = *
+container
lowerMultiplicity = 1
lowerMultiplicity = 1
upperMultiplicity = *

CanIfTrcvDrvCfg: CanIfTrcvCfg:
EcucParamConfContainerDef EcucParamConfContainerDef
+container +subContainer
lowerMultiplicity = 0 lowerMultiplicity = 1
upperMultiplicity = * upperMultiplicity = *

Figure 10.1: Overview about CAN Interface configuration containers

10.1.1 CanIf

Module SWS Item ECUC_CanIf_00244


Module Name CanIf
Module Description This container includes all necessary configuration sub-containers
according the CAN Interface configuration structure.
Post-Build Variant true
Support
Supported Config VARIANT-LINK-TIME, VARIANT-POST-BUILD, VARIANT-PRE-
Variants COMPILE
Included Containers
Container Name Multiplicity Scope / Dependency
CanIfCtrlDrvCfg 1..* Configuration parameters for all the underlying CAN
Driver modules are aggregated under this container.
For each CAN Driver module a seperate instance of
this container has to be provided.
CanIfDispatchCfg 1 Callback functions provided by upper layer modules of
the CanIf. The callback functions defined in this
container are common to all configured CAN Driver /
CAN Transceiver Driver modules.

151 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Container Name Multiplicity Scope / Dependency


CanIfInitCfg 1 This container contains the init parameters of the CAN
Interface.
CanIfPrivateCfg 1 This container contains the private configuration
(parameters) of the CAN Interface.
CanIfPublicCfg 1 This container contains the public configuration
(parameters) of the CAN Interface.
CanIfTrcvDrvCfg 0..* This container contains the configuration (parameters)
of all addressed CAN transceivers by each underlying
CAN Transceiver Driver module. For each CAN
transceiver Driver a seperate instance of this container
shall be provided.

CanIf: EcucModuleDef
CanIfPublicCfg:
upperMultiplicity = 1 +container EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
lowerMultiplicity = 1

CanIfPrivateCfg:
+container
EcucParamConfContainerDef

CanIfDispatchCfg:
+container EcucParamConfContainerDef

CanIfTrcvDrvCfg:
EcucParamConfContainerDef
+container
lowerMultiplicity = 0
upperMultiplicity = *

CanIfCtrlDrvCfg: CanIfCtrlCfg:
EcucParamConfContainerDef EcucParamConfContainerDef
+container +subContainer
lowerMultiplicity = 1 upperMultiplicity = *
upperMultiplicity = * lowerMultiplicity = 1

CanIfInitCfg: EcucParamConfContainerDef
CanIfInitHohCfg:
lowerMultiplicity = 1 EcucParamConfContainerDef
upperMultiplicity = 1 +subContainer
lowerMultiplicity = 0
upperMultiplicity = *

CanIfTxPduCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = *
+container

CanIfRxPduCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = *

CanIfBufferCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = *

Figure 10.2: AR_EcucDef_CanIf

10.1.2 CanIfPrivateCfg

152 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

SWS Item [ECUC_CanIf_00245]


Container Name CanIfPrivateCfg
Parent Container CanIf
Description This container contains the private configuration (parameters) of the
CAN Interface.
Configuration Parameters

Name CanIfFixedBuffer [ECUC_CanIf_00827]


Parent Container CanIfPrivateCfg
Description This parameter defines if the buffer element length shall be fixed to 8
Bytes for buffers to which only PDUs < 8 Bytes are assigned.

TRUE: Minimum buffer element length is fixed to 8 Bytes. FALSE:


Buffer element length depends on the configured length of the
referenced global PDUs (see ECUC_EcuC_00078).
Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local

Name CanIfPrivateDataLengthCheck [ECUC_CanIf_00617]


Parent Container CanIfPrivateCfg
Description Selects whether Data Length Check is supported.

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value true
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local

153 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfPrivateSoftwareFilterType [ECUC_CanIf_00619]


Parent Container CanIfPrivateCfg
Description Selects the desired software filter mechanism for reception only. Each
implemented software filtering method is identified by this enumeration
number.

Range: Types implemented software filtering methods


Multiplicity 1
Type EcucEnumerationParamDef
Range BINARY Selects Binary Filter method.
INDEX Selects Index Filter method.
LINEAR Selects Linear Filter method.
TABLE Selects Table Filter method.
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local
dependency: BasicCAN reception must be enabled by referenced
parameter CanHandleType of the CAN Driver module via
CanIfHrhIdSymRef for at least one HRH.

Name CanIfSupportTTCAN [ECUC_CanIf_00675]


Parent Container CanIfPrivateCfg
Description Defines whether TTCAN is supported.

TRUE: TTCAN is supported. FALSE: TTCAN is not supported, only


normal CAN communication is possible.
Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Included Containers
Container Name Multiplicity Scope / Dependency
CanIfTTGeneral 0..1 CanIfTTGeneral is specified in the SWS TTCAN
Interface and defines if and in which way TTCAN is
supported.

This container is only included and valid if TTCAN is


supported by the controller, enabled (see
CanIfSupportTTCAN, ECUC_CanIf_00675), and used.

154 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CanIf: EcucModuleDef

upperMultiplicity = 1
lowerMultiplicity = 0

+container
CanIfPrivateDataLengthCheck:
CanIfPrivateCfg: +parameter EcucBooleanParamDef
EcucParamConfContainerDef
defaultValue = True

+parameter CanIfPrivateSoftwareFilterType:
EcucEnumerationParamDef

+literal +literal

LINEAR: BINARY:
EcucEnumerationLiteralDef EcucEnumerationLiteralDef

+literal +literal

TABLE: INDEX:
EcucEnumerationLiteralDef EcucEnumerationLiteralDef

CanIfFixedBuffer:
+parameter EcucBooleanParamDef

defaultValue = false
lowerMultiplicity = 1
upperMultiplicity = 1

Figure 10.3: AR_EcucDef_CanIfPrivateCfg

10.1.3 CanIfPublicCfg

SWS Item [ECUC_CanIf_00246]


Container Name CanIfPublicCfg
Parent Container CanIf
Description This container contains the public configuration (parameters) of the
CAN Interface.
Configuration Parameters

Name CanIfBusMirroringSupport [ECUC_CanIf_00847]


Parent Container CanIfPublicCfg
Description Enable support for Bus Mirroring.
Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –

155 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Scope / Dependency scope: local

Name CanIfDevErrorDetect [ECUC_CanIf_00614]


Parent Container CanIfPublicCfg
Description Switches the development error detection and notification on or off.
• true: detection and notification is enabled.
• false: detection and notification is disabled.

Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local

Name CanIfEnableSecurityEventReporting [ECUC_CanIf_00848]


Parent Container CanIfPublicCfg
Description Switches the reporting of security events to the IdsM: - true: reporting
is enabled. - false: reporting is disabled.

Tags:
atp.Status=draft
Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfGlobalTimeSupport [ECUC_CanIf_00854]


Parent Container CanIfPublicCfg
Description Enables/Disables the Global Time APIs used when hardware
timestamping is supported.

Tags:
atp.Status=draft
Multiplicity 1
Type EcucBooleanParamDef
Default Value

156 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant false


Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local

Name CanIfMetaDataSupport [ECUC_CanIf_00824]


Parent Container CanIfPublicCfg
Description Enable support for dynamic ID handling using L-SDU MetaData.
Multiplicity 0..1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfPublicCddHeaderFile [ECUC_CanIf_00671]


Parent Container CanIfPublicCfg
Description Defines header files for callback functions which shall be included in
case of CDDs. Range of characters is 1.. 32.
Multiplicity 0..*
Type EcucStringParamDef
Default Value
Length 1–32
Regular Expression
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –

157 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Scope / Dependency scope: ECU

Name CanIfPublicHandleTypeEnum [ECUC_CanIf_00742]


Parent Container CanIfPublicCfg
Description This parameter is used to configure the Can_HwHandleType. The
Can_HwHandleType represents the hardware object handles of a CAN
hardware unit. For CAN hardware units with more than 255 HW objects
the extended range shall be used (UINT16).
Multiplicity 1
Type EcucEnumerationParamDef
Range UINT16
UINT8
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU
dependency: Can_HwHandleType

Name CanIfPublicMultipleDrvSupport [ECUC_CanIf_00612]


Parent Container CanIfPublicCfg
Description Selects support for multiple CAN Drivers.

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value true
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfPublicPnSupport [ECUC_CanIf_00772]


Parent Container CanIfPublicCfg
Description Selects support of Partial Network features in CanIf.
True: Enabled
False: Disabled

Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value

158 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Value Configuration Pre-compile time X All Variants


Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfPublicReadRxPduDataApi [ECUC_CanIf_00607]


Parent Container CanIfPublicCfg
Description Enables / Disables the API CanIf_ReadRxPduData() for reading
received L-SDU data.

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfPublicReadRxPduNotifyStatusApi [ECUC_CanIf_00608]


Parent Container CanIfPublicCfg
Description Enables and disables the API for reading the notification status of
receive L-PDUs.

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfPublicReadTxPduNotifyStatusApi [ECUC_CanIf_00609]


Parent Container CanIfPublicCfg
Description Enables and disables the API for reading the notification status of
transmit L-PDUs.

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value false

159 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant false


Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfPublicSetDynamicTxIdApi [ECUC_CanIf_00610]


Parent Container CanIfPublicCfg
Description Enables and disables the API for reconfiguration of the CAN Identifier
for each Transmit L-PDU.

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfPublicTxBuffering [ECUC_CanIf_00618]


Parent Container CanIfPublicCfg
Description Enables and disables the buffering of transmit L-PDUs (rejected by the
CanDrv) within the CAN Interface module.

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfPublicTxConfirmPollingSupport [ECUC_CanIf_00733]


Parent Container CanIfPublicCfg
Description Configuration parameter to enable/disable the API to poll for Tx
Confirmation state.
Multiplicity 1
Type EcucBooleanParamDef
Default Value

160 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant false


Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local
dependency: CAN State Manager module

Name CanIfPublicWakeupCheckValidByNM [ECUC_CanIf_00741]


Parent Container CanIfPublicCfg
Description If enabled, only NM messages shall validate a detected wake-up event
in CanIf. If disabled, all received messages corresponding to a
configured Rx PDU shall validate such a wake-up event. This
parameter depends on CanIfPublicWakeupCheckValidSupport and
shall only be configurable, if it is enabled.

True: Enabled False: Disabled


Multiplicity 0..1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfPublicWakeupCheckValidSupport

Name CanIfPublicWakeupCheckValidSupport [ECUC_CanIf_00611]


Parent Container CanIfPublicCfg
Description Selects support for wake up validation

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –

161 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Scope / Dependency scope: ECU

Name CanIfSetBaudrateApi [ECUC_CanIf_00838]


Parent Container CanIfPublicCfg
Description Configuration parameter to enable/disable the CanIf_SetBaudrate API
to change the baud rate of a CAN Controller. If this parameter is set to
true the CanIf_SetBaudrate API shall be supported. Otherwise the API
is not supported.
Multiplicity 0..1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfTriggerTransmitSupport [ECUC_CanIf_00844]


Parent Container CanIfPublicCfg
Description Enables the CanIf_TriggerTransmit API at Pre-Compile-Time.
Therefore, this parameter defines if there shall be support for trigger
transmit transmissions. TRUE: Enabled FALSE: Disabled
Multiplicity 1
Type EcucBooleanParamDef
Default Value true
Post-Build Variant false
Multiplicity
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfTxOfflineActiveSupport [ECUC_CanIf_00837]


Parent Container CanIfPublicCfg
Description Determines wether TxOffLineActive feature (see SWS_CANIF_00072)
is supported by CanIf. True: Enabled False: Disabled
Multiplicity 1
Type EcucBooleanParamDef
Default Value false

162 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant false


Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfVersionInfoApi [ECUC_CanIf_00613]


Parent Container CanIfPublicCfg
Description Enables and disables the API for reading the version information about
the CAN Interface.

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local

Name CanIfWakeupSupport [ECUC_CanIf_00843]


Parent Container CanIfPublicCfg
Description Enables the CanIf_CheckWakeup API at Pre-Compile-Time.
Therefore, this parameter defines if there shall be support for wake-up.
TRUE: Enabled FALSE: Disabled
Multiplicity 1
Type EcucBooleanParamDef
Default Value true
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

163 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Included Containers
Container Name Multiplicity Scope / Dependency
CanIfSecurityEventRefs 0..1 Container for the references to IdsMEvent elements
representing the security events that the CanIf module
shall report to the IdsM in case the coresponding
security related event occurs (and if
CanIfEnableSecurityEventReporting is set to "true").
The standardized security events in this container can
be extended by vendor-specific security events.

Tags:
atp.Status=draft

164 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CanIfPublicCfg: CanIfPublicReadRxPduDataApi:
+parameter
EcucParamConfContainerDef EcucBooleanParamDef
upperMultiplicity = 1 defaultValue = false
lowerMultiplicity = 1 +parameter CanIfPublicReadRxPduNotifyStatusApi:
EcucBooleanParamDef

defaultValue = False
+parameter CanIfPublicReadTxPduNotifyStatusApi:
EcucBooleanParamDef

defaultValue = False CanIfPublicSetDynamicTxIdApi:


+parameter EcucBooleanParamDef

defaultValue = False
+parameter CanIfPublicWakeupCheckValidSupport:
EcucBooleanParamDef
CanIfPublicMultipleDrvSupport:
defaultValue = False EcucBooleanParamDef
+parameter
defaultValue = True
+parameter CanIfVersionInfoApi:
EcucBooleanParamDef
CanIfDevErrorDetect:
defaultValue = false EcucBooleanParamDef
+parameter
defaultValue = false
+parameter CanIfPublicTxConfirmPollingSupport:
EcucBooleanParamDef CanIfPublicTxBuffering:
+parameter EcucBooleanParamDef

defaultValue = False
+parameter CanIfTriggerTransmitSupport:
EcucBooleanParamDef
CanIfTxOfflineActiveSupport:
defaultValue = true EcucBooleanParamDef
+parameter
defaultValue = False
CanIfSetBaudrateApi:
EcucBooleanParamDef CanIfPublicWakeupCheckValidByNM:
+parameter
defaultValue = False EcucBooleanParamDef
lowerMultiplicity = 0 defaultValue = false
upperMultiplicity = 1 lowerMultiplicity = 0
+parameter
upperMultiplicity = 1

+parameter CanIfBusMirroringSupport:
EcucBooleanParamDef CanIfPublicCddHeaderFile:
EcucStringParamDef
defaultValue = false
+parameter
minLength = 1
maxLength = 32
CanIfPublicPnSupport: lowerMultiplicity = 0
+parameter
EcucBooleanParamDef upperMultiplicity = *

defaultValue = false
+parameter CanIfWakeupSupport:
EcucBooleanParamDef
CanIfMetaDataSupport:
defaultValue = true
+parameter EcucBooleanParamDef

defaultValue = false
lowerMultiplicity = 0
upperMultiplicity = 1

+literal
CanIfPublicHandleTypeEnum: UINT8: EcucEnumerationLiteralDef
+parameter EcucEnumerationParamDef
+literal
UINT16: EcucEnumerationLiteralDef

+parameter CanIfEnableSecurityEventReporting:
EcucBooleanParamDef

defaultValue = false
CanIfGlobalTimeSupport:
+parameter
EcucBooleanParamDef

CanIfSecurityEventRefs:
+subContainer EcucParamConfContainerDef

lowerMultiplicity = 0
upperMultiplicity = 1

Figure 10.4: AR_EcucDef_CanIfPublicCfg

10.1.4 CanIfInitCfg

SWS Item [ECUC_CanIf_00247]


Container Name CanIfInitCfg

165 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Parent Container CanIf


Description This container contains the init parameters of the CAN Interface.
Configuration Parameters

Name CanIfInitCfgSet [ECUC_CanIf_00623]


Parent Container CanIfInitCfg
Description Selects the CAN Interface specific configuration setup. This type of the
external data structure shall contain the post build initialization data for
the CAN Interface for all underlying CAN Dirvers.

constant to CanIf_ConfigType
Multiplicity 1
Type EcucStringParamDef
Default Value
Length 1–32
Regular Expression
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

Name CanIfMaxBufferSize [ECUC_CanIf_00828]


Parent Container CanIfInitCfg
Description Maximum total size of all Tx buffers. This parameter is needed only in
case of post-build loadable implementation using static memory
allocation.
Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 ..
18446744073709551615
Default Value
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: local

166 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfMaxRxPduCfg [ECUC_CanIf_00830]


Parent Container CanIfInitCfg
Description Maximum number of Pdus. This parameter is needed only in case of
post-build loadable implementation using static memory allocation.
Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 ..
18446744073709551615
Default Value
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: local

Name CanIfMaxTxPduCfg [ECUC_CanIf_00829]


Parent Container CanIfInitCfg
Description Maximum number of Pdus. This parameter is needed only in case of
post-build loadable implementation using static memory allocation.
Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 ..
18446744073709551615
Default Value
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: local

167 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Included Containers
Container Name Multiplicity Scope / Dependency
CanIfBufferCfg 0..* This container contains the Txbuffer configuration.
Multiple buffers with different sizes could be configured.
If CanIfBufferSize (ECUC_CanIf_00834) equals 0, the
CanIf Tx L-PDU only refers via this CanIfBufferCfg the
corresponding CanIfHthCfg.
CanIfInitHohCfg 0..* This container contains the references to the
configuration setup of each underlying CAN Driver.
CanIfRxPduCfg 0..* This container contains the configuration (parameters)
of each receive CAN L-PDU.

The SHORT-NAME of "CanIfRxPduConfig" container


itself represents the symolic name of Receive L-PDU.

This L-SDU produces a meta data item of type


CAN_ID_32.
CanIfTxPduCfg 0..* This container contains the configuration (parameters)
of a transmit CAN L-PDU. It has to be configured as
often as a transmit CAN L-PDU is needed.

The SHORT-NAME of "CanIfTxPduConfig" container


represents the symolic name of Transmit L-PDU.

This L-SDU consumes a meta data item of type


CAN_ID_32.

168 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CanIf: EcucModuleDef

upperMultiplicity = 1
lowerMultiplicity = 0

+container

CanIfInitCfg: EcucParamConfContainerDef CanIfInitCfgSet: EcucStringParamDef


+parameter
lowerMultiplicity = 1 minLength = 1
upperMultiplicity = 1 maxLength = 32

CanIfRxPduCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = *

CanIfInitHohCfg:
+subContainer EcucParamConfContainerDef

lowerMultiplicity = 0
upperMultiplicity = *

CanIfTxPduCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = *

CanIfMaxBufferSize:
+parameter EcucIntegerParamDef

lowerMultiplicity = 0
upperMultiplicity = 1

CanIfMaxTxPduCfg:
+parameter EcucIntegerParamDef

lowerMultiplicity = 0
upperMultiplicity = 1

CanIfMaxRxPduCfg:
+parameter EcucIntegerParamDef

lowerMultiplicity = 0
upperMultiplicity = 1

Figure 10.5: AR_EcucDef_CanIfInitCfg

10.1.5 CanIfTxPduCfg

SWS Item [ECUC_CanIf_00248]


Container Name CanIfTxPduCfg
Parent Container CanIfInitCfg
Description This container contains the configuration (parameters) of a transmit
CAN L-PDU. It has to be configured as often as a transmit CAN L-PDU
is needed.

The SHORT-NAME of "CanIfTxPduConfig" container represents the


symolic name of Transmit L-PDU.

This L-SDU consumes a meta data item of type CAN_ID_32.


Post-Build Variant true
Multiplicity

169 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Multiplicity Pre-compile time X VARIANT-PRE-COMPILE


Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Configuration Parameters

Name CanIfTxPduCanId [ECUC_CanIf_00592]


Parent Container CanIfTxPduCfg
Description CAN Identifier of transmit CAN L-PDUs used by the CAN Driver for
CAN L-PDU transmission. Range: 11 Bit For Standard CAN Identifier
... 29 Bit For Extended CAN identifier

The CAN Identifier may be omitted for dynamic transmit L-PDUs.


Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 .. 536870911
Default Value
Post-Build Variant true
Multiplicity
Post-Build Variant true
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

Name CanIfTxPduCanIdMask [ECUC_CanIf_00823]


Parent Container CanIfTxPduCfg
Description Identifier mask which denotes relevant bits in the CAN Identifier. This
parameter may be used to keep parts of the CAN Identifier of dynamic
transmit L-PDUs static. Range: 11 bits for Standard CAN Identifier, 29
bits for Extended CAN Identifier.
Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 .. 3758096383
Default Value 3758096383
Post-Build Variant true
Multiplicity
Post-Build Variant true
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD

170 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Value Configuration Pre-compile time X VARIANT-PRE-COMPILE


Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

Name CanIfTxPduCanIdType [ECUC_CanIf_00590]


Parent Container CanIfTxPduCfg
Description Type of CAN Identifier of the transmit CAN L-PDU used by the CAN
Driver module for CAN L-PDU transmission.
Multiplicity 1
Type EcucEnumerationParamDef
Range EXTENDED_CAN CAN frame with extended identifier (29
bits)
EXTENDED_FD_CAN CAN FD frame with extended identifier
(29 bits)
STANDARD_CAN CAN frame with standard identifier (11
bits)
STANDARD_FD_CAN CAN FD frame with standard identifier
(11 bits)
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

Name CanIfTxPduId [ECUC_CanIf_00591]


Parent Container CanIfTxPduCfg
Description ECU wide unique, symbolic handle for transmit CAN L-SDU.

Range: 0..max. number of CantTxPduIds


Multiplicity 1
Type EcucIntegerParamDef (Symbolic Name generated for this parameter)
Range 0 .. 4294967295
Default Value
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

171 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfTxPduPnFilterPdu [ECUC_CanIf_00773]


Parent Container CanIfTxPduCfg
Description If CanIfPublicPnFilterSupport is enabled, by this parameter PDUs
could be configured which will pass the CanIfPnFilter.
If there is no CanIfTxPduPnFilterPdu configured per controller,
the corresponding controller applies no CanIfPnFilter.

Multiplicity 0..1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant true
Multiplicity
Post-Build Variant true
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
dependency: This parameter shall only be configurable if
CanIfPublicPnSupport equals True.

Name CanIfTxPduReadNotifyStatus [ECUC_CanIf_00589]


Parent Container CanIfTxPduCfg
Description Enables and disables transmit confirmation for each transmit CAN
L-SDU for reading its notification status.

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
dependency: CanIfPublicReadTxPduNotifyStatusApi must be enabled.

Name CanIfTxPduTriggerTransmit [ECUC_CanIf_00840]


Parent Container CanIfTxPduCfg
Description Determines if or if not CanIf shall use the trigger transmit API for this
PDU.
Multiplicity 0..1
Type EcucBooleanParamDef
Default Value false

172 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant true


Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU
dependency: If CanIfTxPduTriggerTransmit is TRUE then
CanIfTxPduUserTxConfirmationUL has to be either PDUR or CDD and
CanIfTxPduUserTriggerTransmitName has to be specified accordingly.

Name CanIfTxPduTruncation [ECUC_CanIf_00845]


Parent Container CanIfTxPduCfg
Description Enables/disables truncation of PDUs that exceed the configured size.
Multiplicity 1
Type EcucBooleanParamDef
Default Value true
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

Name CanIfTxPduType [ECUC_CanIf_00593]


Parent Container CanIfTxPduCfg
Description Defines the type of each transmit CAN L-PDU.
Multiplicity 1
Type EcucEnumerationParamDef
Range DYNAMIC CAN ID is defined at runtime.
STATIC CAN ID is defined at compile-time.
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

173 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfTxPduUserTriggerTransmitName [ECUC_CanIf_00842]


Parent Container CanIfTxPduCfg
Description This parameter defines the name of the <User_TriggerTransmit>. This
parameter depends on the parameter
CanIfTxPduUserTxConfirmationUL. If
CanIfTxPduUserTxConfirmationUL equals CAN_TP, CAN_NM, PDUR,
XCP, CAN_TSYN, J1939NM or J1939TP, the name of the
<User_TriggerTransmit> is fixed. If CanIfTxPduUserTxConfirmationUL
equals CDD, the name of the <User_TxConfirmation> is selectable.

Please be aware that this parameter depends on the same parameter


as CanIfTxPduUserTxConfirmationName. It shall be clear which upper
layer is responsible for that PDU.
Multiplicity 0..1
Type EcucFunctionNameDef
Default Value
Length 1–32
Regular Expression
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfTxPduUserTriggerTransmitName requires
CanIfTxPduUserTxConfirmationUL to be either PDUR or CDD.

Name CanIfTxPduUserTxConfirmationName [ECUC_CanIf_00528]


Parent Container CanIfTxPduCfg
Description This parameter defines the name of the <User_TxConfirmation>. This
parameter depends on the parameter
CanIfTxPduUserTxConfirmationUL. If
CanIfTxPduUserTxConfirmationUL equals CAN_TP, CAN_NM, PDUR,
XCP, CAN_TSYN, J1939NM or J1939TP, the name of the
<User_TxConfirmation> is fixed. If CanIfTxPduUserTxConfirmationUL
equals CDD, the name of the <User_TxConfirmation> is selectable.
Multiplicity 0..1
Type EcucFunctionNameDef
Default Value
Length 1–32
Regular Expression
Post-Build Variant false
Multiplicity

174 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant false


Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU

Name CanIfTxPduUserTxConfirmationUL [ECUC_CanIf_00527]


Parent Container CanIfTxPduCfg
Description This parameter defines the upper layer (UL) module to which the
confirmation of the successfully transmitted CanTxPduId has to be
routed via the <User_TxConfirmation>. This <User_TxConfirmation>
has to be invoked when the confirmation of the configured CanTxPduId
will be received by a Tx confirmation event from the CAN Driver
module. If no upper layer (UL) module is configured, no
<User_TxConfirmation> has to be called in case of a Tx confirmation
event of the CanTxPduId from the CAN Driver module.
Multiplicity 0..1
Type EcucEnumerationParamDef
Range CAN_NM CAN NM
CAN_TP CAN TP
CAN_TSYN Global Time Synchronization over CAN
CDD Complex Driver
J1939NM J1939Nm
J1939TP J1939Tp
PDUR PDU Router
XCP Extended Calibration Protocol
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU

175 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfTxPduBufferRef [ECUC_CanIf_00831]


Parent Container CanIfTxPduCfg
Description Configurable reference to a CanIf buffer configuration.
Multiplicity 1
Type Reference to CanIfBufferCfg
true
Post-Build Variant
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

Name CanIfTxPduRef [ECUC_CanIf_00603]


Parent Container CanIfTxPduCfg
Description Reference to the "global" Pdu structure to allow harmonization of
handle IDs in the COM-Stack.
Multiplicity 1
Type Reference to Pdu
true
Post-Build Variant
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

Included Containers
Container Name Multiplicity Scope / Dependency
CanIfTTTxFrame 0..1 CanIfTTTxFrameTriggering is specified in the SWS
Triggering TTCAN Interface and defines Frame trigger for TTCAN
transmission.

This container is only included and valid if TTCAN is


supported by the controller, enabled (see
CanIfSupportTTCAN, ECUC_CanIf_00675), and a
joblist is used.

176 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CanIfTxPduCfg: CanIfTxPduReadNotifyStatus:
+parameter
EcucParamConfContainerDef EcucBooleanParamDef Pdu:
EcucParamConfContainerDef
lowerMultiplicity = 0 defaultValue = false CanIfTxPduRef: +destination
upperMultiplicity = * EcucReferenceDef lowerMultiplicity = 0
+reference upperMultiplicity = *

+literal
CanIfTxPduUserTxConfirmationUL: CAN_TP: EcucEnumerationLiteralDef
EcucEnumerationParamDef +literal
PDUR: EcucEnumerationLiteralDef
lowerMultiplicity = 0
upperMultiplicity = 1 +literal
CAN_NM: EcucEnumerationLiteralDef

+literal
J1939TP: EcucEnumerationLiteralDef

+parameter +literal
XCP: EcucEnumerationLiteralDef

+literal
CDD: EcucEnumerationLiteralDef
+literal
J1939NM: EcucEnumerationLiteralDef
+literal
CAN_TSYN: EcucEnumerationLiteralDef

+literal
CanIfTxPduCanIdType: STANDARD_CAN: EcucEnumerationLiteralDef
EcucEnumerationParamDef +literal
+parameter EXTENDED_CAN: EcucEnumerationLiteralDef

+literal
STANDARD_FD_CAN: EcucEnumerationLiteralDef
+literal
EXTENDED_FD_CAN: EcucEnumerationLiteralDef

CanIfTxPduId: CanIfTxPduUserTxConfirmationName:
EcucIntegerParamDef EcucFunctionNameDef
+parameter
symbolicNameValue = true lowerMultiplicity = 0
min = 0 upperMultiplicity = 1
max = 4294967295 minLength = 1
+parameter maxLength = 32

+parameter CanIfTxPduTruncation:
CanIfTxPduCanIdMask:
EcucBooleanParamDef
EcucIntegerParamDef

+parameter defaultValue = true


min = 0
lowerMultiplicity = 1
max = 3758096383
upperMultiplicity = 1
defaultValue = 3758096383
lowerMultiplicity = 0
upperMultiplicity = 1
+parameter CanIfTxPduPnFilterPdu:
EcucBooleanParamDef
CanIfTxPduCanId:
EcucIntegerParamDef defaultValue = false
+parameter lowerMultiplicity = 0
min = 0 upperMultiplicity = 1
max = 536870911
lowerMultiplicity = 0
upperMultiplicity = 1
CanIfBufferCfg:
EcucParamConfContainerDef
CanIfTxPduBufferRef: +destination lowerMultiplicity = 0
+reference EcucReferenceDef upperMultiplicity = *

+literal
CanIfTxPduType: DYNAMIC: EcucEnumerationLiteralDef
+parameter
EcucEnumerationParamDef
+literal
STATIC: EcucEnumerationLiteralDef

CanIfTxPduTriggerTransmit:
CanIfTxPduUserTriggerTransmitName:
EcucBooleanParamDef
+parameter EcucFunctionNameDef
defaultValue = false
lowerMultiplicity = 0
lowerMultiplicity = 0
upperMultiplicity = 1
upperMultiplicity = 1
minLength = 1
+parameter maxLength = 32

Figure 10.6: AR_EcucDef_CanIfTxPduCfg

177 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

10.1.6 CanIfRxPduCfg

SWS Item [ECUC_CanIf_00249]


Container Name CanIfRxPduCfg
Parent Container CanIfInitCfg
Description This container contains the configuration (parameters) of each receive
CAN L-PDU.

The SHORT-NAME of "CanIfRxPduConfig" container itself represents


the symolic name of Receive L-PDU.

This L-SDU produces a meta data item of type CAN_ID_32.


Post-Build Variant true
Multiplicity
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Configuration Parameters

Name CanIfRxPduCanId [ECUC_CanIf_00598]


Parent Container CanIfRxPduCfg
Description CAN Identifier of Receive CAN L-PDUs used by the CAN Interface.
Exa: Software Filtering. This parameter is used if exactly one Can
Identifier is assigned to the Pdu. If a range is assigned then the
CanIfRxPduCanIdRange parameter shall be used.

Range: 11 Bit For Standard CAN Identifier ... 29 Bit For Extended CAN
identifier
Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 .. 536870911
Default Value
Post-Build Variant true
Multiplicity
Post-Build Variant true
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

178 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfRxPduCanIdMask [ECUC_CanIf_00822]


Parent Container CanIfRxPduCfg
Description Identifier mask which denotes relevant bits in the CAN Identifier. This
parameter defines a CAN Identifier range in an alternative way to
CanIfRxPduCanIdRange. It identifies the bits of the configured CAN
Identifier that must match the received CAN Identifier. Range: 11 bits
for Standard CAN Identifier, 29 bits for Extended CAN Identifier.
Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 .. 536870911
Default Value 536870911
Post-Build Variant true
Multiplicity
Post-Build Variant true
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

Name CanIfRxPduCanIdType [ECUC_CanIf_00596]


Parent Container CanIfRxPduCfg
Description CAN Identifier of receive CAN L-PDUs used by the CAN Driver for
CAN L-PDU reception.
Multiplicity 1
Type EcucEnumerationParamDef
Range EXTENDED_CAN CAN 2.0 or CAN FD frame with
extended identifier (29 bits)
EXTENDED_FD_CAN CAN FD frame with extended identifier
(29 bits)
EXTENDED_NO_FD_CA CAN 2.0 frame with extended identifier
N (29 bits)
STANDARD_CAN CAN 2.0 or CAN FD frame with
standard identifier (11 bits)
STANDARD_FD_CAN CAN FD frame with standard identifier
(11 bits)
STANDARD_NO_FD_CA CAN 2.0 frame with standard identifier
N (11 bits)
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

179 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfRxPduDataLength [ECUC_CanIf_00599]


Parent Container CanIfRxPduCfg
Description Data length of the received CAN L-PDUs used by the CAN Interface.
This information is used for Data Length Check. Additionally it might
specify the valid bits in case of the discrete DLC for CAN FD L-PDUs >
8 bytes.

The data area size of a CAN L-PDU can have a range from 0 to 64
bytes.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 64
Default Value
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU
dependency: If CanIfRxPduDataLength > 8 then
CanIfRxPduCanIdType must not be STANDARD_NO_FD_CAN or
EXTENDED_NO_FD_CAN

Name CanIfRxPduDataLengthCheck [ECUC_CanIf_00846]


Parent Container CanIfRxPduCfg
Description This parameter switches the message specific data length check. True:
Data length check will be executed during the reception of this PDU.
False: No data length check will be executed during the reception of
this PDU.
Multiplicity 1
Type EcucBooleanParamDef
Default Value true
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

Name CanIfRxPduId [ECUC_CanIf_00597]


Parent Container CanIfRxPduCfg
Description ECU wide unique, symbolic handle for receive CAN L-SDU. It shall
fulfill ANSI/AUTOSAR definitions for constant defines.

Range: 0..max. number of defined CanRxPduIds


Multiplicity 1
Type EcucIntegerParamDef (Symbolic Name generated for this parameter)
Range 0 .. 4294967295
Default Value

180 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant false


Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfRxPduReadData [ECUC_CanIf_00600]


Parent Container CanIfRxPduCfg
Description Enables and disables the Rx buffering for reading of received L-SDU
data.

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

Name CanIfRxPduReadNotifyStatus [ECUC_CanIf_00595]


Parent Container CanIfRxPduCfg
Description Enables and disables receive indication for each receive CAN L-SDU
for reading its notification status.

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
dependency: CanIfPublicReadRxPduNotifyStatusApi must be enabled.

181 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfRxPduUserRxIndicationName [ECUC_CanIf_00530]


Parent Container CanIfRxPduCfg
Description This parameter defines the name of the <User_RxIndication>. This
parameter depends on the parameter CanIfRxPduUserRxIndicationUL.
If CanIfRxPduUserRxIndicationUL equals CAN_TP, CAN_NM, PDUR,
XCP, CAN_TSYN, J1939NM or J1939TP, the name of the
<User_RxIndication> is fixed. If CanIfRxPduUserRxIndicationUL
equals CDD, the name of the <User_RxIndication> is selectable.
Multiplicity 0..1
Type EcucFunctionNameDef
Default Value
Length 1–32
Regular Expression
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU

Name CanIfRxPduUserRxIndicationUL [ECUC_CanIf_00529]


Parent Container CanIfRxPduCfg
Description This parameter defines the upper layer (UL) module to which the
indication of the successfully received CANRXPDUID has to be routed
via <User_RxIndication>. This <User_RxIndication> has to be invoked
when the indication of the configured CANRXPDUID will be received
by an Rx indication event from the CAN Driver module. If no upper
layer (UL) module is configured, no <User_RxIndication> has to be
called in case of an Rx indication event of the CANRXPDUID from the
CAN Driver module.
Multiplicity 0..1
Type EcucEnumerationParamDef
Range CAN_NM CAN NM
CAN_TP CAN TP
CAN_TSYN Global Time Synchronization over CAN
CDD Complex Driver
J1939NM J1939Nm
J1939TP J1939Tp
PDUR PDU Router
XCP Extended Calibration Protocol
Post-Build Variant false
Multiplicity

182 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant false


Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU

Name CanIfRxPduHrhIdRef [ECUC_CanIf_00602]


Parent Container CanIfRxPduCfg
Description The HRH to which Rx L-PDU belongs to, is referred through this
parameter.
Multiplicity 1
Type Reference to CanIfHrhCfg
true
Post-Build Variant
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
dependency: This information has to be derived from the CAN Driver
configuration.

Name CanIfRxPduRef [ECUC_CanIf_00601]


Parent Container CanIfRxPduCfg
Description Reference to the "global" Pdu structure to allow harmonization of
handle IDs in the COM-Stack.
Multiplicity 1
Type Reference to Pdu
true
Post-Build Variant
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

183 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Included Containers
Container Name Multiplicity Scope / Dependency
CanIfRxPduCanIdRange 0..1 Optional container that allows to map a range of CAN
Ids to one PduId.
CanIfTTRxFrame 0..1 CanIfTTRxFrameTriggering is specified in the SWS
Triggering TTCAN Interface and defines Frame trigger for TTCAN
reception.

This container is only included and valid if TTCAN is


supported by the controller, enabled (see
CanIfSupportTTCAN, ECUC_CanIf_00675), and a
joblist is used for reception.

184 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CanIfInitCfg: EcucParamConfContainerDef

lowerMultiplicity = 1    


upperMultiplicity = 1      !" " 
# $ %&'

+subContainer
CanIfHrhCfg: +reference
CanIfRxPduCfg: +reference CanIfRxPduHrhIdRef: +destination EcucParamConfContainerDef
EcucParamConfContainerDef EcucReferenceDef CanIfHrhIdSymRef: EcucReferenceDef
lowerMultiplicity = 0
lowerMultiplicity = 0 upperMultiplicity = * requiresSymbolicNameValue = true
upperMultiplicity = *
CanIfRxPduReadNotifyStatus:
+parameter
EcucBooleanParamDef

defaultValue = False
+parameter
CanIfRxPduUserRxIndicationName:
EcucFunctionNameDef
Pdu:
EcucParamConfContainerDef lowerMultiplicity = 0
upperMultiplicity = 1
+reference lowerMultiplicity = 0 minLength = 1
CanIfRxPduRef: +destination upperMultiplicity = * maxLength = 32
EcucReferenceDef

+literal
CanIfRxPduUserRxIndicationUL: CAN_TP: EcucEnumerationLiteralDef
EcucEnumerationParamDef +literal
upperMultiplicity = 1 CDD: EcucEnumerationLiteralDef
lowerMultiplicity = 0 +literal
CAN_NM: EcucEnumerationLiteralDef
+literal
J1939TP: EcucEnumerationLiteralDef
+parameter +literal
PDUR: EcucEnumerationLiteralDef

+literal
XCP: EcucEnumerationLiteralDef

+literal
J1939NM: EcucEnumerationLiteralDef

+literal
CAN_TSYN: EcucEnumerationLiteralDef

+literal
CanIfRxPduCanIdType: EXTENDED_CAN: EcucEnumerationLiteralDef
EcucEnumerationParamDef
+literal
STANDARD_CAN: EcucEnumerationLiteralDef
+literal
EXTENDED_FD_CAN: EcucEnumerationLiteralDef
+parameter
+literal
STANDARD_FD_CAN: EcucEnumerationLiteralDef

+literal
EXTENDED_NO_FD_CAN: EcucEnumerationLiteralDef
+literal
STANDARD_NO_FD_CAN: EcucEnumerationLiteralDef

+parameter
CanIfRxPduDataLengthCheck:
EcucBooleanParamDef
CanIfRxPduId:
EcucIntegerParamDef defaultValue = true
+parameter symbolicNameValue = true
upperMultiplicity = 1
lowerMultiplicity = 1
min = 0
max = 4294967295 CanIfRxPduDataLength:
+parameter EcucIntegerParamDef

min = 0
CanIfRxPduReadData: max = 64
+parameter
EcucBooleanParamDef

defaultValue = false CanIfRxPduCanId:


EcucIntegerParamDef
+parameter
min = 0
max = 536870911
lowerMultiplicity = 0
upperMultiplicity = 1

CanIfRxPduCanIdRange: CanIfRxPduCanIdRangeUpperCanId:
EcucParamConfContainerDef

Figure 10.7: AR_EcucDef_CanIfRxPduCfg

185 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

10.1.7 CanIfRxPduCanIdRange

SWS Item [ECUC_CanIf_00743]


Container Name CanIfRxPduCanIdRange
Parent Container CanIfRxPduCfg
Description Optional container that allows to map a range of CAN Ids to one PduId.
Configuration Parameters

Name CanIfRxPduCanIdRangeLowerCanId [ECUC_CanIf_00745]


Parent Container CanIfRxPduCanIdRange
Description Lower CAN Identifier of a receive CAN L-PDU for identifier range
definition, in which all CAN Ids are mapped to one PduId.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 536870911
Default Value
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

Name CanIfRxPduCanIdRangeUpperCanId [ECUC_CanIf_00744]


Parent Container CanIfRxPduCanIdRange
Description Upper CAN Identifier of a receive CAN L-PDU for identifier range
definition, in which all CAN Ids are mapped to one PduId.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 536870911
Default Value
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

No Included Containers

10.1.8 CanIfDispatchCfg

SWS Item [ECUC_CanIf_00250]


Container Name CanIfDispatchCfg
Parent Container CanIf

186 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Description Callback functions provided by upper layer modules of the CanIf. The
callback functions defined in this container are common to all
configured CAN Driver / CAN Transceiver Driver modules.
Configuration Parameters

Name CanIfDispatchUserCheckTrcvWakeFlagIndicationName
[ECUC_CanIf_00791]
Parent Container CanIfDispatchCfg
Description This parameter defines the name of
<User_CheckTrcvWakeFlagIndication>. If
CanIfDispatchUserCheckTrcvWakeFlagIndicationUL equals CAN_SM
the name of <User_CheckTrcvWakeFlagIndication> is fixed. If it equals
CDD, the name is selectable. If CanIfPublicPnSupport equals False,
this parameter shall not be configurable.
Multiplicity 0..1
Type EcucFunctionNameDef
Default Value
Regular Expression
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfDispatchUserCheckTrcvWakeFlagIndicationUL,
CanIfPublicPnSupport

Name CanIfDispatchUserCheckTrcvWakeFlagIndicationUL
[ECUC_CanIf_00792]
Parent Container CanIfDispatchCfg
Description This parameter defines the upper layer module to which the
CheckTrcvWakeFlagIndication from the Driver modules have to be
routed. If CanIfPublicPnSupport equals False, this parameter shall not
be configurable.
Multiplicity 0..1
Type EcucEnumerationParamDef
Range CAN_SM CAN State Manager
CDD Complex Driver
Post-Build Variant false
Multiplicity

187 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant false


Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfPublicPnSupport

Name CanIfDispatchUserClearTrcvWufFlagIndicationName
[ECUC_CanIf_00789]
Parent Container CanIfDispatchCfg
Description This parameter defines the name of
<User_ClearTrcvWufFlagIndication>. If
CanIfDispatchUserClearTrcvWufFlagIndicationUL equals CAN_SM the
name of <User_ClearTrcvWufFlagIndication> is fixed. If it equals CDD,
the name is selectable. If CanIfPublicPnSupport equals False, this
parameter shall not be configurable.
Multiplicity 0..1
Type EcucFunctionNameDef
Default Value
Regular Expression
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfDispatchUserClearTrcvWufFlagIndicationUL,
CanIfPublicPnSupport

188 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfDispatchUserClearTrcvWufFlagIndicationUL
[ECUC_CanIf_00790]
Parent Container CanIfDispatchCfg
Description This parameter defines the upper layer module to which the
ClearTrcvWufFlagIndication from the Driver modules have to be routed.
If CanIfPublicPnSupport equals False, this parameter shall not be
configurable.
Multiplicity 0..1
Type EcucEnumerationParamDef
Range CAN_SM CAN State Manager
CDD Complex Driver
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfPublicPnSupport

Name CanIfDispatchUserConfirmPnAvailabilityName [ECUC_CanIf_00819]


Parent Container CanIfDispatchCfg
Description This parameter defines the name of <User_ConfirmPnAvailability>. If
CanIfDispatchUserConfirmPnAvailabilityUL equals CAN_SM the name
of <User_ConfirmPnAvailability> is fixed. If it equals CDD, the name is
selectable. If CanIfPublicPnSupport equals False, this parameter shall
not be configurable.
Multiplicity 0..1
Type EcucFunctionNameDef
Default Value
Regular Expression
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –

189 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Value Configuration Pre-compile time X VARIANT-PRE-COMPILE


Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfDispatchUserConfirmPnAvailabilityUL,
CanIfPublicPnSupport

Name CanIfDispatchUserConfirmPnAvailabilityUL [ECUC_CanIf_00820]


Parent Container CanIfDispatchCfg
Description This parameter defines the upper layer module to which the
ConfirmPnAvailability notification from the Driver modules have to be
routed. If CanIfPublicPnSupport equals False, this parameter shall not
be configurable.
Multiplicity 0..1
Type EcucEnumerationParamDef
Range CAN_SM CAN State Manager
CDD Complex Driver
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfPublicPnSupport

Name CanIfDispatchUserCtrlBusOffName [ECUC_CanIf_00525]


Parent Container CanIfDispatchCfg
Description This parameter defines the name of <User_ControllerBusOff>. This
parameter depends on the parameter CanIfDispatchUserCtrlBusOffUL.
If CanIfDispatchUserCtrlBusOffUL equals CAN_SM the name of
<User_ControllerBusOff> is fixed. If CanIfDispatchUserCtrlBusOffUL
equals CDD, the name of <User_ControllerBusOff> is selectable.
Multiplicity 0..1
Type EcucFunctionNameDef
Default Value
Length 1–32
Regular Expression
Post-Build Variant false
Multiplicity

190 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant false


Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfDispatchUserCtrlBusOffUL

Name CanIfDispatchUserCtrlBusOffUL [ECUC_CanIf_00547]


Parent Container CanIfDispatchCfg
Description This parameter defines the upper layer (UL) module to which the
notifications of all ControllerBusOff events from the CAN Driver
modules have to be routed via <User_ControllerBusOff>. There is no
possibility to configure no upper layer (UL) module as the provider of
<User_ControllerBusOff>.
Multiplicity 1
Type EcucEnumerationParamDef
Range CAN_SM CAN State Manager
CDD Complex Driver
Post-Build Variant false
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU

Name CanIfDispatchUserCtrlModeIndicationName [ECUC_CanIf_00683]


Parent Container CanIfDispatchCfg
Description This parameter defines the name of <User_ControllerModeIndication>.
This parameter depends on the parameter
CanIfDispatchUserCtrlModeIndicationUL. If
CanIfDispatchUserCtrlModeIndicationUL equals CAN_SM the name of
<User_ControllerModeIndication> is fixed. If
CanIfDispatchUserCtrlModeIndicationUL equals CDD, the name of
<User_ControllerModeIndication> is selectable.
Multiplicity 0..1
Type EcucFunctionNameDef
Default Value
Length 1–32
Regular Expression

191 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant false


Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfDispatchUserCtrlModeIndicationUL

Name CanIfDispatchUserCtrlModeIndicationUL [ECUC_CanIf_00684]


Parent Container CanIfDispatchCfg
Description This parameter defines the upper layer (UL) module to which the
notifications of all ControllerTransition events from the CAN Driver
modules have to be routed via <User_ControllerModeIndication>.
Multiplicity 1
Type EcucEnumerationParamDef
Range CAN_SM CAN State Manager
CDD Complex Driver
Post-Build Variant false
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU

Name CanIfDispatchUserTrcvModeIndicationName [ECUC_CanIf_00685]


Parent Container CanIfDispatchCfg
Description This parameter defines the name of <User_TrcvModeIndication>. This
parameter depends on the parameter
CanIfDispatchUserTrcvModeIndicationUL. If
CanIfDispatchUserTrcvModeIndicationUL equals CAN_SM the name
of <User_TrcvModeIndication> is fixed. If
CanIfDispatchUserTrcvModeIndicationUL equals CDD, the name of
<User_TrcvModeIndication> is selectable.
Multiplicity 0..1
Type EcucFunctionNameDef
Default Value
Length 1–32
Regular Expression

192 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant false


Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfDispatchUserTrcvModeIndicationUL

Name CanIfDispatchUserTrcvModeIndicationUL [ECUC_CanIf_00686]


Parent Container CanIfDispatchCfg
Description This parameter defines the upper layer (UL) module to which the
notifications of all TransceiverTransition events from the CAN
Transceiver Driver modules have to be routed via
<User_TrcvModeIndication>. If no UL module is configured, no upper
layer callback function will be called.
Multiplicity 0..1
Type EcucEnumerationParamDef
Range CAN_SM CAN State Manager
CDD Complex Driver
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU

193 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfDispatchUserValidateWakeupEventName [ECUC_CanIf_00531]


Parent Container CanIfDispatchCfg
Description This parameter defines the name of <User_ValidateWakeupEvent>.
This parameter depends on the parameter
CanIfDispatchUserValidateWakeupEventUL. If
CanIfDispatchUserValidateWakeupEventUL equals ECUM, the name
of <User_ValidateWakeupEvent> is fixed. If
CanIfDispatchUserValidateWakeupEventUL equals CDD, the name of
<User_ValidateWakeupEvent> is selectable.
Multiplicity 0..1
Type EcucFunctionNameDef
Default Value
Length 1–32
Regular Expression
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: CanIfDispatchUserValidateWakeupEventUL

Name CanIfDispatchUserValidateWakeupEventUL [ECUC_CanIf_00549]


Parent Container CanIfDispatchCfg
Description This parameter defines the upper layer (UL) module to which the
notifications about positive former requested wake up sources have to
be routed via <User_ValidateWakeupEvent>.
Multiplicity 0..1
Type EcucEnumerationParamDef
Range CDD Complex Driver
ECUM ECU State Manager
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –

194 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Value Configuration Pre-compile time X VARIANT-PRE-COMPILE


Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU

No Included Containers

195 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CanIfDispatchUserCtrlBusOffName:
CanIfDispatchCfg:
EcucFunctionNameDef
EcucParamConfContainerDef
+parameter
lowerMultiplicity = 0
upperMultiplicity = 1
minLength = 1 CanIfDispatchUserValidateWakeupEventName:
maxLength = 32 EcucFunctionNameDef
+parameter lowerMultiplicity = 0
upperMultiplicity = 1
minLength = 1
maxLength = 32

+literal
+parameter CanIfDispatchUserCtrlBusOffUL: CAN_SM: EcucEnumerationLiteralDef
EcucEnumerationParamDef
+literal
CDD: EcucEnumerationLiteralDef

CanIfDispatchUserValidateWakeupEventUL: +literal
+parameter EcucEnumerationParamDef ECUM: EcucEnumerationLiteralDef
lowerMultiplicity = 0 +literal
upperMultiplicity = 1 CDD: EcucEnumerationLiteralDef

CanIfDispatchUserCtrlModeIndicationName:
EcucFunctionNameDef
+parameter
lowerMultiplicity = 0
upperMultiplicity = 1
minLength = 1 CanIfDispatchUserTrcvModeIndicationName:
maxLength = 32 EcucFunctionNameDef

lowerMultiplicity = 0
+parameter
upperMultiplicity = 1
minLength = 1
maxLength = 32

+literal
CanIfDispatchUserCtrlModeIndicationUL:
CAN_SM: EcucEnumerationLiteralDef
+parameter EcucEnumerationParamDef

lowerMultiplicity = 1 +literal
upperMultiplicity = 1 CDD: EcucEnumerationLiteralDef

+literal
CanIfDispatchUserTrcvModeIndicationUL: CAN_SM: EcucEnumerationLiteralDef
+parameter EcucEnumerationParamDef
+literal
lowerMultiplicity = 0 CDD: EcucEnumerationLiteralDef
upperMultiplicity = 1

+parameter CanIfDispatchUserConfirmPnAvailabilityName:
EcucFunctionNameDef
CanIfDispatchUserClearTrcvWufFlagIndicationName:
lowerMultiplicity = 0
+parameter EcucFunctionNameDef
upperMultiplicity = 1
lowerMultiplicity = 0
upperMultiplicity = 1
CanIfDispatchUserCheckTrcvWakeFlagIndicationName:
EcucFunctionNameDef

+parameter lowerMultiplicity = 0
upperMultiplicity = 1

CanIfDispatchUserClearTrcvWufFlagIndicationUL: +literal
+parameter EcucEnumerationParamDef CAN_SM: EcucEnumerationLiteralDef

lowerMultiplicity = 0 +literal
upperMultiplicity = 1 CDD: EcucEnumerationLiteralDef

CanIfDispatchUserCheckTrcvWakeFlagIndicationUL: +literal
CAN_SM: EcucEnumerationLiteralDef
+parameter EcucEnumerationParamDef

lowerMultiplicity = 0 +literal
upperMultiplicity = 1 CDD: EcucEnumerationLiteralDef

+literal
CanIfDispatchUserConfirmPnAvailabilityUL: CAN_SM: EcucEnumerationLiteralDef
+parameter EcucEnumerationParamDef

lowerMultiplicity = 0 +literal
upperMultiplicity = 1 CDD: EcucEnumerationLiteralDef

Figure 10.8: AR_EcucDef_CanIfDispatchCfg

10.1.9 CanIfCtrlCfg

SWS Item [ECUC_CanIf_00546]

196 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Container Name CanIfCtrlCfg


Parent Container CanIfCtrlDrvCfg
Description This container contains the configuration (parameters) of an adressed
CAN controller by an underlying CAN Driver module. This container is
configurable per CAN controller.
Post-Build Variant false
Multiplicity
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE,
Configuration Class VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Link time –
Post-build time –
Configuration Parameters

Name CanIfCtrlId [ECUC_CanIf_00647]


Parent Container CanIfCtrlCfg
Description This parameter abstracts from the CAN Driver specific parameter
Controller. Each controller of all connected CAN Driver modules shall
be assigned to one specific ControllerId of the CanIf. Range:
0..number of configured controllers of all CAN Driver modules
Multiplicity 1
Type EcucIntegerParamDef (Symbolic Name generated for this parameter)
Range 0 .. 255
Default Value
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfCtrlWakeupSupport [ECUC_CanIf_00637]


Parent Container CanIfCtrlCfg
Description This parameter defines if a respective controller of the referenced CAN
Driver modules is queriable for wake up events.

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU

197 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfCtrlCanCtrlRef [ECUC_CanIf_00636]


Parent Container CanIfCtrlCfg
Description This parameter references to the logical handle of the underlying CAN
controller from the CAN Driver module to be served by the CAN
Interface module. The following parameters of CanController config
container shall be referenced by this link: CanControllerId,
CanWakeupSourceRef

Range: 0..max. number of underlying supported CAN controllers


Multiplicity 1
Type Symbolic name reference to CanController
false
Post-Build Variant
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: amount of CAN controllers

No Included Containers

CanIf: EcucModuleDef

upperMultiplicity = 1
lowerMultiplicity = 0

+container

CanIfCtrlDrvCfg:
EcucParamConfContainerDef

lowerMultiplicity = 1
upperMultiplicity = *

+subContainer

CanIfCtrlCfg: +reference CanController:


CanIfCtrlCanCtrlRef: EcucReferenceDef +destination
EcucParamConfContainerDef EcucParamConfContainerDef
upperMultiplicity = * requiresSymbolicNameValue = true
upperMultiplicity = *
lowerMultiplicity = 1 lowerMultiplicity = 1

CanIfCtrlId: EcucIntegerParamDef
+parameter +parameter
min = 0
max = 255
CanControllerId:
symbolicNameValue = true
EcucIntegerParamDef

upperMultiplicity = 1
lowerMultiplicity = 1
symbolicNameValue = true
min = 0
max = 255
+parameter CanIfCtrlWakeupSupport:
EcucBooleanParamDef

defaultValue = False

Figure 10.9: AR_EcucDef_CanIfCtrlCfg

10.1.10 CanIfCtrlDrvCfg

198 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

SWS Item [ECUC_CanIf_00253]


Container Name CanIfCtrlDrvCfg
Parent Container CanIf
Description Configuration parameters for all the underlying CAN Driver modules
are aggregated under this container. For each CAN Driver module a
seperate instance of this container has to be provided.
Post-Build Variant false
Multiplicity
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE,
Configuration Class VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Link time –
Post-build time –
Configuration Parameters

Name CanIfCtrlDrvInitHohConfigRef [ECUC_CanIf_00642]


Parent Container CanIfCtrlDrvCfg
Description Reference to the Init Hoh Configuration
Multiplicity 1
Type Reference to CanIfInitHohCfg
false
Post-Build Variant
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: local

Name CanIfCtrlDrvNameRef [ECUC_CanIf_00638]


Parent Container CanIfCtrlDrvCfg
Description CAN Interface Driver Reference.

This reference can be used to get any information (Ex. Driver Name,
Vendor ID) from the CAN driver.

The CAN Driver name can be derived from the ShortName of the CAN
driver module.
Multiplicity 1
Type Reference to CanGeneral
false
Post-Build Variant
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local

199 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Included Containers
Container Name Multiplicity Scope / Dependency
CanIfCtrlCfg 1..* This container contains the configuration (parameters)
of an adressed CAN controller by an underlying CAN
Driver module. This container is configurable per CAN
controller.

CanIf: EcucModuleDef

upperMultiplicity = 1
lowerMultiplicity = 0

+container
CanGeneral:
CanIfCtrlDrvCfg: +reference +destination EcucParamConfContainerDef
CanIfCtrlDrvNameRef:
EcucParamConfContainerDef
EcucReferenceDef upperMultiplicity = 1
lowerMultiplicity = 1 lowerMultiplicity = 1
upperMultiplicity = *

CanIfInitHohCfg:
EcucParamConfContainerDef
+reference CanIfCtrlDrvInitHohConfigRef: +destination
EcucReferenceDef lowerMultiplicity = 0
upperMultiplicity = *

                
                       

Figure 10.10: AR_EcucDef_CanIfCtrlDrvCfg

10.1.11 CanIfTrcvDrvCfg

SWS Item [ECUC_CanIf_00273]


Container Name CanIfTrcvDrvCfg
Parent Container CanIf
Description This container contains the configuration (parameters) of all addressed
CAN transceivers by each underlying CAN Transceiver Driver module.
For each CAN transceiver Driver a seperate instance of this container
shall be provided.
Post-Build Variant false
Multiplicity
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE,
Configuration Class VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Link time –
Post-build time –
Configuration Parameters

200 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Included Containers
Container Name Multiplicity Scope / Dependency
CanIfTrcvCfg 1..* This container contains the configuration (parameters) of
one addressed CAN transceiver by the underlying CAN
Transceiver Driver module. For each CAN transceiver a
seperate instance of this container has to be provided.

CanIf: EcucModuleDef

upperMultiplicity = 1
lowerMultiplicity = 0

+container

CanIfTrcvDrvCfg:
EcucParamConfContainerDef CanIfTrcvCfg:
EcucParamConfContainerDef
lowerMultiplicity = 0 +subContainer
upperMultiplicity = * lowerMultiplicity = 1
upperMultiplicity = *

Figure 10.11: AR_EcucDef_CanIfTrcvDrvCfg

10.1.12 CanIfTrcvCfg

SWS Item [ECUC_CanIf_00587]


Container Name CanIfTrcvCfg
Parent Container CanIfTrcvDrvCfg
Description This container contains the configuration (parameters) of one
addressed CAN transceiver by the underlying CAN Transceiver Driver
module. For each CAN transceiver a seperate instance of this
container has to be provided.
Post-Build Variant false
Multiplicity
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE,
Configuration Class VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Link time –
Post-build time –
Configuration Parameters

201 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfTrcvId [ECUC_CanIf_00654]


Parent Container CanIfTrcvCfg
Description This parameter abstracts from the CAN Transceiver Driver specific
parameter Transceiver. Each transceiver of all connected CAN
Transceiver Driver modules shall be assigned to one specific
TransceiverId of the CanIf.

Range: 0..number of configured transceivers of all CAN Transceiver


Driver modules
Multiplicity 1
Type EcucIntegerParamDef (Symbolic Name generated for this parameter)
Range 0 .. 255
Default Value
Post-Build Variant false
Value
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: ECU

Name CanIfTrcvWakeupSupport [ECUC_CanIf_00606]


Parent Container CanIfTrcvCfg
Description This parameter defines if a respective transceiver of the referenced
CAN Transceiver Driver modules is queriable for wake up events.

True: Enabled False: Disabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value false
Post-Build Variant false
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU

Name CanIfTrcvCanTrcvRef [ECUC_CanIf_00605]


Parent Container CanIfTrcvCfg
Description This parameter references to the logical handle of the underlying CAN
transceiver from the CAN transceiver driver module to be served by the
CAN Interface module.

Range: 0..max. number of underlying supported CAN transceivers


Multiplicity 1
Type Symbolic name reference to CanTrcvChannel
false
Post-Build Variant
Value

202 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Value Configuration Pre-compile time X VARIANT-PRE-COMPILE


Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: ECU
dependency: amount of CAN transceivers

No Included Containers

CanIf: EcucModuleDef

upperMultiplicity = 1
lowerMultiplicity = 0

+container

CanIfTrcvDrvCfg:
EcucParamConfContainerDef

lowerMultiplicity = 0
upperMultiplicity = *

+subContainer

CanIfTrcvCfg: CanIfTrcvWakeupSupport:
EcucParamConfContainerDef +parameter
EcucBooleanParamDef
lowerMultiplicity = 1 defaultValue = false
upperMultiplicity = *

CanIfTrcvId: EcucIntegerParamDef
+parameter
min = 0
max = 255
symbolicNameValue = true

CanIfTrcvCanTrcvRef: EcucReferenceDef CanTrcvChannel: EcucParamConfContainerDef


+reference +destination
lowerMultiplicity = 1 upperMultiplicity = *
upperMultiplicity = 1 lowerMultiplicity = 1
requiresSymbolicNameValue = true

+reference +parameter

CanTrcvWakeupSourceRef: CanTrcvChannelId:
EcucReferenceDef EcucIntegerParamDef

lowerMultiplicity = 0 symbolicNameValue = true


upperMultiplicity = 1 max = 255
requiresSymbolicNameValue = true

Figure 10.12: AR_EcucDef_CanIfTrcvCfg

10.1.13 CanIfInitHohCfg

SWS Item [ECUC_CanIf_00257]


Container Name CanIfInitHohCfg
Parent Container CanIfInitCfg
Description This container contains the references to the configuration setup of
each underlying CAN Driver.
Post-Build Variant false
Multiplicity

203 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Multiplicity Pre-compile time X VARIANT-PRE-COMPILE,


Configuration Class VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Link time –
Post-build time –
Configuration Parameters

Included Containers
Container Name Multiplicity Scope / Dependency
CanIfHrhCfg 0..* This container contains configuration parameters for
each hardware receive object (HRH).
CanIfHthCfg 0..* This container contains parameters related to each HTH.

CanIfInitCfg: EcucParamConfContainerDef

lowerMultiplicity = 1
upperMultiplicity = 1

+subContainer

CanIfInitHohCfg: CanIfHrhCfg:
EcucParamConfContainerDef EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = * upperMultiplicity = *

CanIfHthCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = *

Figure 10.13: AR_EcucDef_CanIfInitHohCfg

10.1.14 CanIfHthCfg

SWS Item [ECUC_CanIf_00258]


Container Name CanIfHthCfg
Parent Container CanIfInitHohCfg
Description This container contains parameters related to each HTH.
Post-Build Variant true
Multiplicity
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Configuration Parameters

204 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfHthCanCtrlIdRef [ECUC_CanIf_00625]


Parent Container CanIfHthCfg
Description Reference to controller Id to which the HTH belongs to. A controller
can contain one or more HTHs.
Multiplicity 1
Type Reference to CanIfCtrlCfg
true
Post-Build Variant
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

Name CanIfHthIdSymRef [ECUC_CanIf_00627]


Parent Container CanIfHthCfg
Description The parameter refers to a particular HTH object in the CanDrv
configuration (see CanHardwareObject ECUC_Can_00324). CanIf
receives the following information of the CanDrv module by this
reference:
• CanHandleType (see ECUC_Can_00323)
• CanObjectId (see ECUC_Can_00326)

Multiplicity 1
Type Symbolic name reference to CanHardwareObject
true
Post-Build Variant
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

No Included Containers

205 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CanIfInitHohCfg:
EcucParamConfContainerDef

lowerMultiplicity = 0
upperMultiplicity = *

+subContainer

CanIfHthCfg: CanIfCtrlCfg:
EcucParamConfContainerDef +reference CanIfHthCanCtrlIdRef: +destination
EcucParamConfContainerDef
EcucReferenceDef
lowerMultiplicity = 0 upperMultiplicity = *
upperMultiplicity = * lowerMultiplicity = 1

+reference CanIfHthIdSymRef: EcucReferenceDef +destination CanHardwareObject:


EcucParamConfContainerDef
requiresSymbolicNameValue = true
upperMultiplicity = *
lowerMultiplicity = 1

+parameter +parameter

CanObjectId: EcucIntegerParamDef CanHandleType:


EcucEnumerationParamDef
upperMultiplicity = 1
lowerMultiplicity = 1
symbolicNameValue = true
min = 0
max = 65535

Figure 10.14: AR_EcucDef_CanIfHthCfg

10.1.15 CanIfHrhCfg

SWS Item [ECUC_CanIf_00259]


Container Name CanIfHrhCfg
Parent Container CanIfInitHohCfg
Description This container contains configuration parameters for each hardware
receive object (HRH).
Post-Build Variant true
Multiplicity
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Configuration Parameters

Name CanIfHrhSoftwareFilter [ECUC_CanIf_00632]


Parent Container CanIfHrhCfg
Description Selects the hardware receive objects by using the HRH range/list from
CAN Driver configuration to define, for which HRH a software filtering
has to be performed at during receive processing.

True: Software filtering is enabled False: Software filtering is enabled


Multiplicity 1
Type EcucBooleanParamDef
Default Value true

206 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant false


Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Scope / Dependency scope: local

Name CanIfHrhCanCtrlIdRef [ECUC_CanIf_00631]


Parent Container CanIfHrhCfg
Description Reference to controller Id to which the HRH belongs to. A controller
can contain one or more HRHs.
Multiplicity 1
Type Reference to CanIfCtrlCfg
true
Post-Build Variant
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

Name CanIfHrhIdSymRef [ECUC_CanIf_00634]


Parent Container CanIfHrhCfg
Description The parameter refers to a particular HRH object in the CanDrv
configuration (see CanHardwareObject ECUC_Can_00324). CanIf
receives the following information of the CanDrv module by this
reference:
• CanHandleType (see ECUC_Can_00323)
• CanObjectId (see ECUC_Can_00326)

Multiplicity 1
Type Symbolic name reference to CanHardwareObject
true
Post-Build Variant
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU

Included Containers
Container Name Multiplicity Scope / Dependency
CanIfHrhRangeCfg 0..* Defines the parameters required for configurating
multiple CANID ranges for a given same HRH.

207 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CanIfInitHohCfg:
EcucParamConfContainerDef

lowerMultiplicity = 0
upperMultiplicity = *

+subContainer CanIfCtrlCfg:
+reference CanIfHrhCanCtrlIdRef: +destination EcucParamConfContainerDef
CanIfHrhCfg:
EcucReferenceDef
EcucParamConfContainerDef upperMultiplicity = *
lowerMultiplicity = 1
lowerMultiplicity = 0
upperMultiplicity = *

CanHardwareObject:
+reference CanIfHrhIdSymRef: EcucReferenceDef +destination EcucParamConfContainerDef
requiresSymbolicNameValue = true upperMultiplicity = *
lowerMultiplicity = 1

CanIfHrhSoftwareFilter:
+parameter EcucBooleanParamDef

defaultValue = True

CanIfHrhRangeCfg:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0
upperMultiplicity = * +parameter

CanHandleType:
EcucEnumerationParamDef

+parameter

CanObjectId: EcucIntegerParamDef

upperMultiplicity = 1
lowerMultiplicity = 1
symbolicNameValue = true
min = 0
max = 65535

Figure 10.15: AR_EcucDef_CanIfHrhCfg

10.1.16 CanIfHrhRangeCfg

SWS Item [ECUC_CanIf_00628]


Container Name CanIfHrhRangeCfg
Parent Container CanIfHrhCfg
Description Defines the parameters required for configurating multiple CANID
ranges for a given same HRH.
Post-Build Variant true
Multiplicity
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Configuration Parameters

208 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfHrhRangeBaseId [ECUC_CanIf_00825]


Parent Container CanIfHrhRangeCfg
Description CAN Identifier used as base value in combination with
CanIfHrhRangeMask for a masked ID range in which all CAN Ids shall
pass the software filtering. The size of this parameter is limited by
CanIfHrhRangeRxPduRangeCanIdType.
Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 .. 536870911
Default Value
Post-Build Variant true
Multiplicity
Post-Build Variant true
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

Name CanIfHrhRangeMask [ECUC_CanIf_00826]


Parent Container CanIfHrhRangeCfg
Description Used as mask value in combination with CanIfHrhRangeBaseId for a
masked ID range in which all CAN Ids shall pass the software filtering.
The size of this parameter is limited by
CanIfHrhRangeRxPduRangeCanIdType.
Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 .. 536870911
Default Value
Post-Build Variant true
Multiplicity
Post-Build Variant true
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

209 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Name CanIfHrhRangeRxPduLowerCanId [ECUC_CanIf_00629]


Parent Container CanIfHrhRangeCfg
Description Lower CAN Identifier of a receive CAN L-PDU for identifier range
definition, in which all CAN Ids shall pass the software filtering.
Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 .. 536870911
Default Value
Post-Build Variant true
Multiplicity
Post-Build Variant true
Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

Name CanIfHrhRangeRxPduRangeCanIdType [ECUC_CanIf_00644]


Parent Container CanIfHrhRangeCfg
Description Specifies whether a configured Range of CAN Ids shall only consider
standard CAN Ids or extended CAN Ids.
Multiplicity 1
Type EcucEnumerationParamDef
Range EXTENDED All the CANIDs are of type extended
only (29 bit).
STANDARD All the CANIDs are of type standard
only (11bit).
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

Name CanIfHrhRangeRxPduUpperCanId [ECUC_CanIf_00630]


Parent Container CanIfHrhRangeCfg
Description Upper CAN Identifier of a receive CAN L-PDU for identifier range
definition, in which all CAN Ids shall pass the software filtering.
Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 .. 536870911
Default Value
Post-Build Variant true
Multiplicity

210 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Post-Build Variant true


Value
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

No Included Containers

CanIfHrhCfg:
EcucParamConfContainerDef

lowerMultiplicity = 0
upperMultiplicity = *

CanIfHrhRangeRxPduUpperCanId:
EcucIntegerParamDef
+subContainer
min = 0
CanIfHrhRangeCfg: +parameter max = 536870911
EcucParamConfContainerDef lowerMultiplicity = 0
upperMultiplicity = 1
lowerMultiplicity = 0
upperMultiplicity = *
CanIfHrhRangeRxPduLowerCanId:
EcucIntegerParamDef
+parameter
upperMultiplicity = 1
lowerMultiplicity = 0
min = 0
max = 536870911
STANDARD:
+literal EcucEnumerationLiteralDef
CanIfHrhRangeRxPduRangeCanIdType:
EcucEnumerationParamDef
+parameter

+literal EXTENDED:
EcucEnumerationLiteralDef

CanIfHrhRangeBaseId:
EcucIntegerParamDef
+parameter
upperMultiplicity = 1
lowerMultiplicity = 0
min = 0
max = 536870911

CanIfHrhRangeMask:
EcucIntegerParamDef
+parameter
upperMultiplicity = 1
lowerMultiplicity = 0
min = 0
max = 536870911

Figure 10.16: AR_EcucDef_CanIfHrhRangeCfg

10.1.17 CanIfBufferCfg

SWS Item [ECUC_CanIf_00832]


Container Name CanIfBufferCfg
Parent Container CanIfInitCfg

211 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Description This container contains the Txbuffer configuration. Multiple buffers with
different sizes could be configured. If CanIfBufferSize
(ECUC_CanIf_00834) equals 0, the CanIf Tx L-PDU only refers via this
CanIfBufferCfg the corresponding CanIfHthCfg.
Post-Build Variant true
Multiplicity
Multiplicity Pre-compile time X VARIANT-PRE-COMPILE
Configuration Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Configuration Parameters

Name CanIfBufferSize [ECUC_CanIf_00834]


Parent Container CanIfBufferCfg
Description This parameter defines the number of CanIf Tx L-PDUs which can be
buffered in one Txbuffer. If this value equals 0, the CanIf does not
perform Txbuffering for the CanIf Tx L-PDUs which are assigned to this
Txbuffer. If CanIfPublicTxBuffering equals False, this parameter equals
0 for all TxBuffer. If the CanHandleType of the referred HTH equals
FULL, this parameter equals 0 for this TxBuffer.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 255
Default Value 0
Post-Build Variant true
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
dependency: CanIfPublicTxBuffering, CanHandleType

Name CanIfBufferHthRef [ECUC_CanIf_00833]


Parent Container CanIfBufferCfg
Description Reference to HTH, that defines the hardware object or the pool of
hardware objects configured for transmission. All the CanIf Tx L-PDUs
refer via the CanIfBufferCfg and this parameter to the HTHs if
TxBuffering is enabled, or not.

Each HTH shall not be assigned to more than one buffer.


Multiplicity 1
Type Reference to CanIfHthCfg
true
Post-Build Variant
Value
Value Configuration Pre-compile time X VARIANT-PRE-COMPILE
Class
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD

212 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Scope / Dependency scope: local

No Included Containers

CanIfBufferCfg: CanIfBufferHthRef: +destination CanIfHthCfg:


EcucParamConfContainerDef +reference EcucReferenceDef EcucParamConfContainerDef

lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = * upperMultiplicity = *

CanIfBufferSize:
+parameter EcucIntegerParamDef

min = 0
max = 255
defaultValue = 0

Figure 10.17: AR_EcucDef_CanIfBufferCfg

10.1.18 CanIfSecurityEventRefs

SWS Item [ECUC_CanIf_00849]


Container Name CanIfSecurityEventRefs
Parent Container CanIfPublicCfg
Description Container for the references to IdsMEvent elements representing the
security events that the CanIf module shall report to the IdsM in case
the coresponding security related event occurs (and if
CanIfEnableSecurityEventReporting is set to "true"). The standardized
security events in this container can be extended by vendor-specific
security events.

Tags:
atp.Status=draft
Post-Build Variant false
Multiplicity
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Configuration Parameters

Name CANIF_SEV_ERRORSTATE_BUSOFF [ECUC_CanIf_00853]


Parent Container CanIfSecurityEventRefs
Description The CAN controller transitioned to state busoff.

Tags:
atp.Status=draft
Multiplicity 0..1
Type Symbolic name reference to IdsMEvent
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value

213 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Multiplicity Pre-compile time X All Variants


Configuration Class
Link time –
Post-build time –
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local

Name CANIF_SEV_ERRORSTATE_PASSIVE [ECUC_CanIf_00852]


Parent Container CanIfSecurityEventRefs
Description A reception related error was detected. Depending on the context data
this could indicate suspicious CAN activity.

Tags:
atp.Status=draft
Multiplicity 0..1
Type Symbolic name reference to IdsMEvent
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local

Name CANIF_SEV_RX_ERROR_DETECTED [ECUC_CanIf_00851]


Parent Container CanIfSecurityEventRefs
Description A reception related error was detected. Depending on the context data
this could indicate suspicious CAN activity.

Tags:
atp.Status=draft
Multiplicity 0..1
Type Symbolic name reference to IdsMEvent
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –

214 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

Value Configuration Pre-compile time X All Variants


Class
Link time –
Post-build time –
Scope / Dependency scope: local

Name CANIF_SEV_TX_ERROR_DETECTED [ECUC_CanIf_00850]


Parent Container CanIfSecurityEventRefs
Description A transmission related error was detected. Depending on the context
data this could indicate suspicious CAN activity.

Tags:
atp.Status=draft
Multiplicity 0..1
Type Symbolic name reference to IdsMEvent
Post-Build Variant false
Multiplicity
Post-Build Variant false
Value
Multiplicity Pre-compile time X All Variants
Configuration Class
Link time –
Post-build time –
Value Configuration Pre-compile time X All Variants
Class
Link time –
Post-build time –
Scope / Dependency scope: local

No Included Containers

215 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

CanIfPublicCfg:
EcucParamConfContainerDef +parameter CanIfEnableSecurityEventReporting:
EcucBooleanParamDef
upperMultiplicity = 1
lowerMultiplicity = 1 defaultValue = false

+subContainer

CanIfSecurityEventRefs: CANIF_SEV_TX_ERROR_DETECTED: IdsMEvent:


EcucParamConfContainerDef +reference EcucReferenceDef +destination EcucParamConfContainerDef

lowerMultiplicity = 0 lowerMultiplicity = 0 lowerMultiplicity = 1


upperMultiplicity = 1 upperMultiplicity = 1 upperMultiplicity = 65535
requiresSymbolicNameValue = true

CANIF_SEV_RX_ERROR_DETECTED:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true

CANIF_SEV_ERRORSTATE_PASSIVE:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true

CANIF_SEV_ERRORSTATE_BUSOFF:
+reference EcucReferenceDef +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true

(from IdsM)

Figure 10.18: AR_EcucDef_CanIfSecurityEventRefs

216 of 217 Document ID 12: AUTOSAR_SWS_CANInterface


Specification of CAN Interface
AUTOSAR CP R21-11

A Not applicable requirements


[SWS_CANIF_00999] dThese requirements are not applicable to this specifica-
tion.c(SRS_BSW_00159, SRS_BSW_00167, SRS_BSW_00170, SRS_BSW_00416,
SRS_BSW_00168, SRS_BSW_00423, SRS_BSW_00424, SRS_BSW_00425, SRS_-
BSW_00426, SRS_BSW_00427, SRS_BSW_00428, SRS_BSW_00429, SRS_-
BSW_00432, SRS_BSW_00433, SRS_BSW_00336, SRS_BSW_00417, SRS_-
BSW_00164, SRS_BSW_00007, SRS_BSW_00307, SRS_BSW_00373, SRS_-
BSW_00328, SRS_BSW_00378, SRS_BSW_00306, SRS_BSW_00308, SRS_-
BSW_00309, SRS_BSW_00330, SRS_BSW_00172, SRS_BSW_00010, SRS_-
BSW_00341, SRS_BSW_00334, SRS_Can_01139, SRS_Can_01014)

217 of 217 Document ID 12: AUTOSAR_SWS_CANInterface

You might also like