AUTOSAR SWS CANDriver
AUTOSAR SWS CANDriver
AUTOSAR SWS CANDriver
AUTOSAR CP R20-11
Disclaimer
This work (specification and/or software implementation) and the material contained
in it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR
and the companies that have contributed to it shall not be liable for any use of the
work.
The material contained in this work is protected by copyright and other types of
intellectual property rights. The commercial exploitation of the material contained in
thiswork requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the
work may be utilized or reproduced, in any form or by any means, without permission
in writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Table of Content
“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)
15 of 112 Document ID 11: AUTOSAR_SWS_CANDriver
Specification of CAN Driver
AUTOSAR CP R20-11
“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)
16 of 112 Document ID 11: AUTOSAR_SWS_CANDriver
Specification of CAN Driver
AUTOSAR CP R20-11
CAN Controller A
Tx A CAN
CAN
Transceiver Physical Channel A
Rx A A Bus A
Message Object
Mailbox A
CAN Controller B
CAN
Tx B
Transceiver CAN Physical Channel B
Rx B B Bus B
Message Object
Mailbox B
3 Related documentation
[19] CiA601-2 Node and system design Part 2: CAN controller interface
specification
Thus, the specification SWS BSW General shall be considered as additional and
required specification for CAN Driver.
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_00236] ⌈ The Can module shall initialize the CAN HW to ignore any
remote transmission requests.⌋ (SRS_Can_01147)
[SWS_Can_00240] ⌈ The Mcu module (SPAL see [8]) shall configure register
settings that are ‘shared’ with other modules.⌋ ()
Implementation hint: The Mcu module shall be initialized before initializing the Can
module.
[SWS_Can_00242] ⌈ If an off-chip CAN controller is used3, the Can module shall use
services of other MCAL drivers (e.g. SPI).⌋ (SRS_BSW_00005)
Implementation hint: If the Can module uses services of other MCAL drivers (e.g.
SPI), it must be ensured that these drivers are up and running before initializing the
Can module.
The sequence of initialization of different drivers is partly specified in [7].
[SWS_Can_00244] ⌈ The Can module shall use the synchronous APIs of the
underlying MCAL drivers and shall not provide callback functions that can be called
by the MCAL drivers.⌋ ()
Thus the type of connection between µC and CAN Hardware Unit has only impact on
implementation and not on the API.
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.
21 of 112 Document ID 11: AUTOSAR_SWS_CANDriver
Specification of CAN Driver
AUTOSAR CP R20-11
[SWS_Can_00281] ⌈ The Can module shall use the OsCounter provided by the
system service for timeout detection in case the hardware does not react in the
expected time (hardware malfunction) to prevent endless loops.⌋ ()
Implementation hint: The blocking time of the Can module function that is waiting for
hardware reaction shall be shorter than the CAN main function (i.e.
Can_MainFunction_Read) trigger period, because the CAN main functions can’t be
used for that purpose.
6 Requirements traceability
SWS_Can_00232, SWS_Can_00233
SRS_BSW_00323 All AUTOSAR Basic Software SWS_Can_00026, SWS_Can_00513,
Modules shall check passed API SWS_Can_00514, SWS_Can_00518,
parameters for validity SWS_Can_00519, SWS_Can_91006,
SWS_Can_91007, SWS_Can_91017,
SWS_Can_91018
SRS_BSW_00325 The runtime of interrupt service SWS_Can_00999
routines and functions that are
running in interrupt context shall be
kept short
SRS_BSW_00330 It shall be allowed to use macros SWS_Can_00079
instead of functions where source
code is used and runtime is critical
SRS_BSW_00331 All Basic Software Modules shall SWS_Can_00039, SWS_Can_00104
strictly separate error and status
information
SRS_BSW_00336 Basic SW module shall be able to SWS_Can_00999, SWS_Can_91002
shutdown
SRS_BSW_00337 Classification of development errors SWS_Can_00026, SWS_Can_00104
SRS_BSW_00342 It shall be possible to create an SWS_Can_00999
AUTOSAR ECU out of modules
provided as source code and
modules provided as object code,
even mixed
SRS_BSW_00344 BSW Modules shall support link-time SWS_Can_00021
configuration
SRS_BSW_00347 A Naming seperation of different SWS_Can_00077
instances of BSW drivers shall be in
place
SRS_BSW_00353 All integer type definitions of target SWS_Can_00999
and compiler specific scope shall be
placed and organized in a single
type header
SRS_BSW_00357 For success/failure of an API call a SWS_Can_00506
standard return type shall be defined
SRS_BSW_00358 The return type of init() functions SWS_Can_00223
implemented by AUTOSAR Basic
Software Modules shall be void
SRS_BSW_00359 All AUTOSAR Basic Software SWS_Can_00999
Modules callback functions shall
avoid return types other than void if
possible
SRS_BSW_00361 All mappings of not standardized SWS_Can_00999
keywords of compiler specific scope
shall be placed and organized in a
compiler specific type and keyword
header
SRS_BSW_00369 All AUTOSAR Basic Software SWS_Can_00089, SWS_Can_00506,
running operations
SRS_SPAL_12067 All driver modules shall set their SWS_Can_00257
wake-up conditions depending on
the selected operation mode
SRS_SPAL_12068 The modules of the MCAL shall be SWS_Can_00999
initialized in a defined sequence
SRS_SPAL_12069 All drivers of the SPAL that wake up SWS_Can_00271, SWS_Can_00364
from a wake-up interrupt shall report
the wake-up 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 SWS_Can_00372
blocking implementation
SRS_SPAL_12092 The driver's API shall be accessed SWS_Can_00058
by its handler or manager
SRS_SPAL_12125 All driver modules shall only initialize SWS_Can_00053
the configured resources
SRS_SPAL_12129 The ISRs shall be responsible for SWS_Can_00033
resetting the interrupt flags and
calling the according notification
function
SRS_SPAL_12163 All driver modules shall implement SWS_Can_00999
an interface for de-initialization
SRS_SPAL_12169 All driver modules that provide SWS_Can_00017
different operation modes shall
provide a service for mode selection
SRS_SPAL_12263 The implementation of all driver SWS_Can_00021
modules shall allow the configuration
of specific module parameter types
at link time
SRS_SPAL_12265 Configuration data shall be kept SWS_Can_00021
constant
SRS_SPAL_12448 All driver modules shall have a SWS_Can_00089, SWS_Can_00091
specific behavior after a
development error detection
SRS_SPAL_12462 The register initialization settings SWS_Can_00999
shall be published
SRS_SPAL_12463 The register initialization settings SWS_Can_00024
shall be combined and forwarded
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)
Can modules shall be implemented such that no two functions with the same name
are generated.⌋ ()
The naming convention is as follows:
<Can module name>_<vendorID>_<Vendor specific API name><driver
abbreviation>()
SRS_BSW_00347 specifies the naming convention.
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)
Refer to [SWS_Can_91010].
33 of 112 Document ID 11: AUTOSAR_SWS_CANDriver
Specification of CAN Driver
AUTOSAR CP R20-11
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.)
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_00257] ⌈ When the CAN hardware supports sleep mode and is triggered
to transition into SLEEP state, the Can module shall set the controller to the SLEEP
state from which the hardware can be woken over CAN Bus.⌋ (SRS_SPAL_12067)
[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.⌋ ()
PowerOff
PowerON reset
UNINIT
Can_DeInit()
Can_DeInit()
STOPPED SLEEP
STARTED
Figure 7-2
[SWS_Can_00259] ⌈ The function Can_Init shall set all CAN controllers in the state
STOPPED.⌋ ()
When the function Can_Init is entered and the Can module is not in state
CAN_UNINIT or the CAN controllers are not in state UNINIT, it shall raise the error
CAN_E_TRANSITION (Compare to SWS_Can_00174 and SWS_Can_00408).
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_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.⌋ ()
STOPPED STARTED
software triggered
STARTED STOPPED
SLEEP STOPPED
software triggered
STOPPED SLEEP
software triggered
[SWS_Can_00290] ⌈ If the CAN HW does not support a sleep mode, the function
Can_SetControllerMode(CAN_CS_SLEEP) shall set the CAN controller to the logical
sleep mode.⌋ ()
This state transition will only occur when sleep mode is supported by hardware.
[SWS_Can_00269] ⌈ The Can module shall not further process the L-PDU that
caused a wake-up.⌋ ()
[SWS_Can_00272] ⌈ After bus-off detection, the CAN controller shall transition to the
state STOPPED and the Can module shall ensure that the CAN controller doesn’t
participate on the network anymore. ⌋ (SRS_Can_01060)
[SWS_Can_00273] ⌈ After bus-off detection, the Can module shall cancel still
pending messages. ⌋ (SRS_Can_01060)
- 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]).
[SWS_Can_00427] ⌈ If the presentation inside the CAN Hardware buffer differs from
AUTOSAR definition, the Can module must provide an adapted SDU-Buffer for the
upper layers.⌋ ()
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)
Note: Ordering of L-PDUs by priority avoids inner priority inversion of the L-PDUs
assigned to a Basic-CAN configured for multiplexed transmission.
Another possibility to avoid inner priority inversion is the configuration of all HTHs to
be Full-CAN if the CAN hardware is able to prioritize upon transmission using the
CAN ID or related priority field.
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)
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.
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.
The ECU State Manager will then set up the MCU and call the Can module back via
the Can Interface, resulting in a call to Can_CheckWakeup.
When wakeup events are detected by polling, the ECU State Manager will cyclically
call Can_CheckWakeup via the Can Interface as before. In both cases,
Can_CheckWakeup will check if there was a wakeup detected by a Can controller
and return the result. The CAN driver will then inform the ECU State Manager of the
wakeup event via EcuM_SetWakeupEvent.
The wakeup validation to prevent false wakeup events, will be done by the ECU
State Manager and the Can Interface afterwards and without any help from the Can
module.
For a general description of the wakeup mechanisms and wakeup sequence
diagrams refer to Specification of ECU State Manager [7].
The configuration of what is and is not polled by the Can module is internal to the
driver, and not visible outside the module. The polling is done inside the CAN main
functions (Can_MainFunction_xxx). Also the polled events are notified by the
appropriate callback function. Then the call context is not the ISR but the CAN main
function. The implementation of all callback functions shall be done as if the call
context was the ISR.
For further details see also description of the CAN main functions
Can_MainFunction_Read, Can_MainFunction_Write, Can_MainFunction_BusOff and
Can_MainFunction_Wakeup.
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.
Based on this foundation, the following section specifies particular errors arranged in
the respective subsections below.
[SWS_Can_00104] ⌈ The Can module shall be able to detect the following errors and
exceptions depending on its configuration (default/production)⌋ (SRS_BSW_00337,
SRS_BSW_00385, SRS_BSW_00331)
[SWS_Can_91019]⌈
Type of error Related error code Error value
⌋()
[SWS_Can_91020]⌈
Type of error Related error code Error value
⌋()
[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)
50 of 112 Document ID 11: AUTOSAR_SWS_CANDriver
Specification of CAN Driver
AUTOSAR CP R20-11
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.
[SWS_Can_91024]⌈
If no of the predefined Can_ErrorType values matches to the error provided by the
CAN hardware, the CAN driver shall not report the error to the CanIf.
⌋(RS_Ids_00810)
[SWS_Can_91023]⌈
If the CanEnableSecurityEventReporting=true and CanDrv detects a transition to
error state passive, then CanDrv shall call CanIf_ControllerErrorStatePassive with
the ControllerId and the values for the Rx and Tx error counters.
⌋(RS_Ids_00810)
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].
ComStack_Types.h PduIdType
ComStack_Types.h PduLengthType
Os.h StatusType
Os.h TickRefType
Os
Os.h TickType
Rte_Os_Type.h CounterType
Std_Types.h Std_ReturnType
Std
Std_Types.h Std_VersionInfoType
⌋()
8.2.1 Can_ConfigType
[SWS_Can_00413]⌈
Name Can_ConfigType
Kind Structure
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
Description
pointers to controller configuration structures. The contents of the initialization data
structure are CAN hardware specific.
Available
Can.h
via
⌋()
8.2.2 Can_PduType
[SWS_Can_00415]⌈
Name Can_PduType
Kind Structure
swPduHandle
Type PduIdType
Comment --
length
Type uint8
Comment --
Elements
id
Type Can_IdType
Comment --
sdu
Type uint8*
Comment --
This type unites PduId (swPduHandle), SduLength (length), SduData (sdu), and Can
Description
Id (id) for any CAN L-SDU.
Available
Can_GeneralTypes.h
via
⌋()
8.2.3 Can_IdType
[SWS_Can_00416]⌈
Name Can_IdType
Kind Type
Derived
uint32
from
Represents the Identifier of an L-PDU. The two most significant bits specify the frame
Description type: 00 CAN message with Standard CAN ID 01 CAN FD frame with Standard CAN
ID 10 CAN message with Extended CAN ID 11 CAN FD frame with Extended CAN ID
Variation --
Available
Can_GeneralTypes.h
via
⌋()
8.2.4 Can_HwHandleType
[SWS_Can_00429]⌈
Name Can_HwHandleType
Kind Type
Basetype Variation
Derived
uint16 --
from
uint8 --
Represents the hardware object handles of a CAN hardware unit. For CAN hardware
Description
units with more than 255 HW objects use extended range.
Available
Can_GeneralTypes.h
via
⌋()
8.2.5 Can_HwType
[SWS_CAN_00496]⌈
Name Can_HwType
Kind Structure
CanId
Type Can_IdType
Hoh
Type Can_HwHandleType
Elements
Comment ID of the corresponding Hardware Object Range
ControllerId
Type uint8
This type defines a data structure which clearly provides an Hardware Object Handle
Description including its corresponding CAN Controller and therefore CanDrv as well as the
specific CanId.
Available
Can_GeneralTypes.h
via
⌋()
[SWS_Can_00039]⌈
CAN_ transmit request could not be processed because no transmit
Range 0x02
BUSY object was available
Description Overlayed return value of Std_ReturnType for CAN driver API Can_Write()
Available
Can_GeneralTypes.h
via
⌋(SRS_BSW_00331)
8.2.7 Can_ErrorStateType
[SWS_Can_91003]⌈
Name Can_ErrorStateType
Kind Enumeration
CAN_ERRORSTATE_
-- The CAN controller takes fully part in communication.
ACTIVE
Available
Can_GeneralTypes.h
via
⌋()
8.2.8 Can_ControllerStateType
[SWS_Can_91013]⌈
Name Can_ControllerStateType
Kind Enumeration
⌋()
8.2.9 Can_ErrorType
[SWS_Can_91021]⌈
Name Can_ErrorType
Kind Enumeration
CAN_ERROR_BIT_
0x01 A 0 was transmitted and a 1 was read back
MONITORING1
CAN_ERROR_BIT_
0x02 A 1 was transmitted and a 0 was read back
MONITORING0
CAN_ERROR_
0x04 Acknowledgement check failed
CHECK_ACK_FAILED
CAN_ERROR_ACK_
0x05 Acknowledgement delimiter check failed
DELIMITER
CAN_ERROR_
0x06 The sender lost in arbitration.
Range ARBITRATION_LOST
CAN_ERROR_
CHECK_FORM_ 0x08 Violations of the fixed frame format
FAILED
CAN_ERROR_
CHECK_STUFFING_ 0x09 Stuffing bits not as expected
FAILED
CAN_ERROR_
0xA CRC failed
CHECK_CRC_FAILED
CAN_ERROR_BUS_
0xB Bus lock (Bus is stuck to dominant level)
LOCK
The enumeration represents a superset of CAN Error Types which typical CAN HW is
Description
able to report. That means not all CAN HW will be able to support the complete set.
Available
Can_GeneralTypes.h
via
⌋()
8.3.1.1 Can_Init
[SWS_Can_00223]⌈
Service Name Can_Init
void Can_Init (
Syntax const Can_ConfigType* Config
)
Sync/Async Synchronous
⌋(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.
8.3.1.2 Can_GetVersionInfo
[SWS_Can_00224]⌈
Service Name Can_GetVersionInfo
void Can_GetVersionInfo (
Syntax Std_VersionInfoType* versioninfo
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (out) versioninfo Pointer to where to store the version information of this module.
⌋()
8.3.1.3 Can_DeInit
[SWS_Can_91002]⌈
Service Name Can_DeInit
void Can_DeInit (
Syntax void
)
Sync/Async Synchronous
⌋(SRS_Can_01166, SRS_BSW_00336)
Caveat: Caller of the Can_DeInit function has to be sure no CAN controller is in the
state STARTED
8.3.2.1 Can_SetBaudrate
[SWS_CAN_00491]⌈
Service Name Can_SetBaudrate
Std_ReturnType Can_SetBaudrate (
uint8 Controller,
Syntax uint16 BaudRateConfigID
)
Service ID
0x0f
[hex]
Sync/Async Synchronous
Reentrancy Reentrant for different Controllers. Non reentrant for the same Controller.
Parameters
None
(inout)
Parameters
None
(out)
This service shall set the baud rate configuration of the CAN controller. Depending
Description
on necessary baud rate modifications the controller might have to reset.
⌋()
[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
Std_ReturnType Can_SetControllerMode (
uint8 Controller,
Syntax Can_ControllerStateType Transition
)
Sync/Async Asynchronous
Parameters
None
(inout)
This function performs software triggered state transitions of the CAN controller
Description
State machine.
⌋()
[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.
8.3.2.3 Can_DisableControllerInterrupts
[SWS_Can_00231]⌈
Service Name Can_DisableControllerInterrupts
void Can_DisableControllerInterrupts (
Syntax uint8 Controller
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Controller CAN controller for which interrupts shall be disabled.
Description This function disables all interrupts for this CAN controller.
⌋(SRS_BSW_00312)
[SWS_Can_00204] ⌈ The Can module shall track all individual enabling and disabling
of interrupts in other functions (i.e. Can_SetControllerMode) , so that the correct
interrupt enable state can be restored.⌋ ()
Implementation example:
• in ‘interrupts enabled mode’: For each interrupt state change does not only
modify the interrupt enable bit, but also a software flag.
• in ‘interrupts disabled mode’: only the software flag is modified.
• Can_DisableControllerInterrupts and Can_EnableControllerInterrupts do not
modify the software flags.
• Can_EnableControllerInterrupts reads the software flags to re-enable the
correct interrupts.
8.3.2.4 Can_EnableControllerInterrupts
[SWS_Can_00232]⌈
Service Name Can_EnableControllerInterrupts
void Can_EnableControllerInterrupts (
Syntax uint8 Controller
)
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Controller CAN controller for which interrupts shall be re-enabled
⌋(SRS_BSW_00312)
8.3.2.5 Can_CheckWakeup
[SWS_Can_00360]⌈
Service Name Can_CheckWakeup
Std_ReturnType Can_CheckWakeup (
Syntax uint8 Controller
Sync/Async Synchronous
Description This function checks if a wakeup has occurred for the given controller.
⌋()
8.3.2.6 Can_GetControllerErrorState
[SWS_Can_91004]⌈
Service Name Can_GetControllerErrorState
Std_ReturnType Can_GetControllerErrorState (
uint8 ControllerId,
Syntax Can_ErrorStateType* ErrorStatePtr
)
Sync/Async Synchronous
Parameters
None
(inout)
Parameters Pointer to a memory location, where the error state of the CAN
ErrorStatePtr
(out) controller will be stored.
Description This service obtains the error state of the CAN controller.
⌋()
8.3.2.7 Can_GetControllerMode
[SWS_Can_91014]⌈
Service Name Can_GetControllerMode
Std_ReturnType Can_GetControllerMode (
Syntax uint8 Controller,
Can_ControllerStateType* ControllerModePtr
)
Sync/Async Synchronous
Parameters (in) Controller CAN controller for which the status shall be requested.
Parameters
None
(inout)
Parameters ControllerMode Pointer to a memory location, where the current mode of the
(out) Ptr CAN controller will be stored.
Description This service reports about the current status of the requested CAN controller.
⌋()
8.3.2.8 Can_GetControllerRxErrorCounter
[SWS_Can_00511]⌈
69 of 112 Document ID 11: AUTOSAR_SWS_CANDriver
Specification of CAN Driver
AUTOSAR CP R20-11
Service
Can_GetControllerRxErrorCounter
Name
Std_ReturnType Can_GetControllerRxErrorCounter (
uint8 ControllerId,
Syntax uint8* RxErrorCounterPtr
)
Service ID
0x30
[hex]
Sync/Async Synchronous
Parameters
None
(inout)
Returns the Rx error counter for a CAN controller. This value might not be available
for all CAN controllers, in which case E_NOT_OK would be returned.
Please note that the value of the counter might not be correct at the moment the API
Description
returns it, because the Rx counter is handled asynchronously in hardware.
Applications should not trust this value for any assumption about the current bus
state.
⌋()
8.3.2.9 Can_GetControllerTxErrorCounter
[SWS_Can_00516]⌈
Service
Can_GetControllerTxErrorCounter
Name
Std_ReturnType Can_GetControllerTxErrorCounter (
uint8 ControllerId,
Syntax
uint8* TxErrorCounterPtr
)
Service ID
0x31
[hex]
Sync/Async Synchronous
Parameters
None
(inout)
Parameters TxErrorCounter Pointer to a memory location, where the current Tx error counter
(out) Ptr of the CAN controller will be stored.
Returns the Tx error counter for a CAN controller. This value might not be available
for all CAN controllers, in which case E_NOT_OK would be returned.
Please note that the value of the counter might not be correct at the moment the API
Description
returns it, because the Tx counter is handled asynchronously in hardware.
Applications should not trust this value for any assumption about the current bus
state.
⌋()
8.3.3.1 Can_Write
[SWS_Can_00233]⌈
Service Name Can_Write
Std_ReturnType Can_Write (
Can_HwHandleType Hth,
Syntax const Can_PduType* PduInfo
)
Service ID
0x06
[hex]
Sync/Async Synchronous
Parameters
None
(inout)
Parameters
None
(out)
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_00504] ⌈ If the trigger transmit API is enabled for the hardware object,
Can_Write() shall interpret a null pointer as SDU (Can_PduType.Can_SduPtrType =
NULL) as request for using the trigger transmit interface. If so and the hardware
object is free, Can_Write() shall call CanIf_TriggerTransmit() with the maximum size
of the message buffer to acquire the PDU’s data.⌋ ()
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().
[SWS_Can_00486] ⌈ The CAN Frame has to be sent according to the two most
significant bits of Can_PduType->id. The CAN FD frame bit is only evaluated if
CAN Controller is in CAN FD mode (valid CanControllerFdBaudrateConfig).⌋ ()
The Can module does not provide callback functions. Only synchronous MCAL API
may used to access external CAN controllers.
The AUTOSAR CAN module supports optional L-PDU callouts on every reception of a
L-PDU.
[SWS_Can_00443]⌈
Service Name <LPDU_CalloutName>
boolean <LPDU_CalloutName> (
uint8 Hrh,
Can_IdType CanId,
Syntax uint8 CanDataLegth,
const uint8* CanSduPtr
)
Sync/Async Asynchronous
Hrh --
CanId --
Parameters (in)
CanDataLegth --
CanSduPtr --
Description --
⌋()
where <LPDU_CalloutName> has to be substituted with the concrete L-PDU callout
name which is configurable, see ECUC_Can_00434.
75 of 112 Document ID 11: AUTOSAR_SWS_CANDriver
Specification of CAN Driver
AUTOSAR CP R20-11
[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
void Can_MainFunction_Write (
Syntax void
)
Service ID
0x01
[hex]
⌋()
76 of 112 Document ID 11: AUTOSAR_SWS_CANDriver
Specification of CAN Driver
AUTOSAR CP R20-11
8.5.1.2 Can_MainFunction_Read
[SWS_Can_00226]⌈
Service Name Can_MainFunction_Read
void Can_MainFunction_Read (
Syntax void
)
Service ID
0x08
[hex]
⌋()
8.5.1.3 Can_MainFunction_BusOff
[SWS_Can_00227]⌈
Service Name Can_MainFunction_BusOff
void Can_MainFunction_BusOff (
Syntax void
)
Service ID
0x09
[hex]
This function performs the polling of bus-off events that are configured statically as
Description
'to be polled'.
⌋()
8.5.1.4 Can_MainFunction_Wakeup
[SWS_Can_00228]⌈
Service Name Can_MainFunction_Wakeup
void Can_MainFunction_Wakeup (
Syntax void
)
Service ID
0x0a
[hex]
This function performs the polling of wake-up events that are configured statically
Description
as 'to be polled'.
⌋()
8.5.1.5 Can_MainFunction_Mode
[SWS_Can_00368]⌈
Service Name Can_MainFunction_Mode
void Can_MainFunction_Mode (
Syntax void
)
Description This function performs the polling of CAN controller mode transitions.
⌋()
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]⌈
Header
API Function Description
File
CanIf_Controller- CanIf_ This service indicates a Controller BusOff event referring to the
79 of 112 Document ID 11: AUTOSAR_SWS_CANDriver
Specification of CAN Driver
AUTOSAR CP R20-11
BusOff Can.h corresponding CAN Controller with the abstract CanIf ControllerId.
CanIf_Controller- CanIf_ This service indicates a controller state transition referring to the
ModeIndication Can.h corresponding CAN controller with the abstract CanIf ControllerId.
⌋(SRS_Can_01055)
This chapter defines all interfaces that are required to fulfill an optional functionality of
the module.
[SWS_Can_00235]⌈
API Function Header File Description
The function shall derive the bus error source rx or tx from the
parameter CanError and report the bus error as security event
CanIf_Error- CanIf_
CANIF_SEV_TX_ERROR_DETECTED or CANIF_SEV_RX_
Notification Can.h
ERROR_DETECTED. It also prepares the context data for the
respective security event.
Within this API, the upper layer module (called module) shall check
whether the available data fits into the buffer size reported by PduInfo
CanIf_Trigger- Ptr->SduLength. If it fits, it shall copy its data into the buffer provided
CanIf.h
Transmit 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_Report-
Det.h Service to report development errors.
Error
interrupt.
EcuM_Set-
EcuM.h Sets the wakeup event.
WakeupEvent
Icu_Disable-
Icu.h This function disables the notification of a channel.
Notification
Icu_Enable-
Icu.h This function enables the notification on the given channel.
Notification
⌋(SRS_SPAL_12056, SRS_Can_01054)
There is no configurable target for the Can module. The Can module always reports
to CanIf module.
9 Sequence diagrams
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.
[SWS_Can_00507] ⌈ The Can Driver module shall reject configurations with partition
mappings which are not supported by the implementation. ⌋ ()
Can: EcucModuleDef
upperMultiplicity = *
lowerMultiplicity = 0
+container
CanConfigSet: EcucParamConfContainerDef
+container +subContainer
+subContainer
CanGeneral: CanHardwareObject:
EcucParamConfContainerDef CanController: CanControllerRef:
+destination +reference EcucParamConfContainerDef
EcucParamConfContainerDef EcucReferenceDef
upperMultiplicity = 1 upperMultiplicity = *
lowerMultiplicity = 1 upperMultiplicity = *
lowerMultiplicity = 1
lowerMultiplicity = 1
+subContainer
CanControllerBaudrateConfig:
EcucParamConfContainerDef
upperMultiplicity = *
lowerMultiplicity = 1
+subContainer
CanControllerId: CanController:
EcucIntegerParamDef EcucParamConfContainerDef
+parameter CanWakeupSourceRef: EcuMWakeupSource:
upperMultiplicity = 1 +reference EcucReferenceDef +destination EcucParamConfContainerDef
upperMultiplicity = *
lowerMultiplicity = 1 lowerMultiplicity = 1 lowerMultiplicity = 0 lowerMultiplicity = 1
symbolicNameValue = true
upperMultiplicity = 1 upperMultiplicity = 32
min = 0
requiresSymbolicNameValue = true
max = 255
CanControllerBaudrateConfig:
CanControllerBaseAddress:
+subContainer EcucParamConfContainerDef
EcucIntegerParamDef +parameter
upperMultiplicity = *
min = 0
lowerMultiplicity = 1
max = 4294967295
+destination
CanWakeupSupport: +parameter
EcucBooleanParamDef CanControllerDefaultBaudrate:
+reference
EcucReferenceDef
CanWakeupFunctionalityAPI:
+parameter
EcucBooleanParamDef MIXED:
+literal EcucEnumerationLiteralDef
defaultValue = false
+parameter CanTxProcessing:
EcucEnumerationParamDef +literal
+literal
CanRxProcessing:
+parameter INTERRUPT:
EcucEnumerationParamDef
+literal EcucEnumerationLiteralDef
+literal
CanBusoffProcessing: +literal
+parameter
EcucEnumerationParamDef
+literal
POLLING:
+literal EcucEnumerationLiteralDef
CanWakeupProcessing: +literal
+parameter
EcucEnumerationParamDef
+literal
CanControllerEcucPartitionRef: EcucPartition:
+reference +destination
EcucReferenceDef EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
CanControllerBaudrateConfig:
CanControllerBaudRate:
EcucParamConfContainerDef
+parameter EcucFloatParamDef
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
Can: EcucModuleDef
upperMultiplicity = *
lowerMultiplicity = 0
+container
CanMultiplexedTransmission: +parameter
EcucBooleanParamDef +parameter CanVersionInfoApi:
EcucBooleanParamDef
defaultValue = false
CanTimeoutDuration:
EcucFloatParamDef +parameter CanMainFunctionRWPeriods: CanMainFunctionPeriod:
EcucParamConfContainerDef EcucFloatParamDef
min = 0.000001 +parameter
max = 65.535 +subContainer lowerMultiplicity = 0 min = 0
upperMultiplicity = * max = INF
CanMainFunctionWakeupPeriod:
EcucFloatParamDef
+parameter
lowerMultiplicity = 0 CanOsCounterRef: OsCounter:
upperMultiplicity = 1 +reference EcucReferenceDef +destination EcucParamConfContainerDef
min = 0
max = INF lowerMultiplicity = 0 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
CanMainFunctionModePeriod:
EcucFloatParamDef +parameter CanLPduReceiveCalloutFunction:
+parameter EcucFunctionNameDef
min = 0
max = INF upperMultiplicity = 1
lowerMultiplicity = 0
CanMainFunctionBusoffPeriod:
EcucFloatParamDef CanEcucPartitionRef: EcucPartition:
+parameter +reference EcucReferenceDef +destination
lowerMultiplicity = 0 EcucParamConfContainerDef
upperMultiplicity = 1 lowerMultiplicity = 0 lowerMultiplicity = 0
min = 0 upperMultiplicity = * upperMultiplicity = *
max = INF
+parameter CanEnableSecurityEventReporting:
CanSetBaudrateApi:
EcucBooleanParamDef
EcucBooleanParamDef
+parameter
defaultValue = false
defaultValue = False
lowerMultiplicity = 0
upperMultiplicity = 1
CanControllerFdBaudrateConfig: CanControllerFdBaudRate:
EcucParamConfContainerDef EcucFloatParamDef
+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
CanControllerSspOffset:
EcucIntegerParamDef
+parameter
min = 0
max = 255
lowerMultiplicity = 0
upperMultiplicity = 1
TRANSMIT: RECEIVE:
BASIC: FULL:
EcucEnumerationLiteralDef EcucEnumerationLiteralDef
EcucEnumerationLiteralDef EcucEnumerationLiteralDef
+parameter +parameter
CanHardwareObject: EcucParamConfContainerDef
upperMultiplicity = *
lowerMultiplicity = 1
+reference +parameter
+literal +literal
CAN_OBJECT_PL_12: CAN_OBJECT_PL_48:
EcucEnumerationLiteralDef EcucEnumerationLiteralDef
+literal +literal
CAN_OBJECT_PL_16: CAN_OBJECT_PL_32:
EcucEnumerationLiteralDef EcucEnumerationLiteralDef
+literal +literal
CAN_OBJECT_PL_20: CAN_OBJECT_PL_24:
EcucEnumerationLiteralDef EcucEnumerationLiteralDef
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
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
Type EcucFloatParamDef
Range ]0 .. INF[
Default value --
Post-Build Variant
false
Multiplicity
Post-Build Variant Value false
Multiplicity ConfigurationPre-compile time X All Variants
Class Link time --
Post-build time --
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency
Included Containers
Container Name Multiplicity Scope / Dependency
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
Name CanWakeupSupport
Parent Container CanController
Description CAN driver support for wakeup over CAN Bus.
Multiplicity 1
Type EcucBooleanParamDef
Default value --
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time --
Post-build time --
Scope / Dependency
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
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
Example:
CAN controller clock frequency = 20MHz => MTQ = 1/20 * 10^(-6) s = 0,05
us = 50ns
Baud rate = 1MBit/s => BitTime = 1/(1 * 10^6) s/Bit = 1 * 10^(-6) = 1us/Bit
SSP = 75% => SSP in seconds = 0,75 * 1us = 750 ns
CanControllerSspOffset in MTQ = 750ns / 50ns = 15
Note: Please consider the minimum range (0..63) stated in [17] and the
range definition (0..127) used as per [19].
Multiplicity 0..1
Type EcucIntegerParamDef
Range 0 .. 255
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
Name CanControllerSyncJumpWidth
Parent Container CanControllerFdBaudrateConfig
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
No Included Containers
10.2.6 CanHardwareObject
Range 0 .. 255
Default value 0
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: ECU
Range 1 .. 65535
Default value 1
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: ECU
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
Type EcucBooleanParamDef
Default 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 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.
"fits" into it. Therefore, if set, CanObjectPayloadLength shall be equal or greater than
the maximum PduLength of all affected Pdus of the EcuCPduCollection ⌋ ()
Note: For A_HOH that has CanObjectPayloadLength configured and any PDU it
sends/receives, A_PDU_Of_A_HOH the condition
Can/CanConfigSet/A_HOH/CanObjectPayloadLength >=
EcuC/EcuCPduCollection/A_PDU_Of_A_HOH/PduLength must hold.
10.2.7 CanHwFilter
Scope / Dependency dependency: The filter mask settings must be known by the CanIf
configuration for optimization of the SW filters.
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.
10.2.9 CanMainFunctionRWPeriods
No Included Containers