0% found this document useful (0 votes)
74 views

AUTOSAR SWS CANTransceiverDriver

Uploaded by

Hunter Hunter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

AUTOSAR SWS CANTransceiverDriver

Uploaded by

Hunter Hunter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 78

Specification of CAN Transceiver Driver

AUTOSAR CP Release 4.3.1

Document Title Specification of CAN Trans-


ceiver Driver
Document Owner AUTOSAR
Document Responsibility AUTOSAR
Document Identification No 071

Document Status Final


Part of AUTOSAR Standard Classic Platform
Part of Standard Release 4.3.1

Document Change History


Date Release Changed by Change Description
2017-12-08 4.3.1 AUTOSAR  CanTrcv_DeInit API added in state
Release machine diagram
Management  Editorial changes 'Runtime errors'
added
2016-11-30 4.3.0 AUTOSAR Re-  Added CanTrcv_DeInit API
lease Man-  Sequence diagram updated
agement  CanTrcvGetVersionInfo renamed to
CanTrcvVersionInfoApi
 Updated Configuration class for con-
figuration parameters
 Minor corrections in the MainFunc-
tion periods
2014-10-31 4.2.1 AUTOSAR  Revised the configuration of CAN
Release Tranceiver.
Management  Minor corrections in wait state func-
tionality.
 Clarification regarding the wakeup
sources.
2014-03-31 4.1.3 AUTOSAR  Revised configuration for SPI inter-
Release face.
Management  Revised naming convention for
transceiver driver
2013-10-31 4.1.2 AUTOSAR  Removed 'Timing' row from sched-
Release uled functions API table.
Management  Editorial changes
 Removed chapter(s) on change
documentation

1 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Document Change History


Date Release Changed by Change Description
2013-03-15 4.1.1 AUTOSAR  Updated sequence diagrams
Administration  Reworked according to the new
SWS_BSWGeneral
2011-12-22 4.0.3 AUTOSAR  Added support for Partial Network-
Administration ing
 Implemented Production error con-
cept
 Updated Baud rate configuration pa-
rameter handling
 Added support to detect that power-
on was caused by CAN communica-
tion
 Reentrancy attribute is corrected for
APIs
 Corrections in few requirements
 Optional Interfaces Table is correct-
ed
2009-12-18 4.0.1 AUTOSAR  CanTrcv state names changed and
Administration state diagram modified
 Usage of SBCs are no longer re-
stricted
 Mode switch requests to the current
mode are allowed
 CanTrvc driver has to invoke
CanIf_TrcvModeIndication after
each mode switch request, when
the requested mode has been
reached

2 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Document Change History


Date Release Changed by Change Description
2010-02-02 3.1.4 AUTOSAR  Wakeup event reporting: In R4.0,
Administration CanTrcv stores wakeup events.
CanIf invokes function
CanTrcv_CheckWakeup() periodi-
cally to check for wakeup events.
 Wakeup modes: In R4.0, wakeup
through interrupt mechanism is not
supported. Only POLLING and
NOT_SUPPORTED wakeup modes
are available in CanTrcv.
 Sleep Wait Count added: Wait count
for transitioning into sleep mode
(CanTrcvSleepWaitCount) added.
 Legal disclaimer revised
2008-08-13 3.1.1 AUTOSAR  Legal disclaimer revised
Administration
2007-12-21 3.0.1 AUTOSAR  Changed API name
Administration CanIf_TrcvWakeupByBus to
CanIf_SetWakeupEvent
 New error code
CANTRCV_E_PARAM_TRCV_WA
KEUP_MODE has been added.
 Output parameter in the API’s
CanTrcv_GetOpMode,
CanTrcv_GetBusWuReason and
CanTrcv_GetVersionInfo is changed
to pointer type.
 API CanTrcv_CB_WakeupByBus
has been modified
 Document meta information extend-
ed
 Small layout adaptations made

3 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Document Change History


Date Release Changed by Change Description
2007-01-24 2.1.15 AUTOSAR  CAN transceiver driver is below
Administration CAN interface. All API access from
higher layers are routed through
CAN interface.
 One CAN transceiver driver used
per CAN transceiver hardware type.
For different CAN transceiver hard-
ware types different CAN transceiv-
er drivers are used. One CAN trans-
ceiver driver supports all CAN
transceiver hardware of same type
 Legal disclaimer revised
 Release Notes added
 “Advice for users” revised
 “Revision Information” added
2006-05-16 2.0 AUTOSAR  Initial release
Administration

4 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Disclaimer

This work (specification and/or software implementation) and the material contained
in it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR
and the companies that have contributed to it shall not be liable for any use of the
work.

The material contained in this work is protected by copyright and other types of
intellectual property rights. The commercial exploitation of the material contained in
this work requires a license to such intellectual property rights.

This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the
work may be utilized or reproduced, in any form or by any means, without permission
in writing from the publisher.

The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.

The word AUTOSAR and the AUTOSAR logo are registered trademarks.

5 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Table of Content
1 Introduction.......................................................................................................... 8
1.1 Goal of CAN Transceiver Driver .................................................................... 9
1.2 Explicitly uncovered CAN transceiver functionality ........................................ 9
1.3 Single wire CAN transceivers according SAE J2411 ..................................... 9
2 Acronyms and abbreviations ............................................................................. 10
3 Related documentation...................................................................................... 11
3.1 Input documents .......................................................................................... 11
3.2 Related standards and norms ..................................................................... 11
3.3 Related specification ................................................................................... 11
4 Constraints and assumptions ............................................................................ 12
4.1 Limitations ................................................................................................... 12
4.2 Applicability to car domains ......................................................................... 12
5 Dependencies to other modules ........................................................................ 13
5.1 File structure ................................................................................................ 13
5.1.1 Code file structure ................................................................................. 13
5.1.2 Header file structure .............................................................................. 14
6 Requirements Traceability ................................................................................. 15
7 Functional specification ..................................................................................... 23
7.1 CAN transceiver driver operation modes ..................................................... 23
7.1.1 Operation mode switching .................................................................... 24
7.2 CAN transceiver hardware operation modes ............................................... 24
7.2.1 Example for temporary “Go-To-Sleep” mode ........................................ 25
7.2.2 Example for “PowerOn/ListenOnly” mode ............................................. 25
7.3 CAN transceiver wake up types .................................................................. 25
7.4 Enabling/Disabling wakeup notification ....................................................... 26
7.5 CAN transceiver wake up modes ................................................................ 26
7.6 Error classification ....................................................................................... 27
7.6.1 Development Errors .............................................................................. 27
7.6.2 Runtime Errors ...................................................................................... 27
7.6.3 Transient Faults .................................................................................... 28
7.6.4 Production Errors .................................................................................. 28
7.6.5 Extended Production Errors .................................................................. 28
7.7 Preconditions for driver initialization ............................................................ 28
7.8 Instance concept ......................................................................................... 29
7.9 Wait states................................................................................................... 29
7.10 Transceivers with selective wakeup functionality .................................... 29
8 API specification ................................................................................................ 31
8.1 Imported types ............................................................................................. 31
8.2 Type definitions ........................................................................................... 32
8.3 Function definitions...................................................................................... 33
8.3.1 CanTrcv_Init.......................................................................................... 33
8.3.2 CanTrcv_SetOpMode ........................................................................... 34
8.3.3 CanTrcv_GetOpMode ........................................................................... 36
6 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

8.3.4 CanTrcv_GetBusWuReason ................................................................. 37


8.3.5 CanTrcv_VersionInfo ............................................................................ 38
8.3.6 CanTrcv_ SetWakeupMode .................................................................. 38
8.3.7 CanTrcv_GetTrcvSystemData .............................................................. 40
8.3.8 CanTrcv_ClearTrcvWufFlag.................................................................. 41
8.3.9 CanTrcv_ReadTrcvTimeoutFlag ........................................................... 42
8.3.10 CanTrcv_ClearTrcvTimeoutFlag ........................................................ 42
8.3.11 CanTrcv_ReadTrcvSilenceFlag ......................................................... 43
8.3.12 CanTrcv_CheckWakeup .................................................................... 43
8.3.13 CanTrcv_SetPNActivationState ......................................................... 44
8.3.14 CanTrcv_CheckWakeFlag ................................................................. 45
8.3.15 CanTrcv_DeInit .................................................................................. 45
8.4 Scheduled functions .................................................................................... 46
8.4.1 CanTrcv_MainFunction ......................................................................... 46
8.4.2 CanTrcv_MainFunctionDiagnostics ...................................................... 47
8.5 Call-back notifications.................................................................................. 47
8.6 Expected Interfaces ..................................................................................... 47
8.6.1 Mandatory Interfaces ............................................................................ 48
8.6.2 Optional Interfaces ................................................................................ 48
8.6.3 Configurable interfaces ......................................................................... 49
9 Sequence diagram ............................................................................................ 50
9.1 Wake up with valid validation ...................................................................... 50
9.2 Interaction with DIO module ........................................................................ 51
9.3 De-Initialization (SPI Synchronous) ............................................................. 53
9.4 De-Initialization (SPI Asynchronous) ........................................................... 55
10 Configuration specification ............................................................................. 57
10.1 How to read this chapter ......................................................................... 57
10.2 Containers and configuration parameters ............................................... 58
10.2.1 CanTrcv ............................................................................................. 58
10.2.2 CanTrcvGeneral ................................................................................ 58
10.2.3 CanTrcvConfigSet ............................................................................. 62
10.2.4 CanTrcvChannel ................................................................................ 63
10.2.5 CanTrcvAccess ................................................................................. 68
10.2.6 CanTrcvDioAccess ............................................................................ 69
10.2.7 CanTrcvDioChannelAccess ............................................................... 69
10.2.8 CanTrcvSpiAccess ............................................................................ 70
10.2.9 CanTrcvSpiSequence ........................................................................ 71
10.2.10 CanTrcvDemEventParameterRefs .................................................... 72
10.2.11 CanTrcvPartialNetwork ...................................................................... 73
10.2.12 CanTrcvPnFrameDataMaskSpec ...................................................... 76
10.3 Published Information ............................................................................. 77
11 Not applicable requirements .......................................................................... 78

7 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

1 Introduction

This specification describes the functionality, APIs and configuration of CAN Trans-
ceiver Driver module. The CAN Transceiver Driver module is responsible for handling
the CAN transceiver hardware chips on an ECU.
The CAN Transceiver is a hardware device, which adapts the signal levels that are
used on the CAN bus to the logical (digital) signal levels recognised by a microcon-
troller.
In addition, the transceivers are able to detect electrical malfunctions like wiring is-
sues, ground offsets or transmission of long dominant signals. Depending on the in-
terfacing with the microcontroller, they flag the detected error summarized by a single
port pin or very detailed by SPI.
Some transceivers support power supply control and wake up via the CAN bus. Dif-
ferent wake up/sleep and power supply concepts are usual on the market.
Within the automotive environment, there are mainly three different CAN bus physics
used. These are ISO11898 for high-speed CAN (up to 1Mbits/s), ISO11519 for low-
speed CAN (up to 125Kbits/s) and SAE J2411 for single-wire CAN.
Latest developments include System Basis Chips (SBCs) where power supply con-
trol and advanced watchdogs are implemented in addition to CAN. These are en-
closed in one housing and controlled through single interface (e.g. via SPI).

8 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

1.1 Goal of CAN Transceiver Driver


The target of this document is to specify the interfaces and behavior which are appli-
cable to most current and future CAN transceiver devices.
The CAN transceiver driver abstracts the CAN transceiver hardware. It offers a
hardware independent interface to the higher layers. It abstracts from the ECU layout
by using APIs of MCAL layer to access the CAN transceiver hardware.

1.2 Explicitly uncovered CAN transceiver functionality


Some CAN bus transceivers offer additional functionality, for example, ECU self test
or error detection capability for diagnostics.
ECU self test and error detection are not defined within AUTOSAR and requiring
such functionality would lock out most currently used transceiver hardware chips.
Therefore, features like “ground shift detection”, “selective wake up”, “slope control”
are not supported.

1.3 Single wire CAN transceivers according SAE J2411


Single wire CAN according SAE J2411 is not supported by AUTOSAR.

9 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

2 Acronyms and abbreviations

Abbreviation Description
ComM Communication Manager
DEM Diagnostic Event Manager
DET Default Error Tracer
DIO Digital Input Output (SPAL module)
EB Externally Buffered channels. Buffers containing data to transfer are outside the
SPI Handler/Driver.
EcuM ECU State Manager
IB Internally Buffered channels. Buffers containing data to transfer are inside the SPI
Handler/Driver.
ISR Interrupt Service Routine
MCAL Micro Controller Abstraction Layer
Port Port module (SPAL module)
n/a Not Applicable
SBC System Basis Chip; a device, which integrates e.g. CAN and/or LIN transceiver,
watchdog and power control.
SPAL Standard Peripheral Abstraction Layer
SPI A channel is a software exchange medium for data that are defined with the same
Channel criteria: configuration parameters, number of data elements with same size and
data pointers (source & destination) or location. See specification of SPI driver for
more details.
SPI A job is composed of one or several channels with the same chip select. A job is
Job considered to be atomic and therefore cannot be interrupted. A job has also an
assigned priority. See specification of SPI driver for more details.
SPI A sequence is a number of consecutive jobs to be transmitted. A sequence de-
Sequence pends on a static configuration. See specification of SPI driver for more details.

CAN Channel A physical channel which is connected to a CAN network from a CAN controller
through a CAN transceiver.
API Application Programming Interface

10 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

3 Related documentation
3.1 Input documents
[1] List of Basic Software Modules
AUTOSAR_TR_BSWModuleList.pdf

[2] Layered Software Architecture


AUTOSAR_EXP_LayeredSoftwareArchitecture.pdf

[3] Specification of ECU Configuration


AUTOSAR_TPS_ECUConfiguration.pdf

[4] General Requirements on Basic Software


AUTOSAR_SRS_BSWGeneral.pdf

[5] Specification of Specification of CAN Interface


AUTOSAR_SWS_CANInterface.pdf

[6] Basic Software Module Description Template,


AUTOSAR_TPS_BSWModuleDescriptionTemplate.pdf

[7] General Specification of Basic Software Modules


AUTOSAR_SWS_BSWGeneral.pdf

3.2 Related standards and norms


[8] ISO11898 – Road vehicles - Controller area network (CAN)

3.3 Related specification


AUTOSAR provides a General Specification on Basic Software modules [7] (SWS
BSW General), which is also valid for CAN Transceiver Driver.

Thus, the specification SWS BSW General shall be considered as additional and re-
quired specification for CAN Transceiver Driver.

11 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

4 Constraints and assumptions

4.1 Limitations
[SWS_CanTrcv_00098] ⌈ The CAN bus transceiver hardware shall provide the
functionality and an interface which can be mapped to the operation mode model of
the AUTOSAR CAN transceiver driver. ⌋ (SRS_BSW_00172)
See also Chapter 7.1.

4.2 Applicability to car domains

This driver might be applicable in all car domains using CAN for communication.

12 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

5 Dependencies to other modules

Module Dependencies
CanIf All CAN transceiver drivers are arranged below CanIf.
ComM ComM steers CAN transceiver driver communication modes via CanIf. Each CAN trans-
ceiver driver is steered independently.
DET DET gets development error information from CAN transceiver driver.
DEM DEM gets production error information from CAN transceiver driver.
DIO DIO module is used to access CAN transceiver device connected via ports.
EcuM EcuM gets information about wake up events from CAN transceiver driver via CanIf.
SPI SPI module is used to access CAN transceiver device connected via SPI.

5.1 File structure


5.1.1 Code file structure

[SWS_CanTrcv_00064] ⌈ The naming convention prescribed by AUTOSAR is ap-


plied to all files of the CanTrcv module. ⌋ (SRS_BSW_00300)
[SWS_CanTrcv_00065] ⌈ The CanTrcv module consists of the following files:
File name Requirements Description
The implementation general c file. It does not contain
CanTrcv.c SWS_CanTrcv_00069
interrupt routines.
It contains only information relevant for other BSW
CanTrcv.h SWS_CanTrcv_00052 modules (API). Differences in API depending in con-
figuration are encapsulated.
Pre-compile time configuration parameter file. It’s gen-
CanTrcv_Cfg.h SWS_CanTrcv_00083
erated by the configuration tool.
Pre-compile time configuration code file. It’s generated
CanTrcv_Cfg.c SWS_CanTrcv_00062 by the configuration tool.
( SRS_BSW_00346, SRS_BSW_00158 )

13 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

5.1.2 Header file structure

[SWS_CanTrcv_00067]

⌋ (SRS_BSW_00301, SRS_BSW_00409)
[SWS_CanTrcv_00162] ⌈ CanTrcv.h shall include Can_GeneralTypes.h, for the
general CAN type definitions. ⌋ ()
[SWS_CanTrcv_00166] ⌈ The imported types described in SWS_CanTrcv_00163,
SWS_CanTrcv_00164 and SWS_CanTrcv_00165 shall be defined in
Can_GeneralTypes.h. ⌋ ()

14 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

6 Requirements Traceability

Requirement Description Satisfied by


SRS_BSW_00005 Modules of the µC Abstraction SWS_CanTrcv_00999
Layer (MCAL) may not have hard
coded horizontal interfaces
SRS_BSW_00006 The source code of software mo- SWS_CanTrcv_00999
dules above the µC Abstraction
Layer (MCAL) shall not be proces-
sor and compiler dependent.
SRS_BSW_00007 All Basic SW Modules written in C SWS_CanTrcv_00999
language shall conform to the
MISRA C 2012 Standard.
SRS_BSW_00009 All Basic SW Modules shall be SWS_CanTrcv_00999
documented according to a com-
mon standard.
SRS_BSW_00010 The memory consumption of all SWS_CanTrcv_00999
Basic SW Modules shall be docu-
mented for a defined configuration
for all supported platforms.
SRS_BSW_00101 The Basic Software Module shall SWS_CanTrcv_00001
be able to initialize variables and
hardware in a separate initializati-
on function
SRS_BSW_00160 Configuration files of AUTOSAR SWS_CanTrcv_00090,
Basic SW module shall be readab- SWS_CanTrcv_00091,
le for human beings SWS_CanTrcv_00093,
SWS_CanTrcv_00095
SRS_BSW_00161 The AUTOSAR Basic Software SWS_CanTrcv_00999
shall provide a microcontroller
abstraction layer which provides a
standardized interface to higher
software layers
SRS_BSW_00164 The Implementation of interrupt SWS_CanTrcv_00999
service routines shall be done by
the Operating System, complex
drivers or modules
SRS_BSW_00168 SW components shall be tested by SWS_CanTrcv_00999
a function defined in a common
API in the Basis-SW
SRS_BSW_00171 Optional functionality of a Basic- SWS_CanTrcv_00013
SW component that is not required
in the ECU shall be configurable at
pre-compile-time
SRS_BSW_00172 The scheduling strategy that is SWS_CanTrcv_00001,
built inside the Basic Software SWS_CanTrcv_00013,
Modules shall be compatible with SWS_CanTrcv_00090,
the strategy used in the system SWS_CanTrcv_00091,
SWS_CanTrcv_00098,
SWS_CanTrcv_00099

15 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

SRS_BSW_00300 All AUTOSAR Basic Software Mo- SWS_CanTrcv_00064


dules shall be identified by an un-
ambiguous name
SRS_BSW_00301 All AUTOSAR Basic Software Mo- SWS_CanTrcv_00067
dules shall only import the neces-
sary information
SRS_BSW_00304 All AUTOSAR Basic Software Mo- SWS_CanTrcv_00999
dules shall use the following data
types instead of native C data ty-
pes
SRS_BSW_00305 Data types naming convention SWS_CanTrcv_00999
SRS_BSW_00306 AUTOSAR Basic Software Mo- SWS_CanTrcv_00999
dules shall be compiler and plat-
form independent
SRS_BSW_00307 Global variables naming conventi- SWS_CanTrcv_00999
on
SRS_BSW_00308 AUTOSAR Basic Software Mo- SWS_CanTrcv_00999
dules shall not define global data
in their header files, but in the C
file
SRS_BSW_00309 All AUTOSAR Basic Software Mo- SWS_CanTrcv_00999
dules shall indicate all global data
with read-only purposes by explici-
tly assigning the const keyword
SRS_BSW_00310 API naming convention SWS_CanTrcv_00001,
SWS_CanTrcv_00002,
SWS_CanTrcv_00005,
SWS_CanTrcv_00007,
SWS_CanTrcv_00008,
SWS_CanTrcv_00009,
SWS_CanTrcv_00013
SRS_BSW_00312 Shared code shall be reentrant SWS_CanTrcv_00999
SRS_BSW_00321 The version numbers of AUTO- SWS_CanTrcv_00999
SAR Basic Software Modules shall
be enumerated according specific
rules
SRS_BSW_00325 The runtime of interrupt service SWS_CanTrcv_00999
routines and functions that are
running in interrupt context shall
be kept short
SRS_BSW_00327 Error values naming convention SWS_CanTrcv_00050,
SWS_CanTrcv_00206,
SWS_CanTrcv_00227
SRS_BSW_00328 All AUTOSAR Basic Software Mo- SWS_CanTrcv_00999
dules shall avoid the duplication of
code
SRS_BSW_00330 It shall be allowed to use macros SWS_CanTrcv_00999
instead of functions where source
code is used and runtime is critical
SRS_BSW_00331 All Basic Software Modules shall SWS_CanTrcv_00206,
strictly separate error and status SWS_CanTrcv_00227
information

16 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

SRS_BSW_00333 For each callback function it shall SWS_CanTrcv_00999


be specified if it is called from in-
terrupt context or not
SRS_BSW_00334 All Basic Software Modules shall SWS_CanTrcv_00999
provide an XML file that contains
the meta data
SRS_BSW_00336 Basic SW module shall be able to SWS_CanTrcv_00999,
shutdown SWS_CanTrcv_91001
SRS_BSW_00337 Classification of development er- SWS_CanTrcv_00206,
rors SWS_CanTrcv_00227
SRS_BSW_00339 Reporting of production relevant SWS_CanTrcv_00228
error status
SRS_BSW_00341 Module documentation shall con- SWS_CanTrcv_00999
tains all needed informations
SRS_BSW_00342 It shall be possible to create an SWS_CanTrcv_00999
AUTOSAR ECU out of modules
provided as source code and mo-
dules provided as object code,
even mixed
SRS_BSW_00343 The unit of time for specification SWS_CanTrcv_00112
and configuration of Basic SW
modules shall be preferably in
physical time unit
SRS_BSW_00344 BSW Modules shall support link- SWS_CanTrcv_00999
time configuration
SRS_BSW_00347 A Naming seperation of different SWS_CanTrcv_00016
instances of BSW drivers shall be
in place
SRS_BSW_00350 All AUTOSAR Basic Software Mo- SWS_CanTrcv_00050
dules shall allow the enab-
ling/disabling of detection and re-
porting of development errors.
SRS_BSW_00357 For success/failure of an API call a SWS_CanTrcv_00002
standard return type shall be defi-
ned
SRS_BSW_00358 The return type of init() functions SWS_CanTrcv_00001
implemented by AUTOSAR Basic
Software Modules shall be void
SRS_BSW_00359 All AUTOSAR Basic Software Mo- SWS_CanTrcv_00999
dules callback functions shall
avoid return types other than void
if possible
SRS_BSW_00360 AUTOSAR Basic Software Mo- SWS_CanTrcv_00999
dules callback functions are allo-
wed to have parameters
SRS_BSW_00369 All AUTOSAR Basic Software Mo- SWS_CanTrcv_00001,
dules shall not return specific de- SWS_CanTrcv_00002,
velopment error codes via the API SWS_CanTrcv_00005,
SWS_CanTrcv_00007,
SWS_CanTrcv_00008,
SWS_CanTrcv_00009,
SWS_CanTrcv_00013,
SWS_CanTrcv_91004,
17 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

SWS_CanTrcv_91005
SRS_BSW_00371 The passing of function pointers SWS_CanTrcv_00001,
as API parameter is forbidden for SWS_CanTrcv_00002,
all AUTOSAR Basic Software Mo- SWS_CanTrcv_00005,
dules SWS_CanTrcv_00007,
SWS_CanTrcv_00008,
SWS_CanTrcv_00009,
SWS_CanTrcv_00013
SRS_BSW_00373 The main processing function of SWS_CanTrcv_00013
each AUTOSAR Basic Software
Module shall be named according
the defined convention
SRS_BSW_00375 Basic Software Modules shall re- SWS_CanTrcv_00007
port wake-up reasons
SRS_BSW_00377 A Basic Software Module can re- SWS_CanTrcv_00005,
turn a module specific types SWS_CanTrcv_00007
SRS_BSW_00378 AUTOSAR shall provide a boolean SWS_CanTrcv_00999
type
SRS_BSW_00383 The Basic Software Module spe- SWS_CanTrcv_00999
cifications shall specify which
other configuration files from other
modules they use at least in the
description
SRS_BSW_00384 The Basic Software Module spe- SWS_CanTrcv_00999
cifications shall specify at least in
the description which other mo-
dules they require
SRS_BSW_00385 List possible error notifications SWS_CanTrcv_00050,
SWS_CanTrcv_00206,
SWS_CanTrcv_00227,
SWS_CanTrcv_00228
SRS_BSW_00386 The BSW shall specify the confi- SWS_CanTrcv_00050
guration for detecting an error
SRS_BSW_00388 Containers shall be used to group SWS_CanTrcv_00090,
configuration parameters that are SWS_CanTrcv_00091,
defined for the same object SWS_CanTrcv_00093,
SWS_CanTrcv_00095
SRS_BSW_00389 Containers shall have names SWS_CanTrcv_00090,
SWS_CanTrcv_00091,
SWS_CanTrcv_00093,
SWS_CanTrcv_00095
SRS_BSW_00390 Parameter content shall be unique SWS_CanTrcv_00090,
within the module SWS_CanTrcv_00091,
SWS_CanTrcv_00093,
SWS_CanTrcv_00095
SRS_BSW_00392 Parameters shall have a type SWS_CanTrcv_00090,
SWS_CanTrcv_00091,
SWS_CanTrcv_00093,
SWS_CanTrcv_00095
SRS_BSW_00393 Parameters shall have a range SWS_CanTrcv_00090,
SWS_CanTrcv_00091,
SWS_CanTrcv_00093,
SWS_CanTrcv_00095

18 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

SRS_BSW_00394 The Basic Software Module spe- SWS_CanTrcv_00090,


cifications shall specify the scope SWS_CanTrcv_00091,
of the configuration parameters SWS_CanTrcv_00093,
SWS_CanTrcv_00095
SRS_BSW_00395 The Basic Software Module spe- SWS_CanTrcv_00091,
cifications shall list all configurati- SWS_CanTrcv_00093,
on parameter dependencies SWS_CanTrcv_00095
SRS_BSW_00398 The link-time configuration is SWS_CanTrcv_00999
achieved on object code basis in
the stage after compiling and befo-
re linking
SRS_BSW_00399 Parameter-sets shall be located in SWS_CanTrcv_00999
a separate segment and shall be
loaded after the code
SRS_BSW_00400 Parameter shall be selected from SWS_CanTrcv_00999
multiple sets of parameters after
code has been loaded and started
SRS_BSW_00401 Documentation of multiple in- SWS_CanTrcv_00999
stances of configuration parame-
ters shall be available
SRS_BSW_00404 BSW Modules shall support post- SWS_CanTrcv_00999
build configuration
SRS_BSW_00405 BSW Modules shall support mul- SWS_CanTrcv_00999
tiple configuration sets
SRS_BSW_00406 A static status variable denoting if SWS_CanTrcv_00002,
a BSW module is initialized shall SWS_CanTrcv_00005,
be initialized with value 0 before SWS_CanTrcv_00007,
any APIs of the BSW module is SWS_CanTrcv_00008,
called SWS_CanTrcv_00009,
SWS_CanTrcv_00013
SRS_BSW_00407 Each BSW module shall provide a SWS_CanTrcv_00008
function to read out the version
information of a dedicated module
implementation
SRS_BSW_00408 All AUTOSAR Basic Software Mo- SWS_CanTrcv_00090,
dules configuration parameters SWS_CanTrcv_00091,
shall be named according to a SWS_CanTrcv_00093,
specific naming rule SWS_CanTrcv_00095
SRS_BSW_00409 All production code error ID sym- SWS_CanTrcv_00067
bols are defined by the Dem mo-
dule and shall be retrieved by the
other BSW modules from Dem
configuration
SRS_BSW_00410 Compiler switches shall have defi- SWS_CanTrcv_00999
ned values
SRS_BSW_00411 All AUTOSAR Basic Software Mo- SWS_CanTrcv_00008
dules shall apply a naming rule for
enabling/disabling the existence of
the API
SRS_BSW_00413 An index-based accessing of the SWS_CanTrcv_00016
instances of BSW modules shall
be done
SRS_BSW_00414 Init functions shall have a pointer SWS_CanTrcv_00001
19 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

to a configuration structure as sin-


gle parameter
SRS_BSW_00416 The sequence of modules to be SWS_CanTrcv_00999
initialized shall be configurable
SRS_BSW_00417 Software which is not part of the SWS_CanTrcv_00999
SW-C shall report error events
only after the DEM is fully operati-
onal.
SRS_BSW_00422 Pre-de-bouncing of error status SWS_CanTrcv_00999
information is done within the DEM
SRS_BSW_00423 BSW modules with AUTOSAR SWS_CanTrcv_00999
interfaces shall be describable
with the means of the SW-C
Template
SRS_BSW_00424 BSW module main processing SWS_CanTrcv_00013
functions shall not be allowed to
enter a wait state
SRS_BSW_00425 The BSW module description SWS_CanTrcv_00090
template shall provide means to
model the defined trigger conditi-
ons of schedulable objects
SRS_BSW_00426 BSW Modules shall ensure data SWS_CanTrcv_00999
consistency of data which is
shared between BSW modules
SRS_BSW_00427 ISR functions shall be defined and SWS_CanTrcv_00999
documented in the BSW module
description template
SRS_BSW_00428 A BSW module shall state if its SWS_CanTrcv_00013
main processing function(s) has to
be executed in a specific order or
sequence
SRS_BSW_00429 Access to OS is restricted SWS_CanTrcv_00999
SRS_BSW_00432 Modules should have separate SWS_CanTrcv_00999
main processing functions for
read/receive and write/transmit
data path
SRS_BSW_00433 Main processing functions are only SWS_CanTrcv_00999
allowed to be called from task bo-
dies provided by the BSW
Scheduler
SRS_Can_01090 The bus transceiver driver packa- SWS_CanTrcv_00090,
ge shall offer configuration para- SWS_CanTrcv_00091,
meters that are needed to configu- SWS_CanTrcv_00093,
re the driver for a given bus and SWS_CanTrcv_00095
the supported notifications
SRS_Can_01091 The CAN bus transceiver driver SWS_CanTrcv_00002,
shall support the configuration for SWS_CanTrcv_00005,
more than one bus SWS_CanTrcv_00007,
SWS_CanTrcv_00009,
SWS_CanTrcv_00016
SRS_Can_01092 The bus transceiver driver shall SWS_CanTrcv_00091
support the independent configu-
ration of the bus operation mode
20 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

for each supported bus.


SRS_Can_01095 The bus transceiver driver shall SWS_CanTrcv_00007
support the compile time configu-
ration of one notification to an up-
per layer for change notification for
"wakeup by bus" events
SRS_Can_01096 The bus transceiver driver shall SWS_CanTrcv_00001
provide an API to initialize the dri-
ver internally and set then all atta-
ched transceivers in their pre-
selected operation modes
SRS_Can_01097 CAN Bus Transceiver driver API SWS_CanTrcv_00001,
shall be synchronous SWS_CanTrcv_00002,
SWS_CanTrcv_00005,
SWS_CanTrcv_00007,
SWS_CanTrcv_00009,
SWS_CanTrcv_00013
SRS_Can_01098 The bus transceiver driver shall SWS_CanTrcv_00002,
support an API to send the SWS_CanTrcv_00055
addressed transceiver into its
Standby mode
SRS_Can_01099 The bus transceiver driver shall SWS_CanTrcv_00002,
support an API to send the SWS_CanTrcv_00055
addressed transceiver into its
Sleep mode
SRS_Can_01100 The bus transceiver driver shall SWS_CanTrcv_00002,
support an API to send the SWS_CanTrcv_00055
addressed transceiver into its
Normal mode
SRS_Can_01101 The bus transceiver driver shall SWS_CanTrcv_00005
support an API to read out the cur-
rent operation mode of the
transceiver of a specified bus
within the ECU
SRS_Can_01103 The bus transceiver driver shall SWS_CanTrcv_00007
support an API to read out the
reason of the last wakeup of a
specified bus within the ECU
SRS_Can_01106 The bus transceiver driver shall SWS_CanTrcv_00007
call the appropriate callback func-
tion of EcuM in case a wakeup by
bus event is detected
SRS_Can_01107 The CAN Transceiver Driver shall SWS_CanTrcv_00999
support the situation where a wa-
keup by bus occurs during the
same time the transition to stand-
by/sleep is in progress
SRS_Can_01108 The bus transceiver driver shall SWS_CanTrcv_00001,
support the AUTOSAR ECU state SWS_CanTrcv_00002,
manager in a way that a safe sys- SWS_CanTrcv_91001,
tem startup and shutdown is pos- SWS_CanTrcv_91002,
sible SWS_CanTrcv_91003
SRS_Can_01109 The bus transceiver driver shall SWS_CanTrcv_00001,
check the control communication SWS_CanTrcv_00002,

21 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

to the transceiver and the reaction SWS_CanTrcv_00005,


of the transceiver for correctness SWS_CanTrcv_00007,
SWS_CanTrcv_00009,
SWS_CanTrcv_00013
SRS_Can_01110 CAN Bus Transceiver driver shall SWS_CanTrcv_00001,
handle the transceiver specific SWS_CanTrcv_00002,
timing requirements internally SWS_CanTrcv_00005,
SWS_CanTrcv_00007,
SWS_CanTrcv_00009,
SWS_CanTrcv_00013
SRS_Can_01115 The bus transceiver driver shall SWS_CanTrcv_00009
support an API to enable and
disable the wakeup notification for
each bus separately
SRS_Can_01138 The CAN Bus Transceiver Driver SWS_CanTrcv_00999
shall provide one callback function
for lower layer ICU Driver for wake
up by bus events
SRS_Can_01157 The bus transceiver driver shall SWS_CanTrcv_00214
provide an API for clearing the
WUF bit in the tranceiver hardware

22 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

7 Functional specification

7.1 CAN transceiver driver operation modes


[SWS_CanTrcv_00055] ⌈ The CanTrcv module shall implement the state diagram
shown below, independently for each configured transceiver. ⌋ (SRS_Can_01098,
SRS_Can_01099, SRS_Can_01100)

Power on Power off

POWER_ON

NOT_ACTIVE

CanTrcv_Init() ACTIVE
CanTrcv_Init()
[CFG1] [CFG3]
3(a) 1(a)
CanTrcv_DeInit()

CANTRCV_TRCVMODE_SLEEP CANTRCV_TRCVMODE_NORMAL
1(c)

CanTrcv_Init()
[CFG2]
2(b)
CanTrcv_DeInit()
3(b)
1(b)

CANTRCV_TRCVMODE_STANDBY

2(a)

Legend:
1 - CanTrcv_SetOpMode(CANTRCV_TRCVMODE_NORMAL)
2 - CanTrcv_SetOpMode(CANTRCV_TRCVMODE_STANDBY)
3 - CanTrcv_SetOpMode(CANTRCV_TRCVMODE_SLEEP)

The main idea intended by this diagram, is to support a lot of up to now available
CAN bus transceivers in a generic view. Depending on the CAN transceiver hard-
ware, the model may have one or two states more than necessary for a given CAN
transceiver hardware but this will clearly decouple the ComM and EcuM from the
used hardware.
23 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

[SWS_CanTrcv_00148] ⌈ The function CanTrcv_Init causes a state change to


either CANTRCV_TRCVMODE_SLEEP, CANTRCV_TRCVMODE _NORMAL or
CANTRCV_TRCVMODE _STANDBY. This depends on the configuration and is in-
dependently configurable for each transceiver. ⌋ ()
State Description

POWER_ON ECU is fully powered.

State of CAN transceiver hardware depends on ECU hardware


NOT_ACTIVE and on Dio and Port driver configuration. CAN transceiver driv-
er is not initialized and therefore not active.

The function CanTrcv_Init has been called. It carries CAN


transceiver driver to active state.

ACTIVE Depending on configuration CAN transceiver driver enters the


state CANTRCV_TRCVMODE_SLEEP,
CANTRCV_TRCVMODE_STANDBY or
CANTRCV_TRCVMODE_NORMAL.

Full bus communication. If CAN transceiver hardware controls


CANTRCV_TRCVMODE_NORMAL ECU power supply, ECU is fully powered. The CAN transceiver
driver detects no further wake up information.

No communication is possible. ECU is still powered if CAN


transceiver hardware controls ECU power supply. A transition
CANTRCV_TRCVMODE_STANDBY to CANTRCV_TRCVMODE_SLEEP is only valid from this
mode. A wake up by bus or by a local wake up event is possi-
ble.

No communication is possible. ECU may be unpowered de-


CANTRCV_TRCVMODE_SLEEP pending on responsibility to handle power supply. A wake up
by bus or by a local wake up event is possible.

If a CAN transceiver driver covers more than one CAN transceiver (configured as
channels), all transceivers (channels) are either in the state NOT_ACTIVE or in the
state ACTIVE.

In state ACTIVE, each transceiver may be in a different sub state.

7.1.1 Operation mode switching

A mode switch is requested with a call to the function CanTrcv_SetOpMode.


[SWS_CanTrcv_00161] ⌈ A mode switch request to the current mode is allowed
and shall not lead to an error, even if DET is enabled. ⌋ ()
[SWS_CanTrcv_00158] ⌈ The CanTrcv module shall invoke the callback function
CanIf_TrcvModeIndication, for each mode switch request with call to
CanTrcv_SetOpMode, after the requested mode has been reached referring to the
corresponding CAN transceiver with the abstract CanIf TransceiverId.⌋ ()

7.2 CAN transceiver hardware operation modes

24 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

The CAN transceiver hardware may support more mode transitions than shown in
the state diagram above. The dependencies and the recommended implementations
behaviour are explained in this chapter.
It is implementation specific to decide which CAN transceiver hardware state is cov-
ered by which CAN transceiver driver software state. An implementation has to guar-
antee that the whole functionality of the described CAN transceiver driver software
state is realized by the implementation.

7.2.1 Example for temporary “Go-To-Sleep” mode

The mode often referred to as “Go-to-sleep” is a temporary mode when switching


from Normal to Sleep. The driver encapsulates such a temporary mode within one of
the CAN transceiver driver software states. In addition, the CAN transceiver driver
switches first from Normal to Standby and then with an additional API call from
Standby to Sleep.

7.2.2 Example for “PowerOn/ListenOnly” mode

The mode often referred to as “PowerOn“ or “ListenOnly” is a mode where the CAN
transceiver hardware is only able to receive messages but not able to send messag-
es. Also, transmission of the acknowledge bit during reception of a message is sup-
pressed. This mode is not supported because it is outside of the CAN standard and
not supported by all CAN transceiver hardware chips.

7.3 CAN transceiver wake up types


There are three different scenarios which are often called wake up:

Scenario 1:
MCU is not powered.
Parts of ECU including CAN transceiver hardware are powered.
The considered CAN transceiver is in SLEEP mode.
A wake up event on CAN bus is detected by CAN transceiver hardware.
The CAN transceiver hardware causes powering of MCU.

In terms of AUTOSAR, this is kept as a cold start and NOT as a wake up.

Scenario 2:
 MCU is in low power mode.
 Parts of ECU including CAN transceiver hardware are powered.
 The considered CAN transceiver is in STANDBY mode.
 A wake up event on CAN bus is detected by CAN transceiver hardware.
 The CAN transceiver hardware causes a SW interrupt for waking up.

In terms of AUTOSAR, this is kept as a wake up of the CAN channel and of the
MCU.

Scenario 3:
 MCU is in full power mode.
 At least parts of ECU including CAN transceiver hardware are powered.
25 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

 The considered CAN transceiver is in STANDBY mode.


 A wake up event on CAN is detected by CAN transceiver hardware.
 The CAN transceiver hardware either causes a SW interrupt for waking up or
is polled cyclically for wake up events.

In terms of AUTOSAR, this is kept as a wake up of the CAN channel.

7.4 Enabling/Disabling wakeup notification

[SWS_CanTrcv_00171] ⌈ CanTrcv driver shall use the following APIs provided by


ICU driver, to enable and disable the wakeup event notification:
- Icu_EnableNotification
- Icu_DisableNotification
CanTrcv driver shall enable/disable ICU channels only if reference is configured for
the parameter CanTrcvIcuChannelRef.⌋ ()

CanTrcv driver shall ensure the following to avoid the loss of wakeup events:
[SWS_CanTrcv_00172] ⌈ It shall enable the ICU channels when the transceiver
transitions to the Standby mode (CANTRCV_STANDBY). ⌋ ()
[SWS_CanTrcv_00173] ⌈ It shall disable the ICU channels when the transceiver
transitions to the Normal mode (CANTRCV_NORMAL). ⌋ ()

7.5 CAN transceiver wake up modes


CAN transceiver driver offers two wake up modes:
[SWS_CanTrcv_00090] ⌈ NOT_SUPPORTED mode ⌋ (SRS_BSW_00388,
SRS_BSW_00389, SRS_BSW_00390, SRS_BSW_00392, SRS_BSW_00393,
SRS_BSW_00394, SRS_BSW_00408, SRS_BSW_00425, SRS_BSW_00160,
SRS_BSW_00172, SRS_Can_01090)
In mode NOT_SUPPORTED, no wake ups are generated by CAN transceiver driver.
This mode is supported by all CAN transceiver hardware types.
[SWS_CanTrcv_00091] ⌈ POLLING mode ⌋ (SRS_BSW_00388,
SRS_BSW_00389, SRS_BSW_00390, SRS_BSW_00392, SRS_BSW_00393,
SRS_BSW_00394, SRS_BSW_00395, SRS_BSW_00408, SRS_BSW_00160,
SRS_BSW_00172, SRS_Can_01090, SRS_Can_01092)
In mode POLLING, wake ups generated by CAN transceiver driver may cause CAN
channel wake ups. In this mode, no MCU wake ups are possible. This mode pre-
sumes a support by used CAN transceiver hardware type. Wake up mode POLLING
requires function CanTrcv_CheckWakeup and main function
CanTrcv_MainFunction to be present in source code.
The main function CanTrcv_MainFunction shall be called by BSW scheduler
and CanTrcv_CheckWakeup by CanIf.
The selection of the wake up mode is done by the configuration parameter
CanTrcvWakeUpSupport. The support of wake ups may be switched on and off for
each CAN transceiver individually by the configuration parameter CanTrcvWakeup-
ByBusUsed.

26 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Note: In both modes the function CanTrcv_CheckWakeup shall be present, but the
functionality shall be based on the configured wakeup mode (NOT_SUPPORTED
OR POLLING).
Implementation Hint:
If a CAN transceiver needs a specific state transition (e.g. Sleep -> Normal) initiated
by the software after detection of a wake-up, this may be accomplished by the
CanTrcv module, during the execution of CanTrcv_CheckWakeup. This behaviour
is implementation specific.
It has to be assured by configuration of modules, which are involved in wake-up pro-
cess (EcuM, CanIf, ICU etc…) that CanTrcv_CheckWakeup is called, when a trans-
ceiver needs a specific state transition.

7.6 Error classification

7.6.1 Development Errors

[SWS_CanTrcv_00050]

Value
Type or error Relevance Related error code
[hex]
API called with
wrong parameter for Development CANTRCV_E_INVALID_TRANSCEIVER 1
the CAN transceiver
API called with null
pointer parameter
Development CANTRCV_E_PARAM_POINTER 2
API service used
without initialization
Development CANTRCV_E_UNINIT 11
API service called in CANTRCV_E_TRCV_NOT_STANDBY 21
wrong transceiver Development
operation mode CANTRCV_E_TRCV_NOT_NORMAL 22
API service called
with invalid parame-
ter for TrcvWakeup-
Development CANTRCV_E_PARAM_TRCV_WAKEUP_MODE 23
Mode
API service called
with invalid parame- Development CANTRCV_E_PARAM_TRCV_OPMODE 24
ter for OpMode
Configured baud
rate is not supported Development CANTRCV_E_BAUDRATE_NOT_SUPPORTED 25
by the transceiver
Module initialization
has failed, e.g.
CanTrcv_Init() called Development CANTRCV_E_INIT_FAILED 27
with an invalid point-
er in postbuild.
⌋ (SRS_BSW_00327, SRS_BSW_00350, SRS_BSW_00385, SRS_BSW_00386)

7.6.2 Runtime Errors

Value
Type or error Related error code
[hex]
No/incorrect communica-
tion to transceiver.
CANTRCV_E_NO_TRCV_CONTROL 26

27 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

7.6.3 Transient Faults

There are no transient faults.

7.6.4 Production Errors

There are no production errors.

7.6.5 Extended Production Errors

[SWS_CanTrcv_00228]

Error Name: CANTRCV_E_BUS_ERROR
Short Description: A CAN bus error occured during communication
Long Description: This Extended Production Error shall be issued when a bus failure is de-
tected by the transceiver during the CAN communication..
Fail When the flag corresponding to bus failure is set,
Dem_SetEventStatus shall be reported with parameters
EventId as CANTRCV_E_BUS_ERROR and EventStatus as
DEM_EVENT_STATUS_FAILED.
SWS_CanTrcv_00206, SWS_CanTrcv_00229
Detection Criteria:
Pass When the flag corresponding to bus failure is not set,
Dem_SetEventStatus shall be reported with parameters
EventId as CANTRCV_E_BUS_ERROR and EventStatus as
DEM_EVENT_STATUS_PASSED.
SWS_CanTrcv_00227, SWS_CanTrcv_00229
Secondary Parameters: N/A
Time Required: N/A
Monitor Frequency continuous
⌋ (SRS_BSW_00339, SRS_BSW_00385)

[SWS_CanTrcv_00229] ⌈ The extended production error CANTRCV_E_BUS_ERROR


(value assigned by DEM) shall be detectable by the CAN tranceiver module when
Bus Error (BUSERR) flag is set, depending on whether it is configured and supported
by hardware. ⌋ ()

7.7 Preconditions for driver initialization


[SWS_CanTrcv_00099] ⌈ The environment of the CanTrcv module shall make sure
that all necessary BSW drivers (used by the CanTrcv module) have been initialized
and are usable before CanTrcv_Init is called. ⌋ (SRS_BSW_00172)
The CAN bus transceiver driver uses drivers for Spi and Dio to control the CAN bus
transceiver hardware. Thus, these drivers must be available and ready to operate be-
fore the CAN bus transceiver driver is initialized.
The CAN transceiver driver may have timing requirements for the initialization se-
quence and the access to the transceiver device which must be fulfilled by these
used underlying drivers.
The timing requirements might be that
1) The call of the CAN bus transceiver driver initialization has to be performed
very early after power up to be able to read all necessary information out of
the transceiver hardware in time for all other users within the ECU.
28 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

2) The runtime of the used underlying services is very short and synchronous to
enable the driver to keep his own timing requirements limited by the used
hardware device.
3) The runtime of the driver may be enlarged due to some hardware devices con-
figuring the port pin level to be valid for e.g. 50µs before changing it again to
reach a specific state (e.g. sleep).

7.8 Instance concept


[SWS_CanTrcv_00016] ⌈ For each different CAN transceiver hardware type, an
ECU has one CAN transceiver driver instance. One instance serves all CAN trans-
ceiver hardware of same type. ⌋ (SRS_BSW_00347, SRS_BSW_00413,
SRS_Can_01091)

7.9 Wait states


For changing operation modes, the CAN transceiver hardware may have to perform
wait states.
[SWS_CanTrcv_00230] ⌈ The CAN Tranceiver Driver shall use the Time service
Tm_BusyWait1us16bit to realize the wait time for transceiver state changes.⌋ ()

7.10 Transceivers with selective wakeup functionality


This section describes requirements for CAN transceivers with selective wakeup
functionality.
Partial Networking is a state in a CAN system where some nodes are in low power
mode while other nodes are communicating. This reduces the power consumption by
the entire network. Nodes in the low-power modes are woken up by pre-defined
wakeup frames.
Transceivers which support selective wakeup can be woken up by Wake Up Frame/
Frames (WUF), in addition to the wakeup by Wake Up Pattern (WUP) offered by
normal transceivers.
[SWS_CanTrcv_00174] ⌈ If selective wakeup is supported by the transceiver hard-
ware, it shall be indicated with the configuration parameter CanTrcvHwPnSupport.
⌋ ()
[SWS_CanTrcv_00175] ⌈ The configuration container for selective wakeup func-
tionality (CanTrcvPartialNetwork) and for the following APIs:
- 8.4.7 CanTrcv_GetTrcvSystemData,
- 8.4.8 CanTrcv_ClearTrcvWufFlag,
- 8.4.9 CanTrcv_ReadTrcvTimeoutFlag,
- 8.4.10 CanTrcv_ClearTrcvTimeoutFlag and
- 8.4.11 CanTrcv_ReadTrcvSilenceFlag
shall exist only if CanTrcvHwPnSupport = TRUE. ⌋ ()
[SWS_CanTrcv_00177] ⌈ If selective wakeup is supported, CAN transceivers shall
be configured to wake up on a particular CAN frame or a group of CAN frames using
the parameters CanTrcvPnFrameCanId, CanTrcvPnFrameCanIdMask and
CanTrcvPnFrameDataMask. ⌋ ()
29 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

[SWS_CanTrcv_00178] ⌈ If the transceiver has the ability to identify bus failures


(and distinguish between bus failures and other hardware failures), it shall be indicat-
ed using the configuration parameter CanTrcvBusErrFlag for bus diagnostic pur-
poses. ⌋ ()
Note:
For CAN transceivers supporting selective wakeup functionality, detection of wakeup
frames is possible during Normal mode (CANTRCV_TRCVMODE_NORMAL). Detected
wakeup frames are signaled by the transceiver WUF flag. This ensures that no
wakeup frame is lost during a transition to Standby mode
(CANTRCV_TRCVMODE_STANDBY).

30 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

8 API specification
8.1 Imported types
In this chapter all types included from the following files are listed:
[SWS_CanTrcv_00084] ⌈
Module Imported Type
Can_GeneralTypes CanTrcv_TrcvModeType
CanTrcv_TrcvWakeupModeType
CanTrcv_TrcvWakeupReasonType
Dem Dem_EventIdType
Dem_EventStatusType
Dio Dio_ChannelGroupType
Dio_ChannelType
Dio_LevelType
Dio_PortLevelType
Dio_PortType
EcuM EcuM_WakeupSourceType
Icu Icu_ChannelType
Spi Spi_ChannelType
Spi_DataBufferType
Spi_NumberOfDataType
Spi_SequenceType
Spi_StatusType
Std_Types Std_ReturnType
Std_VersionInfoType
⌋ ()

[SWS_CanTrcv_00163] ⌈
Name: CanTrcv_TrcvModeType
Type: Enumeration
Range: CANTRCV_TRCVMODE_SLEEP -- Transceiver mode SLEEP
CANTRCV_TRCVMODE_STANDBY -- Transceiver mode STANDBY
CANTRCV_TRCVMODE_NORMAL 0x00 Transceiver mode NORMAL
Description: Operating modes of the CAN Transceiver Driver.
⌋ ()

[SWS_CanTrcv_00164] ⌈
Name: CanTrcv_TrcvWakeupModeType
Type: Enumeration
Range: CANTRCV_WUMODE_ENABLE 0x00 The notification for wakeup events is enabled on
the addressed transceiver.
CANTRCV_WUMODE_DISABLE 0x01 The notification for wakeup events is disabled on
the addressed transceiver.
CANTRCV_WUMODE_CLEAR 0x02 A stored wakeup event is cleared on the ad-
dressed transceiver.
Description: This type shall be used to control the CAN transceiver concerning wake up events
and wake up notifications.
⌋ ()

[SWS_CanTrcv_00165] ⌈
31 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Name: CanTrcv_TrcvWakeupReasonType
Type: Enumeration
Range: CANTRCV_WU_ERROR 0x00 Due to an error wake up reason was not de-
tected. This value may only be reported when
error was reported to DEM before.
CANTRCV_WU_NOT_SUPPORTED 0x01 The transceiver does not support any infor-
mation for the wake up reason.
CANTRCV_WU_BY_BUS 0x02 The transceiver has detected, that the network
has caused the wake up of the ECU.
CANTRCV_WU_INTERNALLY 0x03 The transceiver has detected, that the network
has woken up by the ECU via a request to
NORMAL mode.
CANTRCV_WU_RESET 0x04 The transceiver has detected, that the "wake
up" is due to an ECU reset.
CANTRCV_WU_POWER_ON 0x05 The transceiver has detected, that the "wake
up" is due to an ECU reset after power on.
CANTRCV_WU_BY_PIN 0x06 The transceiver has detected a wake-up event
at one of the transceiver's pins (not at the CAN
bus).
CANTRCV_WU_BY_SYSERR 0x07 The transceiver has detected, that the wake
up of the ECU was caused by a HW related
device failure.
Description: This type denotes the wake up reason detected by the CAN transceiver in detail.
⌋ ()

8.2 Type definitions

[SWS_CanTrcv_00209] ⌈
Name: CanTrcv_ConfigType
Type: Structure
Range: Implementation --
specific
Description: This is the type of the external data structure containing the overall initialization
data for the CAN transceiver driver and settings affecting all transceivers. Fur-
thermore it contains pointers to transceiver configuration structures. The contents
of the initialization data structure are CAN transceiver hardware specific.
⌋ ()

[SWS_CanTrcv_00210] ⌈
Name: CanTrcv_PNActivationType
Type: Enumeration
Range: PN_ENABLED -- PN wakeup functionality in CanTrcv is enabled.
PN_DISABLED -- PN wakeup functionality in CanTrcv is disabled.
Description: Datatype used for describing whether PN wakeup functionality in CanTrcv is ena-
bled or disabled.
⌋ ()

[SWS_CanTrcv_00211] ⌈
Name: CanTrcv_TrcvFlagStateType
Type: Enumeration
Range: CANTRCV_FLAG_SET -- The flag is set in the transceiver hardware.
CANTRCV_FLAG_CLEARED -- The flag is cleared in the transceiver hardware.
Description: Provides the state of a flag in the transceiver hardware.
⌋ ()
.
32 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

8.3 Function definitions


8.3.1 CanTrcv_Init

[SWS_CanTrcv_00001] ⌈
Service name: CanTrcv_Init
Syntax: void CanTrcv_Init(
const CanTrcv_ConfigType* ConfigPtr
)
Service ID[hex]: 0x00
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): ConfigPtr Pointer to driver configuration.
Parameters (in- None
out):
Parameters (out): None
Return value: None
Description: Initializes the CanTrcv module.
⌋ (SRS_BSW_00310, SRS_BSW_00358, SRS_BSW_00369, SRS_BSW_00371,
SRS_BSW_00414, SRS_BSW_00101, SRS_BSW_00172, SRS_Can_01096,
SRS_Can_01097, SRS_Can_01109, SRS_Can_01110, SRS_Can_01108)

[SWS_CanTrcv_00180] ⌈ The function CanTrcv_Init shall initialize all the con-


nected CAN transceivers based on their initialization sequences and configuration
(provided by parameter ConfigPtr). Meanwhile, it shall support the configuration
sequence of the AUTOSAR stack also. ⌋ ()
[SWS_CanTrcv_00100] ⌈ The function CanTrcv_Init shall set the CAN trans-
ceiver hardware to the state configured by the configuration parameter
CanTrcvInitState. ⌋ ()
Note that in the time span between power up and the call to CanTrcv_Init, the
CAN transceiver hardware may be in a different state. This depends on hardware
and SPAL driver configuration.
The initialization sequence after reset (e.g. power up) is a critical phase for the CAN
transceiver driver.
This API shall store the wake up event, if any, during initialization time.
See also requirement SWS_CanTrcv_00099.
[SWS_CanTrcv_00167] ⌈ If supported by hardware, CanTrcv_Init shall validate
whether there has been a wake up due to transceiver activity and if TRUE, reporting
shall be done to EcuM via API EcuM_SetWakeupEvent with the wakeup source ref-
erenced in CanTrcvWakeupSourceRef. ⌋ ()
[SWS_CanTrcv_00181] ⌈ If selective wakeup is enabled and supported by hard-
ware: POR and SYSERR flags of the transceiver status shall be checked by
CanTrcv_Init API. ⌋ ()
[SWS_CanTrcv_00182] ⌈ If the POR flag or SYSERR flag is set, transceiver shall
be re-configured for selective wakeup functionality by running the configuration se-
quence.
If the POR flag or SYSERR flag is not set, the configuration stored in the transceiver
memory will be still valid and re-configuration is not necessary. ⌋ ()
[SWS_CanTrcv_00183] ⌈ If the POR flag is set, wakeup shall be reported to EcuM
through API EcuM_SetWakeupEvent with a wakeup source value, which has a “1”
33 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

at the bit position according to the symbolic name value referred by CanTrcvPor-
WakeupsourceRef, and “0” on all others. ⌋ ()
[SWS_CanTrcv_00184] ⌈ If the SYSERR flag is set, wakeup shall be reported to
EcuM through API EcuM_SetWakeupEvent with a wakeup source value, which has
a “1” at the bit position according to the symbolic name value referred by
CanTrcvSyserrWakeupSourceRef, and “0” on all others. ⌋ ()
[SWS_CanTrcv_00113] ⌈ If there is no/incorrect communication towards the trans-
ceiver, the function CanTrcv_Init shall report the runtime error code
CANTRCV_E_NO_TRCV_CONTROL to the Default Error Tracer and return E_NOT_OK.
For Eg., there are different transceiver types and different access ways (port connec-
tion, SPI). This development error should be signalled if you detect any miscommuni-
cation with your hardware. Depending on connection type and depending on your
transceiver hardware you may not run in situations where you have to signal this er-
ror. ⌋ ()
[SWS_CanTrcv_00168] ⌈ If development error detection is enabled for CanTrcv
module: the function CanTrcv_Init shall raise the development error
CANTRCV_E_BAUDRATE_NOT_SUPPORTED, if the configured baud rate is not sup-
ported by the transceiver. ⌋ ()
[SWS_CanTrcv_00226] ⌈ In order to implement the AUTOSAR Partial Networking
mechanism CAN transceivers shall support the definition of a data mask for the
Wake Up Frame (the configuration structure of CanTrcvPnFrameDataMask is
mandatory). ⌋ ()

8.3.2 CanTrcv_SetOpMode

[SWS_CanTrcv_00002] ⌈
Service name: CanTrcv_SetOpMode
Syntax: Std_ReturnType CanTrcv_SetOpMode(
uint8 Transceiver,
CanTrcv_TrcvModeType OpMode
)
Service ID[hex]: 0x01
Sync/Async: Asynchronous
Reentrancy: Reentrant for different transceivers
Transceiver CAN transceiver to which API call has to be applied.
Parameters (in):
OpMode This parameter contains the desired operating mode
Parameters (in- None
out):
Parameters (out): None
Std_ReturnType E_OK: will be returned if the request for transceiver mode change
has been accepted.
Return value: E_NOT_OK: will be returned if the request for transceiver mode
change has not been accepted or any parameter is out of the al-
lowed range.
Description: Sets the mode of the Transceiver to the value OpMode.
⌋ (SRS_BSW_00310, SRS_BSW_00357, SRS_BSW_00369, SRS_BSW_00371,
SRS_BSW_00406, SRS_Can_01091, SRS_Can_01097, SRS_Can_01098,
SRS_Can_01099, SRS_Can_01100, SRS_Can_01109, SRS_Can_01110,
SRS_Can_01108)
[SWS_CanTrcv_00102] ⌈ The function CanTrcv_SetOpMode shall switch the in-
ternal state of Transceiver to the value of the parameter OpMode, which can be
34 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

CANTRCV_TRCVMODE_NORMAL, CANTRCV_TRCVMODE_STANDBY or
CANTRCV_TRCVMODE_SLEEP. ⌋ ()
[SWS_CanTrcv_00103] ⌈ The user of the CanTrcv module shall call the function
CanTrcv_SetOpMode with OpMode = CANTRCV_TRCVMODE_STANDBY or
CANTRCV_TRCVMODE_NORMAL, if the Transceiver is in mode
CANTRCV_TRCVMODE_NORMAL. ⌋ ()
[SWS_CanTrcv_00104] ⌈ The user of the CanTrcv module shall call the function
CanTrcv_SetOpMode with OpMode = CANTRCV_TRCVMODE_SLEEP or
CANTRCV_TRCVMODE_STANDBY, if the Transceiver is in mode
CANTRCV_TRCVMODE_STANDBY. ⌋ ()
This API is applicable to each transceiver with each value for parameter
CanTrcv_SetOpMode, regardless of whether the transceiver hardware supports
these modes or not. This is to simplify the view of the CanIf to the assigned bus.
[SWS_CanTrcv_00105] ⌈ If the requested mode is not supported by the underlying
transceiver hardware, the function CanTrcv_SetOpMode shall return E_NOT_OK.
⌋ ()
The number of supported busses is set up in the configuration phase.
[SWS_CanTrcv_00186] ⌈ If selective wakeup is supported by hardware: the flags
POR and SYSERR of the transceiver status shall be checked by
CanTrcv_SetOpMode API. ⌋ ()
[SWS_CanTrcv_00187] ⌈ If the POR flag is set, transceiver shall be re-initialized to
run the transceiver’s configuration sequence.⌋ ()
[SWS_CanTrcv_00188] ⌈ If the SYSERR flag is NOT set and the requested mode
is CANTRCV_NORMAL, transceiver shall call the API
CanIf_ConfirmPnAvailability() for the corresponding abstract CanIf Trans-
ceiverId. CanIf_ConfirmPnAvailability informs CanNm (through CanIf and
CanSm) that selective wakeup is enabled.⌋ ()
[SWS_CanTrcv_00114] ⌈ If there is no/incorrect communication to the transceiver,
the function CanTrcv_SetOpMode shall report runtime error code
CANTRCV_E_NO_TRCV_CONTROL to the Default Error Tracer and return
E_NOT_OK. ⌋ ()

[SWS_CanTrcv_00120] ⌈ If development error detection for the module CanTrcv is


enabled:
If the function CanTrcv_SetOpMode is called with OpMode =
CANTRCV_TRCVMODE_STANDBY, and the Transceiver is not in mode
CANTRCV_TRCVMODE_NORMAL or CANTRCV_TRCVMODE_STANDBY, the
function CanTrcv_SetOpMode shall raise the development error
CANTRCV_E_TRCV_NOT_NORMAL otherwise (if DET is disabled) return E_NOT_OK.
⌋ ()
[SWS_CanTrcv_00121] ⌈ If development error detection for the module CanTrcv is
enabled:
If the function CanTrcv_SetOpMode is called with OpMode =
CANTRCV_TRCVMODE_SLEEP, and the Transceiver is not in mode
CANTRCV_TRCVMODE_STANDBY or CANTRCV_TRCVMODE_SLEEP, the func-
tion CanTrcv_SetOpMode shall raise the development error
CANTRCV_E_TRCV_NOT_STANDBY otherwise (if DET is disabled) return E_NOT_OK.
⌋ ()

35 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

[SWS_CanTrcv_00122] ⌈ If development error detection for the module CanTrcv is


enabled:
If called before the CanTrcv module has been initialized, the function
CanTrcv_SetOpMode shall raise the development error CANTRCV_E_UNINIT oth-
erwise (if DET is disabled) return E_NOT_OK. ⌋ ()
[SWS_CanTrcv_00123] ⌈ If development error detection for the module CanTrcv is
enabled: If called with an invalid Transceiver number, the function
CanTrcv_SetOpMode shall raise the development error
CANTRCV_E_INVALID_TRANSCEIVER otherwise (if DET is disabled) return
E_NOT_OK. ⌋ ()

[SWS_CanTrcv_00087] ⌈ If development error detection for the module CanTrcv is


enabled: If called with an invalid OpMode, the function CanTrcv_SetOpMode shall
raise the development error CANTRCV_E_PARAM_TRCV_OPMODE otherwise (if DET is
disabled) return E_NOT_OK. ⌋ ()

8.3.3 CanTrcv_GetOpMode

[SWS_CanTrcv_00005] ⌈
Service name: CanTrcv_GetOpMode
Syntax: Std_ReturnType CanTrcv_GetOpMode(
uint8 Transceiver,
CanTrcv_TrcvModeType* OpMode
)
Service ID[hex]: 0x02
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): Transceiver CAN transceiver to which API call has to be applied.
Parameters (in- None
out):
Parameters (out): OpMode Pointer to operation mode of the bus the API is applied to.
Std_ReturnType E_OK: will be returned if the operation mode was detected.
Return value: E_NOT_OK: will be returned if the operation mode was not de-
tected.
Description: Gets the mode of the Transceiver and returns it in OpMode.
⌋ (SRS_BSW_00310, SRS_BSW_00369, SRS_BSW_00371, SRS_BSW_00377,
SRS_BSW_00406, SRS_Can_01091, SRS_Can_01097, SRS_Can_01101, SRS_Can_01109,
SRS_Can_01110)
[SWS_CanTrcv_00106] ⌈ The function CanTrcv_GetOpMode shall collect the ac-
tual state of the CAN transceiver driver in the out parameter OpMode. ⌋()
See function CanTrcv_Init for the provided state after the CAN transceiver driver
initialization till the first operation mode change request.
The number of supported busses is statically set in the configuration phase.
[SWS_CanTrcv_00115] ⌈ If there is no/incorrect communication to the transceiver,
the function CanTrcv_GetOpMode shall report the runtime error code
CANTRCV_E_NO_TRCV_CONTROL to the Default Error Tracer and return E_NOT_OK.
⌋ ()
[SWS_CanTrcv_00124] ⌈ If development error detection for the module CanTrcv is
enabled: If called before the CanTrcv module has been initialized, the function

36 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

CanTrcv_GetOpMode shall raise the development error CANTRCV_E_UNINIT oth-


erwise (if DET is disabled) return E_NOT_OK. ⌋ ()
[SWS_CanTrcv_00129] ⌈ If development error detection for the module CanTrcv is
enabled: If called with an invalid Transceiver number, the function
CanTrcv_GetOpMode shall raise the development error
CANTRCV_E_INVALID_TRANSCEIVER otherwise (if DET is disabled) return
E_NOT_OK. ⌋ ()
[SWS_CanTrcv_00132] ⌈ If development error detection for the module CanTrcv is
enabled: If called with OpMode = NULL, the function CanTrcv_GetOpMode shall
raise the development error CANTRCV_E_PARAM_POINTER otherwise (if DET is dis-
abled) return E_NOT_OK. ⌋ ()

8.3.4 CanTrcv_GetBusWuReason

[SWS_CanTrcv_00007] ⌈
Service name: CanTrcv_GetBusWuReason
Syntax: Std_ReturnType CanTrcv_GetBusWuReason(
uint8 Transceiver,
CanTrcv_TrcvWakeupReasonType* reason
)
Service ID[hex]: 0x03
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): Transceiver CAN transceiver to which API call has to be applied.
Parameters (in- None
out):
Parameters (out): reason Pointer to wake up reason of the bus the API is applied to.
Std_ReturnType E_OK: will be returned if the transceiver wakeup reason was pro-
vided.
Return value:
E_NOT_OK: will be returned if no wake up reason is available or
if the service request failed due to development errors.
Description: Gets the wakeup reason for the Transceiver and returns it in parameter Reason.
⌋ (SRS_BSW_00310, SRS_BSW_00369, SRS_BSW_00371, SRS_BSW_00375,
SRS_BSW_00377, SRS_BSW_00406, SRS_Can_01091, SRS_Can_01095, SRS_Can_01097,
SRS_Can_01103, SRS_Can_01106, SRS_Can_01109, SRS_Can_01110)

[SWS_CanTrcv_00107] ⌈ The function CanTrcv_GetBusWuReason shall collect


the reason for the wake up that the CAN transceiver has detected in the parameter
Reason. ⌋()
The ability to detect and differentiate the possible wake up reasons depends strongly
on the CAN transceiver hardware.
Be aware if more than one bus is available, each bus may report a different wake up
reason. E.g. if an ECU has CAN, a wake up by CAN may occur and the incoming da-
ta may cause an internal wake up for another CAN bus.
The CAN transceiver driver has a “per bus” view and does not vote the more im-
portant 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.
The number of supported busses is statically set in the configuration phase.
[SWS_CanTrcv_00116] ⌈ If there is no/incorrect communication to the transceiver,
the function CanTrcv_GetBusWuReason shall report the runtime error code
CANTRCV_E_NO_TRCV_CONTROL to the Default Error Tracer and return E_OK. ⌋ ()

37 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

[SWS_CanTrcv_00125] ⌈ If development error detection for the module CanTrcv is


enabled: If called before the CanTrcv module has been initialized, the function
CanTrcv_GetBusWuReason shall raise development error CANTRCV_E_UNINIT
POINTER otherwise (if DET is disabled) return E_NOT_OK. ⌋ ()

[SWS_CanTrcv_00130] ⌈ If development error detection for the module CanTrcv is


enabled: If called with an invalid Transceiver number, the function
CanTrcv_GetBusWuReason shall raise development error
CANTRCV_E_INVALID_TRANSCEIVER POINTER otherwise (if DET is disabled) re-
turn E_NOT_OK. ⌋ ()
[SWS_CanTrcv_00133] ⌈ If development error detection for the module CanTrcv is
enabled: If called with Reason = NULL, the function CanTrcv_GetBusWuReason
shall raise the development error CANTRCV_E_PARAM_POINTER POINTER otherwise
(if DET is disabled) return E_NOT_OK. ⌋ ()

8.3.5 CanTrcv_VersionInfo

[SWS_CanTrcv_00008] ⌈
Service name: CanTrcv_GetVersionInfo
Syntax: void CanTrcv_GetVersionInfo(
Std_VersionInfoType* versioninfo
)
Service ID[hex]: 0x04
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): None
Parameters (in- None
out):
Parameters (out): versioninfo Pointer to version information of this module.
Return value: None
Description: Gets the version of the module and returns it in VersionInfo.
⌋ (SRS_BSW_00310, SRS_BSW_00369, SRS_BSW_00371, SRS_BSW_00406,
SRS_BSW_00407, SRS_BSW_00411)

8.3.6 CanTrcv_ SetWakeupMode

[SWS_CanTrcv_00009] ⌈
Service name: CanTrcv_SetWakeupMode
Syntax: Std_ReturnType CanTrcv_SetWakeupMode(
uint8 Transceiver,
CanTrcv_TrcvWakeupModeType TrcvWakeupMode
)
Service ID[hex]: 0x05
Sync/Async: Synchronous
Reentrancy: Reentrant for different transceivers
Transceiver CAN transceiver to which API call has to be applied.
Parameters (in):
TrcvWakeupMode Requested transceiver wakeup reason
Parameters (in- None
out):
Parameters (out): None
Std_ReturnType E_OK: Will be returned, if the wakeup state has been changed
Return value: to the requested mode.
E_NOT_OK: Will be returned, if the wakeup state change has
38 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

failed or the parameter is out of the allowed range. The previ-


ous state has not been changed.
Description: Enables, disables or clears wake-up events of the Transceiver according to
TrcvWakeupMode.
⌋ (SRS_BSW_00310, SRS_BSW_00369, SRS_BSW_00371, SRS_BSW_00406,
SRS_Can_01091, SRS_Can_01097, SRS_Can_01109, SRS_Can_01110, SRS_Can_01115)
[SWS_CanTrcv_00111] ⌈ Enabled: If the function CanTrcv_SetWakeupMode is
called with TrcvWakupMode = CANTRCV_ WUMODE_ENABLE and if the CanTrcv
module has a stored wakeup event pending for the addressed bus, the CanTrcv
module shall update its wakeup event as ‘present’. ⌋ ()
[SWS_CanTrcv_00093] ⌈ Disabled: If the function CanTrcv_SetWakeupMode is
called with TrcvWakeupMode = CANTRCV_ WUMODE_DISABLE, the wakeup
events are disabled on the addressed transceiver. It is required by the transceiver
device and the transceiver driver to detect the wakeup events and store it internally,
in order to raise the wakeup events when the wakeup mode is enabled again.
⌋ (SRS_BSW_00388, SRS_BSW_00389, SRS_BSW_00390, SRS_BSW_00392,
SRS_BSW_00393, SRS_BSW_00394, SRS_BSW_00395, SRS_BSW_00408,
SRS_BSW_00160, SRS_Can_01090)
[SWS_CanTrcv_00094] ⌈ Clear: If the function CanTrcv_SetWakeupMode is
called with TrcvWakeupMode = CANTRCV_ WUMODE_CLEAR, then a stored
wakeup event is cleared on the addressed transceiver. ⌋ ()
[SWS_CanTrcv_00150] ⌈ Clearing of wakeup events have to be used when the
wake up notification is disabled to clear all stored wake up events under control of
the higher layer. ⌋ ()
[SWS_CanTrcv_00095] ⌈ The implementation can enable, disable or clear wake up
events from the last communication cycle. It is very important not to lose wake up
events during the disabled period. ⌋ (SRS_BSW_00388, SRS_BSW_00389,
SRS_BSW_00390, SRS_BSW_00392, SRS_BSW_00393, SRS_BSW_00394,
SRS_BSW_00395, SRS_BSW_00408, SRS_BSW_00160, SRS_Can_01090)
The number of supported busses is statically set in the configuration phase.
[SWS_CanTrcv_00117] ⌈ If there is no/incorrect communication to the transceiver,
the function CanTrcv_SetWakeupMode shall report the runtime error code
CANTRCV_E_NO_TRCV_CONTROL to the Default Error Tracer and return E_NOT_OK.
⌋ ()
[SWS_CanTrcv_00127] ⌈ If development error detection for the module CanTrcv is
enabled: If called before the CanTrcv has been initialized, the function
CanTrcv_SetWakeupMode shall raise development error CANTRCV_E_UNINIT
POINTER otherwise (if DET is disabled) return E_NOT_OK. ⌋ ()
[SWS_CanTrcv_00131] ⌈ If development error detection for the module CanTrcv is
enabled: If called with an invalid Transceiver number, the function
CanTrcv_SetWakeupMode shall raise development error
CANTRCV_E_INVALID_TRANSCEIVER POINTER otherwise (if DET is disabled) re-
turn E_NOT_OK. ⌋ ()
[SWS_CanTrcv_00089] ⌈ If development error detection for the module CanTrcv is
enabled: If called with an invalid TrcvWakeupMode, the function
CanTrcv_SetWakeupMode shall raise the development error
CANTRCV_E_PARAM_TRCV_WAKEUP_MODE
POINTER otherwise (if DET is disabled) return E_NOT_OK. ⌋ ()

39 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

8.3.7 CanTrcv_GetTrcvSystemData

[SWS_CanTrcv_00213] ⌈
Service name: CanTrcv_GetTrcvSystemData
Syntax: Std_ReturnType CanTrcv_GetTrcvSystemData(
uint8 Transceiver,
const uint32* TrcvSysData
)
Service ID[hex]: 0x09
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): Transceiver CAN transceiver ID.
Parameters (in- None
out):
Parameters (out): TrcvSysData Configuration/Status data of the transceiver.
Std_ReturnType E_OK: will be returned if the transceiver status is successfully
read.
Return value:
E_NOT_OK: will be returned if the transceiver status data is not
available or a development error occurs.
Description: Reads the transceiver configuration/status data and returns it through parameter
TrcvSysData. This API shall exist only if CanTrcvHwPnSupport = TRUE.
⌋ ()
[SWS_CanTrcv_00189] ⌈ The function CanTrcv_GetTrcvSystemData shall read
the configuration/status of the CAN transceiver and store the read data in the out pa-
rameter TrcvSysData. If this is successful, E_OK shall be returned.
Hint: This API can be invoked through diagnostic services or during initialization to
determine the transceiver status and its availability.
Note: Currently an agreement on the parameter set for the transceiver HW specifica-
tion has not been reached. For this reason, the diagnostic data is now returned as a
uint32 (as stored in the transceiver registers). When a definitive and standard pa-
rameter set is defined, a data structure may be defined for abstracting the diagnostic
data. ⌋ ()
[SWS_CanTrcv_00190] ⌈ If there is no/incorrect communication to the transceiver,
the function CanTrcv_GetTrcvSystemData shall report the runtime error code
CANTRCV_E_NO_TRCV_CONTROL to the default Error Tracer and return E_NOT_OK.
⌋ ()
[SWS_CanTrcv_00191] ⌈ If development error detection is enabled for the CanTrcv
module: if called before the CanTrcv has been initialized, the function
CanTrcv_GetTrcvSystemData shall raise development error
CANTRCV_E_UNINIT otherwise (if DET is disabled) return E_NOT_OK. ⌋ ()
[SWS_CanTrcv_00192] ⌈ If development error detection is enabled for the CanTrcv
module: if called with an invalid transceiver ID for parameter Transceiver, function
CanTrcv_GetTrcvSystemData shall raise the development error
CANTRCV_E_INVALID_TRANSCEIVER otherwise (if DET is disabled) return
E_NOT_OK. ⌋ ()
[SWS_CanTrcv_00193] ⌈ If development error detection is enabled for the CanTrcv
module: if called with NULL pointer for parameter TrcvSysData, function
CanTrcv_GetTrcvSystemData shall raise the development error
CANTRCV_E_PARAM_POINTER otherwise (if DET is disabled) return E_NOT_OK. ⌋ ()

40 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

8.3.8 CanTrcv_ClearTrcvWufFlag

[SWS_CanTrcv_00214] ⌈
Service name: CanTrcv_ClearTrcvWufFlag
Syntax: Std_ReturnType CanTrcv_ClearTrcvWufFlag(
uint8 Transceiver
)
Service ID[hex]: 0x0a
Sync/Async: Synchronous
Reentrancy: Reentrant for different transceivers
Parameters (in): Transceiver CAN Transceiver ID.
Parameters (in- None
out):
Parameters (out): None
Std_ReturnType E_OK: will be returned if the WUF flag has been cleared.
Return value: E_NOT_OK: will be returned if the WUF flag has not been
cleared or a development error occurs.
Description: Clears the WUF flag in the transceiver hardware. This API shall exist only if
CanTrcvHwPnSupport = TRUE.
⌋ (SRS_Can_01157)
[SWS_CanTrcv_00194] ⌈ The function CanTrcv_ClearTrcvWufFlag shall clear
the wakeup flag in the CAN transceiver. If successful, E_OK shall be returned.
Implementation Hints:
This API shall be used by the CanSM module for ensuring that no frame wakeup
event is lost, during entering a low-power mode. This API clears the WUF flag.
The CAN transceiver shall be shall be put into Standby mode (CANTRCV_STANDBY)
after clearing of the WUF flag.
If a system error (SYSERR, e.g. configuration error) occurs while selective wakeup
functionality is being enabled, transceiver will disable the functionality. Transceiver
will wake up on the next CAN wake pattern (WUP).
In case of any other hardware error (e.g. frame detection error), transceiver will wake
up if the error counter inside the transceiver overflows. ⌋ ()
[SWS_CanTrcv_00195] ⌈ CanTrcv shall inform CanIf that the wakeup flag has been
cleared for the requested Transceiver, through the callback notification
CanIf_ClearTrcvWufFlagIndication referring to the corresponding CAN
transceiver with the abstract CanIf TransceiverId. ⌋ ()
[SWS_CanTrcv_00196] ⌈ ⌈ If there is no/incorrect communication to the transceiv-
er, the function CanTrcv_ClearTrcvWufFlag shall report the runtime error
CANTRCV_E_NO_TRCV_CONTROL to the Default Error Tracer and return E_NOT_OK.
⌋ ()
[SWS_CanTrcv_00197] ⌈ If development error detection is enabled for the CanTrcv
module: if called before the CanTrcv has been initialized, the function
CanTrcv_ClearTrcvWufFlag shall raise development error CANTRCV_E_UNINIT
otherwise (if DET is disabled) return E_NOT_OK. ⌋ ()
[SWS_CanTrcv_00198] ⌈ If development error detection is enabled for the CanTrcv
module: if called with an invalid transceiver ID for parameter Transceiver, function
CanTrcv_ClearTrcvWufFlag shall raise the development error
CANTRCV_E_INVALID_TRANSCEIVER otherwise (if DET is disabled) return
E_NOT_OK. ⌋ ()

41 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

8.3.9 CanTrcv_ReadTrcvTimeoutFlag

[SWS_CanTrcv_00215] ⌈
Service name: CanTrcv_ReadTrcvTimeoutFlag
Syntax: Std_ReturnType CanTrcv_ReadTrcvTimeoutFlag(
uint8 Transceiver,
CanTrcv_TrcvFlagStateType* FlagState
)
Service ID[hex]: 0x0b
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): Transceiver CAN transceiver ID.
Parameters (in- None
out):
Parameters (out): FlagState State of the timeout flag.
Std_ReturnType E_OK: Will be returned, if status of the timeout flag is success-
fully read.
Return value:
E_NOT_OK: Will be returned, if status of the timeout flag
could not be read.
Description: Reads the status of the timeout flag from the transceiver hardware. This API shall
exist only if CanTrcvHwPnSupport = TRUE.
⌋ ()
[SWS_CanTrcv_00199] ⌈ If development error detection is enabled for the module
CanTrcv: If called with an invalid transceiver ID Transceiver, the function
CanTrcv_ReadTrcvTimeoutFlag shall raise the development error
CANTRCV_E_INVALID_TRANSCEIVER otherwise (if DET is disabled) return
E_NOT_OK. ⌋ ()
[SWS_CanTrcv_00200] ⌈ If development error detection is enabled for the module
CanTrcv: If called with FlagState = NULL, the function
CanTrcv_ReadTrcvTimeoutFlag shall raise the development error
CANTRCV_E_PARAM_POINTER otherwise (if DET is disabled) return E_NOT_OK. ⌋ ()

8.3.10 CanTrcv_ClearTrcvTimeoutFlag

[SWS_CanTrcv_00216] ⌈
Service name: CanTrcv_ClearTrcvTimeoutFlag
Syntax: Std_ReturnType CanTrcv_ClearTrcvTimeoutFlag(
uint8 Transceiver
)
Service ID[hex]: 0x0c
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): Transceiver CAN transceiver ID.
Parameters (in- None
out):
Parameters (out): None
Std_ReturnType E_OK: Will be returned, if the timeout flag is successfully
cleared.
Return value:
E_NOT_OK: Will be returned, if the timeout flag could not be
cleared.
Description: Clears the status of the timeout flag in the transceiver hardware. This API shall
exist only if CanTrcvHwPnSupport = TRUE.
⌋ ()
42 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

[SWS_CanTrcv_00201] ⌈ If development error detection is enabled for the module


CanTrcv: If called with an invalid transceiver ID Transceiver, the function
CanTrcv_ClearTrcvTimeoutFlag shall raise the development error
CANTRCV_E_INVALID_TRANSCEIVER otherwise (if DET is disabled) return
E_NOT_OK. ⌋ ()

8.3.11 CanTrcv_ReadTrcvSilenceFlag

[SWS_CanTrcv_00217] ⌈
Service name: CanTrcv_ReadTrcvSilenceFlag
Syntax: Std_ReturnType CanTrcv_ReadTrcvSilenceFlag(
uint8 Transceiver,
CanTrcv_TrcvFlagStateType* FlagState
)
Service ID[hex]: 0x0d
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): Transceiver CAN transceiver ID.
Parameters (in- None
out):
Parameters (out): FlagState State of the silence flag.
Std_ReturnType E_OK: Will be returned, if status of the silence flag is success-
fully read.
Return value:
E_NOT_OK: Will be returned, if status of the silence flag could
not be read.
Description: Reads the status of the silence flag from the transceiver hardware. This API shall
exist only if CanTrcvHwPnSupport = TRUE.
⌋ ()
[SWS_CanTrcv_00202] ⌈ If development error detection is enabled for the module
CanTrcv: If called with an invalid transceiver ID Transceiver, the function
CanTrcv_ReadTrcvSilenceFlag shall raise the development error
CANTRCV_E_INVALID_TRANSCEIVER otherwise (if DET is disabled) return
E_NOT_OK. ⌋ ()
[SWS_CanTrcv_00203] ⌈ If development error detection is enabled for the module
CanTrcv: If called with FlagState = NULL, the function
CanTrcv_ReadTrcvSilenceFlag shall raise the development error
CANTRCV_E_PARAM_POINTER otherwise (if DET is disabled) return E_NOT_OK. ⌋ ()

8.3.12 CanTrcv_CheckWakeup

[SWS_CanTrcv_00143] ⌈
Service name: CanTrcv_CheckWakeup
Syntax: Std_ReturnType CanTrcv_CheckWakeup(
uint8 Transceiver
)
Service ID[hex]: 0x07
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): Transceiver CAN transceiver to which API call has to be applied.
Parameters (in- None
out):
43 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Parameters (out): None


Std_ReturnType E_OK: API call has been accepted
Return value:
E_NOT_OK: API call has not been accepted
Description: Service is called by underlying CANIF in case a wake up interrupt is detected.
⌋ ()

EcuM_EndCheckWakeup(WakeupSource) is called by CanTrcv_CheckWakeup for


checking the wakeup source asynchronously.

[SWS_CanTrcv_00144] ⌈ If development error detection for the module CanTrcv is


enabled: If called before the CanTrcv module has been initialized, the function
CanTrcv_CheckWakeup shall raise the development error CANTRCV_E_UNINIT
otherwise (if DET is disabled) return E_NOT_OK. ⌋ ()
[SWS_CanTrcv_00145] ⌈ If development error detection for the module CanTrcv is
enabled: If called with an invalid Transceiver number, the function
CanTrcv_CheckWakeup shall raise the development error
CANTRCV_E_INVALID_TRANSCEIVER otherwise (if DET is disabled) return
E_NOT_OK. ⌋ ()
[SWS_CanTrcv_00146] ⌈ If supported by hardware, CanTrcv_CheckWakeup shall
validate whether there has been a wake up due to transceiver activity and if TRUE,
reporting shall be done to EcuM via API EcuM_SetWakeupEvent with the wakeup
source referenced in CanTrcvWakeupSourceRef.⌋ ()

8.3.13 CanTrcv_SetPNActivationState

[SWS_CanTrcv_00219] ⌈
Service name: CanTrcv_SetPNActivationState
Syntax: Std_ReturnType CanTrcv_SetPNActivationState(
CanTrcv_PNActivationType ActivationState
)
Service ID[hex]: 0x0f
Sync/Async: Synchronous
Reentrancy: Non Reentrant
ActivationState PN_ENABLED: PN wakeup functionality in CanTrcv shall be
enabled.
Parameters (in):
PN_DIABLED: PN wakeup functionality in CanTrcv shall be
disabled.
Parameters (in- None
out):
Parameters (out): None
Std_ReturnType E_OK: Will be returned, if the PN has been changed to the re-
quested configuration.
Return value:
E_NOT_OK: Will be returned, if the PN configuration change
has failed. The previous configuration has not been changed.
Description: The API configures the wake-up of the transceiver for Standby and Sleep Mode:
Either the CAN transceiver is woken up by a remote wake-up pattern (standard
CAN wake-up) or by the configured remote wake-up frame.
⌋ ()
[SWS_CanTrcv_00220] ⌈ If development error detection for the module CanTrcv is
enabled: If called before the CanTrcv module has been initialized, the function
CanTrcv_SetPNActivationState shall raise the development error
CANTRCV_E_UNINIT otherwise (if DET is disabled) return E_NOT_OK. ⌋ ()
44 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

[SWS_CanTrcv_00221] ⌈ CanTrcv shall enable the PN wakeup functionality when


function CanTrcv_SetPNActivationState is called with ActivationState=
PN_ENABLED and return E_OK. ⌋ ()
[SWS_CanTrcv_00222] ⌈ CanTrcv shall disable the PN wakeup functionality when
function CanTrcv_SetPNActivationState is called with ActivationState=
PN_DISABLED and return E_OK. ⌋ ()

8.3.14 CanTrcv_CheckWakeFlag

[SWS_CanTrcv_00223] ⌈
Service name: CanTrcv_CheckWakeFlag
Syntax: Std_ReturnType CanTrcv_CheckWakeFlag(
uint8 Transceiver
)
Service ID[hex]: 0x0e
Sync/Async: Asynchronous
Reentrancy: Non Reentrant
Parameters (in): Transceiver CAN transceiver ID.
Parameters (in- None
out):
Parameters (out): None
Std_ReturnType E_OK: Will be returned, if the request for checking the wakeup
flag has been accepted.
Return value:
E_NOT_OK: Will be returned, if the request for checking the
wakeup flag has not been accepted.
Description: Requests to check the status of the wakeup flag from the transceiver hardware.
⌋ ()
[SWS_CanTrcv_00224] ⌈ CanTrcv shall inform the CanIf with the callback notifica-
tion CanIf_CheckTrcvWakeFlagIndication, that the wake flag of the CAN
Transceiver with the corresponding TransceiverId has been checked.⌋()
[SWS_CanTrcv_00225] ⌈ If development error detection is enabled for the module
CanTrcv: If called with an invalid transceiver ID Transceiver, the function
CanTrcv_CheckWakeFlag shall raise the development error
CANTRCV_E_INVALID_TRANSCEIVER otherwise (if DET is disabled) return
E_NOT_OK.⌋ ()

8.3.15 CanTrcv_DeInit

[SWS_CanTrcv_91001] ⌈
Service name: CanTrcv_DeInit
Syntax: void CanTrcv_DeInit(
void
)
Service ID[hex]: 0x10
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): None
Parameters (in- None
out):
Parameters (out): None
Return value: None
Description: De-initializes the CanTrcv module.
45 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

⌋ (SRS_Can_01108, SRS_BSW_00336)

[SWS_CanTrcv_91002] ⌈ The function CanTrcv_DeInit shall de-initialize all the con-


nected CAN transceivers based on their de-initialization sequenc-
es.⌋ (SRS_Can_01108)
[SWS_CanTrcv_91003] ⌈The function CanTrcv_DeInit shall set the CAN transceiver
hardware to the state NOT_ACTIVE.⌋(SRS_Can_01108)

In the state NOT_ACTIVE, the CAN transceiver hardware allows to be re-configured


with a new configuration sequence

[SWS_CanTrcv_91004] ⌈ If there is no/incorrect communication towards the trans-


ceiver, the function CanTrcv_DeInit shall report the runtime error
CANTRCV_E_NO_TRCV_CONTROL code to the Default Error Tracer.

For Eg., there are different transceiver types and different access ways (port connec-
tion, SPI). This development error should be signaled if you detect any miscommuni-
cation with your hardware. Depending on connection type and depending on your
transceiver hardware you may not run in situations where you have to signal this er-
ror. ⌋(SRS_BSW_00369)

[SWS_CanTrcv_91005] ⌈If development error detection for the CanTrcv module is


enabled: The function CanTrcv_DeInit shall raise the error
CANTRCV_E_TRCV_NOT_NORMAL if the transceiver is not in state
CANTRCV_TRCVMODE_NORMAL.⌋(SRS_BSW_00369)

8.4 Scheduled functions


This chaper lists all functions provided by the CanTrcv module and called directly by
the Basic Software Module Scheduler.

8.4.1 CanTrcv_MainFunction

[SWS_CanTrcv_00013] ⌈
Service name: CanTrcv_MainFunction
Syntax: void CanTrcv_MainFunction(
void
)
Service ID[hex]: 0x06
Description: Service to scan all busses for wake up events and perform these event.
⌋ (SRS_BSW_00310, SRS_BSW_00369, SRS_BSW_00371, SRS_BSW_00373,
SRS_BSW_00406, SRS_BSW_00424, SRS_BSW_00428, SRS_BSW_00171, SRS_BSW_00172,
SRS_Can_01097, SRS_Can_01109, SRS_Can_01110)
The CAN bus transceiver driver may have cyclic jobs like polling for wake up events
(if configured).
[SWS_CanTrcv_00112] ⌈ The CanTrcv_MainFunction shall scan all busses in
STANDBY and SLEEP for wake up events.
This function shall set a wake-up event flag to perform these events.
⌋ (SRS_BSW_00343)

46 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

According to [SRS_BSW_00424], main processing functions shall be allocated by


basic tasks. No special call order to be kept. This function is directly called by Basic
Software Scheduler.
See configuration parameter CanTrcvWakeUpSupport.
[SWS_CanTrcv_00128] ⌈ If development error detection for the module CanTrcv is
enabled: If called before the CanTrcv has been initialized, the function
CanTrcv_MainFunction shall raise development error CANTRCV_E_UNINIT. ⌋ ()

8.4.2 CanTrcv_MainFunctionDiagnostics

[SWS_CanTrcv_00218] ⌈
Service name: CanTrcv_MainFunctionDiagnostics
Syntax: void CanTrcv_MainFunctionDiagnostics(
void
)
Service ID[hex]: 0x08
Description: Reads the transceiver diagnostic status periodically and sets product/development
accordingly.
⌋ ()
[SWS_CanTrcv_00204] ⌈ The cyclic function
CanTrcv_MainFunctionDiagnostics shall read the transceiver status periodi-
cally and report production/development errors accordingly. ⌋ ()
[SWS_CanTrcv_00205] ⌈ The cyclic function
CanTrcv_MainFunctionDiagnostics shall exist only if CanTrcvBusErrFlag
= TRUE. ⌋ ()
[SWS_CanTrcv_00206] ⌈ If configured and supported by hardware: if the BUSERR
flag reported from BSW is set, function CanTrcv_MainFunctionDiagnostics
shall call the API Dem_SetEventStatus with parameters EventId as
CANTRCV_E_BUS_ERROR and EventStatus as DEM_EVENT_STATUS_FAILED.
⌋ (SRS_BSW_00337, SRS_BSW_00385, SRS_BSW_00327, SRS_BSW_00331)
[SWS_CanTrcv_00227] ⌈ If configured and supported by hardware: if the BUSERR
flag reported from BSW is reset, function CanTrcv_MainFunctionDiagnostics
shall call the API Dem_SetEventStatus with parameters EventId as
CANTRCV_E_BUS_ERROR and EventStatus as DEM_EVENT_STATUS_PASSED.⌋
(SRS_BSW_00337, SRS_BSW_00385, SRS_BSW_00327, SRS_BSW_00331)
[SWS_CanTrcv_00207] ⌈ If development error detection is enabled for the module:
If called before the CanTrcv has been initialized, the function
CanTrcv_MainFunctionDiagnostics shall raise development error
CANTRCV_E_UNINIT. ⌋ ()

8.5 Call-back notifications


Since the CanTrcv is a driver module, it doesn’t provide any callback functions for
lower layer modules.

8.6 Expected Interfaces


This chapter lists all functions the module CanTrcv requires from other modules.

47 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

8.6.1 Mandatory Interfaces

This chapter defines all interfaces which are required to fulfill the core functionality of
the module.

[SWS_CanTrcv_00085] ⌈
API function Description
CanIf_TrcvModeIndication This service indicates a transceiver state transition referring to the cor-
responding CAN transceiver with the abstract CanIf TransceiverId.
Det_ReportRuntimeError Service to report runtime errors. If a callout has been configured then
this callout shall be called.
⌋ ()

8.6.2 Optional Interfaces

This chapter defines all interfaces which are required to fulfill an optional functionality
of the module.

[SWS_CanTrcv_00086] ⌈
API function Description
CanIf_CheckTrcvWakeFlagIndication 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.
CanIf_ClearTrcvWufFlagIndication This service indicates that the transceiver has cleared the
WufFlag referring to the corresponding CAN transceiver with the
abstract CanIf TransceiverId.
CanIf_ConfirmPnAvailability This service indicates that the transceiver is running in PN com-
munication mode referring to the corresponding CAN transceiver
with the abstract CanIf TransceiverId.
Dem_SetEventStatus Called by SW-Cs or BSW modules to report monitor status infor-
mation to the Dem. BSW modules calling Dem_SetEventStatus
can safely ignore the return value.
Det_ReportError Service to report development errors.
Dio_ReadChannel Returns the value of the specified DIO channel.
Dio_ReadChannelGroup This Service reads a subset of the adjoining bits of a port.
Dio_ReadPort Returns the level of all channels of that port.
Dio_WriteChannel Service to set a level of a channel.
Dio_WriteChannelGroup Service to set a subset of the adjoining bits of a port to a speci-
fied level.
Dio_WritePort Service to set a value of the port.
EcuM_SetWakeupEvent Sets the wakeup event.
Icu_DisableNotification This function disables the notification of a channel.
Icu_EnableNotification This function enables the notification on the given channel.
Spi_GetStatus Service returns the SPI Handler/Driver software module status.
Spi_ReadIB Service for reading synchronously one or more data from an IB
SPI Handler/Driver Channel specified by parameter.
Spi_SetupEB Service to setup the buffers and the length of data for the EB SPI
Handler/Driver Channel specified.
Spi_SyncTransmit Service to transmit data on the SPI bus
Spi_WriteIB Service for writing one or more data to an IB SPI Handler/Driver
Channel specified by parameter.
Tm_BusyWait1us16bit Performs busy waiting by polling with a guaranteed minimum
waiting time.
⌋ ()
48 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

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.
1. The interfaces of the SPI module are used by the CanTrcv module if there are
instances of the container CanTrcvSpiSequence.

2. The interfaces of the DIO module are used by the CanTrcv module if there are
instances of the container CanTransceiverDIOAccess.

Note: If the Can transceiver is controlled via Dio/Spi, the Dio/Spi interfaces are re-
quired to fulfill the core functionality of the module. Which interfaces are needed ex-
actly shall not be detailed further in this specification

8.6.3 Configurable interfaces

There are no configurable interfaces for CAN transceiver driver.

49 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

9 Sequence diagram

The focus of the following diagrams is on the interaction between the CAN transceiv-
er driver and the BSW modules CanIf, ComM, EcuM and Dio. Depending on the CAN
transceiver hardware, one or more calls to Dio_WriteChannels may be neces-
sary.
Depending on the transceiver hardware, there may be a need of wait states for some
transitions.

9.1 Wake up with valid validation


For all wakeup related sequence diagrams please refer to chapter 9 of ECU State
Manager.

50 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

9.2 Interaction with DIO module

51 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Integration «module» «module» «module» «module» «module» «module» «Peripheral»


Code EcuM ComM CanSM CanIf CanTrcv Dio CAN Transceiver
Hardware

ComM_EcuM_WakeUpIndication(NetworkHandleType)

ComM_EcuM_WakeUpIndication()

CanSM_RequestComMode(COMM_FULL_COMMUNICATION)
alt

[Start CAN Network]


CanIf_SetTrcvMode(CANIF_TRCV_MODE_NORMAL)

CanTrcv_SetOpMode(CANIF_TRCV_MODE_NORMAL)

Dio_WriteChannel(Dio_ChannelType, Dio_LevelType)

set/reset HW ports()
Dio_WriteChannel()

Dio_WriteChannel(Dio_ChannelType, Dio_LevelType)

set/reset HW ports()
Dio_WriteChannel()
CanTrcv_SetOpMode()
CanIf_SetTrcvMode()
CanSM_RequestComMode()
Comment:

CAN transceiver
hardware is now in
NORMAL mode. It's
ready to operate.

CanSM_RequestComMode(COMM_NO_COMMUNICATION)
alt

CanIf_SetTrcvMode(CANIF_TRCV_MODE_STANDBY) [Stop & Sleep CAN Network]

CanTrcv_SetOpMode(CANIF_TRCV_MODE_STANDBY)

Dio_WriteChannel(Dio_ChannelType, Dio_LevelType)

set/reset HW ports()
Dio_WriteChannel()

Dio_WriteChannel(Dio_ChannelType, Dio_LevelType)

set/reset HW ports()
Dio_WriteChannel()
CanTrcv_SetOpMode()
CanIf_SetTrcvMode()
CanSM_RequestComMode()
Comment:

CAN transceiver
hardware is now in
STANDBY mode. No
transmitting or receiving
EcuM_AL_SwitchOff()
possible. It's ready to
wake up again.

CanIf_SetTrcvMode(CANIF_TRCV_MODE_SLEEP)

CanTrcv_SetOpMode(CANIF_TRCV_MODE_SLEEP)

Dio_WriteChannel(Dio_ChannelType, Dio_LevelType)

set/reset HW ports()

Dio_WriteChannel()

Dio_WriteChannel(Dio_ChannelType, Dio_LevelType)

set/reset HW ports()
Dio_WriteChannel()
CanTrcv_SetOpMode()

CanIf_SetTrcvMode() Comment:

EcuM_AL_SwitchOff() CAN transceiver


hardware is now in
SLEEP mode. No
transmitting or receiving
possible. It's ready to
wake up again

52 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

9.3 De-Initialization (SPI Synchronous)

53 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

«module» «module» «module» «module» «module» «module» «module»


ComM EcuM CanSM CanIf CanTrcv Can Spi

ComM state == CanSM mode == Trcv == NORMAL Ctrl == STARTED


NoCom SilentCom

CanSM_RequestComMode(NetworkA,
NoCom)

CanSM_MainFunction()

CanIf_ClearTrcvWufFlag(TransceiverId)

CanTrcv_ClearTrcvWufFlag(Transceiver)

Spi_SyncTransmit(Sequence)

CanIf_ClearTrcvWufFlagIndication(TransceiverId)
SPI request is processed synchronously

[1] CanSm_MainFunction() shall not return if response indication was CanSM_ClearTrcvWufFlagIndication(Transceiver)


called during request function. The next step in Shutdown sequence
shall directly be performed.
-> Here CanSM_ClearWufFlagIndication was called during
CanSM_ClearTrcvWufFlag
-> next step in sequence (CanIf_SetControllerMode) shall be
performed

alt CanSM_ClearTrcvWufFlagIndication() was called

CanIf_SetControllerMode(ControllerId,
CAN_CS_STOPPED)

Can_SetControllerMode(Controller,
CAN_T_STOP)

In CanSM buffered CtrlMode =


CAN_CS_STOPPED

CanIf_SetTrcvMode(TransceiverId,
CANIF_TRCV_MODE_STANDBY)

CanTrcv_SetOpMode(Transceiver, CANIF_TRCV_MODE_STANDBY)
:Std_ReturnType
Spi_SyncTransmit(Sequence)

CanIf_TrcvModeIndication(TransceiverId,
CANIF_TRCV_MODE_STANDBY)

CanSM_TransceiverModeIndication(TransceiverId,
CANIF_TRCV_MODE_STANDBY)

see note [1]

alt CanSM_TransceiverModeIndication was called with TransceiverMode == STANDBY

CanIf_SetControllerMode(ControllerId,
CANIF_CS_SLEEP)

Can_SetControllerMode(Controller,
CAN_T_SLEEP)

:CAN_OK / CAN_NOT_OK

:E_OK / E_NOT_OK

If CanIf_SetControllerMode(ControllerId, CANIF_CS_SLEEP) returns E_NOT_OK, the


In CanSM buffered CtrlMode = buffered CC state in CanSM is not changed to CANIF_CS_SLEEP
CANIF_CS_SLEEP if E_OK has
been returned

CanIf_CheckTrcvWakeFlag(TransceiverId)

CanTrcv_CheckWakeFlag(Transceiver)

Read Wake Flag via


Spi_SyncTransmit()

alt Wakeup Source


[bus (priority_high)] EcuM_SetWakeupEvent(WuSourceBus)

see note [1]

[pin (prio_medium)]
[optional]:
If Wake Flags are cleared, the
EcuM_SetWakeupEvent(WuSourcePin) see note [1]
dominant level on RxD has to be
cleared. -> OEM HW requirement

Clear Wake Flag via


Spi_SyncTransmit()

CanIf_CheckTrcvWakeFlagIndication(TransceiverId)

CanSM_CheckTransceiverWakeFlagIndication(Transceiver)

alt return value of SetCtrlMode (SLEEP)

[E_OK]
ComM_CanSM_ModeIndication(NetworkA,
NoCom)

[E_NOT_OK]

[no wakeup (prio_low)]


CanIf_CheckTrcvWakeFlagIndication(TransceiverId)

see note [1]


CanSM_CheckTransceiverWakeFlagIndication(Transceiver)

alt return value of SetCtrlMode (SLEEP)

[E_OK]
ComM_BusSM_ModeIndication(NetworkA,
NoCom)

[E_NOT_OK]

54 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

9.4 De-Initialization (SPI Asynchronous)

55 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

«module» «module» «module» «module» «module» «module» «module»


ComM EcuM CanSM CanIf CanTrcv Can Spi

ComM state == CanSM mode == Trcv == NORMAL Ctrl == STARTED


NoCom SilentCom

CanSM_RequestComMode(NetworkA, NoCom) :
Std_ReturnType [1] It could be checked via
- Spi_JobEndNotification() callback or
- Spi_GetSequenceResult() or
- Spi_ReadIB()
whether SPI request was successfully transmitted via SPI lines.
This could either be done in interrupt context or in
CanTrcv_MainFunction().

CanSM_MainFunction()

CanIf_ClearTrcvWufFlag(TransceiverId) :
Std_ReturnType

CanTrcv_ClearTrcvWufFlag(Transceiver) :
Std_ReturnType

Spi_AsyncTransmit(Sequence) :
Std_ReturnType

CanIf_ClearTrcvWufFlagIndication(TransceiverId)

CanSM_ClearTrcvWufFlagIndication(Transceiver) see note [1] above

CanSM_MainFunction()

alt CanSM_ClearTrcvWufFlagIndication() was called

CanIf_SetControllerMode(ControllerId,
CAN_CS_STOPPED)

Can_SetControllerMode(Controller,
CAN_T_STOP)

In CanSM buffered CtrlMode =


CAN_CS_STOPPED

CanIf_SetTrcvMode(TransceiverId, CANIF_TRCV_MODE_STANDBY) :
Std_ReturnType

CanTrcv_SetOpMode(Transceiver, CANIF_TRCV_MODE_STANDBY) :
Std_ReturnType
Spi_AsyncTransmit(Sequence) :
Std_ReturnType

CanIf_TrcvModeIndication(TransceiverId,
CANIF_TRCV_MODE_STANDBY)

CanSM_TransceiverModeIndication(TransceiverId,
CANIF_TRCV_MODE_STANDBY)
see note [1] above

In CanSM buffered Trcv Mode =


CANIF_TRCV_MODE_STANDBY

alt CanSM_TransceiverModeIndication was called with TransceiverMode == STANDBY

CanIf_SetControllerMode(ControllerId,
CANIF_CS_SLEEP)

Can_SetControllerMode(Controller,
CAN_T_SLEEP)

:CAN_OK / CAN_NOT_OK

:E_OK / E_NOT_OK

If CanIf_SetControllerMode(ControllerId, CANIF_CS_SLEEP) returns E_NOT_OK, the


In CanSM buffered CtrlMode = buffered CC state in CanSM is not changed to CANIF_CS_SLEEP
CANIF_CS_SLEEP if E_OK has
been returned

CanIf_CheckTrcvWakeFlag(TransceiverId) :
Std_ReturnType
CanTrcv_CheckWakeFlag(Transceiver) :
Std_ReturnType

Read Wake Flag via Spi_AsyncTransmit()

alt Wakeup Source

[bus (priority_high)] EcuM_SetWakeupEvent(WuSourceBus)

see note [1] above

[pin (prio_medium)]
[optional]:
If Wake Flags are cleared, the
EcuM_SetWakeupEvent(WuSourcePin) see note [1] above
dominant level on RxD has to be
cleared. -> OEM HW requirement

Clear Wake Flag via Spi_AsyncTransmit()

CanIf_CheckTrcvWakeFlagIndication(TransceiverId)

CanSM_CheckTransceiverWakeFlagIndication(Transceiver)

alt return value of SetCtrlMode (SLEEP)

[E_OK]
ComM_CanSM_ModeIndication(NetworkA,
NoCom)

[E_NOT_OK]

[no wakeup (prio_low)]


CanIf_CheckTrcvWakeFlagIndication(TransceiverId)

see note [1] above


CanSM_CheckTransceiverWakeFlagIndication(Transceiver)

alt return value of SetCtrlMode (SLEEP)

[E_OK]
ComM_BusSM_ModeIndication(NetworkA, NoCom)

[E_NOT_OK]

56 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

10 Configuration specification

In general this chapter defines configuration parameters and their clustering into con-
tainers. In order to support the specification Chapter 10.1 describes fundamentals.

Chapter 10.2 specifies the structure (containers) and the parameters of the module
CanTrcv.

Chapter 10.2.1 specifies published information of the module CanTrcv.

10.1 How to read this chapter


For details refer to the chapter 10.1 “Introduction to configuration specification” in
SWS_BSWGeneral

57 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

10.2 Containers and configuration parameters


The following chapters summarize all configuration parameters. The detailed mean-
ings of the parameters are described in preeding hapters.

10.2.1 CanTrcv
SWS Item ECUC_CanTrcv_00192 :
Module Name CanTrcv
Module Description Configuration of the CanTrcv (CAN Transceiver driver) module.
Post-Build Variant Support true
Supported Config Variants VARIANT-LINK-TIME, VARIANT-POST-BUILD, VARIANT-PRE-COMPILE

Included Containers
Container Name Multiplicity Scope / Dependency
This container contains the configuration parameters and sub
CanTrcvConfigSet 1
containers of the AUTOSAR WdgM module.
CanTrcvGeneral 1 Container gives CAN transceiver driver basic information.

CanTrcv :EcucModuleDef
CanTrcvGeneral :
upperMultiplicity = * +container EcucParamConfContainerDef
lowerMultiplicity = 0
lowerMultiplicity = 1
upperMultiplicity = 1

CanTrcvConfigSet : CanTrcvChannel :
EcucParamConfContainerDef EcucParamConfContainerDef CanTrcvAccess :
+subContainer EcucChoiceContainerDef
upperMultiplicity = *
lowerMultiplicity = 1 upperMultiplicity = 1
+subContainer lowerMultiplicity = 1

CanTrcvPartialNetwork :
+subContainer EcucParamConfContainerDef

lowerMultiplicity = 0
upperMultiplicity = 1
+container

CanTrcvSPICommTimeout :
+parameter EcucIntegerParamDef

min = 0
max = 100
defaultValue = 0

CanTrcvSPICommRetries :
+parameter EcucIntegerParamDef

min = 0
max = 255
defaultValue = 0

10.2.2 CanTrcvGeneral
SWS Item ECUC_CanTrcv_00090 :
Container Name CanTrcvGeneral
Description Container gives CAN transceiver driver basic information.
Configuration Parameters

SWS Item ECUC_CanTrcv_00152 :


Name CanTrcvDevErrorDetect
Parent Container CanTrcvGeneral
Description Switches the development error detection and notification on or off.

 true: detection and notification is enabled.

58 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

 false: detection and notification is disabled.

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

SWS Item ECUC_CanTrcv_00184 :


Name CanTrcvIndex
Parent Container CanTrcvGeneral
Description Specifies the InstanceId of this module instance. If only one instance is
present it shall have the Id 0.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 255
Default value --
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00187 :


Name CanTrcvMainFunctionDiagnosticsPeriod
Parent Container CanTrcvGeneral
Description This parameter describes the period for cyclic call to
CanTrcv_MainFunctionDiagnostics. Unit is seconds.
Multiplicity 0..1
Type EcucFloatParamDef
Range ]0 .. INF[
Default value --
Post-Build Variant Multi-
false
plicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00186 :


Name CanTrcvMainFunctionPeriod
Parent Container CanTrcvGeneral
Description This parameter describes the period for cyclic call to
CanTrcv_MainFunction. Unit is seconds.
Multiplicity 0..1
Type EcucFloatParamDef
Range ]0 .. INF[
Default value --
Post-Build Variant Multi- false
59 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

plicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00190 :


Name CanTrcvTimerType
Parent Container CanTrcvGeneral
Description Type of the Time Service Predefined Timer.
Multiplicity 0..1
Type EcucEnumerationParamDef
Range None None
Timer_1us16bit 16 bit 1us timer
Post-Build Variant
false
Multiplicity
Post-Build Variant
false
Value
Multiplicity Config-
Pre-compile time X All Variants
uration Class Link time --
Post-build time --
Value Configura- Pre-compile time X All Variants
tion Class Link time --
Post-build time --
Scope / Dependen- scope: local
cy

SWS Item ECUC_CanTrcv_00153 :


Name CanTrcvVersionInfoApi
Parent Container CanTrcvGeneral
Description Switches version information API on and off. If switched off, function need
not be present in compiled code.
Multiplicity 1
Type EcucBooleanParamDef
Default value false
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00191 :


Name CanTrcvWaitTime
Parent Container CanTrcvGeneral
Description Wait time for transceiver state changes in seconds.
Multiplicity 0..1
Type EcucFloatParamDef
Range [0 .. 2.55E-4]
Default value --
Post-Build Variant Multi-
false
plicity
Post-Build Variant Value false

60 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Multiplicity ConfigurationPre-compile time X All Variants


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

SWS Item ECUC_CanTrcv_00154 :


Name CanTrcvWakeUpSupport
Parent Container CanTrcvGeneral
Description Informs whether wake up is supported by polling or not supported. In case no
wake up is supported by the hardware, setting has to be NOT_SUPPORTED. Only in
the case of wake up supported by polling, function CanTrcv_MainFunction has to be
present and to be invoked by the scheduler.
Multiplicity 1
Type EcucEnumerationParamDef
Range CANTRCV_WAKEUP_BY_POLLING Wake up by polling
CANTRCV_WAKEUP_NOT_SUPPORTED Wake up is not supported
Post-Build Vari-
false
ant Value
Value Configura- Pre-compile time X All Variants
tion Class Link time --
Post-build time --
Scope / Depend- scope: local
ency dependency: CanTrcvWakeupByBusUsed

No Included Containers

61 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

CanTrcvGeneral : CanTrcvDevErrorDetect :
+parameter
EcucParamConfContainerDef EcucBooleanParamDef

lowerMultiplicity = 1 defaultValue = false


upperMultiplicity = 1 +literal CANTRCV_WAKEUP_BY_POLLING :
CanTrcvWakeUpSupport : EcucEnumerationLiteralDef
+parameter EcucEnumerationParamDef
+literal CANTRCV_WAKEUP_NOT_SUPPORTED :
EcucEnumerationLiteralDef

CanTrcvVersionInfoApi :
+parameter EcucBooleanParamDef

defaultValue = false

CanTrcvIndex :
+parameter EcucIntegerParamDef

min = 0
max = 255

CanTrcvMainFunctionPeriod :
EcucFloatParamDef
+parameter
min = 0
max = INF
lowerMultiplicity = 0
upperMultiplicity = 1

CanTrcvMainFunctionDiagnosticsPeriod :
EcucFloatParamDef
+parameter
min = 0
max = INF
lowerMultiplicity = 0
upperMultiplicity = 1

+literal None :
CanTrcvTimerType : EcucEnumerationLiteralDef
EcucEnumerationParamDef
+parameter
lowerMultiplicity = 0
upperMultiplicity = 1
+literal
Timer_1us16bit :
EcucEnumerationLiteralDef

CanTrcvWaitTime :
EcucFloatParamDef
+parameter
min = 0
max = 0.000255
lowerMultiplicity = 0
upperMultiplicity = 1

10.2.3 CanTrcvConfigSet
SWS Item ECUC_CanTrcv_00173 :
Container Name CanTrcvConfigSet
This container contains the configuration parameters and sub containers of
Description
the AUTOSAR WdgM module.
Configuration Parameters

SWS Item ECUC_CanTrcv_00175 :


Name CanTrcvSPICommRetries
Parent Container CanTrcvConfigSet
Description Indicates the maximum number of communication retries in case of a failed
SPI communication (applies both to timed out communication and to er-
rors/NACK in the response data).
62 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

If configured value is '0', no retry is allowed (communication is expected to


succeed at first try).
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 255
Default value 0
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
dependency: This parameter exists only if atleast one SPI Sequence is
referenced in CanTrcvSpiSequence.

SWS Item ECUC_CanTrcv_00174 :


Name CanTrcvSPICommTimeout
Parent Container CanTrcvConfigSet
Description Indicates the maximum time allowed to the CanTrcv for replying (either
positively or negatively) to a SPI command.
Timeout is configured in milliseconds. Timeout value of '0' means that no
specific timeout is to be used by CanTrcv and the communication is exe-
cuted at the best of the SPI HW capacity.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 100
Default value 0
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
dependency: This parameter exists only if atleast one SPI Sequence is
referenced in CanTrcvSpiSequence.

Included Containers
Container Name Multiplicity Scope / Dependency
Container gives CAN transceiver driver information about a
CanTrcvChannel 1..* single CAN
transceiver (channel).

10.2.4 CanTrcvChannel
SWS Item ECUC_CanTrcv_00143 :
Container Name CanTrcvChannel
Container gives CAN transceiver driver information about a single CAN
Description
transceiver (channel).
Configuration Parameters

SWS Item ECUC_CanTrcv_00155 :


Name CanTrcvChannelId
Parent Container CanTrcvChannel
Description Unique identifier of the CAN Transceiver Channel.
Multiplicity 1
Type EcucIntegerParamDef (Symbolic Name generated for this parameter)
Range 0 .. 255
Default value --
Post-Build Variant Value false
63 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Value Configuration Class Pre-compile time X All Variants


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

SWS Item ECUC_CanTrcv_00096 :


Name CanTrcvChannelUsed
Parent Container CanTrcvChannel
Description Shall the related CAN transceiver channel be used?
Multiplicity 1
Type EcucBooleanParamDef
Default value true
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00097 :


Name CanTrcvControlsPowerSupply
Parent Container CanTrcvChannel
Description Is ECU power supply controlled by this transceiver?
TRUE = Controlled by transceiver.
FALSE = Not controlled by transceiver.
Multiplicity 1
Type EcucBooleanParamDef
Default value false
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00160 :


Name CanTrcvHwPnSupport
Parent Container CanTrcvChannel
Description Indicates whether the HW supports the selective wake-up function
TRUE = Selective wakeup feature is supported by the transceiver
FALSE = Selective wakeup functionality is not available in transceiver
Multiplicity 1
Type EcucBooleanParamDef
Default value false
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
dependency: CanTrcvWakeUpSupport

SWS Item ECUC_CanTrcv_00146 :


Name CanTrcvInitState
Parent Container CanTrcvChannel
Description State of CAN transceiver after call to CanTrcv_Init.
Multiplicity 1
Type EcucEnumerationParamDef
Range CANTRCV_OP_MODE_NORMAL Normal operation mode

64 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

CANTRCV_OP_MODE_SLEEP Sleep operation mode


CANTRCV_OP_MODE_STANDBY Standby operation mode
Default value CANTRCV_OP_MODE_NORMAL
Post-Build Variant
false
Value
Value Configura- Pre-compile time X All Variants
tion Class Link time --
Post-build time --
Scope / Depend- scope: local
ency

SWS Item ECUC_CanTrcv_00147 :


Name CanTrcvMaxBaudrate
Parent Container CanTrcvChannel
Description Indicates the data transfer rate in kbps.
Maximum data transfer rate in kbps for transceiver hardware type. Only
used for validation purposes. This value can be used by configuration
tools.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 12000
Default value --
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00148 :


Name CanTrcvWakeupByBusUsed
Parent Container CanTrcvChannel
Description Is wake up by bus supported? If CAN transceiver hardware does not sup-
port wake up by bus value is always FALSE. If CAN transceiver hardware
supports wake up by bus value is TRUE or FALSE depending whether it is
used or not.
TRUE = Is used.
FALSE = Is not used.
Multiplicity 0..1
Type EcucBooleanParamDef
Default value false
Post-Build Variant Multi-
false
plicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
dependency: CanTrcvWakeUpSupport

SWS Item ECUC_CanTrcv_00185 :


Name CanTrcvIcuChannelRef
Parent Container CanTrcvChannel
Description Reference to the IcuChannel to enable/disable the interrupts
for wakeups.
65 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Multiplicity 0..1
Type Symbolic name reference to [ IcuChannel ]
Post-Build Variant Multi-
false
plicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency

SWS Item ECUC_CanTrcv_00181 :


Name CanTrcvPorWakeupSourceRef
Parent Container CanTrcvChannel
Description Symbolic name reference to specify the wakeup sources that should be
used in the calls to EcuM_SetWakeupEvent as specified in
[SWS_CanTrcv_00183] and [SWS_CanTrcv_00184].
This reference is mandatory if the HW supports POR or SYSERR flags
Multiplicity 0..1
Type Symbolic name reference to [ EcuMWakeupSource ]
Post-Build Variant Multi-
false
plicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: ECU

SWS Item ECUC_CanTrcv_00182 :


Name CanTrcvSyserrWakeupSourceRef
Parent Container CanTrcvChannel
Description Symbolic name reference to specify the wakeup sources that should be
used in the calls to EcuM_SetWakeupEvent as specified in
[SWS_CanTrcv_00183] and [SWS_CanTrcv_00184]
This reference is mandatory if the HW supports POR or SYSERR flags
Multiplicity 0..1
Type Symbolic name reference to [ EcuMWakeupSource ]
Post-Build Variant Multi-
false
plicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: ECU

SWS Item ECUC_CanTrcv_00177 :


Name CanTrcvWakeupSourceRef
Parent Container CanTrcvChannel
Description Reference to a wakeup source in the EcuM configuration.
66 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

This reference is only needed if CanTrcvWakeupByBusUsed is true.


Multiplicity 0..1
Type Symbolic name reference to [ EcuMWakeupSource ]
Post-Build Variant Multi-
false
plicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: ECU
dependency: CanTrcvWakeupByBusUsed

Included Containers
Container Name Multiplicity Scope / Dependency
Container gives CanTrcv Driver information about access
CanTrcvAccess 1
to a single CAN transceiver.
Container for the references to DemEventParameter ele-
ments which shall be invoked using the API
Dem_SetEventStatus in case the corresponding error oc-
CanTrcvDemEventParameter-
0..1 curs. The EventId is taken from the referenced DemEv-
Refs
entParameter's DemEventId symbolic value. The stand-
ardized errors are provided in this container and can be
extended by vendor-specific error references.
Container gives CAN transceiver driver information about
CanTrcvPartialNetwork 0..1
the configuration of Partial Networking functionality.

67 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

CanTrcvChannel :
CanTrcvChannelId :EcucIntegerParamDef
EcucParamConfContainerDef +parameter

symbolicNameValue = true
upperMultiplicity = *
max = 255
lowerMultiplicity = 1

+parameter CanTrcvChannelUsed :EcucBooleanParamDef

defaultValue = true

CanTrcvInitState :EcucEnumerationParamDef +literal CANTRCV_OP_MODE_SLEEP :


EcucEnumerationLiteralDef
+parameter defaultValue = CANTRCV_OP_MODE_NORMAL
+literal
CANTRCV_OP_MODE_STANDBY :
EcucEnumerationLiteralDef
+literal

CANTRCV_OP_MODE_NORMAL :
CanTrcvWakeupByBusUsed : EcucEnumerationLiteralDef
EcucBooleanParamDef
+parameter

defaultValue = false
lowerMultiplicity = 0
upperMultiplicity = 1

+parameter CanTrcvControlsPowerSupply :
EcucBooleanParamDef

defaultValue = false

CanTrcvMaxBaudrate :EcucIntegerParamDef
+parameter

max = 12000
min = 0

CanTrcvAccess :EcucChoiceContainerDef
+subContainer
upperMultiplicity = 1
lowerMultiplicity = 1

CanTrcvPartialNetwork :
+subContainer EcucParamConfContainerDef

lowerMultiplicity = 0
upperMultiplicity = 1

CanTrcvWakeupSourceRef :
+reference EcucSymbolicNameReferenceDef EcuMWakeupSource :EcucParamConfContainerDef
+destination

lowerMultiplicity = 0 lowerMultiplicity = 1
upperMultiplicity = 1 upperMultiplicity = 32

CanTrcvPorWakeupSourceRef :
+reference EcucSymbolicNameReferenceDef +destination

lowerMultiplicity = 0
upperMultiplicity = 1

CanTrcvSyserrWakeupSourceRef :
+reference EcucSymbolicNameReferenceDef +destination

lowerMultiplicity = 0
upperMultiplicity = 1
(from EcuM)

CanTrcvIcuChannelRef : IcuChannel :
+reference EcucSymbolicNameReferenceDef +destination EcucParamConfContainerDef

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

(from ICU)

CanTrcvDemEventParameterRefs : CANTRCV_E_BUS_ERROR : DemEventParameter :


+subContainer EcucParamConfContainerDef +reference EcucSymbolicNameReferenceDef +destination EcucParamConfContainerDef

lowerMultiplicity = 0 lowerMultiplicity = 0 upperMultiplicity = 65535


upperMultiplicity = 1 upperMultiplicity = 1 lowerMultiplicity = 1

(from Dem)

10.2.5 CanTrcvAccess
SWS Item ECUC_CanTrcv_00101 :
68 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Choice container Name CanTrcvAccess


Container gives CanTrcv Driver information about access to a single CAN
Description
transceiver.

Container Choices
Container Name Multiplicity Scope / Dependency
Container gives CAN transceiver driver information about ac-
cessing ports and port pins. In addition relation between CAN
transceiver hardware pin names and Dio port access infor-
CanTrcvDioAccess 0..1
mation is given.
If a CAN transceiver hardware has no Dio interface, there is no
instance of this container.
Container gives CAN transceiver driver information about ac-
CanTrcvSpiAccess 0..1 cessing Spi. If a CAN transceiver hardware has no Spi inter-
face, there is no instance of this container.

CanTrcvAccess : CanTrcvDioAccess : +parameter CanTrcvHardwareInterfaceName :


CanTrcvDioChannelAccess :
EcucChoiceContainerDef EcucParamConfContainerDef EcucParamConfContainerDef EcucStringParamDef

upperMultiplicity = 1 +choice +subContainer


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

+reference CanTrcvDioSymNameRef :
EcucChoiceReferenceDef

CanTrcvSpiSequence :
CanTrcvSpiSequenceName :
EcucParamConfContainerDef
+reference EcucSymbolicNameReferenceDef
CanTrcvSpiAccess :
+subContainer lowerMultiplicity = 1
+choice EcucParamConfContainerDef lowerMultiplicity = 0
upperMultiplicity = *
upperMultiplicity = *
lowerMultiplicity = 0
upperMultiplicity = 1 CanTrcvSpiAccessSynchronous :
+parameter EcucBooleanParamDef

defaultValue = false
lowerMultiplicity = 0
upperMultiplicity = 1

10.2.6 CanTrcvDioAccess
SWS Item ECUC_CanTrcv_00145 :
Container Name CanTrcvDioAccess
Container gives CAN transceiver driver information about accessing ports
and port pins. In addition relation between CAN transceiver hardware pin
Description names and Dio port access information is given.
If a CAN transceiver hardware has no Dio interface, there is no instance of
this container.
Configuration Parameters

Included Containers
Container Name Multiplicity Scope / Dependency
Container gives DIO channel access by single Can transceiver
CanTrcvDioChannelAccess 1..*
channel.

10.2.7 CanTrcvDioChannelAccess
SWS Item ECUC_CanTrcv_00157 :
Container Name CanTrcvDioChannelAccess
Description Container gives DIO channel access by single Can transceiver channel.
Configuration Parameters

SWS Item ECUC_CanTrcv_00150 :


Name CanTrcvHardwareInterfaceName
Parent Container CanTrcvDioChannelAccess
69 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Description CAN transceiver hardware interface name. It is typically the name of a pin.
From a Dio point of view it is either a port, a single channel or a channel
group. Depending on this fact either
CANTRCV_DIO_PORT_SYMBOLIC_NAME or
CANTRCV_DIO_CHANNEL_SYMBOLIC_NAME or
CANTRCV_DIO_CHANNEL_GROUP_SYMBOLIC_NAME
shall reference a Dio configuration.
The CAN transceiver driver implementation description shall list up this
name for the appropriate CAN transceiver hardware.
Multiplicity 1
Type EcucStringParamDef
Default value --
maxLength --
minLength --
regularExpression --
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00149 :


Name CanTrcvDioSymNameRef
Parent Container CanTrcvDioChannelAccess
Description Choice Reference to a DIO Port, DIO Channel or DIO Channel Group. This
reference replaces the CANTRCV_DIO_PORT_SYM_NAME,
CANTRCV_DIO_CHANNEL_SYM_NAME and
CANTRCV_DIO_GROUP_SYM_NAME references in the Can Trcv SWS.
Multiplicity 1
Type Choice reference to [ DioChannel , DioChannelGroup , DioPort ]
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency

No Included Containers

10.2.8 CanTrcvSpiAccess
SWS Item ECUC_CanTrcv_00183 :
Container Name CanTrcvSpiAccess
Container gives CAN transceiver driver information about accessing Spi. If
Description a CAN transceiver hardware has no Spi interface, there is no instance of
this container.
Configuration Parameters

Included Containers
Container Name Multiplicity Scope / Dependency
Container gives CAN transceiver driver information about one
SPI sequence.
One SPI sequence used by CAN transceiver driver is in exclu-
CanTrcvSpiSequence 1..* sive use for it. No other driver is allowed to access this se-
quence. CAN transceiver driver may use one sequence to ac-
cess n CAN transceiver hardwares chips of the same type or n
sequences are used to access one single CAN transceiver

70 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

hardware chip.
If a CAN transceiver hardware has no SPI interface, there is
no instance of this container.

10.2.9 CanTrcvSpiSequence
SWS Item ECUC_CanTrcv_00144 :
Container Name CanTrcvSpiSequence
Container gives CAN transceiver driver information about one SPI se-
quence.
One SPI sequence used by CAN transceiver driver is in exclusive use for
it. No other driver is allowed to access this sequence. CAN transceiver
Description driver may use one sequence to access n CAN transceiver hardwares
chips of the same type or n sequences are used to access one single CAN
transceiver hardware chip.
If a CAN transceiver hardware has no SPI interface, there is no instance of
this container.
Configuration Parameters

SWS Item ECUC_CanTrcv_00176 :


Name CanTrcvSpiAccessSynchronous
Parent Container CanTrcvSpiSequence
Description This parameter is used to define whether the access to the Spi sequence
is synchronous or asynchronous.
true: SPI access is synchronous.
false: SPI access is asynchronous.
Multiplicity 0..1
Type EcucBooleanParamDef
Default value false
Post-Build Variant Multi-
false
plicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00151 :


Name CanTrcvSpiSequenceName
Parent Container CanTrcvSpiSequence
Description Reference to a Spi sequence configuration container.
Multiplicity 0..*
Type Symbolic name reference to [ SpiSequence ]
Post-Build Variant Multi-
false
plicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: local
dependency: SpiSequence
71 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

No Included Containers

.
CanTrcvSpiSequence : SpiSequence :
CanTrcvSpiSequenceName :
EcucParamConfContainerDef +reference EcucSymbolicNameReferenceDef +destination EcucParamConfContainerDef

lowerMultiplicity = 1 lowerMultiplicity = 0 upperMultiplicity = *


upperMultiplicity = * upperMultiplicity = * lowerMultiplicity = 1

(from SPI)

DioChannelGroup :
CanTrcvDioChannelAccess : CanTrcvDioSymNameRef : +destination EcucParamConfContainerDef
EcucParamConfContainerDef EcucChoiceReferenceDef
+reference upperMultiplicity = *
lowerMultiplicity = 1
lowerMultiplicity = 0
upperMultiplicity = *
+subContainer (from DIO)

DioPort :EcucParamConfContainerDef
+destination
+subContainer
upperMultiplicity = *
lowerMultiplicity = 1

(from DIO)
CanTrcvDioAccess : +subContainer
EcucParamConfContainerDef
DioChannel :EcucParamConfContainerDef
upperMultiplicity = 1 +destination
lowerMultiplicity = 0 upperMultiplicity = *
lowerMultiplicity = 0

(from DIO)

10.2.10 CanTrcvDemEventParameterRefs
SWS Item ECUC_CanTrcv_00188 :
Container Name CanTrcvDemEventParameterRefs
Container for the references to DemEventParameter elements which shall
be invoked using the API Dem_SetEventStatus in case the corresponding
Description error occurs. The EventId is taken from the referenced DemEventParame-
ter's DemEventId symbolic value. The standardized errors are provided in
this container and can be extended by vendor-specific error references.
Configuration Parameters

SWS Item ECUC_CanTrcv_00189 :


Name CANTRCV_E_BUS_ERROR
Parent Container CanTrcvDemEventParameterRefs
Description Reference to the DemEventParameter which shall be issued when bus
error has occurred.
Multiplicity 0..1
Type Symbolic name reference to [ DemEventParameter ]
Post-Build Variant Multi-
false
plicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
72 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Post-build time --
Scope / Dependency scope: ECU
dependency: DEM

No Included Containers

10.2.11 CanTrcvPartialNetwork
SWS Item ECUC_CanTrcv_00161 :
Container Name CanTrcvPartialNetwork
Container gives CAN transceiver driver information about the configuration
Description
of Partial Networking functionality.
Configuration Parameters

SWS Item ECUC_CanTrcv_00169 :


Name CanTrcvBaudRate
Parent Container CanTrcvPartialNetwork
Description Indicates the data transfer rate in kbps.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 12000
Default value --
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
dependency: Although WUF with DLC=0 is technically possible, it is explic-
itly not wanted.

SWS Item ECUC_CanTrcv_00171 :


Name CanTrcvBusErrFlag
Parent Container CanTrcvPartialNetwork
Description Indicates if the Bus Error (BUSERR) flag is managed by the BSW. This
flag is set if a bus failure is detected by the transceiver.
TRUE = Supported by transceiver and managed by BSW.
FALSE = Not managed by BSW.
Multiplicity 1
Type EcucBooleanParamDef
Default value false
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00164 :


Name CanTrcvPnCanIdIsExtended
Parent Container CanTrcvPartialNetwork
Description Indicates whether extended or standard ID is used.
TRUE = Extended Can identifier is used.
FALSE = Standard Can identifier is used
Multiplicity 1
Type EcucBooleanParamDef
Default value false

73 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Post-Build Variant Value true


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

SWS Item ECUC_CanTrcv_00172 :


Name CanTrcvPnEnabled
Parent Container CanTrcvPartialNetwork
Description Indicates whether the selective wake-up function is enabled or disabled in
HW.
TRUE = Selective wakeup feature is enabled in the transceiver hardware
FALSE = Selective wakeup feature is disabled in the transceiver hardware
Multiplicity 1
Type EcucBooleanParamDef
Default value false
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00163 :


Name CanTrcvPnFrameCanId
Parent Container CanTrcvPartialNetwork
Description CAN ID of the Wake-up Frame (WUF).
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 4294967295
Default value --
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00162 :


Name CanTrcvPnFrameCanIdMask
Parent Container CanTrcvPartialNetwork
Description ID Mask for the selective activation of the transceiver. It is used to enable-
Frame Wake-up (WUF) on a group of IDs.
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 4294967295
Default value --
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00168 :


Name CanTrcvPnFrameDlc
Parent Container CanTrcvPartialNetwork
Description Data Length of the Wake-up Frame (WUF).
Multiplicity 1

74 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

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

SWS Item ECUC_CanTrcv_00170 :


Name CanTrcvPowerOnFlag
Parent Container CanTrcvPartialNetwork
Description Description: Indicates if the Power On Reset (POR) flag is available and is
managed by the transceiver.
TRUE = Supported by Hardware.
FALSE = Not supported by Hardware
Multiplicity 1
Type EcucBooleanParamDef
Default value false
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

Included Containers
Container Name Multiplicity Scope / Dependency
Defines data payload mask to be used on the received
CanTrcvPnFrameData-
0..8 payload in order to determine if the transceiver must be
MaskSpec
woken up by the received Wake-up Frame (WUF).

75 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

CanTrcvPartialNetwork : CanTrcvPnFrameCanIdMask :
EcucParamConfContainerDef +parameter EcucIntegerParamDef

lowerMultiplicity = 0 min = 0
upperMultiplicity = 1 max = 4294967295

CanTrcvPnFrameCanId :
+parameter EcucIntegerParamDef

min = 0
max = 4294967295

CanTrcvPnCanIdIsExtended :
+parameter EcucBooleanParamDef

defaultValue = false

CanTrcvPnFrameDataMaskSpec : CanTrcvPnFrameDataMask :
EcucParamConfContainerDef +parameter EcucIntegerParamDef

lowerMultiplicity = 0 min = 0
+subContainer upperMultiplicity = 8 max = 255

+parameter CanTrcvPnFrameDataMaskIndex :
EcucIntegerParamDef

min = 0
max = 7

CanTrcvPnFrameDlc :
+parameter EcucIntegerParamDef

min = 0
max = 8

CanTrcvBaudRate :EcucIntegerParamDef
+parameter
min = 0
max = 12000

CanTrcvPowerOnFlag :
+parameter EcucBooleanParamDef

defaultValue = false

CanTrcvBusErrFlag :
+parameter EcucBooleanParamDef

defaultValue = false

CanTrcvPnEnabled :
+parameter EcucBooleanParamDef

defaultValue = false

10.2.12 CanTrcvPnFrameDataMaskSpec
SWS Item ECUC_CanTrcv_00165 :
Container Name CanTrcvPnFrameDataMaskSpec
Defines data payload mask to be used on the received payload in order to
Description determine if the transceiver must be woken up by the received Wake-up
Frame (WUF).
Configuration Parameters

SWS Item ECUC_CanTrcv_00166 :


Name CanTrcvPnFrameDataMask
76 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver
- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

Parent Container CanTrcvPnFrameDataMaskSpec


Description Defines the n byte (Byte0 = LSB) of the data payload mask to be used on
the received payload in order to determine if the transceiver must be wok-
en up by the received Wake-up Frame (WUF).
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 255
Default value --
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

SWS Item ECUC_CanTrcv_00167 :


Name CanTrcvPnFrameDataMaskIndex
Parent Container CanTrcvPnFrameDataMaskSpec
Description holds the position n in frame of the mask-part
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 7
Default value --
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local

No Included Containers

10.3 Published Information


For details refer to the chapter 10.3 “Published Information” in SWS_BSWGeneral

77 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -
Specification of CAN Transceiver Driver
AUTOSAR CP Release 4.3.1

11 Not applicable requirements


[SWS_CanTrcv_00999] ⌈ These requirements are not applicable to this specifica-
tion. ⌋ (SRS_BSW_00304, SRS_BSW_00305, SRS_BSW_00306,
SRS_BSW_00307, SRS_BSW_00308, SRS_BSW_00309, SRS_BSW_00312,
SRS_BSW_00321, SRS_BSW_00325, SRS_BSW_00328, SRS_BSW_00330,
SRS_BSW_00333, SRS_BSW_00334, SRS_BSW_00336, SRS_BSW_00341,
SRS_BSW_00342, SRS_BSW_00344, SRS_BSW_00359, SRS_BSW_00360,
SRS_BSW_00378, SRS_BSW_00383, SRS_BSW_00384, SRS_BSW_00398,
SRS_BSW_00399, SRS_BSW_00400, SRS_BSW_00401, SRS_BSW_00404,
SRS_BSW_00405, SRS_BSW_00410, SRS_BSW_00416, SRS_BSW_00417,
SRS_BSW_00422, SRS_BSW_00423, SRS_BSW_00426, SRS_BSW_00427,
SRS_BSW_00429, SRS_BSW_00432, SRS_BSW_00433, SRS_BSW_00005,
SRS_BSW_00006, SRS_BSW_00007, SRS_BSW_00009, SRS_BSW_00010,
SRS_BSW_00161, SRS_BSW_00164, SRS_BSW_00168, SRS_Can_01107,
SRS_Can_01138)

78 of 78 Document ID 071: AUTOSAR_SWS_CANTransceiverDriver


- AUTOSAR confidential -

You might also like