Autosar Sws Candriver
Autosar Sws Candriver
Autosar Sws Candriver
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN 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.
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Table of Content
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
“If only a single transmit buffer is used inner priority inversion may occur. Because of
low priority a message stored in the buffer waits until the ”traffic on the bus calms
down”. During the waiting time this message could prevent a message of higher
priority generated by the same microcontroller from being transmitted over the bus.”1
1
Picture and text by CiA (CAN in Automation)
16 of 110 Document ID 011: AUTOSAR_SWS_CANDriver
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
“The problem of outer priority inversion may occur in some CAN implementations. Let
us assume that a CAN node wishes to transmit a package of consecutive messages
with high priority, which are stored in different message buffers. If the interframe
space between these messages on the CAN network is longer than the minimum
space defined by the CAN standard, a second node is able to start the transmission
of a lower priority message. The minimum interframe space is determined by the
Intermission field, which consists of 3 recessive bits. A message, pending during the
transmission of another message, is started during the Bus Idle period, at the earliest
in the bit following the Intermission field. The exception is that a node with a waiting
transmission message will interpret a dominant bit at the third bit of Intermission as
Start-of-Frame bit and starts transmission with the first identifier bit without first
transmitting an SOF bit. The internal processing time of a CAN module has to be
short enough to send out consecutive messages with the minimum interframe space
to avoid the outer priority inversion under all the scenarios mentioned.”2
2
Text and image by CiA (CAN in Automation)
17 of 110 Document ID 011: AUTOSAR_SWS_CANDriver
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
CAN Controller A
Tx A CAN
CAN
Transceiver Physical Channel A
Rx A Bus A
A
Message Object
Mailbox A
CAN Controller B
Tx B CAN
Transceiver CAN Physical Channel B
Rx B B Bus B
Message Object
Mailbox B
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
3 Related documentation
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Thus, the specification SWS BSW General shall be considered as additional and
required specification for CAN Driver.
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
4.1 Limitations
A CAN controller always corresponds to one physical channel. It is allowed to
connect physical channels on bus side. Regardless the CanIf module will treat the
concerned CAN controllers separately.
A few CAN hardware units support the possibility to combine several CAN controllers
by using the CAN RAM, to extend the number of message objects for one CAN
controller. These combined CAN controller are handled as one controller by the Can
module.
The Can module does not support CAN remote frames.
[SWS_Can_00237] ⌈ The Can module shall not transmit messages triggered by
remote transmission requests.⌋ (SRS_Can_01147)
[SWS_Can_00236] ⌈ The Can module shall initialize the CAN HW to ignore any
remote transmission requests.⌋ (SRS_Can_01147)
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
3
In this case the CAN driver is not any more part of the µC abstraction layer but put part of the ECU
abstraction layer. Therefore it is (theoretically) allowed to use any µC abstraction layer driver it needs.
22 of 110 Document ID 011: AUTOSAR_SWS_CANDriver
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
[SWS_Can_00034] ⌈
[SWS_Can_00388] ⌈ The header file Can.h shall include the header file
ComStack_Types.h.⌋ ()
24 of 110 Document ID 011: AUTOSAR_SWS_CANDriver
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
[SWS_Can_00035] ⌈
The Can module does not provide callback functions (no Can_Cbk.h, see also
SWS_Can_00244) ⌋ ()
[SWS_Can_00390] ⌈ The Can module shall include the header file EcuM_Cbk.h, in
which the callback functions called by the Can module at the Ecu State Manager
module are declared.⌋ ()
[SWS_Can_00391] ⌈ Can module implementations for off-chip CAN controllers shall
include the header file Spi.h. By this inclusion, the APIs to access an external CAN
controller by the SPI module [11] are included.⌋ ()
[SWS_Can_00397] ⌈ The Can module shall include the header file Os.h file. By this
inclusion, the API to read a OsCounter value (GetCounterValue) provided by the
system service shall be included.⌋ ()
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
6 Requirements traceability
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
initialization
SRS_Can_01147 The CAN Driver shall not support remote SWS_Can_00236,
frames SWS_Can_00237
SRS_Can_01160 Padding of bytes due to discrete CAN FD SWS_CAN_00502
DLC
SRS_Can_01162 The CAN Interface shall support classic SWS_CAN_00501
CAN and CAN FD frames
SRS_Can_01166 The CAN Driver shall implement an noname, SWS_Can_91002,
interface for de-initialization SWS_Can_91010
SRS_CAN_01167 - SWS_Can_91008
SRS_SPAL_00157 All drivers and handlers of the AUTOSAR SWS_Can_00026,
Basic Software shall implement notification SWS_Can_00031,
mechanisms of drivers and handlers SWS_Can_00108,
SWS_Can_00112
SRS_SPAL_12056 All driver modules shall allow the static SWS_Can_00235
configuration of notification mechanism
SRS_SPAL_12057 All driver modules shall implement an SWS_Can_00245,
interface for initialization SWS_Can_00246
SRS_SPAL_12063 All driver modules shall only support raw SWS_Can_00059,
value mode SWS_Can_00060
SRS_SPAL_12064 All driver modules shall raise an error if the SWS_Can_00999
change of the operation mode leads to
degradation of running operations
SRS_SPAL_12067 All driver modules shall set their wake-up SWS_Can_00257
conditions depending on the selected
operation mode
SRS_SPAL_12068 The modules of the MCAL shall be initialized SWS_Can_00999
in a defined sequence
SRS_SPAL_12069 All drivers of the SPAL that wake up from a SWS_Can_00271,
wake-up interrupt shall report the wake-up SWS_Can_00364
reason
SRS_SPAL_12075 All drivers with random streaming SWS_Can_00011
capabilities shall use application buffers
SRS_SPAL_12077 All drivers shall provide a non blocking SWS_Can_00372
implementation
SRS_SPAL_12092 The driver's API shall be accessed by its SWS_Can_00058
handler or manager
SRS_SPAL_12125 All driver modules shall only initialize the SWS_Can_00053
configured resources
SRS_SPAL_12129 The ISRs shall be responsible for resetting SWS_Can_00033
the interrupt flags and calling the according
notification function
SRS_SPAL_12163 All driver modules shall implement an SWS_Can_00999
interface for de-initialization
SRS_SPAL_12169 All driver modules that provide different SWS_Can_00017
operation modes shall provide a service for
mode selection
SRS_SPAL_12263 The implementation of all driver modules SWS_Can_00021
31 of 110 Document ID 011: AUTOSAR_SWS_CANDriver
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
7 Functional specification
On L-PDU transmission, the Can module writes the L-PDU in an appropriate buffer
inside the CAN controller hardware.
See chapter 7.5 for closer description of L-PDU transmission.
On L-PDU reception, the Can module calls the RX indication callback function with
ID, Data Length and pointer to L-SDU as parameter.
See chapter 7.6 for closer description of L-PDU reception.
The Can module provides an interface that serves as periodical processing function,
and which must be called by the Basic Software Scheduler module periodically.
Furthermore, the Can module provides services to control the state of the CAN
controllers. Bus-off and Wake-up events are notified by means of callback functions.
The Can module is a Basic Software Module that accesses hardware resources.
Therefore, it is designed to fulfill the requirements for Basic Software Modules
specified in AUTOSAR_SRS_SPAL (see [3]).
[SWS_Can_00033] ⌈ The Can module shall implement the interrupt service routines
for all CAN Hardware Unit interrupts that are needed. ⌋ (SRS_BSW_00164,
SRS_SPAL_12129)
[SWS_Can_00419] ⌈ The Can module shall disable all unused interrupts in the CAN
controller.⌋ ()
[SWS_Can_00420] ⌈ The Can module shall reset the interrupt flag at the end of the
ISR (if not done automatically by hardware). ⌋ ()
Implementation hint: The Can module shall not set the configuration (i.e. priority) of
the vector table entry.
[SWS_Can_00079] ⌈ The Can module shall fulfill all design and implementation
guidelines described in [2].⌋ (SRS_BSW_00007, SRS_BSW_00306,
SRS_BSW_00308, SRS_BSW_00309, SRS_BSW_00330)
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
CAN_UNINIT
Initial
Can_Init() Can_DeInit()
CAN_READY
Figure 7-1
[SWS_Can_00246] ⌈ The function Can_Init shall change the module state to
CAN_READY, after initializing all controllers inside the HW
Unit.⌋ (SRS_SPAL_12057, SRS_Can_01041)
[SWS_Can_00245] ⌈ The function Can_Init shall initialize all CAN controllers
according to their configuration.⌋ (SRS_SPAL_12057, SRS_Can_01041)
Each CAN controller must then be started separately by calling the function
Can_SetControllerMode(CAN_CS_STARTED).
Implementation hint:
Hardware register settings that have impact on all CAN controllers inside the HW
Unit can only be set in the function Can_Init.
Implementation hint:
The ECU State Manager module shall call Can_Init at most once during runtime.
[SWS_Can_ 91009] ⌈The function Can_DeInit shall change the module state to
CAN_UNINIT before de-initializing all controllers inside the HW unit⌋(
SRS_Can_01166) Refer to [SWS_Can_91010]
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
These events are indicated either by an interrupt or by a status bit that is polled in the
Can_MainFunction_BusOff or Can_MainFunction_Wakeup.
The Can module does the register settings that are necessary to fulfill the required
behavior (i.e. no hardware recovery in case of bus off).
Then it notifies the CanIf module with the corresponding callback function. The
software state is then changed inside this callback function.
In case development errors are enabled and there is a not allowed transition
requested by the upper layer, the Can module shall rise the development error
CAN_E_TRANSITION.
The Can module does not check the actual state before it performs Can_Write or
raises callbacks.
This chapter describes the required hardware behavior for the different controller
states.
The CAN controller is not initialized. All registers belonging to the CAN module are in
reset state, CAN interrupts are disabled. The CAN Controller is not participating on
the CAN bus.
In this state the CAN Controller is initialized but does not participate on the bus. In
addition, error frames and acknowledges must not be sent.
(Example: For many controllers entering an ‘initialization’-mode causes the controller
to be stopped.)
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
The hardware settings only differ from state STOPPED for CAN hardware that
support a sleep mode (wake-up over CAN bus directly supported by CAN hardware).
[SWS_Can_00258] ⌈ When the CAN hardware does not support sleep mode and is
triggered to transition into SLEEP state, the Can module shall emulate a logical
SLEEP state from which it returns only, when it is triggered by software to transition
into STOPPED state.⌋ ()
[SWS_Can_00404] ⌈ The CAN hardware shall remain in state STOPPED, while the
logical SLEEP state is active.⌋ ()
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
PowerOff
PowerON reset
UNINIT
Can_DeInit()
Can_DeInit()
STOPPED SLEEP
STARTED
Figure 7-2
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
The software can trigger a CAN controller state transition with the function
Can_SetControllerMode. Depending on the CAN hardware, a change of a register
setting to transition to a new CAN controller state may take over only after a delay.
The Can module notifies the upper layer (CanIf_ControllerModeIndication) after a
successful state transition about the new state. The monitoring whether the
requested state is achieved is part of an upper layer module and is not part of the
Can module.
[SWS_Can_00370] ⌈ The function Can_Mainfunction_Mode shall poll a flag of the
CAN status register until the flag signals that the change takes effect and notify the
upper layer with function CanIf_ControllerModeIndication about a successful state
transition referring to the corresponding CAN controller with the abstract CanIf
ControllerId.⌋ ()
[SWS_Can_00398] ⌈ The function Can_SetControllerMode shall use the system
service GetCounterValue for timeout monitoring to avoid blocking functions.⌋ ()
[SWS_Can_00372] ⌈ In case the flag signals that the change takes no effect and the
maximum time CanTimeoutDuration is elapsed, the function
Can_SetControllerMode shall be left and the function Can_Mainfunction_Mode shall
continue to poll the flag.⌋ (SRS_SPAL_12077)
[SWS_Can_00373] ⌈ The function Can_Mainfunction_Mode shall call the function
CanIf_ControllerModeIndication to notify the upper layer about a successful state
transition of the corresponding CAN controller referred by abstract CanIf ControllerId,
in case the state transition was triggered by function Can_SetControllerMode.⌋ ()
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
STOPPED STARTED
software triggered
STARTED STOPPED
SLEEP STOPPED
software triggered
STOPPED SLEEP
software triggered
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
This state transition will only occur when sleep mode is supported by hardware.
[SWS_Can_00270] ⌈ On hardware wakeup (triggered by a wake-up event from CAN
bus), the CAN controller shall transition into the state STOPPED.⌋ ()
[SWS_Can_00271] ⌈ On hardware wakeup (triggered by a wake-up event from CAN
bus), the Can module shall call the function EcuM_CheckWakeup either in interrupt
context or in the context of Can_MainFunction_Wakeup.⌋ (SRS_BSW_00375,
SRS_SPAL_12069, SRS_Can_01054)
[SWS_Can_00269] ⌈ The Can module shall not further process the L-PDU that
caused a wake-up.⌋ ()
[SWS_Can_00048] ⌈ In case of a CAN bus wake-up during sleep transition, the
function Can_SetControllerMode(CAN_CS_STOPPED) shall return
E_NOT_OK.⌋ (SRS_Can_01122)
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- STOPPED -> UNINIT; SLEEP -> UNINIT (for all controllers in HW unit)
- software triggered by the function call Can_DeInit
- prepares all CAN controllers inside HW Unit to be re-configured
[SWS_Can_91010] ⌈The function Can_DeInit shall set all CAN controllers in the
state UNINIT⌋(SRS_Can_01166, SRS_Can_01053)
When the function Can_DeInit is entered and the Can module is not in state
CAN_READY or any of the CAN controllers is in state STARTED, it shall raise the
error CAN_E_TRANSITION (Refer to [SWS_Can_91011] and [SWS_Can_91012]).
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Figure 7-3: Example of assignment of HTHs and HRHs to the Hardware Objects. The numbering
of HTHs and HRHs are implementation specific. The chosen numbering is only an example.
[SWS_Can_00277] ⌈ The Can module shall allow that the functionality “Multiplexed
Transmission” is statically configurable (ON | OFF) at pre-compile
time.⌋ (SRS_Can_01134)
[SWS_Can_00401] ⌈ Several transmit hardware objects (defined by
"CanHwObjectCount") shall be assigned by one HTH to represent one transmit
entity to the upper layer.⌋ (SRS_Can_01134)
[SWS_Can_00402] ⌈ The Can module shall support multiplexed transmission
mechanisms for devices where either
Multiple transmit hardware objects, which are grouped to a transmit entity can be
filled over the same register set, and the microcontroller stores the L-PDU into a
free buffer autonomously,
or
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Figure 7-4: Example of assignment of HTHs and HRHs to the Hardware Objects with
multiplexed transmission. The numbering of HTHs and HRHs are implementation specific. The
chosen numbering is only an example.
[SWS_Can_00011] ⌈ The Can module shall directly copy the data from the upper
layer buffers. It is the responsibility of the upper layer to keep the buffer consistent
until return of function call (Can_Write).⌋ (SRS_SPAL_12075, SRS_Can_01059)
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Figure 7-5: Example of assignment of same HRHs to multiple Hardware Objects The chosen
numbering is only an example.
[SWS_Can_00299] ⌈ The Can module shall copy the L-SDU in a shadow buffer
after reception, if the RX buffer cannot be protected (locked) by CAN Hardware
against overwriting by a newly received message.⌋ ()
[SWS_Can_00300] ⌈ The Can module shall copy the L-SDU in a shadow buffer, if
the CAN Hardware is not globally accessible.⌋ ()
The complete RX processing (including copying to destination layer, e.g. COM) is
done in the context of the RX interrupt or in the context of the
Can_MainFunction_Read.
[SWS_Can_00012] ⌈ The Can module shall guarantee that neither the ISRs nor the
function Can_MainFunction_Read can be interrupted by itself. The CAN hardware (or
shadow) buffer is always consistent, because it is written and read in sequence in
exactly one function that is never interrupted by itself.⌋ (SRS_Can_01059)
If the CAN hardware cannot be configured to lock the RX hardware object after
reception (hardware feature), it could happen that the hardware buffer is overwritten
by a newly arrived message. In this case, the CAN controller detects an “overwrite”
event, if supported by hardware.
If the CAN hardware can be configured to lock the RX hardware object after
reception, it could happen that the newly arrived message cannot be stored to the
hardware buffer. In this case, the CAN controller detects an “overrun” event, if
supported by hardware.
[SWS_Can_00395] ⌈ Can module shall raise the runtime error CAN_E_DATALOST
in case of “overwrite” or “overrun” event detection.⌋ ()
Implementation Hint:
The system designer shall assure that the runtime for message reception (interrupt
driven or polling) correlates with the fasted possible reception in the system.
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Transmit requests are simply forwarded by the CanIf module inside the function
CanIf_Transmit.
The function CanIf_Transmit is re-entrant. Therefore the function Can_Write needs to
be implemented thread-safe (for example by using mutexes):
Further (preemptive) calls will return with CAN_BUSY when the write can’t be
performed re-entrant. (example: write to different hardware TX Handles allowed,
write to same TX Handles not allowed)
In case of CAN_BUSY the CanIf module queues that request. (same behavior as if
all hardware objects are busy).
Can_EnableCanInterrupts and Can_DisableCanInterrupts may be called inside re-
entrant functions. Therefore these functions also need to be reentrant.
All other services don’t need to be implemented as reentrant functions.
The CAN main functions (i.e. Can_MainFunction_Read) shall not be interrupted by
themselves. Therefore these CAN main functions are not reentrant.
(a) ICOM Software implementation: (b) ICOM is a functional hardware (c) ICOM is a separate hardware
ICOM features are exclusively extension of the existing component with its own Communication
implemented in software, reusing Communication Controller Controller
the existing Communication
Controller
Figure 7-6: Possible ICOM implementations
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
The use of Intelligent Communication Controllers (ICOM) supports those features (no
specific hardware implementation mandatory). If some or all of the functionality of an
ECU is temporarily not required, e.g., based on the vehicle state, the ECU can enter
a “Pretended Networking” mode. In this mode, the MCU and/or peripherals are
switched into a low-power mode. Only the ICOM and the connected transceivers stay
active. The ICOM generates a wakeup event, caused by, e.g. a received bus
message, when the ECU needs to resume operation.
Depending on the ICOM implementation, message ID and payload of received
messages may either be evaluated and filtered completely in hardware, require a
callback mechanism in software. As shown in Figure 7-6, the ECU implementation
can be divided into three possible variants – Approach (a) software approach, without
specific hardware to support Pretended Networking. Approach (b) depicts a
functional hardware extension of a communication controller and approach (c) shows
a hardware variant with a 2nd extended communication controller for wakeup
handling. All variants and ICOM implementations shall be supported by Pretended
Networking.
Furthermore, Pretended Networking aims at reducing wakeup response time, i.e., the
time between a wakeup event and valid behavior of an ECU. By using the ICOM to
save relevant messages during activated Pretended Networking mode, the
application has access to the last valid signal values directly after resuming
operation. Therefore, the ECU can immediately respond to a user request after
wakeup and does not have to wait until the according message is received again.
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
[SWS_Can_00026] ⌈ The Can module shall indicate errors that are caused by
erroneous usage of the Can module API. This covers API parameter checks and call
sequence errors. ⌋ (SRS_BSW_00337, SRS_BSW_00323, SRS_SPAL_00157)
[SWS_Can_00091] ⌈ After return of the DET the Can module’s function that raised
the development error shall return immediately.⌋ (SRS_SPAL_12448)
[SWS_Can_00089] ⌈ The Can module’s environment shall indicate development
errors only in the return values of a function of the Can module when DET is
switched on and the function provides a return value. The returned value is
E_NOT_OK. ⌋ (SRS_BSW_00369, SRS_BSW_00386, SRS_SPAL_12448)
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
⌋()
⌋()
The Can module does not call the Diagnostic Event Manager, because there is no
production error code defined for the Can module.
CAN_BUSY is reported via return value of the function Can_Write. The CanIf module
reacts according the sequence diagrams specified for the CanIf module.E_NOT_OK
is reported via return value in case of a wakeup during transition to sleep mode.Bus-
off and Wake-up events are forwarded via notification callback functions.
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
8 API specification
The prefix of the function names may be changed in an implementation with several
Can modules as described in SWS_Can_00284.
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
8.2.1 Can_ConfigType
[SWS_Can_00413] ⌈
Name: Can_ConfigType
Type: Structure
Range: Implementation specific.
Description: This is the type of the external data structure containing the overall initialization
data for the CAN driver and SFR settings affecting all controllers. Furthermore it
contains pointers to controller configuration structures. The contents of the
initialization data structure are CAN hardware specific.
⌋ ()
8.2.2 Can_PduType
[SWS_Can_00415] ⌈
Name: Can_PduType
Type: Structure
Element: PduIdType swPduHandle --
uint8 length --
Can_IdType id --
uint8* sdu --
Description: This type unites PduId (swPduHandle), SduLength (length), SduData (sdu), and
CanId (id) for any CAN L-SDU.
⌋ ()
8.2.3 Can_IdType
[SWS_Can_00416] ⌈
Name: Can_IdType
Type: uint32
Range: Standard32Bit -- 0..0x400007FF
Extended32Bit -- 0..0xDFFFFFFF
Description: Represents the Identifier of an L-PDU. The two most significant bits specify the
frame type:
00 CAN message with Standard CAN ID
01 CAN FD frame with Standard CAN ID
10 CAN message with Extended CAN ID
55 of 110 Document ID 011: AUTOSAR_SWS_CANDriver
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
8.2.4 Can_HwHandleType
[SWS_Can_00429] ⌈
Name: Can_HwHandleType
Type: uint8, uint16
Range: Standard -- 0..0x0FF
Extended -- 0..0xFFFF
Description: Represents the hardware object handles of a CAN hardware unit. For CAN
hardware units with more than 255 HW objects use extended range.
⌋ ()
8.2.5 Can_HwType
[SWS_CAN_00496] ⌈
Name: Can_HwType
Type: Structure
Element: Can_IdType CanId Standard/Extended CAN ID of CAN L-
PDU
Can_HwHandleType Hoh ID of the corresponding Hardware
Object Range
uint8 ControllerId ControllerId provided by CanIf clearly
identify the corresponding controller
Description: This type defines a data structure which clearly provides an Hardware Object
Handle including its corresponding CAN Controller and therefore CanDrv as well
as the specific CanId.
⌋ ()
8.2.6 Can_ReturnType
[SWS_Can_00039] ⌈
Range: CAN_BUSY 0x02 transmit request could not be processed because no
transmit object was available
Description: Overlayed return value of Std_ReturnType for CAN driver API Can_Write()
⌋ (SRS_BSW_00331)
8.2.7 Can_ErrorStateType
[SWS_Can_91003] ⌈
Name: Can_ErrorStateType
Type: Enumeration
Range: CAN_ERRORSTATE_ACTIVE -- The CAN controller takes fully part in communication.
CAN_ERRORSTATE_PASSIVE -- The CAN controller takes part in communication, but
does not send active error frames.
CAN_ERRORSTATE_BUSOFF -- The CAN controller does not take part in
56 of 110 Document ID 011: AUTOSAR_SWS_CANDriver
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
communication.
Description: Error states of a CAN controller.
⌋ ()
8.2.8 Can_ControllerStateType
[SWS_Can_91013] ⌈
Name: Can_ControllerStateType
Type: Enumeration
Range: CAN_CS_UNINIT 0x00 CAN controller state UNINIT.
CAN_CS_STARTED 0x01 CAN controller state STARTED.
CAN_CS_STOPPED 0x02 CAN controller state STOPPED.
CAN_CS_SLEEP 0x03 CAN controller state SLEEP.
Description: States that are used by the several ControllerMode functions.
⌋ ()
8.3.1.1 Can_Init
[SWS_Can_00223] ⌈
Service name: Can_Init
Syntax: void Can_Init(
const Can_ConfigType* Config
)
Service ID[hex]: 0x00
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): Config Pointer to driver configuration.
Parameters None
(inout):
Parameters (out): None
Return value: None
Description: This function initializes the module.
⌋ (SRS_BSW_00358, SRS_BSW_00414)
Symbolic names of the available configuration sets are provided by the configuration
description of the Can module. See chapter 10 about configuration description.
[SWS_Can_00174] ⌈ If development error detection for the Can module is enabled:
The function Can_Init shall raise the error CAN_E_TRANSITION if the driver is not in
state CAN_UNINIT.⌋ ()
57 of 110 Document ID 011: AUTOSAR_SWS_CANDriver
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
8.3.1.2 Can_GetVersionInfo
[SWS_Can_00224] ⌈
Service name: Can_GetVersionInfo
Syntax: void Can_GetVersionInfo(
Std_VersionInfoType* versioninfo
)
Service ID[hex]: 0x07
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): None
Parameters None
(inout):
Parameters (out): versioninfo Pointer to where to store the version information of this module.
Return value: None
Description: This function returns the version information of this module.
⌋ ()
8.3.1.3 Can_DeInit
[SWS_Can_91002] ⌈
Service name: Can_DeInit
Syntax: void Can_DeInit(
void
)
Service ID[hex]: 0x10
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): None
Parameters None
(inout):
Parameters (out): None
Return value: None
Description: This function de-initializes the module.
⌋ (SRS_Can_01166, SRS_BSW_00336)
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Caveat: Caller of the Can_DeInit function has to be sure no CAN controller is in the
state STARTED
[SWS_Can_91011] ⌈If development error detection for the Can module is enabled:
The function Can_DeInit shall raise the error CAN_E_TRANSITION if the driver is not
in state CAN_READY.⌋(SRS_BSW_00369)
[SWS_Can_91012] ⌈If development error detection for the Can module is enabled:
The function Can_DeInit shall raise the error CAN_E_TRANSITION if any of the CAN
controllers is in state STARTED.⌋(SRS_BSW_00369)
8.3.2.1 Can_SetBaudrate
[SWS_CAN_00491] ⌈
Service name: Can_SetBaudrate
Syntax: Std_ReturnType Can_SetBaudrate(
uint8 Controller,
uint16 BaudRateConfigID
)
Service ID[hex]: 0x0f
Sync/Async: Synchronous
Reentrancy: Reentrant for different Controllers. Non reentrant for the same Controller.
Controller CAN controller, whose baud rate shall be set
Parameters (in): BaudRateConfigID references a baud rate configuration by ID (see
CanControllerBaudRateConfigID)
Parameters None
(inout):
Parameters (out): None
Std_ReturnType E_OK: Service request accepted, setting of (new) baud rate
Return value: started
E_NOT_OK: Service request not accepted
Description: This service shall set the baud rate configuration of the CAN controller. Depending
on necessary baud rate modifications the controller might have to reset.
⌋ ()
There might be several baud rate configurations available. The function
Can_SetBaudrate can be used to switch between different configurations.
Depending on the old and new baud rate configuration only a subset of
parameters may be changed during runtime and a re-initialization of the CAN
Controller might be avoidable.
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
The function Can_SetBaudrate shall raise the error CAN_E_UNINIT and return
E_NOT_OK if the driver is not yet initialized.⌋ ()
[SWS_CAN_00500]⌈ If the requested baud rate change can not performed without
a re-initialization of the CAN Controller E_NO_OK shall be returned.⌋ ()
8.3.2.2 Can_SetControllerMode
[SWS_Can_00230] ⌈
Service name: Can_SetControllerMode
Syntax: Std_ReturnType Can_SetControllerMode(
uint8 Controller,
Can_ControllerStateType Transition
)
Service ID[hex]: 0x03
Sync/Async: Asynchronous
Reentrancy: Non Reentrant
Controller CAN controller for which the status shall be changed
Parameters (in):
Transition Transition value to request new CAN controller state
Parameters None
(inout):
Parameters (out): None
Std_ReturnType E_OK: request accepted
Return value:
E_NOT_OK: request not accepted, a development error
occurred
Description: This function performs software triggered state transitions of the CAN controller
State machine.
⌋ ()
[SWS_Can_00017] ⌈ The function Can_SetControllerMode shall perform software
triggered state transitions of the CAN controller State machine. See also
[SRS_SPAL_12169]⌋ (SRS_SPAL_12169, SRS_Can_01053)
[SWS_Can_00384] ⌈ Each time the CAN controller state machine is triggered with
the state transition value CAN_CS_STARTED, the function Can_SetControllerMode
shall re-initialize the CAN controller with the same controller configuration set
previously used by functions Can_SetBaudrate or Can_Init.⌋ ()
Refer to SWS_Can_00048 for the case of a wakeup event from CAN bus occurred
during sleep transition.
[SWS_Can_00294] ⌈ The function Can_SetControllerMode shall disable the wake-
up interrupt, while checking the wake-up status. ⌋ ()
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
8.3.2.3 Can_DisableControllerInterrupts
[SWS_Can_00231] ⌈
Service name: Can_DisableControllerInterrupts
Syntax: void Can_DisableControllerInterrupts(
uint8 Controller
)
Service ID[hex]: 0x04
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): Controller CAN controller for which interrupts shall be disabled.
Parameters None
(inout):
Parameters (out): None
Return value: None
Description: This function disables all interrupts for this CAN controller.
⌋ (SRS_BSW_00312)
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
8.3.2.4 Can_EnableControllerInterrupts
[SWS_Can_00232] ⌈
Service name: Can_EnableControllerInterrupts
Syntax: void Can_EnableControllerInterrupts(
uint8 Controller
)
Service ID[hex]: 0x05
Sync/Async: Synchronous
Reentrancy: Reentrant
Parameters (in): Controller CAN controller for which interrupts shall be re-enabled
Parameters None
(inout):
Parameters (out): None
Return value: None
Description: This function enables all allowed interrupts.
⌋ (SRS_BSW_00312)
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
8.3.2.5 Can_CheckWakeup
[SWS_Can_00360] ⌈
Service name: Can_CheckWakeup
Syntax: Std_ReturnType Can_CheckWakeup(
uint8 Controller
)
Service ID[hex]: 0x0b
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): Controller Controller to be checked for a wakeup.
Parameters None
(inout):
Parameters (out): None
Std_ReturnType E_OK: API call has been accepted
Return value:
E_NOT_OK: API call has not been accepted
Description: This function checks if a wakeup has occurred for the given controller.
⌋ ()
[SWS_Can_00361] ⌈ The function Can_CheckWakeup shall check if the requested
CAN controller has detected a wakeup. If a wakeup event was successfully detected,
reporting shall be done to EcuM via API EcuM_SetWakeupEvent.⌋ ()
8.3.2.6 Can_GetControllerErrorState
[SWS_Can_91004] ⌈
Service name: Can_GetControllerErrorState
Syntax: Std_ReturnType Can_GetControllerErrorState(
uint8 ControllerId,
Can_ErrorStateType* ErrorStatePtr
)
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
8.3.2.7 Can_GetControllerMode
[SWS_Can_91014] ⌈
Service name: Can_GetControllerMode
Syntax: Std_ReturnType Can_GetControllerMode(
uint8 Controller,
Can_ControllerStateType* ControllerModePtr
)
Service ID[hex]: 0x12
Sync/Async: Synchronous
Reentrancy: Non Reentrant
Parameters (in): Controller CAN controller for which the status shall be requested.
Parameters None
(inout):
ControllerModePtr Pointer to a memory location, where the current
Parameters (out):
mode of the CAN controller will be stored.
Std_ReturnType E_OK: Controller mode request has been accepted.
Return value:
E_NOT_OK: Controller mode request has not been
64 of 110 Document ID 011: AUTOSAR_SWS_CANDriver
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
accepted.
Description: This service reports about the current status of the requested CAN controller.
⌋ ()
8.3.3.1 Can_Write
[SWS_Can_00233] ⌈
Service name: Can_Write
Syntax: Std_ReturnType Can_Write(
Can_HwHandleType Hth,
const Can_PduType* PduInfo
)
Service ID[hex]: 0x06
Sync/Async: Synchronous
Reentrancy: Reentrant (thread-safe)
Hth information which HW-transmit handle shall be used for transmit.
Implicitly this is also the information about the controller to use
Parameters (in):
because the Hth numbers are unique inside one hardware unit.
PduInfo Pointer to SDU user memory, Data Length and Identifier.
Parameters None
(inout):
Parameters (out): None
Std_ReturnType E_OK: Write command has been accepted
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Can_ReturnType)
Description: This function is called by CanIf to pass a CAN message to CanDrv for
transmission.
⌋ (SRS_BSW_00312)
The function Can_Write first checks if the hardware transmit object that is identified
by the HTH is free and if another Can_Write is ongoing for the same HTH.
[SWS_Can_00212] ⌈ The function Can_Write shall perform following actions if the
hardware transmit object is free:
The mutex for that HTH is set to ‘signaled’
The ID, Data Length and SDU are put in a format appropriate for the hardware
(if necessary) and copied in the appropriate hardware registers/buffers.
All necessary control operations to initiate the transmit are done
The mutex for that HTH is released
The function returns with E_OK⌋ (SRS_Can_01049)
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Note: Using the message buffer size allows for late changes of the PDU size, e.g. if a
container PDU receives another contained PDU between the call to Can_Write() and
the call of CanIf_TriggerTransmit().
The AUTOSAR CAN module supports optional L-PDU callouts on every reception of a
L-PDU.
[SWS_Can_00443] ⌈
Service name: <LPDU_CalloutName>
Syntax: boolean <LPDU_CalloutName>(
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
uint8 Hrh,
Can_IdType CanId,
uint8 CanDataLegth,
const uint8* CanSduPtr
)
Service ID[hex]: 0x20
Sync/Async: Asynchronous
Reentrancy: Non Reentrant
Hrh --
CanId --
Parameters (in):
CanDataLegth --
CanSduPtr --
Parameters None
(inout):
Parameters (out): None
Return value: boolean --
Description: --
⌋ ()
where <LPDU_CalloutName> has to be substituted with the concrete L-PDU callout
name which is configurable, see ECUC_Can_00434.
[SWS_Can_00444] ⌈ If the L-PDU callout returns false, the L-PDU shall not be
processed any further. ⌋ ()
[SWS_Can_00445] ⌈ Can driver shall use the following APIs provided by Icu driver,
to enable and disable the wakeup event notification:
Icu_EnableNotification
Icu_DisableNotification⌋ ()
8.5.1.1 Can_MainFunction_Write
[SWS_Can_00225] ⌈
Service name: Can_MainFunction_Write
68 of 110 Document ID 011: AUTOSAR_SWS_CANDriver
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
8.5.1.2 Can_MainFunction_Read
[SWS_Can_00226] ⌈
Service name: Can_MainFunction_Read
Syntax: void Can_MainFunction_Read(
void
)
Service ID[hex]: 0x08
Description: This function performs the polling of RX indications when
CAN_RX_PROCESSING is set to POLLING.
⌋ ()
[SWS_Can_00108] ⌈ The function Can_MainFunction_Read shall perform the
polling of RX indications when CanRxProcessing is set to POLLING or MIXED. In
case of MIXED processing only the hardware objects for which
CanHardwareObjectUsesPolling is set to TRUE shall be
polled.⌋ (SRS_BSW_00432, SRS_SPAL_00157)
[SWS_Can_00180] ⌈ The Can module may implement the function
Can_MainFunction_Read as empty define in case no polling at all is used.⌋ ()
[SWS_Can_00442] ⌈ The API name of Can_MainFunction_Read() shall obey the
following pattern:
• Can_MainFunction_Read_0()
• Can_MainFunction_Read_1()
• Can_MainFunction_Read_2()
• Can_MainFunction_Read_3()
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
8.5.1.3 Can_MainFunction_BusOff
[SWS_Can_00227] ⌈
Service name: Can_MainFunction_BusOff
Syntax: void Can_MainFunction_BusOff(
void
)
Service ID[hex]: 0x09
Description: This function performs the polling of bus-off events that are configured statically as
'to be polled'.
⌋ ()
[SWS_Can_00109] ⌈ The function Can_MainFunction_BusOff shall perform the
polling of bus-off events that are configured statically as ‘to be polled’.⌋ ()
(SRS_BSW_00432, SRS_SPAL_00157)
8.5.1.4 Can_MainFunction_Wakeup
[SWS_Can_00228] ⌈
Service name: Can_MainFunction_Wakeup
Syntax: void Can_MainFunction_Wakeup(
void
)
Service ID[hex]: 0x0a
Description: This function performs the polling of wake-up events that are configured statically
as 'to be polled'.
⌋ ()
[SWS_Can_00112] ⌈ The function Can_MainFunction_Wakeup shall perform the
polling of wake-up events that are configured statically as ‘to be
polled’.⌋ (SRS_BSW_00432, SRS_SPAL_00157)
[SWS_Can_00185] ⌈ The Can module may implement the function
Can_MainFunction_Wakeup as empty define in case no polling at all is used.⌋ ()
8.5.1.5 Can_MainFunction_Mode
[SWS_Can_00368] ⌈
Service name: Can_MainFunction_Mode
Syntax: void Can_MainFunction_Mode(
void
)
Service ID[hex]: 0x0c
Description: This function performs the polling of CAN controller mode transitions.
⌋ ()
70 of 110 Document ID 011: AUTOSAR_SWS_CANDriver
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
This chapter defines all interfaces which are required to fulfill the core functionality of
the module. All callback functions that are called by the Can module are implemented
in the CanIf module. These callback functions are not configurable.
[SWS_Can_00234] ⌈
API function Description
CanIf_ControllerBusOff This service indicates a Controller BusOff event referring to the
corresponding CAN Controller with the abstract CanIf ControllerId.
CanIf_ControllerModeIndication This service indicates a controller state transition referring to the
corresponding CAN controller with the abstract CanIf ControllerId.
CanIf_RxIndication This service indicates a successful reception of a received CAN Rx L-
PDU to the CanIf after passing all filters and validation checks.
CanIf_TxConfirmation This service confirms a previously successfully processed transmission
of a CAN TxPDU.
Det_ReportRuntimeError Service to report runtime errors. If a callout has been configured then
this callout shall be called.
GetCounterValue This service reads the current count value of a counter (returning either
the hardware timer ticks if counter is driven by hardware or the
software ticks when user drives counter).
⌋ (SRS_Can_01055)
This chapter defines all interfaces that are required to fulfill an optional functionality of
the module.
[SWS_Can_00235] ⌈
API function Description
CanIf_CurrentIcomConfiguration This service shall inform about the change of the Icom Configuration
of a CAN controller using the abstract CanIf ControllerId.
CanIf_TriggerTransmit Within this API, the upper layer module (called module) shall check
whether the available data fits into the buffer size reported by
PduInfoPtr->SduLength.
If it fits, it shall copy its data into the buffer provided by PduInfoPtr-
>SduDataPtr and update the length of the actual copied data in
PduInfoPtr->SduLength.
If not, it returns E_NOT_OK without changing PduInfoPtr.
Det_ReportError Service to report development errors.
EcuM_CheckWakeup This callout is called by the EcuM to poll a wakeup source. It shall also
be called by the ISR of a wakeup source to set up the PLL and check
other wakeup sources that may be connected to the same interrupt.
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
There is no configurable target for the Can module. The Can module always reports
to CanIf module.
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
9 Sequence diagrams
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
10 Configuration specification
This chapter defines configuration parameters and their clustering into containers. In
order to support the specification Chapter 10.1 describes fundamentals. It also
specifies a template (table) you shall use for the parameter specification. We intend
to leave Chapter 10.1 in the specification to guarantee comprehension.
Chapter 10.2 specifies the structure (containers) and the parameters of the Can
module.
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Can :EcucModuleDef
upperMultiplicity = *
lowerMultiplicity = 0
+container
CanConfigSet :EcucParamConfContainerDef
+container +subContainer
+subContainer
CanGeneral : CanHardwareObject :
EcucParamConfContainerDef CanController :
+destination CanControllerRef : +reference EcucParamConfContainerDef
EcucParamConfContainerDef EcucReferenceDef
upperMultiplicity = 1 upperMultiplicity = *
lowerMultiplicity = 1 upperMultiplicity = *
lowerMultiplicity = 1
lowerMultiplicity = 1
+subContainer +subContainer
CanControllerBaudrateConfig : CanIcom :
EcucParamConfContainerDef EcucParamConfContainerDef
upperMultiplicity = * lowerMultiplicity = 0
lowerMultiplicity = 1 upperMultiplicity = 1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
CanConfigSet :EcucParamConfContainerDef
Can :EcucModuleDef +container
upperMultiplicity = *
lowerMultiplicity = 0
+subContainer
CanControllerId : CanController :
EcucIntegerParamDef EcucParamConfContainerDef
+parameter CanWakeupSourceRef : EcuMWakeupSource :
+reference EcucSymbolicNameReferenceDef +destination EcucParamConfContainerDef
upperMultiplicity = 1 upperMultiplicity = *
lowerMultiplicity = 1 lowerMultiplicity = 1 upperMultiplicity = 1 lowerMultiplicity = 1
symbolicNameValue = true
lowerMultiplicity = 0 upperMultiplicity = 32
min = 0
max = 255 (from EcuM)
upperMultiplicity = *
lowerMultiplicity = 1
(from MCU)
CanControllerBaudrateConfig :
CanControllerBaseAddress :
+subContainer EcucParamConfContainerDef
EcucIntegerParamDef +parameter
upperMultiplicity = *
min = 0
lowerMultiplicity = 1
max = 4294967295
+destination
CanWakeupSupport : +parameter
EcucBooleanParamDef CanControllerDefaultBaudrate :
+reference
EcucReferenceDef
CanWakeupFunctionalityAPI :
+parameter
EcucBooleanParamDef
defaultValue = false
MIXED :
+literal EcucEnumerationLiteralDef
+parameter CanTxProcessing :
+literal
EcucEnumerationParamDef
+literal
CanRxProcessing :
+parameter
EcucEnumerationParamDef INTERRUPT :
+literal EcucEnumerationLiteralDef
+literal
CanBusoffProcessing : +literal
+parameter
EcucEnumerationParamDef
+literal
POLLING :
+literal EcucEnumerationLiteralDef
+literal
+parameter CanWakeupProcessing :
EcucEnumerationParamDef
+literal
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
CanControllerBaudrateConfig :
CanControllerBaudRate :
EcucParamConfContainerDef
+parameter EcucIntegerParamDef
upperMultiplicity = *
min = 0
lowerMultiplicity = 1
max = 2000
CanControllerPropSeg :
+parameter EcucIntegerParamDef
min = 0
max = 255
CanControllerSeg1 :
+parameter EcucIntegerParamDef
min = 0
max = 255
CanControllerSeg2 :
+parameter EcucIntegerParamDef
min = 0
max = 255
CanControllerSyncJumpWidth :
+parameter EcucIntegerParamDef
min = 0
max = 255
CanControllerBaudRateConfigID :
EcucIntegerParamDef
+parameter
min = 0
max = 65535
defaultValue = 0
CanControllerFdBaudrateConfig :
+subContainer EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Can :EcucModuleDef
upperMultiplicity = *
lowerMultiplicity = 0
upperMultiplicity = 1
defaultValue = false
lowerMultiplicity = 1
CanMultiplexedTransmission : +parameter
EcucBooleanParamDef
CanVersionInfoApi :
+parameter
EcucBooleanParamDef
defaultValue = false
CanTimeoutDuration :
EcucFloatParamDef +parameter
CanMainFunctionRWPeriods :
CanMainFunctionPeriod :
EcucParamConfContainerDef
min = 0.000001 EcucFloatParamDef
max = 65.535 +parameter
lowerMultiplicity = 0
min = 0
upperMultiplicity = *
CanMainFunctionWakeupPeriod : max = INF
EcucFloatParamDef
+parameter +subContainer
lowerMultiplicity = 0
upperMultiplicity = 1
min = 0
max = INF
CanMainFunctionModePeriod :
EcucFloatParamDef +parameter
min = 0
max = INF
OsCounter :
CanOsCounterRef :
+destination EcucParamConfContainerDef
+reference EcucReferenceDef
lowerMultiplicity = 0
lowerMultiplicity = 0
upperMultiplicity = *
upperMultiplicity = 1
(from OS)
CanMainFunctionBusoffPeriod : CanLPduReceiveCalloutFunction :
EcucFloatParamDef +parameter EcucFunctionNameDef
+parameter
lowerMultiplicity = 0 upperMultiplicity = 1
upperMultiplicity = 1 lowerMultiplicity = 0
min = 0
max = INF
CanIcomGeneral :
CanSetBaudrateApi : +subContainer EcucParamConfContainerDef
EcucBooleanParamDef
+parameter
lowerMultiplicity = 0
defaultValue = False upperMultiplicity = 1
lowerMultiplicity = 0
upperMultiplicity = 1
CanPublicIcomSupport :
+parameter
EcucBooleanParamDef
defaultValue = false
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
CanControllerFdBaudrateConfig : CanControllerFdBaudRate :
EcucParamConfContainerDef EcucIntegerParamDef
+parameter
lowerMultiplicity = 0 min = 0
upperMultiplicity = 1 max = 16000
CanControllerTxBitRateSwitch :
+parameter
EcucBooleanParamDef
defaultValue = true
CanControllerPropSeg :
+parameter EcucIntegerParamDef
min = 0
max = 255
CanControllerSeg1 :
+parameter EcucIntegerParamDef
min = 0
max = 255
CanControllerSeg2 :
+parameter EcucIntegerParamDef
min = 0
max = 255
CanControllerSyncJumpWidth :
+parameter EcucIntegerParamDef
min = 0
max = 255
CanControllerTrcvDelayCompensationOffset :
EcucIntegerParamDef
+parameter
min = 0
max = 400
lowerMultiplicity = 0
upperMultiplicity = 1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Can :EcucModuleDef
TRANSMIT : RECEIVE :
BASIC : FULL : EcucEnumerationLiteralDef
upperMultiplicity = * EcucEnumerationLiteralDef
EcucEnumerationLiteralDef EcucEnumerationLiteralDef
lowerMultiplicity = 0
+literal +literal +literal +literal
CanObjectId :
+container
EcucIntegerParamDef
+subContainer +parameter
CanHardwareObject :EcucParamConfContainerDef
upperMultiplicity = *
lowerMultiplicity = 1
+reference CanFdPaddingValue :
CanIdType :EcucEnumerationParamDef
EcucIntegerParamDef CanControllerRef :
CanMainFunctionRWPeriodRef : EcucReferenceDef
EcucReferenceDef min = 0
max = 255
lowerMultiplicity = 0 defaultValue = 0
upperMultiplicity = 1 lowerMultiplicity = 0
upperMultiplicity = 1 +literal
+literal
lowerMultiplicity = 0
upperMultiplicity = 1
defaultValue = false
+parameter +parameter
CanHardwareObjectUsesPolling : CanHwObjectCount :
EcucBooleanParamDef EcucIntegerParamDef
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
CanIcom : CanIcomConfig :
EcucParamConfContainerDef CanIcomConfigId :
EcucParamConfContainerDef +parameter EcucIntegerParamDef
lowerMultiplicity = 0 lowerMultiplicity = 1
upperMultiplicity = 1 min = 1
upperMultiplicity = * max = 255
+subContainer
CanIcomWakeOnBusOff :
+parameter EcucBooleanParamDef
defaultValue = true
+subContainer CanIcomWakeupCauses :
EcucParamConfContainerDef
+literal CAN_ICOM_VARIANT_HW :
EcucEnumerationLiteralDef
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
CanIcomRxMessageSignalConfig : CanIcomSignalMask :
EcucParamConfContainerDef +parameter EcucIntegerParamDef
lowerMultiplicity = 0 min = 0
upperMultiplicity = *
CanIcomSignalValue :
+parameter EcucIntegerParamDef
min = 0
+literal XOR :
+parameter EcucEnumerationLiteralDef
+literal
GREATER :
EcucEnumerationLiteralDef
+literal SMALLER :
EcucEnumerationLiteralDef
+literal
EQUAL :
EcucEnumerationLiteralDef
CanIcomSignalRef :
EcucReferenceDef ComSignal :
+reference +destination EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1 lowerMultiplicity = 0
upperMultiplicity = *
(from Com)
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
CanIcomMessageIdMask :
EcucIntegerParamDef
+parameter
min = 0
max = 536870912
lowerMultiplicity = 0
upperMultiplicity = 1
CanIcomCounterValue :
EcucIntegerParamDef
+parameter
+subContainer
min = 1
max = 65536
lowerMultiplicity = 0
upperMultiplicity = 1
CanIcomMissingMessageTimerValue :
+parameter EcucFloatParamDef
lowerMultiplicity = 0
upperMultiplicity = 1
CanIcomPayloadLengthError :
+parameter
EcucBooleanParamDef
defaultValue = false
CanIcomRxMessageSignalConfig :
+subContainer EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
10.2.1 Can
Included Containers
Container Name Multiplicity Scope / Dependency
This container contains the configuration parameters and sub
CanConfigSet 1
containers of the AUTOSAR Can module.
This container contains the parameters related each CAN
CanGeneral 1
Driver Unit.
10.2.2 CanGeneral
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
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Type EcucFloatParamDef
Range ]0 .. INF[
Default value --
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Post-build time --
Scope / Dependency scope: ECU
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Included Containers
Container Name Multiplicity Scope / Dependency
This container contains the general configuration parameters
CanIcomGeneral 0..1
of the ICOM Configuration.
This container contains the parameter for configuring the
CanMainFunctionRWPeriods 0..* period for cyclic call to Can_MainFunction_Read or
Can_MainFunction_Write depending on the referring item.
10.2.3 CanController
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Post-Build Variant
false
Value
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Type EcucEnumerationParamDef
Range INTERRUPT Interrupt Mode of operation.
POLLING Polling Mode of operation.
Post-Build Variant
false
Value
Value Pre-compile time X All Variants
Configuration Link time --
Class Post-build time --
Scope / scope: local
Dependency
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Included Containers
Container Name Multiplicity Scope / Dependency
CanControllerBaudrateConfi This container contains bit timing related configuration
1..*
g parameters of the CAN controller(s).
CanTTController is specified in the SWS TTCAN and contains
the configuration parameters of the TTCAN controller(s) (which
are needed in addition to the configuration parameters of the
CanTTController 0..1 CAN controller(s)).
This container is only included and valid if TTCAN is supported
by the controller, enabled (see CanSupportTTCANRef,
ECUC_Can_00430), and used.
10.2.4 CanControllerBaudrateConfig
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Multiplicity 1
Type EcucIntegerParamDef
Range 0 .. 65535
Default value 0
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time --
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU
dependency: CanSetBaudrateApi
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Name CanControllerSyncJumpWidth
Parent Container CanControllerBaudrateConfig
Description Specifies the synchronization jump width for the controller in time quantas.
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 --
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
Included Containers
Container Name Multiplicity Scope / Dependency
This optional container contains bit timing related
CanControllerFdBaudrateConfi configuration parameters of the CAN controller(s) for
0..1
g payload and CRC of a CAN FD frame. If this container
exists the controller supports CAN FD frames.
10.2.5 CanControllerFdBaudrateConfig
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Range 0 .. 400
Default value --
Post-Build Variant
true
Multiplicity
Post-Build Variant Value true
Multiplicity ConfigurationPre-compile time X VARIANT-PRE-COMPILE
Class Link time --
Post-build time X VARIANT-POST-BUILD
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time --
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
No Included Containers
10.2.6 CanHardwareObject
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
standard identifier
- extended identifier
- mixed mode
ImplementationType: Can_IdType
Multiplicity 1
Type EcucEnumerationParamDef
Range EXTENDED All the CANIDs are of type extended only
(29 bit).
MIXED The type of CANIDs can be both
Standard or Extended.
STANDARD All the CANIDs are of type standard only
(11bit).
Post-Build Variant
true
Value
Value Pre-compile time X VARIANT-PRE-COMPILE
Configuration Link time --
Class Post-build time X VARIANT-POST-BUILD
Scope / scope: ECU
Dependency
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Included Containers
Container Name Multiplicity Scope / Dependency
This container is only valid for HRHs and contains the
CanHwFilter 0..*
configuration (parameters) of one hardware filter.
CanTTHardwareObjectTrigger is specified in the SWS
TTCAN and contains the configuration (parameters) of
TTCAN triggers for Hardware Objects, which are additional to
CanTTHardwareObjectTrigge
0..* the configuration (parameters) of CAN Hardware Objects.
r
This container is only included and valid if TTCAN is
supported by the controller and, enabled (see
CanSupportTTCANRef, ECUC_Can_00430), and used.
10.2.7 CanHwFilter
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
No Included Containers
10.2.8 CanConfigSet
Included Containers
Container Name Multiplicity Scope / Dependency
This container contains the configuration parameters of the
CanController 1..*
CAN controller(s).
This container contains the configuration (parameters) of CAN
CanHardwareObject 1..*
Hardware Objects.
This container contains the parameters for configuring
CanIcom 0..1
pretended networking
10.2.9 CanMainFunctionRWPeriods
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
No Included Containers
10.2.10 CanIcom
Included Containers
Container Name Multiplicity Scope / Dependency
This container contains the configuration parameters of the
CanIcomConfig 1..*
ICOM Configuration.
10.2.11 CanIcomConfig
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Included Containers
Container Name Multiplicity Scope / Dependency
This container contains the configuration parameters of the
CanIcomWakeupCauses 1
wakeup causes to leave the power saving mode.
10.2.12 CanIcomGeneral
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
No Included Containers
10.2.13 CanIcomRxMessage
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Description This parameter defines that the MCU shall wake if a payload error occurs
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: ECU
Included Containers
Container Name Multiplicity Scope / Dependency
This container contains the configuration parameters for
the wakeup causes for matching signals.
It has to be configured as often as a signal is defined as
wakeup cause. If at least one Signal conditions defined in
CanIcomRxMessageSignalConfi
0..* a CanIcomRxMessageSignalConfig evaluates to true or if
g
no CanIcomRxMessageSignalConfig are defined, the
whole wakeup condition is considered to be true. All
instances of this container refer to the same frame/pdu
(see CanIcomMessageId).
10.2.14 CanIcomRxMessageSignalConfig
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Post-build time --
Scope / Dependency scope: local
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
Name CanIcomSignalRef
Parent Container CanIcomRxMessageSignalConfig
Description This parameter defines a reference to the signal which shall be checked
additional to the message id (CanIcomMessageId).
This reference is used for documentation to define which ComSignal
originates this filter setting. All signals being referred by this reference shall
point to the same PDU.
Multiplicity 0..1
Type Reference to [ ComSignal ]
Post-Build Variant
false
Multiplicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency scope: ECU
dependency: The signal referenced by CanIcomSignalRef shall be
included in a ComIPdu which matches with the current CAN Controller and
the CAN Identifier (CanIcomMessageId) configured for this
CanIcomRxMessage.
No Included Containers
10.2.15 CanIcomWakeupCauses
Included Containers
Container Name Multiplicity Scope / Dependency
This container contains the configuration parameters for the
wakeup causes for matching received messages. It has to be
configured as often as received messages are defined as
CanIcomRxMessage 1..* wakeup cause.
constraint: For all CanIcomRxMessage instances the Message
IDs which are defined in CanIcomMessageId and in
CanIcomRxMessageIdMask shall not overlap.
- AUTOSAR confidential -
Specification of CAN Driver
AUTOSAR CP Release 4.3.1
- AUTOSAR confidential -