XCP - Part 3 - Transport Layer Specification XCP On CAN - 1.0
XCP - Part 3 - Transport Layer Specification XCP On CAN - 1.0
Version 1.0
Part 3
XCP on CAN - Transport Layer Specification
Date: 2003-04-08
Authors: Roel Schuermans, Vector Informatik GmbH
Rainer Zaiser, Vector Informatik GmbH
Frank Hepperle, DaimlerChrysler AG
Hans Schröter, DaimlerChrysler AG
Reiner Motz, Robert Bosch GmbH
Andreas Aberfeld, Robert Bosch GmbH
Hans-Georg Kunz, Siemens VDO Automotive AG
Thomas Tyl, Siemens VDO Automotive AG
Robert Leinfellner, dSPACE GmbH
Hendirk Amsbeck, dSPACE GmbH
Harald Styrsky, Compact Dynamics GmbH
Boris Ruoff, ETAS GmbH
Lars Wahlmann, Accurate Technologies Inc.
Version: 1.0
Doc-ID: XCP - Part 3- Transport Layer Specification
XCP on CAN -1.0
Status: Released
Type Final
Disclaimer of Warranty
Although this document was created with the utmost care it cannot be guaranteed
that it is completely free of errors or inconsistencies.
ASAM e.V. makes no representations or warranties with respect to the contents or
use of this documentation, and specifically disclaims any expressed or implied
warranties of merchantability or fitness for any particular purpose. Neither ASAM
nor the author(s) therefore accept any liability for damages or other consequences
that arise from the use of this document.
ASAM e.V. reserves the right to revise this publication and to make changes to its
content, at any time, without obligation to notify any person or entity of such
revisions or changes.
This revision history shows only major modifications between release versions.
0 Introduction ........................................................................................................6
0.1 The XCP Protocol Family .......................................................................................... 6
0.2 Documentation Overview .......................................................................................... 7
0.3 Definitions and Abbreviations ................................................................................... 8
This document is based on experiences with the CAN Calibration Protocol (CCP) version 2.1 as
described in feedback from the companies Accurate Technologies Inc., Compact Dynamics GmbH,
DaimlerChrysler AG, dSPACE GmbH, ETAS GmbH, Kleinknecht Automotive GmbH, Robert Bosch
GmbH, Siemens VDO Automotive AG and Vector Informatik GmbH.
The XCP Specification documents describe an improved and generalized version of CCP.
The generalized protocol definition serves as standard for a protocol family and is called “XCP”
(Universal Measurement and Calibration Protocol).
The “X” generalizes the “various” transportation layers that are used by the members of the protocol
family e.g “XCP on CAN”, “XCP on TCP/IP”, “XCP on UDP/IP”, “XCP on USB” and so on.
XCP
CAN TCP/IP UDP/IP USB ...
Part 1 “Overview” gives an overview over the XCP protocol family, the XCP features and the
fundamental protocol definitions.
Part 2 “Protocol Layer Specification” defines the generic protocol, which is independent from the
transportation layer used.
Part 3 “Transport Layer Specification” defines the way how the XCP protocol is transported by a
particular transportation layer like CAN, TCP/IP and UDP/IP.
This document describes the way how the XCP protocol is transported on CAN.
Part 4 “Interface Specification” defines the interfaces from an XCP master to an ASAM MCD 2MC
description file and for calculating Seed & Key algorithms and checksums.
Part 5 “Example Communication Sequences” gives example sequences for typical actions
performed with XCP.
Everything not explicitly mentioned in this document, should be considered as implementation specific.
The following table gives an overview about the most commonly used definitions and
abbreviations throughout this document.
Abbreviation Description
A2L File Extension for an ASAM 2MC Language File
AML ASAM 2 Meta Language
ASAM Association for Standardization of Automation and Measuring Systems
BYP BYPassing
CAL CALibration
CAN Controller Area Network
CCP Can Calibration Protocol
CMD CoMmanD
CS CheckSum
CTO Command Transfer Object
CTR CounTeR
DAQ Data AcQuisition, Data AcQuisition Packet
DTO Data Transfer Object
ECU Electronic Control Unit
ERR ERRor Packet
EV EVent Packet
LEN LENgth
MCD Measurement Calibration and Diagnostics
MTA Memory Transfer Address
ODT Object Descriptor Table
PAG PAGing
PGM ProGraMming
PID Packet IDentifier
RES command RESponse packet
SERV SERVice request packet
SPI Serial Peripheral Interface
STD STanDard
STIM Data STIMulation packet
TCP/IP Transfer Control Protocol / Internet Protocol
TS Time Stamp
UDP/IP Unified Data Protocol / Internet Protocol
USB Universal Serial Bus
XCP Universal Calibration Protocol
1.1 Addressing
The master can use GET_SLAVE_ID to detect all XCP slaves within a CAN network. The
master has to send GET_SLAVE_ID with the XCP Broadcast CAN identifier.
XCP on CAN uses at least two different CAN identifiers for each independent slave: one
identifier for the CMD and STIM packets and one identifier for the RES, ERR, EV, SERV and
DAQ packets.
The STIM CAN Identifiers may be the same as the CMD CAN Identifier or may be assigned by
the SET_DAQ_ID command.
The DAQ CAN Identifiers may be the same as the RES/ERR/EV/SERV CAN Identifier or may
be assigned by the SET_DAQ_ID command.
The assignment of CAN message identifiers to the XCP objects CMD/STIM and
RES/ERR/EV/SERV/DAQ is defined in the slave device description file (e.g. the ASAP2 format
description file), which is used to configure the master device. It is recommended that the bus
priority of the message objects be carefully determined in order to avoid injury to other real-time
communication on the bus. Also, the CMD/STIM should obtain higher priority than the
RES/ERR/EV/SERV/DAQ.
The most significant bit (of the 32-bit value) set, indicates a 29 bit CAN identifier.
1.3.1 Header
For XCP on CAN, the Tail consists of a Control Field containing optional Fill bytes.
The maximum data length of a CAN message and therefore maximum length of an XCP on
CAN message is MAX_DLC = 8.
If the length (LEN) of an XCP Packet equals MAX_DLC, the Control Field of the XCP Tail is
empty and the XCP on CAN Message is the same as the XCP Packet (DLC = LEN =
MAX_DLC).
If LEN is smaller than MAX_DLC, there’re 2 possibilities to set the DLC.
A first possibility is to set DLC = LEN. The Control Field of the XCP Tail is empty and the XCP
on CAN Message is the same as the XCP Packet.
XCP Packet
XCP Tail
DLC PID .... empty
LEN
A second possibility is to set DLC = MAX_DLC = 8. The Control Field of the XCP Tail contains
MAX_DLC – LEN fill bytes. The contents of the FILL bytes is “don’t care”.
With MAX_DLC_REQUIRED, the slave can inform the master that it has to use CAN frames
with DLC = MAX_DLC = 8 when sending to the slave.
The master can use GET_SLAVE_ID to detect all XCP slaves within a CAN network.
At the same time, the master gets to know the CAN identifier the master has to use when
transferring CMD/STIM to a specific slave and the CAN identifier this slave uses for transferring
RES/ERR/EV/SERV/DAQ.
The master has to send GET_SLAVE_ID with the XCP Broadcast CAN identifier.
If the master sends an XCP message with the XCP Broadcast CAN identifier, all XCP slaves
that are connected to the CAN network have to respond. GET_SLAVE_ID is the only XCP
message that can be broadcasted.
A slave always has to respond to GET_SLAVE_ID, even if the slave device is not in Connected
state yet.
The slave has to send the response with the CAN identifier it uses for transferring
RES/ERR/EV/SERV/DAQ.
The master sends GET_SLAVE_ID with an Identification Pattern (ASCII for “XCP”). The master
uses this Pattern for recognizing answers from XCP slaves.
If the master sends a GET_SLAVE_ID(identify by echo), the slave has to send a response that
contains an echo of the Pattern. Additionally the slave informs the master about the CAN
identifier the master has to use when transferring CMD/STIM to this slave.
Master Slave
upon GET_SLAVE_ID(XCP, identify by echo)
Broadcast CAN id
slave 1 upon its
Response(XCP, CAN id for CMD/STIM) CAN id for RES/
ERR/EV/SERV/DAQ
upon CONNECT
CAN id for CMD/STIM
for slave 1 slave 1 upon its
Response
CAN id for RES/
ERR/EV/SERV/DAQ
upon CONNECT
CAN id for CMD/STIM
for slave 2 slave 2 upon its
Response
CAN id for RES/
ERR/EV/SERV/DAQ
Positive Response:
As a default, the master transfers all DAQ lists with DIRECTION = STIM on the same CAN
Identifier as used for CMD.
Alternatively, the master may have individual CAN Identifiers (other than the one used for CMD)
for the DAQ lists with DIRECTION = STIM.
As a default, the slave transfers all DAQ lists with DIRECTION = DAQ on the same CAN
Identifier as used for RES/ERR/EV/SERV.
Alternatively, the slave may have individual CAN Identifiers (other than the one used for
RES/ERR/EV/SERV) for its DAQ lists with DIRECTION = DAQ.
With GET_DAQ_ID, the master can detect whether a DAQ list uses an individual CAN identifier
and whether this Identifier is fixed or configurable.
If the CAN Identifier is configurable, the master can configure the individual Can Identifier for
this DAQ list with SET_DAQ_ID.
taggedstruct { /* optional */
“CAN_ID_BROADCAST” ulong; /* Auto detection CAN-ID */
/* master -> slaves */
/* Bit31= 1: extended identifier */
})*;
};
/begin XCP_ON_CAN
/begin DAQ_LIST_CAN_ID
0x0000 /* for DAQ_LIST 0 */
FIXED 0x310
/end DAQ_LIST_CAN_ID
/begin DAQ_LIST_CAN_ID
0x0001 /* for DAQ_LIST 1 */
FIXED 0x320
/end DAQ_LIST_CAN_ID
/begin DAQ_LIST_CAN_ID
0x0002 /* for DAQ_LIST 2 */
FIXED 0x330
/end DAQ_LIST_CAN_ID
/end XCP_ON_CAN