AUTOSAR Diagnostics Stack
AUTOSAR Diagnostics Stack
Industry
AUTOSAR Diagnostics Stack
“If horses had controlled investment
decisions, there would have been no auto
industry.”
— Warren Buffett
01
Overview of
Diagnostics Protocols
The way I drive, the way I handle a car, is an
expression of my inner feelings.
Lewis Hamilton
Introduction
● Standardization committees presented some standards that specify the operations and services that
can be used , in order to serve different use cases of automotive diagnostics
○ Unified Diagnostics Protocol (UDS) - ISO - 14229 (Commonly used in all ECUs)
○ Onboard Diagnostics Protocol (OBD) - ISO - 15031 (Only used in few ECUs)
● AUTOSAR provides standard , well-defined and modular specifications for implementing most
commonly used Diagnostics protocols (e.g. DCM , DEM , …)
Diagnostics Protocols
● Diagnostic system model consists of:
○ Diagnostic tool
○ Ecu(s) to be diagnosed
○ Communication channel between the diagnostics tool and diagnosed ECU(s) e.g. CAN , LIN …
● The diagnostic tool requests a service and the ECU responds with results
○ Service Request
SID Data
● Functional Addressing
○ Broadcasting a request to all ECUs
● The ECU response behavior depends on the addressing format of the request
○ Physical Addressing : Respond if required
○ Functional Addressing : Some negative responses are suppressed (e.g.
ServiceNotSupported (0x11) , SubFunctionNotSupported (0x12) ,
RequestOutOfRange(0x31)
02
UDS Services
I love fast cars… and to go too fast in them.
Lara Flynn Boyle
UDS Services
● Most Common UDS Services
Sub-function
SID 0x10
(Session Type)
● Sub-function :
○ Default Session (0x01)
○ Programming Session (0x02)
○ Extended Session (0x03)
○ Response Format
Sub-function Session
RSID 0x50
(Session Type) Parameter Record
UDS Services
● Ecu Reset (0x11)
○ Ecu Reset service allows the external tester to request server reset
○ DCM is responsible for requesting system reset from application layer
○ DCM shall send the service positive response before performing the server reset
○ After a successful reset , the DCM shall activate the default session
○ Examples of Ecu Reset
■ Hard Reset : Simulates the power on sequence typically performed after the server got
connected from the power supply
■ Soft Reset : This is implementation specific reset type , typically used to restart the
application layer without re-initializing the basic software
UDS Services
● Ecu Reset (0x11)
○ Request Format
Sub-function
SID 0x11
(Reset Type)
● Sub-function :
○ Hard Reset (0x01)
○ KeyOffOn Reset (0x02)
○ Soft Reset (0x03)
○ Response Format
Sub-function
RSID 0x51
(Reset Type)
UDS Services
● Security Access (0x27)
○ Access to some services needs to be restricted for security matters
Request Seed
SID 0x27
0x01,0x03, ...
● Sub-function :
○ “Request Seed” for security level 1 ( 0x01)
○ “Request Seed” for security level 2 (0x03)
○ …..
○ Response Format
Request Seed
RSID 0x67 Security Seed
0x01,0x03, ...
UDS Services
● Security Access Control (0x27) - Send Key
○ Request Format
Send Key
SID 0x27 Security Seed
0x02,0x04, ...
● Sub-function :
○ “Send Key” for security level 1 (0x02)
○ “Send Key” for security level 2 (0x04)
○ …..
○ Response Format
Send Key
RSID 0x67
0x02,0x04, ...
UDS Services
● Read Data By Identifier (0x22)
○ Client uses RDBI service to request one or more “two bytes data identifiers” (DID) that
identify data records
○ DIDs with read access type can be used with RDBI service
○ DIDs can be used to represent data from application or from BSW modules
○ Request Format
○ Response Format
○ DIDs with write access type can be used with WDBI service
○ DIDs can be used to represent data from application or from BSW modules
○ Request Format
○ Response Format
● Time-Based Algorithm:
○ Time based algorithm monitors functions with timeout
○ Dem starts the internal debounce time to qualify events as failed, when monitors reported
PREFAILED status
○ When the configured DemDebounceTimeFailedThreshold value is reached , the event is
qualified as failed
○ Dem starts the internal debounce time to qualify events as passed , when monitors report
PREPASSED status
○ When the configured DemDebounceTimePassedThreshold value is reached , the event is then
qualified as passed
Diagnostics modules
● DET Module Functionality
○ BSW modules and SW components report all detected development errors to the Det
○ Det provides the API Det_ReportErro for tracing the occurrence of the error and it’s related
information
www.imtschool.com
www.facebook.com/imaketechnologyschool/