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

CAN COM Training

Uploaded by

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

CAN COM Training

Uploaded by

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

CAN Communication Stack Training

HWIA AUTOSAR BSW Training


Order of Contents

1. Architecture
2. Methodology
3. Application interfaces
4. Introduction of Final Delivery

Confidential | ETAS/ERS-Sk | 2019-10-01


2 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Overview

○ In today’s cars, multiple different ECUs and

communication systems are implemented.

BCM EMS
ABS
○ How can AUTOSAR adapt?
CAN BUS …

… …

TCU
ESC

AWD

Confidential | ETAS/ERS-Sk | 2019-10-01


3 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
AUTOSAR BSW Communication Stack Architecture

Application Layer

AUTOSAR Runtime Environment (RTE) BSW-Layers

System Services Memory Services Communication I/O Hardware Complex Services


Services Abstraction Drivers

Onboard Device Memory Hardware Comm. Hardware ECU Abstraction


Abstraction Abstraction Abstraction and Complex
Drivers

Micro-controller Memory Drivers Communication I/O Drivers Micro-controller


Drivers Drivers Abstraction

Microcontroller
Confidential | ETAS/ERS-Sk | 2019-10-01
4 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
AUTOSAR BSW Communication Stack Architecture
RTE

Communication
Signals
Manager

FlexRay
Diagnostic Eth State TTCAN State CAN State LIN State Generic
IPDU State
Communi- Manager Manager Manager Manager NM interface
multi- AUTOSAR COM Debugging Manager
plexer cation
Manager
NM Coordinator
I-PDU I-PDU I-PDU I-PDU
XCP

PDU Router

Ethernet Protocol
I-PDU1 I-PDU1 I-PDU NM Module
I-PDU I-PDU1 I-PDU
NM Module
NM Module
CAN Tp NM Module
FlexRay Tp J1939Tp

N-PDU N-PDU N-PDU

Communication
HW
LIN Interface Abstraction
Eth Interface FlexRay Interface CAN Interface2
(incl. LIN TP)

L-PDU L-PDU L-PDU L-PDU

Communication Drivers

Eth Driver FlexRay Driver CAN Driver2 LIN Low Level Driver

Confidential | ETAS/ERS-Sk | 2019-10-01


5 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
AUTOSAR BSW Communication Stack Architecture
RTE

Request Com Mode Communication


Service
DEM BswM ComM
Signal Bus Off
Diagnostic /Recovery Status Network
Network
Information Request/
Status
Request Com Mode Release
Generic
IpduM COM DCM Debug NM interface
CanSM
NM Coordinator
I-PDU I-PDU I-PDU I-PDU
Network Network
XCP

Enable / Status Request/


PduR
Disable/ Release
I-PDU Recovery CanNm
I-PDU CAN
CanTP
Communication I-PDU : NM PDU
N-PDU Status/Bus Off

Communication
HW
CanIf
Abstraction
L-PDU : Frame Communication
Status/Bus Off
Communication Drivers
CanDrv

Confidential | ETAS/ERS-Sk | 2019-10-01


6 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture ASW
CAN Communication Stack – Communication Services
RTE
○ Com Stack:

○ Group of modules for vehicle network communication


DCM COM ComM
using CAN Bus
XCP
○ Provides a uniform (standardized) interface to the CAN CAN
network PDU Router
State
Manager

CAN Tp

○ Abstracts location of Communication controllers


and ECU HW CAN Interface
○ Provide equal access a bus channel regardless of it’s
CAN Transceiver
location Driver

SPIHandler
CAN Driver
Driver

CAN
Confidential | ETAS/ERS-Sk | 2019-10-01
7 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
CAN Communication Stack - Bus independent Communication Services

○ Com:
○ Provides signal oriented data Rte
I-PDU Group
interface to RTE Control
Transmit Receive
○ Packing/unpacking of AUTOSAR (signal) (signal) BswM
signals to I-PDUs
○ Routes individual signals
Com
(or groups) between I-PDUs
Transmit Receive
○ PDU Router - PduR:
(I-PDU) (I-PDU)
Initialize
EcuM
○ Provides routing of PDUs between
different abstract communication PduR
controllers and upper layers
○ TP routing on-the-fly. Transfer of TP data is started before full TP data is buffered

Confidential | ETAS/ERS-Sk | 2019-10-01


8 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
CAN Communication Stack - Bus independent Communication Services

○ NM Coordinator - Nm:
○ Bus-independent adaptation layer
○ Bus-specific Network Management modules
○ Communication Manager module (ComM)
○ Synchronization of Network States of different communication channels
connected to an ECU via the network managements handled by the NM
Coordinator

○ Communication Manager – ComM (Services Layer):


○ Collects the bus communication access requests from communication
requestors (Applications, Complex Drivers) and coordinates the bus
communication access requests.
○ Triggers the Start-up and Shut-down the hardware units of the
communication systems

Confidential | ETAS/ERS-Sk | 2019-10-01


9 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
CAN Communication Stack - Bus-specific Communication Services

○ xxxTp: Transport Protocol


○ Segmentation and reassembly of I-PDUs larger than single bus frame
○ CAN > 8 bytes

○ xxxIf: Bus Interface


○ Unique interface to manage different hardware device types
○ e.g. CAN controllers and CAN transceivers used by the defined ECU
hardware layout

○ xxxSm: State Manager


○ Communication system dependent Start-up and Shutdown features

○ xxxNm: Network Manager


○ Coordinate the transition between normal operation and bus-sleep mode of
the network.

Confidential | ETAS/ERS-Sk | 2019-10-01


10 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Normal communication

○ RTE calls the service from COM to send the signal RTE
Signals

○ COM assembles the signals to PDU COM

I-PDU

○ PDUR routes the PDU to its destination PDU Router

I-PDU I-PDU

○ CanTP segments the PDU to fit CAN frame CAN Tp

N-PDU

Communication
HW
○ CanIf calls API from specific CAN controller to send CAN Interface Abstraction

L-PDU

Communication Drivers
○ CanDriver send the frame to the bus CAN Driver

Confidential | ETAS/ERS-Sk | 2019-10-01


11 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Signals and PDUs
AUTOSAR VFB
AUTOSAR
Signal
○ Com provides a signal-based interface ASW ASW
○ ComSignals
System Description
○ System Template uses System Signals and ISignals SystemSignal S

Signals
○ SystemSignal – unique piece of data that is transferred
RTE
between SWCs ISignal_S1 ISignal_S2
○ ISignal – interaction layer signal used to distribute this
data to multiple receivers. Com
Pdu1 Pdu2

PDUs
○ Com uses a PDU-based interface PduR
○ Data unit delivered through layer(s) CAN_PDU FlexRay_PDU

CanIf FrIf
○ Buses use a Frame-based interface Frame1 Frame2
○ Data unit exchanged over comm channel

Frames
FlexRay FlexRay
Channel A Channel B

Confidential | ETAS/ERS-Sk | 2019-10-01


12 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
PDU Naming Convention
RTE

I-Signals
I-PDU (Interaction Layer PDU):
o Packed by Com from the
transmitted signals COM

o Passed to the PduR.


I-PDU

PDU Router
N-PDU (Network Layer PDU)
o Used by AUTOSAR Transmission Protocol
I-PDU I-PDU
(TP) layer
o When transmitting / receiving PDUs that CAN Tp
are larger than a single frame on the
associated network. N-PDU

Communication
L-PDU (Data Link Layer PDU) CAN Interface
HW
Abstraction
o Assembled by ECU abstraction modules,
e.g. CanIf.
o During assembly of the L-PDU, additional L-PDU
information such as data length is Communication Drivers
included in the PCI. CAN Driver

Confidential | ETAS/ERS-Sk | 2019-10-01


13 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
PDU Structure
RTE

PCI SDU PDU I-Signals

COM

ID DLC DATA PDU


I-PDU

PDU Router

○ PCI (Protocol Control Information): The information necessary for I-PDU I-PDU
the SDU pass from the upper to the lower layer (data length, CAN Tp
identifier,..)
N-PDU

Communication
○ SDU (Service Data Unit): The PDU’s data “payload”. Upper layer HW
CAN Interface Abstraction
passes the SDU along with a request for transmission to a lower
L-PDU
layer
Communication Drivers

○ A PDU (Protocol Data Unit): consists of a PCI and an SDU CAN Driver

Confidential | ETAS/ERS-Sk | 2019-10-01


14 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
PDU Structure
RTE

PCI SDU PDU I-Signals

COM

ID DLC DATA PDU


I-PDU

PDU Router

ID of I-PDU Length of
I-PDU (Internal ID) meaningful DATA
I-PDU I-PDU

bytes CAN Tp

N-PDU
Length of
N-PDU ID of N-PDU
(Internal ID) meaningful
Bit define first frame, Communication
HW
consecutive frame,…
bytes CAN Interface Abstraction

L-PDU

Can ≤ 8 bytes
L-PDU ID of Can
CAN-FD ≤ 64 DATA
Communication Drivers

frame CAN Driver


bytes

Confidential | ETAS/ERS-Sk | 2019-10-01


15 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
PDU Transmission through the Com Stack

○ PDU passes from the upper layer to


Layer N+1
the lower layer Data PDU

LayerN_Transmit(PduId,*PDU)
○ Layer N passed PDU as its SDU by
layer N+1 void LayerN_Transmit(PduId,*SDU)

Layer N
PCI Data SDU
○ Layer N interprets PDU as its SDU
and adds PCI PCI Data PDU
○ Passes as a PDU to the next lower
layer “N-1”
LayerN-1_Transmit(PduId,*PDU)

void LayerN-1_Transmit(PduId,*SDU)

○ Layer N-1 repeats the processing of Layer N-1


handling the PDU as its SDU PCI Data SDU

Confidential | ETAS/ERS-Sk | 2019-10-01


16 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
PDU Routing

○ PduR routes the I-PDU(s)


Com Dcm
○ from Com and Dcm
○ to the correct communication bus
(or buses).
IPduM PduR Routing Table

○ Routing Table(s) – defines the source


I-PDU I-PDU
I-PDU I-PDU I-PDU
and destination of each I-PDU handled
by PduR. CanTP FrTP
N-PDU N-PDU

○ PDU Router Engine –performs the


LinIf (inc LIN
CanIf FrIf
actual routing of I-PDUs based on TP)
interface Communication HW Abstraction

Confidential | ETAS/ERS-Sk | 2019-10-01


17 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
PDU Routing

○ PDU Routing Table

Confidential | ETAS/ERS-Sk | 2019-10-01


18 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
PDU Routing

○ PDU Routing Table

Source PDU reference

Destination PDU reference

Normal PDU Rx Routing Path

Normal PDU Tx Routing Path

Diagnostic PDU Routing Path

Confidential | ETAS/ERS-Sk | 2019-10-01


19 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Transmission of a signal to the bus
RTE
Com_SendSignal ()
○ COM takes data from RTE
COM

○ COM propagates IPDU to PDUR


PduR_ComTransmit ()

○ PDUR routes IPDU to CanTp or CanIf PDU Router

CanIf_Transmit() CanTp_Transmit ()
○ CanIf sends data to CAN driver CAN Tp

CanIf_Transmit ()
○ CAN driver sends data to Can transceiver

CAN Interface
 After successful transmission, a transmission confirmation is Communication
HW Abstraction CanIf_Write ()
called back to upper layers
CAN Driver

Communication Drivers
CAN

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Transmission of a signal to the bus
RTE

COM

PDU Router

CAN
Tp

CAN Interface

CAN Driver

CAN

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Reception of a CAN frame from the bus
RTE

Com_ReceiveSignal ()
○ CAN Driver detects received data
COM

○ CAN Driver sends data to CanIf


Com_ReceiveIPdu()

○ CanIf sends data to CanTp or PduR PDU Router

PduR_Tp_RxIndication()
○ PduR routes data to Com
PduR_If_RxIndication () CAN Tp

CanTp_RxIndication ()
○ Com extracts to signal and sends to RTE
Communication
HW
CAN Interface
Abstraction
 Can Driver can detect received data by Interrupt or Polling CanIf_RxIndication ()
mode
Communication Drivers
CAN Driver
Receive
Interrupt or
Polling
CAN

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Reception of a CAN frame from the bus
RTE

COM

PDU Router

CAN
Tp

CAN Interface

CAN Driver

CAN

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (interrupt mode)

CanIf User CanIf Can Driver Can Controller

Receive Interrupt

The CAN Controller indicates a successful


reception and triggers a receive interrupt.

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (interrupt mode)

CanIf User CanIf Can Driver Can Controller

Receive Interrupt

Invalidation of
hardware
object

The CPU (CanDrv) get exclusive access rights


to the CAN mailbox or at least to the
corresponding hardware object, where new
data were received.

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (interrupt mode)

CanIf User CanIf Can Driver Can Controller

Receive Interrupt

Invalidation of
hardware
object

Copy received L-PDU into


temporary buffer
The L-PDU is normalized and is buffered in the
temporary buffer located in CanDrv.

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (interrupt mode)

CanIf User CanIf Can Driver Can Controller

Copy received L-PDU


into temporary buffer

CanIf_RxIndication()

The reception is indicated to CanIf by calling


of CanIf_RxIndication().

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (interrupt mode)

CanIf User CanIf Can Driver Can Controller

Copy received L-PDU


into temporary buffer

CanIf_RxIndication()
User_RxIndication()

CanIf_RxIndication()

CanIf indicates to CanIf User (PduR -> Com)

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (interrupt mode)

CanIf User CanIf Can Driver Can Controller

Copy received L-PDU


into temporary buffer

CanIf_RxIndication()
User_RxIndication()

CanIf_RxIndication()
Validation of
hardware object

The CAN Controller get back exclusive access


rights to the CAN mailbox or at least to the
corresponding hardware object

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (interrupt mode)

CanIf User CanIf Can Driver Can Controller

Copy received L-PDU


into temporary buffer

CanIf_RxIndication()
User_RxIndication()

CanIf_RxIndication()
Validation of
hardware object

Receive Interrupt

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Transmit confirmation (interrupt mode)

CanIf User CanIf Can Driver Can Controller

Transmit interrupt

The acknowledged CAN frame signals a


successful transmission to the receiving
CAN Controller and triggers the transmit
interrupt
Confidential | ETAS/ERS-Sk | 2019-10-01
© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Transmit confirmation (interrupt mode)

CanIf User CanIf Can Driver Can Controller

Transmit interrupt
CanIf_TxConfirmation()

Can Driver sends the confirmation


to CanIf

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Transmit confirmation (interrupt mode)

CanIf User CanIf Can Driver Can Controller

Transmit interrupt
CanIf_TxConfirmation()
User_TxConfirmation()

CanIf sends the confirmation to the


corresponding upper layer

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Transmit confirmation (interrupt mode)

CanIf User CanIf Can Driver Can Controller

Transmit interrupt
CanIf_TxConfirmation()
User_TxConfirmation()

CanIf_TxConfirmation()
Transmit interrupt

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler

Can_MainFunction_Read()

The service Can_MainFunction_Read() is called


by the BSW Scheduler.

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler

Can_MainFunction_Read() Check for pending Rx


indication

Can_MainFunction_Read() checks the


underlying CAN Controller(s) about new
received L-PDUs.

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler

Can_MainFunction_Read() Check for pending Rx


indication

Invalidation of
hardware object

In case of a new receive event the CanDrv get


exclusive access rights to the CAN mailbox or at least
to the corresponding hardware object
Confidential | ETAS/ERS-Sk | 2019-10-01
© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler

Can_MainFunction_Read() Check for pending Rx


indication

Invalidation of
hardware object

Copy received L-PDU into


temporary buffer

In case of a new receive event the L-PDU is


normalized and is buffered in the temporary buffer
located in CanDrv.
Confidential | ETAS/ERS-Sk | 2019-10-01
© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler
Copy received L-PDU into
temporary buffer

CanIf_RxIndication()

The reception is indicated to CanIf by


calling of CanIf_RxIndication().

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler
Copy received L-PDU into
temporary buffer

CanIf_RxIndication()
User_RxIndication()

The reception
CanIf sends the is indicated
Receive to CanIf
Indication by
to the
upper
callinglayer
of CanIf_RxIndication().
Confidential | ETAS/ERS-Sk | 2019-10-01
© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler
Copy received L-PDU into
temporary buffer

CanIf_RxIndication()
User_RxIndication()
CanIf_RxIndication()

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler
Copy received L-PDU into
temporary buffer

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

The CAN Controller get back exclusive access


rights to the CAN mailbox or at least to the
corresponding hardware object

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Receive indication (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler
Copy received L-PDU into
temporary buffer

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

Can_MainFunction_Read()

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Transmit confirmation (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler
Can_MainFunction_Write()

The service Can_MainFunction_Write() is


called by the BSWScheduler.
Confidential | ETAS/ERS-Sk | 2019-10-01
© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Transmit confirmation (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler
Can_MainFunction_Write()
Check for pending TX
confirmations

Checks the underlying CAN Controller(s) about


pending transmit confirmations of previously
succeeded transmit events.
Confidential | ETAS/ERS-Sk | 2019-10-01
© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Transmit confirmation (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler
Can_MainFunction_Write()
Check for pending TX
confirmations

CanIf_TxConfirmation()

Can Driver sends the confirmation to CanIf

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Transmit confirmation (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler
Can_MainFunction_Write()
Check for pending TX
confirmations

CanIf_TxConfirmation()
User_TxConfirmation()

CanIf_TxConfirmation()

Calling of the corresponding upper layer


confirmation service. It signals a successful L-
SDU transmission to the upper layer.
Confidential | ETAS/ERS-Sk | 2019-10-01
© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Polling and interrupt - Transmit confirmation (polling mode)

CanIf User CanIf Can Driver Can Controller


BSW Scheduler
Can_MainFunction_Write()
Check for pending TX
confirmations

CanIf_TxConfirmation()
User_TxConfirmation()

Can_MainFunction_Write()

Confidential | ETAS/ERS-Sk | 2019-10-01


© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture o PDU Gatewaying
Gateways RTE

○ Gateways are part of the Communication Stack: COM

○ PduR performs PDU gatewaying


PDU Router Pdu Gateway
○ Routes PDUs between buses
Same period (1) (2) (2) Direct Transmission
Communication
○ Avoid PDU traversing entire Com stack HW
FR Interface CAN Interface LIN Interface Abstraction
○ Com performs signal gatewaying
o Signal Gatewaying
○ Routes signals between I-PDUs on same ECU
RTE

Signal size can (3) (3)


○ IpduM/PduR support multiplexing be changed in
ASW
COM Signal Gateway
(1) (2)
○ Different contents but same frame IDs
PDU Router

Can be different
period (1) (2) (2) Indirect Transmission
Communication
HW
FR Interface CAN Interface LIN Interface Abstraction

(1) Receive (2) Transmission


(3) Signal Processing in Application
Confidential | ETAS/ERS-Sk | 2019-10-01
49 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture o PDU Gatewaying
Gateways RTE

○ PDU Gatewaying COM

○ I-PDUs may be gatewayed from a source


PDU Router Pdu Gateway
communication interface module to one (1:1) or Same period Direct Transmission
(1) (2) (2) Communication
more destination communication interface FR Interface CAN Interface LIN Interface
HW
Abstraction

modules (1:n I-PDU gateway)


o PDUR AUTOSAR specification
○ I-PDUs can only be gatewayed between

communication interface modules or TP


modules, not a mix of them. For example an I-
PDU cannot be received from CanIf and
gatewayed to LinTp.

Confidential | ETAS/ERS-Sk | 2019-10-01


50 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Multiplexed PDUs

○ Each CAN message has a specific CAN identifier – same set of signals packed into the same layout.
○ Efficient packing/un-packing of CAN messages
○ Enables hardware filtering to reduce the load on upper software layers.
○ …but requires a significant number of CAN identifiers to be reserved
○ Multiplexed CAN Message supports the transport of more than one signal at the same location in the

CAN message
○ Message has a static part with a fixed layout
○ Variable (dynamic) message part with multiple layouts
○ Selector signal in the static part defines the layout.
○ Reduces the number of CAN identifiers required as the same CAN message can carry more than one

signal layout
○ Selector signal extension of the CAN identifier.

Confidential | ETAS/ERS-Sk | 2019-10-01


51 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Multiplexed PDUs

○ IpduM module performs (de)multiplexing of I-PDUs


PduR passes
○ In conjunction with the PduR. multiplexed
I-PDU to
IpduM

○ I-PDU multiplexing occurs on the same architectural level as

PduR IpduM
Returned
receives
○ Applies to all bus systems handled to PduR for
new
routing
I-PDU
by the PduR.

○ IpduM maintains an internal buffer for each multiplexed I-PDU. Merged


with
○ New data (from PduR) updates buffer existing
data
○ Merged I-PDU may be returned to the

PduR (with new PDU identifier) for routing.


Confidential | ETAS/ERS-Sk | 2019-10-01
52 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Multiplexed PDUs
Multiplex I-PDU IPduM I-PDU
○ A single static part and three Dynamic S Dynamic
S0 S1
Segment 0 F Segment 1
configured dynamic layouts

Static Part I-PDU in COM Com I-PDU containing static


○ Static part contains two signals part with two signals S0 and
S0 S1
S1.

Dynamic part I-PDU in COM (Selector = 00) Com I-PDU containing


○ Each of the three dynamic parts 0 dynamic layout 00. Contains
D0 D1 D2 D3 D4
0 five signals D0-D4.
contains a different signals layout
Dynamic part I-PDU in COM (Selector = 01) Com I-PDU containing
○ Selector signal D5
0
D2 D6
dynamic layout 01. Contains
1 signals D2, D5 and D6.

Dynamic part I-PDU in COM (Selector = 10) Com I-PDU containing


D0 D7
1
D8 D9
dynamic layout 10. Contains
0 signals D0, D7-9.

Confidential | ETAS/ERS-Sk | 2019-10-01


53 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Overview

○ How communication can start / sleep ?

○ What happen if a ECU is lost connection with


BCM EMS
ABS
communication system?
CAN BUS …

… …
○ How can AUTOSAR adapt?
TCU
ESC

AWD

Confidential | ETAS/ERS-Sk | 2019-10-01


54 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture ASW

Communication Management and State Management


RTE
ComM Channel states and communication capabilities

○ ComM is a Resource Manager, which encapsulates the control


DET
DCM ComM
of the underlying communication services.
○ The ComM module requests a Communication Mode from the CAN
State
PDU Router Manager
BswM
CAN State Manager and the CAN State Manager maps the
Communication Mode to a bus state
CAN Tp

○ The BswM propagates user requests to the ComM module, if

configured in the action lists of BswM to be able to request


ComM modes via BswM CAN Interface

CAN Transceiver
○ DCM and ASW SWC also can propagate user request to the Driver

ComM Modules. CAN Driver


SPIHandler
Driver
○ User request with ComM_RequestMode Interface
○ via DCM active diagnosis
Confidential | ETAS/ERS-Sk | 2019-10-01
55 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Communication Management and State Management
ComM Channel states and communication capabilities

COMM_FULL_ COMM_SILENT_ COMM_NO_


COMMUNICATION COMMUNICATION COMMUNICATION
• Allows transmission/reception • • Default mode
Used only for network
on the affected physical • Prevents
synchronization together with
channel NM transmission/reception on the
affected physical channel

Message
Transmission ON OFF OFF

Message ON ON OFF
Reception

Bus communication requested Bus communication released Bus communication released


NM
=> wake up NM cluster => Sleep ECU/NM cluster => Sleep ECU/NM cluster

Confidential | ETAS/ERS-Sk | 2019-10-01


56 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Communication Management and State Management
○ The ComM module requests communication modes from the networks. It knows by its configuration, which

handle is assigned to what kind of network. In case of CAN, it uses the CanSM module.
○ The CanSM module is responsible for the control flow abstraction of CAN networks.
○ Any change of the CAN Controller modes and CAN Transceiver modes will be notified by the CanIf module to

the CanSM module.


○ Depending on this notifications and state of the CAN network state machine, the CanSM module notifies the

ComM and the BswM.


UserRequests ComM
CAN ControllerState
UserRequests Channel1 ChannelState CanSM CanIf
CAN TransceiverState
WakeupIndication Channel2

State requests are propagated to the corresponding Bus


SM. ComM does not control the actual bus state.
Confidential | ETAS/ERS-Sk | 2019-10-01
57 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture ASW

Communication Management and State Management


RTE
Start of communication
Network Request
NM
(Optional)
○ BswM triggers ComM to propagate the requested mode to DET Request ComM
ComM Mode CanNm
CanSM for COMM_FULL_COMMUNICATION Switch COM
(FULL COMM) User 0 Ch 0
CAN
User 1 FULL COMM Send/
○ CanSM calls CanIf API to change the current mode to start State
Manager Receive
BswM
User 2 PDU Router NM
CAN Controller Indication Message

Indication
○ CanIf calls Can Driver API to start the CAN controller CAN Tp
Start CAN Controller

CAN Interface

 After successful change, CAN Driver sends


Indication Start CAN Controller CAN Transceiver
back mode indication to ComM Driver

SPIHandler
CAN Driver
Driver

Confidential | ETAS/ERS-Sk | 2019-10-01


58 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture ASW

Communication Management and State Management


RTE
Sleep/Stop of communication
Network Release
NM
(Optional)
○ BswM triggers ComM to propagate the requested mode to DET Request ComM
ComM Mode CanNm
CanSM for COMM_NO_COMMUNICATION Switch COM
(NO COMM) User 0 Ch 0
CAN
User 1 NO COMM Send/
○ CanSM calls CanIf API to change the current mode to stop State
Manager Receive
BswM
User 2 PDU Router NM
CAN Controller Indication Message

Indication
○ CanIf calls Can Driver API to stop the CAN Controller CAN Tp
Stop CAN Controller

CAN Interface
Sleep/
 After successful change, CAN Driver sends Standby
Indication Stop CAN Controller CAN Transceiver
back mode indication to ComM Driver

SPIHandler
CAN Driver
Driver

Confidential | ETAS/ERS-Sk | 2019-10-01


59 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture ASW
Communication Management and State Management
RTE
Time-out event

○ [Option1] While transmitting and receiving data, if COM


DET COM
can not receive or transmit data in configured time-out ComM

time (e.g. 500ms , it’s up to your setting): CAN


State
PDU Router Manager
○ COM will notify to ASW BswM

CAN Tp

CAN Interface

CAN Transceiver
Driver

SPIHandler
CAN Driver
Driver

Confidential | ETAS/ERS-Sk | 2019-10-01


60 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture ASW
Communication Management and State Management
RTE
Time-out event

○ [Option2] CanSM can also detect the time-out event via


DET CAN COM ComM
SM_
E_M
following use-cases ODE
_RE
Q UES CAN
T
○ Update the baudrate (via CanSM_SetBaudrate()) _TI
MEO State
BswM BswM_CanS PDU Router UT Manager
M_RequestM
○ Update the operation mode of Can controller (via ode()

CanIf_SetControllerMode() -> CAN Tp

Can_17_MCanP_SetControllerMode())
○ If Can driver can not perform the request during the time
CAN Interface
defining by CanTimeoutDuration, CanSM will detect the CAN Transceiver
Driver
event.
○ Note: This feature will not fully supported by CAN. Because this parameter is CAN Driver
SPIHandler
Driver
not used by the CAN driver
Detection
Confidential | ETAS/ERS-Sk | 2019-10-01
Notification
61 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Communication Management and State Management
Wait the recovery from HW with
Bus-off mode Indication - Level 1
- Level 2 (if bus-off still there)
RECOVERY_L1 /
a) SW will close the Tx gate RECOVERY_L2
SW operates of CAN frames
as normal b) Start recovery machine

Time out
bus-off occurs
NO_BUS_OFF RESTART_CC

If b
us-o
ff st
ill th
ere
BUS_OFF_CHECK
If Tx succeed ->
Bus-Off recovered SW will open the Tx gate
to allow transmission of
CAN frames
Confidential | ETAS/ERS-Sk | 2019-10-01
62 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Communication Management and State Management
Bus-off mode Indication
Tx CAN
message
TFilter noise TRECOVERY_L1 TRECOVERY_L2
T1 T2

… … …
Time (s)

PowerOn Normal Bus-Off Normal


Operation Operation

○ CAN message type ○ Timing parameter


○ TFilter noise : Time to log bus off events when occurred
Normal CAN message
○ T1 : The duration of bus off recovery time in L1(short recovery time)

○ T2 : The duration of bus off recovery time in L2(long recovery


CAN Error message
time)
Confidential | ETAS/ERS-Sk | 2019-10-01 ○ N : The count of bus retry until bus off switch from L1 to L2
63 L1_L2
© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture ASW
Communication Management and State Management
RTE
Bus-off mode Indication

CAN controller (peripheral)


• Detects bus off event and log the error in a register DEM COM ComM

• Report the error immediately to the CAN Driver if


CAN
interrupt configured PDU Router
State
Manager
BswM

Can Driver CAN Tp

• Recognize bus off event if polling mode operation


configured. CanSM_ControllerBusOff()

• Notify the event into upper layer (CanIf->CanSM). CAN Interface

CAN Transceiver
Driver
CanIf_ControllerBusOff()

SPIHandler
CAN Driver
Driver

Detection
Notification CAN
Confidential | ETAS/ERS-Sk | 2019-10-01
64 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture ASW
Communication Management and State Management
RTE
Bus-off mode Indication
Network Mode State
CanSM
• Count the repeated event until it reaches the DEM COM ComM

threshold
CAN
ComM Mode indication State
PDU Router Manager
• If error is confirmed, BswM

• Disable Tx path CanSM current state indication


• Log the event as error (to Dem) CAN Tp

• Notify to upper layer (to ComM & ASW)


CanSM_ControllerBusOff()
• Start recovery machine
CAN Interface

CAN Transceiver
Driver
CanIf_ControllerBusOff()

SPIHandler
CAN Driver
Driver

Detection
Notification CAN
Confidential | ETAS/ERS-Sk | 2019-10-01
65 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture ASW
Communication Management and State Management
RTE
Bus-off mode Indication
CanSM
• If error is confirmed, DEM COM ComM

• Start recovery machine


• Wait for the recovery of HW with L1 & L2 (if CAN
State
Manager
bus-off still there) BswM PDU Router

• Inform the BswM of the Bus off event for BswM_CanSM_CurrentState()

further action (if required). CAN Tp

• Recovery time out L1/L2 expired CanIf_SetControllerMode(…, CANSM_CS_STARTED)


• Enable Tx path CanIf_SetPduMode(..., CANIF_SET_TX_ONLINE)
• Can Driver:
CAN Interface
• Take the action from CanSM to transmit
CAN Transceiver
CAN message again Driver

• If transmit successfully, means bus-off


recovered. CAN Driver
SPIHandler
Driver

Detection Recovery initiator


Notification Recovery CAN
Confidential | ETAS/ERS-Sk | 2019-10-01
66 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture ASW
Communication Management and State Management
RTE
Bus-off mode Indication
CanSM
• If error is confirmed, DEM COM ComM

• Start recovery machine.


• If the recovery is succeed, the event is CAN
State
PDU Router Manager
cleared from DEM BswM

BswM_CanSM_CurrentState()

CAN Tp

CAN Interface

CAN Transceiver
Driver

SPIHandler
CAN Driver
Driver

Detection Recovery initiator


Notification Recovery CAN
Confidential | ETAS/ERS-Sk | 2019-10-01
67 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Communication Management and State Management

○ Bus-off mode Indication


Specification of Communication Manager
○ ComM: Bus off handling removed

Confidential | ETAS/ERS-Sk | 2019-10-01


68 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Can

Can_SetControllerMode()

Disable Can Node via NCR.INIT bit

Confidential | ETAS/ERS-Sk | 2019-10-01


69 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Can

Can_SetControllerMode()

CanSM_ControllerModeIndication()
-> This callback shall notify the CanSM module about a CAN controller mode change

Confidential | ETAS/ERS-Sk | 2019-10-01


70 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Network management

Overview
○ If we want to push group of ECUs into

“sleep mode” to save energy.

BCM EMS
ABS
○ How can AUTOSAR adapt?
CAN BUS …

… …

TCU
ESC

AWD

Not belong to any


Note: NM cluster

NM cluster

Confidential | ETAS/ERS-Sk | 2019-10-01


71 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Network management

Overview

○ Objective
○ NM protocol is to coordinate one or more groups of
BCM EMS
ECUs to wake up and shutdown their communication ABS
CAN BUS …
stack synchronously
… …
○ NM messages format
TCU
ESC

AWD

Not belong to any


Note: NM cluster

NM cluster

Confidential | ETAS/ERS-Sk | 2019-10-01


72 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Network management
RTE
Overview

○ Architecture ComM

○ To other protocol layers


○ NM algorithm uses services of the underlying communication stack NM

modules to send and receive NM messages.


○ ComM stands here to use the NM to synchronize the control of
CanNM
communication capabilities across the network (synchronous start-
up and shutdown)
Communication
○ To the Application Layer HW
Abstraction
CAN Interface
○ Upper layer (e.g. application) uses NM services to request or release

a network i.e. to activate or deactivate sending of NM messages.


Communication Drivers

○ In addition, the upper layer/module may use the possibility to get CAN Driver

informed about changes of the NM operational modes.

Confidential | ETAS/ERS-Sk | 2019-10-01


73 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Network management – Network Wakeup
Network
Network Released
Status

ABS
Network
Activator

TCU
Network Time (s)
Responder

○ CAN message type ○ Network states


NM PDU sent by Responder ○ Network Released: whether the software components don’t have to
NM PDU sent by Activator communicate on the bus
Application Message ○ Network Requested: whether the software components need to

74
Confidential | ETAS/ERS-Sk | 2019-10-01
communicate on the bus
© ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Network management – Network Wakeup
Network
Network Released Network Requested
Status

Immediate NM PDU

ABS Wake up message with CBV.bit4 = 1


Network
Activator
T1
T4

TCU Respond ACK message with CBV.bit4 = 1


Network Time (s)
Responder
T6
T5

• T1: NM PDU Immediate transmit cycle time(optional) • T4: Duration to accept ACK NM message from network

• T6: waiting time before starting the transmission of NM • T5: Time from ECU detection of valid wakeup request to 1st transmit
PDU application message
Confidential | ETAS/ERS-Sk | 2019-10-01
75 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Network management – Network Wakeup
Network
Network Released Network Requested Repeat Message State Normal Operation State
Status
T3

Immediate NM PDU

ABS
Network … … …
Activator
T1
T4 T2 Normal Operation State
Repeat Message State

T3
TCU
Network … … … … … … Time (s)
Responder
T6 T2
T5
• T2: NM PDU Normal transmit cycle time
• T3: Repeat Message Timer

Confidential | ETAS/ERS-Sk | 2019-10-01


76 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Architecture
Network management – Network Sleep
Network Network Requested Network Released
Status
Normal Operation State Ready Sleep State Prepare Bus-sleep Mode Bus-sleep Mode

T7 T8

ABS Sleep message with CBV.bit4 = 0 and CBV.bit3 = 1


… … …
Network
Activator

Normal Operation State Ready Sleep State Prepare Bus-sleep Mode Bus-sleep Mode

TCU
Network
… …
Time (s)
Responder
T7 T8

• T7: NM-Timeout Timer

• T8: Wait Bus-Sleep Timer

Confidential | ETAS/ERS-Sk | 2019-10-01


77 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Confidential | ETAS/ERS-Sk | 2019-10-01
78 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Confidential | ETAS/ERS-Sk | 2019-10-01
79 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Confidential | ETAS/ERS-Sk | 2019-10-01
80 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Confidential | ETAS/ERS-Sk | 2019-10-01
81 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Order of Contents

1. Architecture

2. Methodology
3. Application interfaces
4. Introduction of Final Delivery

Confidential | ETAS/ERS-Sk | 2019-10-01


82 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
Basic Approach

Basic Approach

Confidential | ETAS/ERS-Sk | 2019-10-01


83 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
Basic Approach

Basic Approach
The “virtual functional bus” is
the communication mechanism
that allows SW components to
interact for a modeled
application

Confidential | ETAS/ERS-Sk | 2019-10-01


84 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
Basic Approach
System constraint description:
Basic Approach - Topology
- Communication networks
- Mapping
- Mapping Constraints

Confidential | ETAS/ERS-Sk | 2019-10-01


85 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
Basic Approach ECU description:
- Processing units
- Memory
Basic Approach
- Peripherals
- Sensors
- Actuators
- Pins
- Connectors

Confidential | ETAS/ERS-Sk | 2019-10-01


86 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
Basic Approach

Activities
1. Software-Components (SWC)
describe software functions, code
entities (Runnables), etc. The activity is
to describe (author) SWCs.
2. Provide & Require Ports allow SWCs
to send and receive Data Elements via
Sender-Receiver and Client-Server
Interfaces. The activity is to author
Ports and Interfaces.
3. Compositions of SWCs allow to
describe hierarchical software systems.
The activity is to author SWC
compositions.
4. The Virtual Functional Bus (VFB)
includes all communication of SWCs.
Authoring tools allow to specify single
SWCs and Software Systems atop the
VFB.
Confidential | ETAS/ERS-Sk | 2019-10-01
87 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
Basic Approach

Activities

1. ECU Extracts are generated to describe


the needs of SWCs and other system
constraints on the infrastructure of each
ECU. The activity is to author (generate)
ECU Extracts.

2. Based on an ECU Extract, an ECU


Configuration is created for configuring
and generating the ECU infrastructure
software (RTE and Basic Software).
Activities are for each ECU to configure and
generate the Runtime-Environment (RTE)
and Basic Software (BSW).

Confidential | ETAS/ERS-Sk | 2019-10-01


88 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
AUTOSAR Workflow

Workflow

○ OEM
○ Provide the system description
○ Tier1
○ ASW development
○ ECU Extract and RTE Generation
○ BSW implementation
○ RTE Generation
○ Software Integration

Confidential | ETAS/ERS-Sk | 2019-10-01


89 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
AUTOSAR Workflow

OEM : Provide the system description

○ Network description (DBC, Fibex, Arxml, …)


○ E.g.

20190403_CANFD_WIA_ATC_rev03_190403.dbc

○ Network description

+ SWC description
+ SWC Implementation
+ E.g: SWC_CAN_RX_10ms_v00,
SWC_CAN_TX_10ms_v00,

Confidential | ETAS/ERS-Sk | 2019-10-01


90 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
AUTOSAR Workflow

Tier1 : ASW development

○ Architecture Design

- Port, Interface, Runnable, Event, ..


- Interface connection between ASWs
- Software composition

○ Manual code development

○ Model based development

Confidential | ETAS/ERS-Sk | 2019-10-01


91 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
AUTOSAR Workflow

Tier1 : ECU Extract and RTE Generation

○ ECU Extract

- Root software Composition


- Extract for specific ECU

○ RTE Generation

Confidential | ETAS/ERS-Sk | 2019-10-01


92 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
AUTOSAR Workflow

Tier1 : BSW implementation

○ BSW Configuration

- OS, COM, DIAG, MEM, ...

○ BSW Generation

- bswmd, swcd, code, …

Confidential | ETAS/ERS-Sk | 2019-10-01


93 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
AUTOSAR Workflow

Tier1 : RTE Generation

○ RTE Generation with BSW description

- BSW SWC mapping


- Interface connection between ASW and BSW
- RTE Generation

Confidential | ETAS/ERS-Sk | 2019-10-01


94 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
AUTOSAR Workflow

Tier1 : Software Integration

○ ASW Code

- Manual + Generated (from Model)

○ BSW Code

- BSW (Including OS, MCAL, and CDD)


- Static + Generated (from Configuration)

○ RTE

Confidential | ETAS/ERS-Sk | 2019-10-01


95 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
BSW implementation

CAN frame verification 1


For UDS (ETAS) For Com stack (HWIA)

Sample_DBC_CANNODE_0.dbc 2

20190403_CANFD_WIA_ATC_rev03_190403.dbc
Confidential | ETAS/ERS-Sk | 2019-10-01
96 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
BSW implementation

BSW configuration
○ Remove all frames in ECU before moving to further steps.
○ Click on DBC import icon or in the menu File, select Import 
ISOLAR-AB  DBC Importer
○ In DBC importer
○ “File name”: link to DBC file will be imported.
○ “Network Name”: Set name for network which DBC file is imported

into.

Confidential | ETAS/ERS-Sk | 2019-10-01


97 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
BSW implementation

BSW configuration
○ In DBC importer
○ Select ‘ECU’ in Select ECUs phase
○ Select the effective of DBC file into the system
○ Assign CAN frames and types
- COM (normal COM message)
- NM (Nm message)
- NPDU
- Gateway
- XCP (XCP message)
- DCM (Diagnostic message)
○ Click Finish button to import DBC file.

Confidential | ETAS/ERS-Sk | 2019-10-01


98 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
BSW implementation
RTE
BSW configuration
○ Run “Configuration generation”:
DEM COM ComM
○ The standard COM stack configuration will generated

automatically into Project_EcucValues.arxml file according CAN


State
to system information BswM PDU Router Manager

○ Including CAN configuration: CanEcucValues.arxml

CAN Tp

CAN Interface

CAN Transceiver
Driver

SPIHandler
CAN Driver
Driver

Confidential | ETAS/ERS-Sk | 2019-10-01


99 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
BSW implementation
RTE
BSW configuration
○ Run “Configuration generation”:
DEM COM ComM
○ Modification: for specific requirements purpose and

improving the limitation from tool. CAN


State
○ Static configuration files: “.\Sources\BSW\ecu_config\ BswM PDU Router Manager

bsw\ecuc_values”
CAN Tp

CAN Interface

CAN Transceiver
Driver

SPIHandler
CAN Driver
Driver

Confidential | ETAS/ERS-Sk | 2019-10-01


100 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
BSW implementation
RTE
BSW Code
○ Run “Code generation”:
DEM COM ComM
○ The source code for standard COM stack will generated

automatically .\Sources\BSW\src\bsw\gen CAN


State
○ Core source for following modules BswM PDU Router Manager

○ Including the generated code, indicating for the

configuration CAN Tp

○ Supported features
○ Normal Rx-Tx Can signal
○ Time-out & Bus-off, including recovery feature. CAN Interface

CAN Transceiver
Driver

Input Output
SPIHandler
CAN Driver
Driver
DBC file
RTA-BSW
5.0
Confidential | ETAS/ERS-Sk | 2019-10-01
101 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
BSW implementation
Old New
CAN configuration
Tx Pdu handles
○ Verify the update in CanIf_Cfg.h for

Tx Pdu handles and Rx Pdu handles


○ -> Add new mailbox configuration
○ -> or update the Can ID for specific

Rx mailbox Rx Pdu handles

Confidential | ETAS/ERS-Sk | 2019-10-01


102 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
BSW implementation
Old New
CAN configuration
Tx Pdu handles
○ E.g. Add new mailbox configuration

for Tx

Confidential | ETAS/ERS-Sk | 2019-10-01


103 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
BSW implementation
Old New
CAN configuration
Rx Pdu handles
○ E.g. Update the Can ID for specific Rx

mailbox

Confidential | ETAS/ERS-Sk | 2019-10-01


104 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
BSW implementation POWER
SUPPLY
Manual code development
○ Can Transceiver (SBC - FS6500) ASW
RTE
○ Required when SBC runs as non-debug mode.
BSW CDD
○ Feature
○ Power up: Make CAN transceiver works as MCAL

normal mode (via CAN_LIN_MODE register). Microcontroller SBC


○ Run-time: Get diagnostic information (via (µC) VDD VCORE
DIAG_VSUP_VCAN & DIAG_CAN_FD registers)
Reset Pin RSTB
and transfer to APP if required.
○ Power down: No wake up for CAN CAN Controller CAN Transceiver

○ Note: will dived deeper sharing in CDD training CAN H TXD CAN H
CAN L RXD CAN L
later.
SPI Handler

Confidential | ETAS/ERS-Sk | 2019-10-01


105 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

Composition
Composition
○ To prepare the environment for further development.
○ A Software Composition represents a logical SWC SWC
SWC
1 2
assembly of interacting software components 3

○ Compositions are built from


○ SWC Prototypes
○ Assembly Connector Prototypes
SWC
4

Confidential | ETAS/ERS-Sk | 2019-10-01


106 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

Composition
SWC_CAN_RX
○ To have the available of Com stack, Add necessary SWCs
_10ms_v00
into the Composition, including from BSW and ASW layer.
Receiver
○ AWD_SWC: handle signal data from Com stack AWD_SWC
○ If it is Rx signal, it will get data from Com stack and

transfer to SWC_CAN_RX_10ms_v00 SWC_CAN_TX


_10ms_v00
○ If it is Tx signal, it will get data from
Sender
SWC_CAN_TX_10ms_v00 and transfer to Com
stack

RTE

COM BSW

Confidential | ETAS/ERS-Sk | 2019-10-01


107 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

Can system signal <> AWD_SWC E.g. SR_Interface

○ Create Interface & RPort/PPort SWC_CAN_RX


○ They are known as ‘Sender/Receiver’ (S/R) _10ms_v00 SpeedType speed
communication Receiver
AWD_SWC
○ Used when data is to be ‘pushed’ to a receiver DistanceType odo

SWC_CAN_TX
○ A S/R interface contains Data Elements _10ms_v00 StatusType cond
○ Data Elements are independent from each other Sender
○ Each data element is sent or received
separately
○ Each Data Element has a Data Type RTE

COM BSW

Confidential | ETAS/ERS-Sk | 2019-10-01


108 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

Can system signal <> AWD_SWC

○ Create Interface & RPort/PPort


○ Right click at Software and select Create Interface 

Create Port Interface  Elements | Sender Receiver


Interface
○ Allocate the new interface into existing xml file for easy to

manage.
○ Recommend to create interface name using Signal name

defined in DBC file.

Confidential | ETAS/ERS-Sk | 2019-10-01


109 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

Can system signal <> AWD_SWC

○ Create Interface & RPort/PPort


○ Open Interface editor by double clicking interface name.
○ Click
○ Define VariableData Prototype (VDP) ShortName and its’

Type Reference
○ The interface will be used to describe ports connecting a

Com (Receiver) and a AWD_SWC (Sender)

SRInterface_AWD_Test_Speed

Uint32 AWD_Test_Speed

Confidential | ETAS/ERS-Sk | 2019-10-01


110 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

Can system signal <> AWD_SWC

○ Create Interface & RPort/PPort


○ Open RPort/PPort editor by double clicking
○ Click Pports… button or Rports… button to make suitbale port.
○ Choose Interface correctly like the picture.

Confidential | ETAS/ERS-Sk | 2019-10-01


111 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

Can system signal <> AWD_SWC


AWD_SWC
○ Create Data Access Points
○ We want to execute some code when a signal is

received/transmitted
Runnable
RE_swc_AWD
○ The Runnable also needs to read from the R-port or

write to the P-Port PPort_AWD_Test_Speed

RTE

BSW COM

Confidential | ETAS/ERS-Sk | 2019-10-01


112 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

Can system signal <> AWD_SWC

○ Create Data Access Points


○ The procedure should be like the picture
○ Note: By clicking to the following box, the

access to the Read/Write data is available.

○ Note: by moving to Events Tab, we can see the

time period for the runnable

Confidential | ETAS/ERS-Sk | 2019-10-01


113 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

Can system signal <> AWD_SWC

○ Signal Mapping
○ Right click System in System Info, select Open With  Auto

Signal Mapping
○ Use option “Use Naming Rules” to enable vary method for

mapping signal
○ Note:
○ DEP Name: from Data Element Prototype
○ Signal Name: from Isignal
SRInterface_AWD_Test_Speed
Uint32 AWD_Test_Speed

Confidential | ETAS/ERS-Sk | 2019-10-01


114 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

Can system signal <> AWD_SWC

○ Signal Mapping
○ Click Next button and check the Select all possible mapping
○ The suggestion mapping result will show as following
○ Let’s enable “Select all possible mapping” after verification
○ Click Next > Finish to establish the connection

○ To verify the result, let’s open TopLevelComposition and check

the open port had been closed.

Confidential | ETAS/ERS-Sk | 2019-10-01


115 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

AWD_SWC <> Other_SWCs


SWC_CAN_RX
○ Create Interface & RPort/Pport _10ms_v00

○ Create Data Access Points Receiver


AWD_SWC
○ -> Similar with the previous section

SWC_CAN_TX
_10ms_v00
○ Signal Mapping
○ Open TopLevelComposition Sender

○ Click Auto Assemble button ( )


○ This will help you to make connection between SWC
RTE

COM BSW

Confidential | ETAS/ERS-Sk | 2019-10-01


116 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

System Information
Composition
○ ECU Extract
DEPLOYMENT
SWC SWC
SWC
1 2
Composition 3

SWC
4

ECU

Confidential | ETAS/ERS-Sk | 2019-10-01


117 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

System Information

○ Generate ECU Extract


○ Right clicking on the System and select Create ECU Extract
○ Click Finish button in dialog Create ECUExtract.

○ The output will automatically store into


○ EXTR_AWD: output from System, is the top level element of the

System Description (e.g. SWC map to ECU, system signals, …)


○ AWD_FlatMap: is the middle output, contains a list of references to

software objects. This list is used to identify instances and to resolve


name conflicts
○ AWD_FlatView: output from TopLevelComposition which contains the

info of each SWC (Rport-Pport) and connection among them.

Confidential | ETAS/ERS-Sk | 2019-10-01


118 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development
Composition
Mapping Runnable
to Task SWC SWC SWC
1 2 3

SWC
4

R1 R2 R3 R4
Task1_ECU Task2_ECU Task3_ECU

Confidential | ETAS/ERS-Sk | 2019-10-01


119 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development
Mapping Runnable
to Task
○ Drag and Drop from right to

left to map the RE to task.


○ The result will be as

following

Confidential | ETAS/ERS-Sk | 2019-10-01


120 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

Generate RTE
○ Select the root folder of project

○ Click ( ) or In toolbar, select menu


RTE  RTE Generate Phase Wizard.
○ Enter the information of RTE Tool Path and

Output Dir Path


○ Fill the Additional Commands with
○ --notimestamps --os-define-

osenv=RTAOS40

Confidential | ETAS/ERS-Sk | 2019-10-01


121 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
AWD_SWC Other_SWCs
ASW development
RTE
Result
○ In side the BSW, the following feature are

now available DEM COM ComM

○ Time-out & Bus-off, including recovery


CAN
feature. State
PDU Router Manager
BswM
○ In APP, we can recognize
○ Normal Rx-Tx Can signal
CAN Tp
○ -> In-case of Time-out, Let’s following

next slide.
○ -> Incase of Bus-off, it’ll introduced in
CAN Interface

Diagnostic section later. CAN Transceiver


Driver

SPIHandler
CAN Driver
Driver

Confidential | ETAS/ERS-Sk | 2019-10-01


122 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
AWD_SWC Other_SWCs
ASW development
RTE
Timeout notification
○ COM provide the service for monitoring of

receive signals (signals timeout) DEM COM ComM

○ After waiting for a while of Rx signals, the


CAN
notification event will be raised to APP. State
PDU Router Manager
BswM
○ Note:
○ Polling
CAN Tp
○ Notification
○ Detection

CAN Interface

CAN Transceiver
Driver

SPIHandler
CAN Driver
Driver

CAN
Confidential | ETAS/ERS-Sk | 2019-10-01
123 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

Timeout notification
○ Step1: Configure the timeout for all CAN

signals.
○ Double click on the System
○ In the System Editor, navigate to

Isignal Ports

Confidential | ETAS/ERS-Sk | 2019-10-01


124 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
ASW development

Timeout notification
○ Step2: Create DataElement required to ComSpec: Communication attributes of PortPrototype with respect communication interface.

handle Rx signal timeout value.


○ In the area of AWD_SWC
○ Find the RPorts connecting to the Rx signal

and follow the procedure as figures.


○ Add the RequiredComSpecs in

RPortPrototype
Ref: Specification
○ Add Timeout Value andofrefer
RTE Software
to DataElement
Section 4.3.1.7 Communication Time-out

If AliveTimeout attribute is present, RTE shall


provide the time-out callback function

DataElement should be referred to raise an event


of a reception time-out.
Confidential | ETAS/ERS-Sk | 2019-10-01
125 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology Path <./Source/BSW/src/bsw/gen/Com/Com_Cfg.c>
[EXAMPLE]
ASW development /* Rx Timeout Notification callback function for IPDU :
EMS_06_100ms_Can_Network_CANNODE_0 */
FUNC(void,COM_CODE) Com_RxTONotify_EMS_06_100ms_Can_Network_CANNODE_0(void)
Timeout notification {
Rte_COMCbkTOut_EMS06_Bitset_03();
Rte_COMCbkTOut_EMS06_Bitset_02();
○ Click following button Rte_COMCbkTOut_EMS06_Bitset_01();
}
○ -> BSW Configuration
○ -> BSW Code Path <./Source/RTE/gen/Rte.c>
[EXAMPLE]
○ Result: generate Rx Timeout Notification FUNC(void, RTE_CODE)
Rte_COMCbkTOut_EMS06_Bitset_03(void)
callback function for IPDU {
/* Box: test begin */
#if !defined(RTE_OMIT_UNINIT_CHECK)
if ( TRUE != Rte_Initialized )
○ -> RTE {
return;
○ Result: generate Rx Timeout Notification }
#endif /* !defined(RTE_OMIT_UNINIT_CHECK) */
/* Box: test end */
callback function for each signal of IPDU /* Box: initialize begin */
/* Box: initialize end */
/* Box: receive begin */
/* Box: receive end */
/* Box: process begin */
Rte_Rx_000046_status |= ((VAR(Std_ReturnType,
AUTOMATIC))RTE_E_MAX_AGE_EXCEEDED);
/* Box: process end */
}
Confidential | ETAS/ERS-Sk | 2019-10-01
126 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Methodology
Os

Generate Os
○ 1. Verify the update in following input files 1
for Os

○ 2. Execute generate Os library if required


2

Confidential | ETAS/ERS-Sk | 2019-10-01


127 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Order of Contents

1. Architecture
2. Methodology

3. Application interfaces
4. Introduction of Final Delivery

Confidential | ETAS/ERS-Sk | 2019-10-01


128 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Application interfaces
ASW development

Interface Definitions in AUTOSAR


○ AUTOSAR distinguishes between three types

of interfaces:
○ AUTOSAR Interface
○ Standardized Interface
○ Standardized AUTOSAR Interface

Confidential | ETAS/ERS-Sk | 2019-10-01


129 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Application interfaces
ASW development

Interface Definitions in AUTOSAR


SWC_CAN_RX
○ AUTOSAR distinguishes between three types AWD_SWC _10ms_v00
of interfaces:
Receiver
○ AUTOSAR Interface Runnable
RE_swc_AWD
○ Is a generic interface, which is derived

from the ports of any SWC. SWC_CAN_TX


_10ms_v00
○ Are provided by the RTE and serve as
Sender
interfaces between SWCs or between
RTE
an SWC and the ECU firmware
(IoHwAb, Complex Drivers).
BSW
○ An SWC might read input values and

write output values via these interfaces,


for example.

Confidential | ETAS/ERS-Sk | 2019-10-01


130 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Application interfaces
ASW development

Interface Definitions in AUTOSAR


SWC_CAN_RX
○ AUTOSAR distinguishes between three types AWD_SWC _10ms_v00
of interfaces:
Receiver
○ Standardized Interface Runnable
RE_swc_AWD
○ Is an interface which is predefined by

the AUTOSAR standard as an API in the SWC_CAN_TX


_10ms_v00
C language.
○ It is used between BSW modules in an
Sender
RTE
ECU, between the RTE and the
operating system or between the RTE
BSW COM

and the BSW module Com.

Confidential | ETAS/ERS-Sk | 2019-10-01


131 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Application interfaces
ASW development

Interface Definitions in AUTOSAR


○ AUTOSAR distinguishes between three types
Diag_SWC
of interfaces:
○ Standardized AUTOSAR Interface
Runnable
○ Is a special AUTOSAR interface RE_Diag_SWC

predefined by the AUTOSAR standard.


R_CANSM_E_BUS_OFF_NETWORK_0
○ These types of interfaces are used by

SWCs for access to AUTOSAR services,


RTE
which are provided by BSW modules of
EvtInfo_CANSM_E_BUS_OFF_NETWORK_0
the Service Layer, such as the ECU State
Manager or the Diagnostic Event
BSW DEM

Manager.

Confidential | ETAS/ERS-Sk | 2019-10-01


132 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Application interfaces
ASW development

Manual code development


○ In here, it required the manual code for data
SWC_CAN_RX
exchange
AWD_SWC _10ms_v00
○ Tx: Get data from CAN Tx signal and Receiver
transfer to SWC_CAN_RX_10ms_v00
Runnable
RE_swc_AWD
○ Rx: Get data from
SWC_CAN_TX
SWC_CAN_TX_10ms_v00 and transfer to _10ms_v00
CAN Rx signal
Sender
RTE

BSW COM

Confidential | ETAS/ERS-Sk | 2019-10-01


133 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Application interfaces
ASW development

Manual code development


Service name Rte_IRead_RE_swc_AWD_RPort_<RxSignalName>_<RxSignalName>
○ AWD_SWC
Description This service is used to read raw data of CAN RX signals with signal size is fit into 4 bytes.
○ Read CAN Rx signal The prototype is generated automatically based on number of available RX CAN signals
defined from DBC for each target ECU.

Example (ABSESC01_Bitset_01):
Rte_IRead_RE_swc_AWD_RPort_ABSESC01_Bitset_01_ABSESC01_Bitset_01();

Transfer to

Service name Rte_IWriteRef_RE_swc_AWD_PPort_<RxSignalName>_<RxSignalName>

○ SWC_CAN_RX_10ms_v00 Description This service is used to transfer raw data of CAN RX signals from AWD_SWC to
SWC_CAN_RX_10ms_v00.
○ Got transferred data via The prototype is generated automatically based on number of available RX CAN signals
CanRX_Mapping_Process() defined from DBC for each target ECU.

Example (ABSESC01_Bitset_01):
Rte_IWriteRef_RE_swc_AWD_PPort_ABSESC01_Bitset_01_ABSESC01_Bitset_01 ();

Confidential | ETAS/ERS-Sk | 2019-10-01


134 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Application interfaces
ASW development

Manual code development


Service name Rte_IStatus_RE_swc_AWD_RPort_<RxSignalName>_<RxSignalName>
○ AWD_SWC
Description This service is used to read raw data of CAN RX signals status with size is fit into 1 byte.
○ Read CAN Rx signal status The prototype is generated automatically based on number of available RX CAN signals
defined from DBC for each target ECU.

Example (ABSESC01):
Rte_IStatus_RE_swc_AWD_RPort_ABSESC01_Bitset_01_ABSESC01_Bitset_01 ();

Transfer to

Service name Rte_IWriteRef_RE_swc_AWD_PPort_<RxSignalStat>_<RxSignalStat>

○ SWC_CAN_RX_10ms_v00 Description This service is used to transfer raw data of CAN RX signals status from AWD_SWC to
SWC_CAN_RX_10ms_v00.
○ Got transferred data via The prototype is generated automatically based on number of available RX CAN signals
CanRX_Mapping_Process() defined from DBC for each target ECU.

Example (ABSESC01_Rx_Stat):
Rte_IWriteRef_RE_swc_AWD_PPort_ABSESC01_Rx_Stat_ABSESC01_Rx_Stat ();

Confidential | ETAS/ERS-Sk | 2019-10-01


135 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Application interfaces
ASW development

Manual code development


Service name Rte_IWriteRef_RE_swc_AWD_PPort_<TxSignalName>_<TxSignalName>
○ AWD_SWC
Description This service is used to update raw data of CAN TX signals.
○ Update CAN Tx system signal The prototype is generated automatically based on number of available TX CAN signals
defined from DBC for each target ECU.

Example (AWD01_Bitset_01):
Rte_IWriteRef_RE_swc_AWD_PPort_AWD01_Bitset_01_AWD01_Bitset_01();

Transfer to

Service name Rte_IWrite_Runnable_Step_11_<TxSignalName>_<TxSignalName>(data)

○ SWC_CAN_TX_10ms_v00 Description This service is used to update raw data of CAN TX signals.
The prototype is generated automatically based on number of available RX CAN signals
○ Update the CAN Tx signal and defined from DBC for each target ECU.
transfer it to AWD_SWC via
Example (AWD01_Bitset_01):
CanTX_Mapping_Process() Rte_IWrite_Runnable_Step_11_AWD01_Bitset_01_AWD01_Bitset_01(data);

Confidential | ETAS/ERS-Sk | 2019-10-01


136 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Application interfaces
ASW development

Manual code development


Service name Rte_Call_R_CANSM_E_BUS_OFF_NETWORK_0_GetEventFailed
○ AWD_SWC
○ BUS OFF Testing Description Function is used to read current status of Bus Off event. If bus off event was happened
and did not recover yet, EventFailed is set as TRUE. If there is no bus off happened or it is
recovered yet. Then EventFailed is set as FALSE.

Confidential | ETAS/ERS-Sk | 2019-10-01


137 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Order of Contents

1. Architecture
2. Methodology
3. Application interfaces

4. Introduction of Final Delivery

Confidential | ETAS/ERS-Sk | 2019-10-01


138 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Introduction of Final Delivery
Com stack

AWD_SWC
SWC_CAN_RX
○ This SWC is used to handle the Communication on CAN.
_10ms_v00
○ The SWC is connected to the Com module to receive the signal listed in the
Receiver
table below and gateway the Rx signal to the equivalent Tx. AWD_SWC

Parameter Value SWC_CAN_TX


description 1 RPort_<RxSignalName> _10ms_v00
Timing event 10ms 2 PPort_<TxSignalName> 1 2 Sender
Runnable RE_swc_AWD

RTE

20190403_CANFD_WIA_ATC_rev03_190403.dbc COM

BSW
PduR

Confidential | ETAS/ERS-Sk | 2019-10-01


139 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Introduction of Final Delivery
Com stack

PDU
○ PDU payload after successfully

importing *dbc file.


○ For Com stack
○ And for UDS stack

Confidential | ETAS/ERS-Sk | 2019-10-01


140 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Introduction of Final Delivery
Com stack

COM
○ Configuration parameters of the

AUTOSAR COM module's I-PDUs.

Confidential | ETAS/ERS-Sk | 2019-10-01


141 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Introduction of Final Delivery
Com stack

COM sd Com-Rte Interaction RxIndication

«module» «module» «module»


Rte Com PduR

○ Configuration parameters of the


alt Unpacking Com_RxIndication(PduIdType,
AUTOSAR COM module's I-PDUs. [Unpack.Immediate] Rte_COMCbk_signalX()
PduInfoType*)

○ Reception – PduR to RTE


internal
processing() Immediate
internal
Rte_COMCbk_signalY()
I-PDU
processing()

[Unpack.Deferred] Com_RxIndication(PduIdType,
PduInfoType*)

set flag, copy


data()

Deferred
check
flag() I-PDU
alt check flag

[flag set] Rte_COMCbk_signalX()

internal
processing()

Rte_COMCbk_signalY()

internal
processing()

[flag not set]

Confidential | ETAS/ERS-Sk | 2019-10-01


142 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Introduction of Final Delivery
Com stack

COM
○ Com invokes RTE generated callback for each

unpacked signal
sd Com-Rte Interaction RxIndication

«module» «module»
Rte Com

alt Unpacking Com_RxIndication(PduIdType,


PduInfoType*)
[Unpack.Immediate] Rte_COMCbk_signalX()

internal
processing()

Rte_COMCbk_signalY()

internal
processing()

[Unpack.Deferred] Com_RxIndication(PduIdType,
PduInfoType*)

set flag, copy


data()

Confidential | ETAS/ERS-Sk | 2019-10-01 check


143 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
flag()
Introduction of Final Delivery
Com stack

COM
○ Transmission mode for each Tx

IPDU
○ AWD_01_20ms
○ AWD_R_10ms

Confidential | ETAS/ERS-Sk | 2019-10-01


144 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Introduction of Final Delivery
Com stack

PduR
○ Routing information in PduR

configuration

Confidential | ETAS/ERS-Sk | 2019-10-01


145 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Introduction of Final Delivery
Com stack

CanIf
○ Rx mailbox

Confidential | ETAS/ERS-Sk | 2019-10-01


146 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Introduction of Final Delivery
Com stack

CanIf
○ Tx mailbox

Confidential | ETAS/ERS-Sk | 2019-10-01


147 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Introduction of Final Delivery
Com stack

Can
○ Rx-Tx mailbox used as the

reference in Tresos
configuration later

Confidential | ETAS/ERS-Sk | 2019-10-01


148 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Introduction of Final Delivery
Com stack

ComM

Confidential | ETAS/ERS-Sk | 2019-10-01


149 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Introduction of Final Delivery
Com stack

CanSM
○ General configuration &

mode request handling

○ Duration to accept the request


○ E.g. Bus-off request from Can driver
○ 1st parameter: As least 5 time continue bus-off
○ 2nd parameter: duration the CanSM module shall

repeat mode change requests by using the API of the


CanIf module.

Confidential | ETAS/ERS-Sk | 2019-10-01


150 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Introduction of Final Delivery
Com stack

CanSM
○ Bus-Off event handling

with recovery timing


parameters

Confidential | ETAS/ERS-Sk | 2019-10-01


151 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Introduction of Final Delivery
Com stack

Schedule task

Task/ISR Runnable function SWC Priority Cyclic (ms)


ASW_InitTask Runnable_Init_02 CPT_CAN_RX_10ms_v00 70 1 time
Runnable_Init_11 CPT_CAN_TX_10ms_v00 access
AswTask_10ms Runnable_Step_02 CPT_CAN_RX_10ms_v00 35 10
Runnable_Step_11 CPT_CAN_TX_10ms_v00
RE_swc_AWD CPT_Awd_SWC
BswTask_10ms CanSM_MainFunction CanSM 30 10
ComM_MainFunction_ComMChannel_Can_Network_Channel ComM
Com_MainFunctionTx Com
Com_MainFunctionRx Com
BswTask_1ms Can_MainFunction_Write Can 50 1
Can_MainFunction_Read Can
Can_MainFunction_BusOff Can
Can_MainFunction_Mode Can

Confidential | ETAS/ERS-Sk | 2019-10-01


152 © ETAS GmbH 2018. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Thank you

You might also like