MICROSAR XCP
Technical Reference
Version 6.0.2
Authors
vishr
Status
Released
Technical Reference MICROSAR XCP
© 2021 Vector Informatik GmbH Version 6.0.2 2
based on template version 6.0.1
Document Information
History
Author
Date
Version
Remarks
Vishr
2017-02-13
1.00.00
Initial Version
Vishr
2017-11-14
2.00.00
Added new API Xcp_SetStimMode
Vishr
2018-07-06
2.00.01
Fixed Copy&Paste error in chapter 5.5.2
Vishr
2018-11-13
3.00.00
Added Relative ODT, Absolute DAQ mode
Some clarifications
Vishr
2019-03-28
4.00.00
STORY-7952 Support IF Modules on different cores for
XCP
Vishr
2020-07-29
5.00.00
SWAT-1093 XCP Event Extension to support dynamic
memory
SWAT-880 XCP multi frame seed/key support
Vishr
2020-09-15
5.00.01
Minor clarifications
Vishr
2021-04-29
6.00.00
Added complementary channel
ESCAN00108827 TechRef erroneously states that the
Max DTO is limited to 255.
Vishr
2021-08-21
6.00.01
Improved Howto.
vishr
2021-10-04
6.00.02
Improved Howto.
Reference Documents
No.
Source
Title
Version
[1]
AUTOSAR
AUTOSAR_SWS_XCP.pdf
2.3.0
[2]
AUTOSAR
AUTOSAR_SWS_DET.pdf
3.4.1
[3]
AUTOSAR
AUTOSAR_SWS_DEM.pdf
5.2.0
[4]
AUTOSAR
AUTOSAR_BasicSoftwareModules.pdf
V1.0.0
[5]
ASAM
ASAM_AE_MCD-1-XCP_Protocol-Layer_BS_V1-2-0.pdf
V1.2
[6]
VECTOR
UserManual_Multi-Core.pdf
1.1.3
Scope of the Document
This document describes the features, APIs, and integration of the XCP Protocol Layer.
This document does not cover the XCP Transport Layers for CAN, FlexRay and Ethernet,
which are available at Vector Informatik.
Further information about XCP on CAN, FlexRay and Ethernet Transport Layers can be
found in their documentation.
Please also refer to “The Universal Measurement and Calibration Protocol Family”
specification by ASAM e.V.
The XCP Protocol Layer is a hardware independent protocol that can be ported to almost
any hardware. Due to there are numerous combinations of micro controllers, compilers
and memory models it cannot be guaranteed that it will run properly on any of the above-
mentioned combinations.
Technical Reference MICROSAR XCP
© 2021 Vector Informatik GmbH Version 6.0.2 3
based on template version 6.0.1
Please note that in this document the term Application is not used strictly for the user
software but also for any higher software layer, like e.g. a Communication Control Layer.
Therefore, Application refers to any of the software components using XCP.
The API of the functions is described in a separate chapter at the end of this document.
Info
The source code of the XCP Protocol Layer, configuration examples and
documentation are available on the Internet at www.vector-informatik.de in a functional
restricted form.
Caution
We have configured the programs in accordance with your specifications in the
questionnaire. Whereas the programs do support other configurations than the one
specified in your questionnaire, Vector´s release of the programs delivered to your
company is expressly restricted to the configuration you have specified in the
questionnaire.
Technical Reference MICROSAR XCP
© 2021 Vector Informatik GmbH Version 6.0.2 4
based on template version 6.0.1
Contents
1 Introduction................................................................................................................. 10
1.1 Architecture Overview ...................................................................................... 10
2 Functional Description ............................................................................................... 12
2.1 Features .......................................................................................................... 12
2.1.1 Deviations ........................................................................................ 12
2.1.2 Additions/ Extensions ....................................................................... 14
2.2 Initialization ...................................................................................................... 14
2.3 States .............................................................................................................. 14
2.4 Main Functions ................................................................................................ 15
2.4.1 Xcp_MainFunction ........................................................................... 15
2.4.2 Xcp_TlMainFunction ........................................................................ 15
2.5 Block Transfer Communication Model .............................................................. 16
2.6 Slave Device Identification ............................................................................... 16
2.6.1 XCP Station Identifier ....................................................................... 16
2.6.2 XCP Generic Identification ............................................................... 16
2.7 Seed & Key ...................................................................................................... 16
2.8 Checksum Calculation ..................................................................................... 17
2.8.1 Custom CRC calculation .................................................................. 17
2.9 Memory Access by Application ......................................................................... 18
2.9.1 Special use case “Type Safe Copy” ................................................. 18
2.10 Memory Read and Write Protection ................................................................. 18
2.11 Event Codes .................................................................................................... 19
2.12 Service Request Messages ............................................................................. 19
2.13 User Defined Command................................................................................... 20
2.14 Synchronous Data Transfer ............................................................................. 20
2.14.1 Synchronous Data Acquisition (DAQ) ............................................... 20
2.14.2 DAQ Timestamp ............................................................................... 21
2.14.3 Power-Up Data Transfer................................................................... 21
2.14.4 Data Stimulation (STIM) ................................................................... 22
2.14.5 Bypassing ........................................................................................ 22
2.14.6 Data Acquisition Plug & Play Mechanisms ....................................... 22
2.14.7 Event Channel Plug & Play Mechanism ........................................... 23
2.14.8 Send Queue ..................................................................................... 23
2.14.9 Data consistency .............................................................................. 23
2.14.10 16 Bit PID “Relative ODT, Absolute DAQ” ........................................ 24
2.14.11 Complementary Channel.................................................................. 24
2.15 The Online Data Calibration Model .................................................................. 25
Technical Reference MICROSAR XCP
© 2021 Vector Informatik GmbH Version 6.0.2 5
based on template version 6.0.1
2.15.1 Page Switching ................................................................................ 25
2.15.2 Page Switching Plug & Play Mechanism .......................................... 26
2.15.3 Calibration Data Page Copying ........................................................ 26
2.15.4 Freeze Mode Handling ..................................................................... 26
2.16 Flash Programming .......................................................................................... 26
2.16.1 Flash Programming by the ECU’s Application .................................. 27
2.16.2 Flash Programming Plug & Play Mechanism .................................... 27
2.16.3 Flash Programming with a Flash Kernel ........................................... 27
2.17 Multi Core Support ........................................................................................... 28
2.17.1 Type Safe Copy ............................................................................... 28
2.17.2 DAQ/STIM with Multi Core ............................................................... 29
2.18 Timestamps ..................................................................................................... 30
2.19 En- / Disabling the XCP module ....................................................................... 30
2.20 XCP measurement during the post event time ................................................. 30
2.21 Error Handling .................................................................................................. 31
2.21.1 Development Error Reporting ........................................................... 31
2.21.2 Production Code Error Reporting ..................................................... 32
3 Integration ................................................................................................................... 34
3.1 Scope of Delivery ............................................................................................. 34
3.1.1 Static Files ....................................................................................... 34
3.1.2 Templates – user modifiable ............................................................. 34
3.1.3 Dynamic Files .................................................................................. 34
3.1.4 Generated a2l files ........................................................................... 34
3.2 Critical Sections ............................................................................................... 35
3.2.1 XCP_EXCLUSIVE_AREA_0 ............................................................ 35
3.2.2 XCP_EXCLUSIVE_AREA_1 ............................................................ 35
3.2.3 XCP_EXCLUSIVE_AREA_2 ............................................................ 35
3.3 Memory Mapping ............................................................................................. 36
4 API Description ........................................................................................................... 37
4.1 Type Definitions ............................................................................................... 37
4.2 Structure Definitions ......................................................................................... 37
4.3 Services provided by XCP ............................................................................... 37
4.3.1 Xcp_InitMemory ............................................................................... 37
4.3.2 Xcp_Init ............................................................................................ 38
4.3.3 Xcp_Event ....................................................................................... 38
4.3.4 Xcp_DaqConfigInit ........................................................................... 39
4.3.5 Xcp_EventEx ................................................................................... 40
4.3.6 Xcp_StimEventStatus ...................................................................... 41
4.3.7 Xcp_MainFunction ........................................................................... 42