XCP - Part 2 - Protocol Layer Specification - 1.0
XCP - Part 2 - Protocol Layer Specification - 1.0
Version 1.0
Part 2
Protocol 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 2- Protocol Layer Specification -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.
0 Introduction ........................................................................................................8
0.1 The XCP Protocol Family............................................................................................... 8
0.2 Documentation Overview............................................................................................... 9
0.3 Definitions and Abbreviations...................................................................................... 10
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 (this document).
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.
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.
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
The CTO (Command Transfer Object) is used for transferring generic control commands. It
is used for carrying out protocol commands (CMD), transferring command responses (RES),
error (ERR) packets, event (EV) packets and for service request packets (SERV).
The DTO (Data Transfer Object) is used for transmitting synchronous data acquisition data
(DAQ) and for transmitting synchronous data stimulation data (STIM).
Master
XCP driver
CTO DTO
CMD STIM
ERR EV SERV
RES DAQ
Bypass
Slave
Event, Service Request and Data Acquisition Packets are send asynchronously, therefore it
may not be guaranteed that the master device will receive them when using a non
acknowledged transportation link like e.g. UDP/IP.
The XCP Packet contains the generic part of the protocol, which is independent from the transport
layer used.
An XCP Packet consists of an Identification Field, an optional Timestamp Field and a Data Field.
XCP Packet
Identification Field
Diagram 3 : The XCP Packet Identification Field
When exchanging XCP Packets, both master and slave always have to be able to
unambiguously identify any transferred XCP Packet concerning its Type and the contents of
its Data Field.
For this purpose, an XCP Packet basically always starts with an Identification Field which as
first byte contains the Packet IDentifier (PID).
For CTO Packets, the Identification Field should be able to identify the packets concerning
their Type, distinguishing between protocol commands (CMD), command responses (RES),
error packets (ERR), event packets (EV) and service request packets (SERV).
For CTO Packets, the Identification Field just consists of the PID, containing the CTO Packet
code.
Identification Field
PID
For every DAQ list the numbering of the ODTs through ODT_NUMBER restarts from 0:
so the scope for ODT_NUMBER is local for a DAQ list and ODT numbers are not unique
within one and the same slave device.
One possibility to map the relative and not unique ODT numbers to unambiguously
identifiable DTO Packets, is to map the relative ODT numbers to absolute ODT numbers by
means of a “FIRST_PID for this DAQ list”, and then transfer the absolute ODT numbers
within the DTO Packet.
The following mapping from relative_ODT_NUMBER to absolute_ODT_NUMBER applies:
FIRST_PID is the PID in the DTO Packet of the first ODT transferred by this DAQ list.
FIRST_PID is determined by the slave device and sent to the master upon
START_STOP_DAQ_LIST(DAQ list j).
When allocating the FIRST_PIDs, the slave has to make sure that for every ODT there’s a
unique absolute ODT number.
All PIDs also have to be in the available ranges for PID(DAQ) and PID(STIM).
For DTO Packets with Identification Field Type “absolute ODT number”, the Identification
Field just consists of the PID, containing the absolute ODT number.
Identification Field
PID
Another possibility to map the relative and not unique ODT numbers to unambiguously
identifiable DTO Packets, is to transfer the absolute DAQ list number together with the
relative ODT number within the DTO Packet.
For DTO Packets with Identification Field Types “relative ODT number and absolute DAQ list
number”, the Identification Field consists of the PID, containing the relative ODT number,
DAQ bits, containing the absolute DAQ list number, and an optional FILL byte.
One possibility is to transfer the DAQ list number as BYTE, which reduces the number of
theoretically possible Packets since the DAQ_LIST_NUMBER parameter is coded as
WORD.
Identification Field
PID DAQ
For fully exploring the limits of performance, there’s the possibility to transfer the DAQ list
number as WORD
Identification Field
PID DAQ
Identification Field
for alignment
A DAQ list can have the property that it can transmit DTO Packets without Identification Field
(ref. PID_OFF_SUPPORTED flag in DAQ_PROPERTIES at GET_DAQ_PROCESSOR_INFO).
Turning off the transmission of the Identification Field is only allowed if the Identification
Field Type is “absolute ODT number”. If the Identification Field is not transferred in the XCP
Packet, the unambiguous identification has to be done on the level of the Transport Layer.
This can be done e.g. on CAN with separate CAN-Ids for each DAQ list and only one ODT
for each DAQ list. In this case turning off the Identification Field would allow the transmission
of 8 byte signals on CAN.
XCP Packet
Timestamp Field
Diagram 9 : The XCP Packet Timestamp Field
With the TIMESTAMP flag at SET_DAQ_LIST_MODE, the master can set a DAQ list into
time stamped mode.
The TIMESTAMP flag can be used as well for DIRECTION = DAQ as for DIRECTION =
STIM.
For DIRECTION = DAQ, time stamped mode means that the slave device transmits the
current value of its clock in the DTO Packet for the first ODT of a DAQ cycle.
Identification
TIMESTAMP DATA
First ODT of this DAQ list First sample
Identification of this DAQ list
DATA
Next ODT of this DAQ list
Identification incremented
DATA
First ODT of this DAQ list TIMESTAMP
Next sample
Identification of this DAQ list
DATA
Next ODT of this DAQ list
For DIRECTION = STIM, time stamped mode means that the master device first receives a
time stamped DTO(DAQ) from the slave and then echoes this current value of the slave
device’s clock in the DTO Packet for the first ODT of the DAQ cycle. In this way the “time
stamp” can be used as a counter that gives the slave the possibility to check whether
DTO(DAQ) and CTO(STIM) belong functionally together.
The Timestamp Field always consists of the TS, containing the current value of the
synchronous data transfer clock
The synchronous data transfer clock is a free running counter in the slave, which is never
reset or modified.
Depending on the Timestamp Field Type, the TS is transferred as BYTE, WORD or DWORD
value.
Timestamp Field
TS
TS
TS
Diagram 11 : Timestamp Field Types
XCP Packet
Data Field
Diagram 12 : The XCP Packet Data Field
For CTO Packets, the Data Field contains the specific parameters for the different types of
CTO packet.
For DTO Packets, the Data Field contains the data for synchronous acquisition and
stimulation.
PID DATA
Data Field
Identification Field
Timestamp Field
empty for CTO
The Identification Field just consists of the PID, containing the CTO Packet code.
The Timestamp Field is not available.
The Data Field contains the specific parameters for the different types of CTO packet.
The PID contains the ComManD Packet code in the range 0xC0 <= CMD <= 0xFF.
All possible command codes are defined in the section “Table of Command Codes (CMD)”
in this paper. The structure of all possible commands is defined in the “Description of
Commands” section of this paper.
The PID contains the Command Positive RESponse Packet code RES = 0xFF.
The RES is sent as an answer to a CMD if the command has been successfully executed.
The implementation is optional. Event packets sent from the slave device to the master
device are not acknowledged, therefore the transmission is not guaranteed.
The PID contains the SERVice Request Packet code SERV = 0xFC.
The SERV requests some action to be performed by the master device. The second byte
contains the service request code. Possible service request codes are defined in the section
“Table of Service Request codes” in this paper.
The DTO is used for transmitting synchronous data acquisition data (DAQ), and for
transmitting synchronous data stimulation data (STIM).
PID
PID DAQ TS
PID DAQ TS
The contents of the Identification Field varies depending upon the Identification Field Type.
The contents of the Timestamp Field varies depending upon the Timestamp Field Type.
Any combination of Identification Field Type and Timestamp Field Type is possible.
The Data Field contains the data for synchronous acquisition and stimulation.
The PID contains the (absolute or relative) ODT number in the range 0x00 <= STIM <= 0xBF.
The ODT number refers to a corresponding Object Descriptor Table (ODT) that describes
which data stimulation elements are contained in the remaining data bytes.
The following tables give an overview of all possible Packet IDentifiers for transferring
Packets from Master to Slave and from Slave to Master.
0xFF
CMD
....
0xC0
0xBF
absolute or relative
ODT number
....
for STIM
0x00
0xFF RES
0xFE ERR
0xFD EV
0xFC SERV
0xFB
absolute or relative
....
ODT number
for DAQ
0x00
The implementation is optional. Event packets sent from the slave device to the master
device are not acknowledged, therefore the transmission is not guaranteed.
With EV_CLEAR_DAQ the slave indicates that the DAQ configuration in non-volatile
memory has been cleared.
With EV_STORE_DAQ the slave indicates that the DAQ configuration has been stored into
non-volatile memory.
With EV_STORE_CAL the slave indicates that calibration data have been stored into non-
volatile memory.
With EV_CMD_PENDING the slave requests the master to restart the time-out detection.
With EV_DAQ_OVERLOAD the slave may indicate an overload situation when transferring
DAQ lists.
The implementation is optional for the slave device, but mandatory for the master device.
Service request packets sent from the slave device to the master device are not
acknowledged, therefore the transmission is not guaranteed.
Bit
7 6 5 4 3 2 1 0
CAL/PAG
STIM
PGM
DAQ
x
x
COMM_MODE_BASIC parameter in CONNECT
Bit
7 6 5 4 3 2 1 0
ADDRESS_GRANULARITY_1
ADDRESS_GRANULARITY_0
SLAVE_BLOCK_MODE
BYTE_ORDER
OPTIONAL
Bit
7 6 5 4 3 2 1 0
MASTER_BLOCK_MODE
INTERLEAVED_MODE
x
Bit
7 6 5 4 3 2 1 0
MASTER_BLOCK_MODE
SLAVE_BLOCK_MODE
INTERLEAVED_MODE
x
Bit
7 6 5 4 3 2 1 0
CAL/PAG
STIM
PGM
DAQ
x
x
Mode parameter in SET_REQUEST
Bit
7 6 5 4 3 2 1 0
STORE_DAQ_REQ
CLEAR_DAQ_REQ
STORE_CAL_REQ
x
Bit
7 6 5 4 3 2 1 0
STORE_DAQ_REQ
CLEAR_DAQ_REQ
STORE_CAL_REQ
DAQ RUNNING
RESUME
7
7
Bit
Bit
Bit
Bit
RESUME x OVERLOAD_EVENT Identification_Field_Type_1
6
6
6
6
5
5
5
5
4
4
4
4
3
3
3
3
x x BIT_STIM_SUPPORTED Optimisation_Type_3
2
2
2
2
x x RESUME_SUPPORTED Optimisation_Type_2
1
1
1
1
0
0
0
0
36
DAQ_LIST_PROPERTIES parameter in GET_DAQ_LIST_INFO
Bit
7 6 5 4 3 2 1 0
EVENT_FIXED
PREDEFINED
STIM
DAQ
x
Bit
7 6 5 4 3 2 1 0
STIM
DAQ
x
Bit
7 6 5 4 3 2 1 0
TIMESTAMP_FIXED
Size_2
Size_1
Size_0
Unit_3
Unit_2
Unit_1
Unit_0
Bit
7 6 5 4 3 2 1 0
FREEZE_SUPPORTED
x
x
Mode parameter in SET_SEGMENT_MODE
Bit
7 6 5 4 3 2 1 0
FREEZE
x
Bit
7 6 5 4 3 2 1 0
FREEZE
x
x
6
x
5
XCP_WRITE_ACCESS_WITH_ECU
4
XCP_WRITE_ACCESS_WITHOUT_ECU
3
XCP_READ_ACCESS_WITH_ECU
2
XCP_READ_ACCESS_WITHOUT_ECU
1
PAGE_PROPERTIES parameter in GET_PAGE_INFO
ECU_ACCESS_WITH_XCP
0
ECU_ACCESS_WITHOUT_XCP
Bit
7 6 5 4 3 2 1 0
ECU
XCP
All
x
x
x
x
x
NON_SEQ_PGM_REQUIRED
6
NON_SEQ_PGM_SUPPORTED
5
ENCRYPTION_REQUIRED
4
ENCRYPTION_SUPPORTED
3
COMPRESSION_REQUIRED
2
COMPRESSION_SUPPORTED
1
FUNCTIONAL_MODE
0
ABSOLUTE_MODE
42
1.6 Description of Commands
The following chapters are a description of all possible XCP command packets and their
responses.
Unused data bytes, marked as „reserved”, may have arbitrary values.
Command parameters in WORD (2 Byte) format, are always aligned to a position that can
be divided by 2. Command parameters in DWORD (4 Bytes) format, are always aligned to a
position that can be divided by 4.
The byte format (MOTOROLA, INTEL) of multi byte parameters is slave device dependent.
Command CMD:
To simplify this documentation, in the following sections of this document, positive and
negative responses are not explicitly described unless they have parameters.
With a CONNECT(Mode = Normal), the master can start an XCP communication with the
slave.
With a CONNECT(Mode = user defined), the master can start an XCP communication with
the slave and at the same time tell the slave that it should go into a special (user defined)
mode.
Positive Response:
Bit
7 6 5 4 3 2 1 0
CAL/PAG
STIM
PGM
DAQ
x
x
Flag Description
CAL/PAG CALibration and PAGing
0 = calibration/ paging not available
1 = calibration/ paging available
The commands DOWNLOAD, DOWNLOAD_MAX, SHORT_DOWNLOAD,
SET_CAL_PAGE, GET_CAL_PAGE are available.
DAQ DAQ lists supported
0 = DAQ lists not available
1 = DAQ lists available
The DAQ commands (GET_DAQ_PROCESSOR_INFO,
GET_DAQ_LIST_INFO, ...) are available.
STIM STIMulation
0 = stimulation not available
1 = stimulation available
data stimulation mode of a DAQ list available
PGM ProGraMming
0 = Flash programming not available
1 = Flash programming available
The commands PROGRAM_CLEAR, PROGRAM, PROGRAM_MAX are
available.
Bit
7 6 5 4 3 2 1 0
ADDRESS_GRANULARITY_1
ADDRESS_GRANULARITY_0
SLAVE_BLOCK_MODE
BYTE_ORDER
OPTIONAL
ADDRESS_GRANULARITY_1
ADDRESS_GRANULARITY_0
ADDRESS_ AG [BYTE]
GRANULARITY
0 0 BYTE 1
0 1 WORD 2
1 0 DWORD 4
1 1 reserved
The address granularity indicates the size of an element contained at a single address.
It is needed if the master has to do address calculation.
The SLAVE_BLOCK_MODE flag indicates whether the Slave Block Mode is available.
The OPTIONAL flag indicates whether additional information on supported types
of Communication mode is available. The master can get that additional
information with GET_COMM_MODE_INFO.
MAX_CTO mod AG = 0
MAX_DTO mod AG = 0
All length information which refers to the address range of the slave itself is based on the AG
(ELEMENTS). If the length information refers to the data stream ( XCP Protocol ), it is based
on bytes.
The XCP Protocol Layer Version Number indicates the major version of the Protocol Layer
Specification.
The XCP Transport Layer Version Number indicates the major version of the Specification of
the current Transport Layer.
Negative Response:
If DISCONNECT is currently not possible, ERR_CMD_BUSY will be returned.
This command returns all current status information of the slave device. This includes the
status of the resource protection, pending store requests and the general status of data
acquisition and stimulation.
Positive Response:
Bit
7 6 5 4 3 2 1 0
STORE_DAQ_REQ
STORE_CAL_REQ
DAQ_RUNNING
CLEAR_DAQ_REQ
RESUME
Flag Description
STORE_CAL_REQ REQuest to STORE CALibration data
0 = STORE_CAL_REQ mode is reset.
1 = STORE_CAL_REQ mode is set
STORE_DAQ_REQ REQuest to STORE DAQ list
0 = STORE_DAQ_REQ mode is reset.
1 = STORE_DAQ_REQ mode is set
CLEAR_DAQ_REQ REQuest to CLEAR DAQ configuration
0 = CLEAR_DAQ_REQ is reset.
1 = CLEAR_DAQ_REQ is set
DAQ_RUNNING Data Transfer
0 = Data transfer is not running
1 = Data transfer is running.
RESUME RESUME Mode
0 = Slave is not in RESUME mode
1 = Slave is in RESUME mode
The Current Resource Protection Status parameter is a bit mask described below:
Bit
7 6 5 4 3 2 1 0
CAL/PAG
STIM
PGM
DAQ
X
Command
CONNECT
DISCONNECT
GET_STATUS
SYNCH
Command
TRANSPORT_LAYER_CMD
USER_CMD
The CAL/PAG flags indicates that all commands of the CALibration/PAGing group are
protected and will return an ERR_ACCESS_LOCKED upon an attempt to execute the
command without a previous successful GET_SEED/UNLOCK sequence.
Command
DOWNLOAD
Command
DOWNLOAD_NEXT
DOWNLOAD_MAX
SHORT_DOWNLOAD
MODIFY_BITS
Command
SET_CAL_PAGE
GET_CAL_PAGE
Command
GET_PAG_PROCESSOR_INFO
GET_SEGMENT_INFO
GET_PAGE_INFO
SET_SEGMENT_MODE
GET_SEGMENT_MODE
COPY_CAL_PAGE
Command
CLEAR_DAQ_LIST
SET_DAQ_PTR
WRITE_DAQ
SET_DAQ_LIST_MODE
GET_DAQ_LIST_MODE
START_STOP_DAQ_LIST
START_STOP_SYNCH
Command
GET_DAQ_CLOCK
READ_DAQ
GET_DAQ_PROCESSOR_INFO
GET_DAQ_RESOLUTION_INFO
GET_DAQ_LIST_INFO
GET_DAQ_EVENT_INFO
Command
FREE_DAQ
ALLOC_DAQ
ALLOC_ODT
ALLOC_ODT_ENTRY
Command
PROGRAM_START
PROGRAM_CLEAR
PROGRAM
PROGRAM_RESET
Command
GET_PGM_PROCESSOR_INFO
GET_SECTOR_INFO
PROGRAM_PREPARE
PROGRAM_FORMAT
PROGRAM_NEXT
PROGRAM_MAX
PROGRAM_VERIFY
This command is used to synchronize command execution after timeout conditions. The
SYNCH command will always have a negative response with the error code
ERR_CMD_SYNCH. There is no other command using this error code, therefore the
response to a SYNCH command may be distinguished from the response to any other
command.
For a detailed explanation of the purpose of the SYNCH command, please refer to the
chapter “time-out handling”.
Negative Response:
Positive Response:
Bit
7 6 5 4 3 2 1 0
MASTER_BLOCK_MODE
INTERLEAVED_MODE
x
The MASTER_BLOCK_MODE flag indicates whether the Master Block Mode is available.
If the master device block mode is supported, MAX_BS indicates the maximum allowed
block size as the number of consecutive command packets (DOWNLOAD_NEXT or
PROGRAM_NEXT) in a block sequence. MIN_ST indicates the required minimum
separation time between the packets of a block transfer from the master device to the
slave device in units of 100 microseconds.
The INTERLEAVED_MODE flag indicates whether the Interleaved Mode is available.
If interleaved mode is available, QUEUE_SIZE indicates the maximum number of
consecutive command packets the master can send to the receipt queue of the slave.
This command is used for automatic session configuration and for slave device identification.
The following identification types may be requested:
Type Description
0 ASCII text
Positive Response:
Bit
7 6 5 4 3 2 1 0
STORE_DAQ_REQ
CLEAR_DAQ_REQ
STORE_CAL_REQ
x
Flag Description
STORE_CAL_REQ REQuest to STORE CALibration data
0 = STORE_CAL_REQ is not set.
1 = STORE_CAL_REQ is set
STORE_DAQ_REQ REQuest to STORE DAQ list
0 = STORE_DAQ_REQ is not set.
1 = STORE_DAQ_REQ is set
CLEAR_DAQ_REQ REQuest to CLEAR DAQ configuration
0 = CLEAR_DAQ_REQ is not set.
1 = CLEAR_DAQ_REQ is set
STORE_CAL_REQ sets a request to save calibration data into non-volatile memory. The
STORE_CAL_REQ bit obtained by GET_STATUS will be reset by the slave, when the
request is fulfilled. The slave device may indicate this by transmitting an EV_STORE_CAL
event packet.
STORE_DAQ_REQ sets a request to save all DAQ lists, which have been selected with
START_STOP_DAQ_LIST(Select) into non-volatile memory. The slave also has to store the
session configuration id in non-volatile memory.
Upon saving, the slave first has to clear any DAQ list configuration that might already be
stored in non-volatile memory.
The STORE_DAQ_REQ bit obtained by GET_STATUS will be reset by the slave, when the
request is fulfilled. The slave device may indicate this by transmitting an EV_STORE_DAQ
event packet.
CLEAR_DAQ_REQ is used to clear all DAQ lists in non-volatile memory. All ODT entries
reset to address = 0, extension = 0, size = 0 and bit_offset = FF. Session configuration ID
reset to 0.
The CLEAR_DAQ_REQ bit obtained by GET_STATUS will be reset by the slave, when the
request is fulfilled. The slave device may indicate this by transmitting an EV_CLEAR_DAQ
event packet.
If the slave device does not support the requested mode, an ERR_OUT_OF_RANGE will be
returned.
With Mode = 0, the master requests the slave to transmit (the first part of) the seed. The
slave answers with (the first part of) the seed and the total length of the seed.
With Mode = 1, the master has to request the remaining part(s) of the seed from the slave if
the total length of the seed is bigger than MAX_CTO-2.
The master has to use GET_SEED(Mode=1) in a defined sequence together with
GET_SEED(Mode=0). If the master sends a GET_SEED(Mode=1) directly without a
previous GET_SEED(Mode=0), the slave returns an ERR_SEQUENCE as negative
response.
See command GET_STATUS (resource protection status) for a description for the values of
the resource parameter (CAL/PAG, DAQ, STIM, PGM) and the related commands.
Only one resource may be requested with one GET_SEED command. If more than one
resource has to be unlocked, the (GET_SEED+UNLOCK) sequence has to be performed
multiple times. If the master does not request any resource or requests multiple resources at
the same time, the slave will respond with an ERR_OUT_OF_RANGE.
Positive Response:
Length indicates the (remaining) number of seed bytes. If Length = 0, the resource is
unprotected and no UNLOCK command is necessary.
A GET_SEED sequence returns the ´seed´ data for a Seed&Key algorithm computing the
´key´ to unlock the requested resource category for authorized access (see the UNLOCK
command).
The master has to calculate the key by calling an external function file. There’s only 1 external
function file which might contain from 1 up to 4 different algorithms, one algorithm for each of
the resources CAL/PAG, DAQ, STIM or PGM.
The external function file supplier can enable/disable the use of each of these 4 algorithms.
The master can get the information about the ability of the algorithms directly from the
external function file.
The external function file supplier can compile different versions of the external function file
by making different combinations of enabled algorithms.
The master gets the name of the external function file to be used for this slave, from the
ASAM MCD 2MC description file. The API for communicating with the external function file is
specified in Part 4 “Interfacing” of the XCP specification.
Unlocks the slave device’s security protection using a ´key´ computed from the ´seed´
obtained by a previous GET_SEED sequence. See the description of the GET_SEED
command.
Length indicates the (remaining) number of key bytes.
The master has to use UNLOCK in a defined sequence together with GET_SEED.
The master only can send an UNLOCK sequence if previously there was a GET_SEED
sequence.
The master has to send the first UNLOCK after a GET_SEED sequence with a Length
containing the total length of the key.
If the total length of the key is bigger than MAX_CTO-2, the master has to send the
remaining key bytes with (a) consecutive UNLOCK command(s) containing the remaining
length of the key.
If the master does not respect this sequence, the slave returns an ERR_SEQUENCE as
negative response.
The key is checked after completion of the UNLOCK sequence. If the key is not accepted,
ERR_ACCESS_LOCKED will be returned. The slave device will then go to disconnected
state. A repetition of an UNLOCK sequence with a correct key will have a positive response
and no other effect.
Positive Response:
The answer upon UNLOCK contains the Current Resource Protection Mask as described at
GET_STATUS.
Seed = 11 22 33 44
Key = 43 21
Master Slave
GET_SEED (00, Resource)
11 22 33 44
UNLOCK(length, 43 21)
FF 00
Seed = 99 88 77 66 55 44 33 22 11 00 11 22 33 44 55 66 77 88 99
Key = 98 76 54 32 10 01 23 45 67 89
Master Slave
GET_SEED(00, Resource)
0x13, 99 88 77 66 55 44
GET_SEED(01, xx)
0x0D, 33 22 11 00 11 22
GET_SEED(01, xx)
0x07, 33 44 55 66 77 88
GET_SEED(01, xx)
0x01, 99
UNLOCK(0x0A, 98 76 54 32 10 01)
FF 01
UNLOCK(0x04, 23 45 67 89)
FF 00
This command will initialize a pointer (32Bit address + 8Bit extension) for following memory
transfer commands.
The MTA is used by the commands BUILD_CHECKSUM, UPLOAD, DOWNLOAD,
DOWNLOAD_MAX, MODIFY_BITS, PROGRAM_CLEAR, PROGRAM and
PROGRAM_MAX.
A data block of the specified length, starting at the current MTA, will be returned. The MTA
will be post-incremented by the given number of data elements.
Positive Response:
If block transfer mode is supported, the uploaded data are transferred in multiple responses
on the same request packet. For the master there are no limitations allowed concerning the
maximum block size. Therefore the number of data elements (n) can be in the range
[1..255]. The slave device will transmit (n*AG / (MAX_CTO-1)) +1 response packets. The
separation time between the response packets is depending on the slave device
implementation. It’s the responsibility of the master device to keep track of all packets and to
check for lost packets. It is slave device implementation specific if the data in different
response packets are consistent. For instance, this has to be considered, when block upload
mode is used to obtain 8 byte floating point objects.
MAX_CTO=8
AG=1
Master Slave
UPLOAD(0x03)
Master Slave
UPLOAD(0x07)
Master Slave
UPLOAD(0x10)
FF d[14] d[15]
A data block of the specified length, starting at address will be returned. The MTA pointer is
set to the first data byte behind the uploaded data block. The error handling and the
response structure is identical to the UPLOAD command.
ELEMENT is BYTE. WORD or DWORD, depending upon AG.
This command does not support block transfer and it must not be used within a block
transfer sequence.
Returns a checksum result of the memory block that is defined by the MTA and
Block size. The MTA will be post-incremented by the block size.
Positive Response:
With the Checksum Type “XCP_USER_DEFINED”, the Slave can indicate that the Master
for calculating the checksum has to use a user-defined algorithm implemented in an
®
externally calculated function (e.g.Win32 DLL, UNIX shared object file,..)
The master gets the name of the external function file to be used for this slave, from the
ASAM MCD 2MC description file.
The API for communicating with the external function file is specified in Part 4 “Interfacing” of
the XCP specification.
Name:
this is the name given to the algorithm. A string value starting with “XCP_”.
Width:
this is the width of the algorithm expressed in bits. This is one less than the width of the poly.
Poly:
This parameter is the polynomial. This is a binary value that should be specified as a
hexadecimal number. The top bit of the poly should be omitted. For example, if the poly is
10110, you should specify 0x06. An important aspect of this parameter is that it represents
the unreflected poly; the bottom of this parameter is always the LSB of the divisor during the
division, regardless of whether the algorithm is reflected.
Init:
This parameter specifies the initial value of the register when the algorithm starts. This is the
value that is to be assigned to the register in the direct table algorithm. In the table algorithm,
we may think of the register always commencing with the value zero, and this value being
XORed into the register after the N’th bit iteration. This parameter should be specified as a
hexadecimal number.
Refin:
This is a Boolean parameter. If it is FALSE, input bytes are processed with bit 7 being
treated as the most significant bit (MSB) and bit 0 being treated as the least significant bit. If
this parameter is TRUE, each byte is reflected before being processed.
Refout:
This is a boolean parameter. If it is set to FALSE, the final value in the register is fed into the
XORout stage directly. If this parameter is TRUE, the final register value is reflected first.
XORout:
This is a width-bit value that should be specified as hexadecimal number. It is XORed to the
final register value (after the Refout stage) before the value is returned as the official
checksum.
http://www.repairfaq.org/filipg/LINK/F_crc_v34.html
This command is defined in the Transport Layer specification. It is used to perform Transport
Layer specific actions.
Example:
This command is user defined. It mustn’t be used to implement functionalities done by other
services.
Example:
MAX_CTO=8
Master Slave
DOWNLOAD(0x06, d[0] d[1] d[2] d[3] d[4] d[5])
FF
Example:
MAX_CTO=8
Master Slave
DOWNLOAD(0x0E, d[0] d[1] d[2] d[3] d[4] d[5])
FF
Depending upon AG, 1 or 3 alignment bytes must be used in order to meet alignment
requirements.
ELEMENT is BYTE, WORD or DWORD, depending upon AG.
The data block with the fixed length (size) of MAX_CTO/AG-1 elements contained in the
CMD will be copied into memory, starting at the MTA. The MTA will be post-incremented by
MAX_CTO/AG-1.
This command does not support block transfer and it mustn’t not be used within a block
transfer sequence.
Please note that this command will have no effect (no data bytes can be transferred) if
MAX_CTO = 8 (e.g. XCP on CAN).
The 32 Bit memory location A referred by the MTA will be modified using the formula below:
The AND Mask (MA) specifies all the bits of A which have to be set to “0” by setting the
corresponding bit in MA to “0” and all untouched bits to “1”.
The XOR Mask (MX) specifies all bits of A which has to be toggled by setting the
corresponding bit in MX to “1” and all untouched bits to “0”.
Via the masks MA and MX it is only possible to access a 16 bit wide memory location. Thus
the shift parameter S is used to move both masks together with the specified number of bits
into the more significant direction.
Example:
MSB LSB
A= 1111 1111 1111 0000 1111 1111 1111 1111
S=16
A = 1111 1111 1111 0000 1111 1111 1111 1111
MA = 1011 1111 1111 1110
MX = 0000 0000 0000 0001
Result:
A = 1011 1111 1111 0001 1111 1111 1111 1111
This command sets the access mode for a calibration data segment, if the slave device
supports calibration data page switching (PAG flag in the resource availability mask).
A calibration data segment and its pages are specified by logical numbers.
Bit
7 6 5 4 3 2 1 0
ECU
XCP
All
x
x
x
x
x
Flag Description
ECU The given page will be used by the slave
device application.
XCP The slave device XCP driver will access the
given page.
ALL The logical segment number is ignored. The
command applies to all segments
If the calibration data page cannot be set to the given mode, an ERR_MODE_NOT_VALID
will be returned.
If the calibration data page is not available, a ERR_PAGE_NOT_VALID or
ERR_SEGMENT_NOT_VALID will be returned.
This command returns the logical number for the calibration data page that is currently
activated for the specified access mode and data segment. Mode may be 0x01 (ECU
access) or 0x02 (XCP access). All other values are invalid.
Positive Response:
Positive response:
Bit
7 6 5 4 3 2 1 0
FREEZE_SUPPORTED
Flag Description
FREEZE_SUPPORTED 0 = SEGMENTS can not be set to FREEZE mode.
1 = SEGMENTS can be set to FREEZE mode.
The FREEZE_SUPPORTED flag indicates that all SEGMENTS can be put in FREEZE
mode.
MAX_MAPPING indicates the number of address ranges within this SEGMENT that should
have an address mapping applied.
The compression and the encryption method of the slave segment must correspond to the
compression and the encryption method of the segment of the new flashware.
If Mode = 2, the response contains mapping information about this SEGMENT for the range
indicated with MAPPING_INDEX.
If SEGMENT_INFO = 0 , this command returns the source address for this MAPPING_INDEX
in MAPPING_INFO.
Positive response:
Bit
7 6 5 4 3 2 1 0
XCP_WRITE_ACCESS_WITHOUT_ECU
XCP_READ_ACCESS_WITHOUT_ECU
XCP_WRITE_ACCESS_WITH_ECU
XCP_READ_ACCESS_WITH_ECU
ECU_ACCESS_WITHOUT_XCP
ECU_ACCESS_WITH_XCP
x
Bit
1 0
ECU_ACCESS_WITHOUT_XCP
ECU_ACCESS_WITH_XCP
ECU_ACCESS_TYPE
The XCP_x_ACCESS_y flags indicate whether and how the XCP master can access this
page. The flags make a distinction for the XCP_ACCESS_TYPE depending on the kind of
access the XCP master can have on this page (READABLE and/or WRITEABLE).
Bit
3 2
XCP_READ_ACCESS_WITHOUT_ECU
XCP_READ_ACCESS_WITH_ECU
XCP_READ_ACCESS_TYPE
If the XCP master can access this PAGE, the XCP_READ_ACCESS_x flags indicate
whether the XCP master can read from this PAGE only if the ECU does NOT access this
PAGE at the same time, only if the ECU accesses this page at the same time, or the XCP
master doesn’t need to care whether the ECU accesses this page at the same time or not.
XCP_WRITE_ACCESS_WITHOUT_ECU
XCP_WRITE_ACCESS_WITH_ECU
XCP_WRITE_ACCESS_TYPE
If the XCP master can access this PAGE, the XCP_WRITE_ACCESS_x flags indicate
whether the XCP master can write to this PAGE only if the ECU does NOT access this
PAGE at the same time, only if the ECU accesses this page at the same time, or the XCP
master doesn’t need to care whether the ECU accesses this page at the same time or not.
PAGE 0 of the INIT_SEGMENT of a PAGE contains the initial data for this PAGE.
Bit
7 6 5 4 3 2 1 0
FREEZE
x
Flag Description
FREEZE 0 = disable FREEZE Mode
1 = enable FREEZE Mode
The FREEZE flag selects the SEGMENT for freezing through STORE_CAL_REQ.
Positive response:
Bit
7 6 5 4 3 2 1 0
FREEZE
x
This command forces the slave to copy one calibration page to another.
This command is only available if more than one calibration page is defined.
In principal any page of any segment can be copied to any page of any segment. However,
restrictions might be possible.
If calibration data page cannot be copied to the given destination, e.g. because the location
of destination is a flash segment, an ERR_WRITE_PROTECTED will be returned. In this
case Flash programming procedure has to be performed.
If the calibration data page is not available, an ERR_PAGE_NOT_VALID or
ERR_SEGMENT_NOT_VALID will be returned.
This command can be used for PREDEFINED and for configurable DAQ lists, so the range
for DAQ_LIST_NUMBER is [0,1,..MAX_DAQ-1].
If the specified list is not available, ERR_OUT_OF_RANGE will be returned.
CLEAR_DAQ_LIST clears the specified DAQ list. For a configurable DAQ list, all ODT
entries will be reset to address=0, extension=0 and size=0 (if valid : bit_offset = 0xFF). For
PREDEFINED and configurable DAQ lists, the running Data Transmission on this list will be
stopped and all DAQ list states are reset.
Initializes the DAQ list pointer for a subsequent operation with WRITE_DAQ or READ_DAQ.
If the specified list is not available, ERR_OUT_OF_RANGE will be returned.
Writes one ODT entry to a DAQ list defined by the DAQ list pointer (see SET_DAQ_PTR).
WRITE_DAQ is only possible for elements in configurable DAQ lists. Therefore the
DAQ_LIST_NUMBER used in the previous SET_DAQ_PTR has to be in the range
[MIN_DAQ, MIN_DAQ+1,..MAX_DAQ-1]. Otherwise the slave will return an
ERR_WRITE_PROTECTED as negative response upon WRITE_DAQ.
The BIT_OFFSET field allows the transmission of data stimulation elements that represent
the status of a bit. For a MEASUREMENT that’s in a DAQ list with DIRECTION = DAQ, the
key word BIT_MASK describes the mask to be applied to the measured data to find out the
status of a single bit. For a MEASUREMENT that’s in a DAQ list with DIRECTION = STIM,
the key word BIT_MASK describes the position of the bit that has to be stimulated. The
Master has to transform the BIT_MASK to the BIT_OFFSET
e.g Bit7 ! BIT_MASK = 0x80 ! BIT_OFFSET = 0x07
When BIT_OFFSET = FF, the field can be ignored and the WRITE_DAQ applies to a normal
data element with size expressed in AG. If the BIT_OFFSET is from 0x00 to 0x1F, the ODT
entry describes an element that represents the status of a bit. In this case, the Size of DAQ
element always has to be equal to the GRANULARITY_ODT_ENTRY_SIZE_x. If the value
of this element = 0, the value for the bit = 0. If the value of the element > 0, the value for the
bit = 1.
The size of an ODT entry has to fulfill the rules for granularity and maximum value.
(ref. GET_DAQ_RESOLUTION_INFO).
The DAQ list pointer is auto post incremented to the next ODT entry within one and the
same ODT. After writing to the last ODT entry of an ODT, the value of the DAQ pointer is
undefined. The master has to make sure the correct position of the DAQ pointer when
writing to the next ODT respectively the next DAQ list.
This command can be used for PREDEFINED and for configurable DAQ lists, so the range
for DAQ_LIST_NUMBER is [0,1,..MAX_DAQ-1].
If the specified list is not available, ERR_OUT_OF_RANGE will be returned.
Bit
7 6 5 4 3 2 1 0
TIMESTAMP
DIRECTION
PID_OFF
x
Flag Description
DIRECTION 0 = DAQ set to Data Acquisition Mode (Slave ! Master)
1 = STIM set to Data Stimulation Mode (Master ! Slave)
TIMESTAMP 0 = disable timestamp
1 = enable timestamp
PID_OFF 0 = transmit DTO with Identification Field
1 = transmit DTO without Identification Field
The DIRECTION flag sets the DAQ list into synchronized data acquisition or synchronized
data stimulation mode.
The TIMESTAMP and PID_OFF flags can be used as well for DIRECTION = DAQ as for
DIRECTION = STIM.
The TIMESTAMP flag sets the DAQ list into time stamped mode.
The PID_OFF flag turns of the transmission of the Identification Field in each DTO packet.
Turning off the transmission of the Identification Field is only allowed if the Identification
Field Type is “absolute ODT number”. If the Identification Field is not transferred in the XCP
Packet, the unambiguous identification has to be done on the level of the Transport Layer.
This can be done e.g. on CAN with separate CAN-Ids for each DAQ list and only one ODT
for each DAQ list. In this case turning off the Identification Field would allow the transmission
of 8 byte signals on CAN.
The Event Channel Number specifies the generic signal source that effectively determines
the data transmission timing.
To allow reduction of the desired transmission rate, a transmission rate prescaler may be
applied to the DAQ lists. Without reduction, the prescaler value must equal 1. For reduction,
the prescaler has to be greater than 1.The use of a prescaler is only used for DAQ lists with
DIRECTION = DAQ.
The DAQ list priority specifies the priority of this DAQ list if this DAQ list is processed
together with other DAQ lists. The slave device driver may use this information to prioritize
the transmission of data packets. DAQ list priority = 0 means that the slave may buffer the
data and process them in a background task. DAQ list priority > 0 means that the slave has
to process the data as fast as possible within the current raster. The DAQ-list with DAQ list
priority = FF has the highest priority
If the ECU doesn’t support the prioritization of DAQ lists , a DAQ list priority > 0 is not
allowed and will be indicated by returning ERR_OUT_OF_RANGE.
Returns information on the current mode of the specified DAQ list. This command can be
used for PREDEFINED and for configurable DAQ lists, so the range for
DAQ_LIST_NUMBER is [0,1,..MAX_DAQ-1].
If the specified list is not available, ERR_OUT_OF_RANGE will be returned.
Positive Response:
Bit
7 6 5 4 3 2 1 0
TIMESTAMP
DIRECTION
SELECTED
RUNNING
RESUME
PID_OFF
Flag Description
SELECTED 0 = DAQ list not selected
1 = DAQ list selected
DIRECTION 0 = DAQ Data Acquisition Mode (Slave ! Master) is set
1 = STIM Data Stimulation Mode (Master ! Slave) is set
TIMESTAMP 0 = timestamp is disabled
1 = timestamp is enabled
PID_OFF 0 = DTO is transmitted with Identification Field
1 = DTO is transmitted without Identification Field
RUNNING 0 = DAQ list is inactive
1 = DAQ list is active
RESUME 0 = this DAQ list is not part of a configuration used in RESUME mode
1 = this DAQ list is part of a configuration used in RESUME mode
This command can be used for PREDEFINED and for configurable DAQ lists, so the range
for DAQ_LIST_NUMBER is [0,1,..MAX_DAQ-1].
If the specified list is not available, ERR_OUT_OF_RANGE will be returned.
This command is used to start, stop or to prepare a synchronized start of the specified
DAQ_LIST_NUMBER.
The mode parameter allows to start or stop this specific DAQ list.
The select mode configures the DAQ list with the provided parameters but does not start the
data transmission of the specified list. This mode is used for a synchronized start/stop of all
configured DAQ lists (ref. START_STOP_SYNCH) or for preparing the slave for RESUME
mode (ref. SET_REQUEST).
The slave has to reset the SELECTED flag in the mode at GET_DAQ_LIST_MODE as soon
as the related START_STOP_SYNCH or SET_REQUEST have been acknowledged.
If at least one DAQ list has been started, the slave device is in data transfer mode. The
GET_STATUS command will return the DAQ_RUNNING status bit set.
Positive Response:
If the DTO Packets have an Identification Field Type “absolute ODT number”, FIRST_PID is
the absolute ODT number in the DTO Packet of the first ODT transferred by this DAQ list.
The absolute ODT number for any other ODT can be determined by:
If the DTO Packets have an Identification Field Type “relative ODT number and absolute
DAQ list number”, FIRST_PID can be ignored.
The parameter Mode indicates the action and whether the command applies to
all DAQ lists or to the selected ones only (previously configured with
START_STOP_DAQ_LIST(select)). The slave device software has to reset the
mode SELECTED of a DAQ list after successful execution of a
START_STOP_SYNCH.
This command is used to synchronize the free running data acquisition clock of
the slave device with the data acquisition clock in the master device. It is optional,
if the slave device does not support timestamped data acquisition.
Positive Response:
On CAN based systems, the master device would be able to determine when the
GET_DAQ_CLOCK command packet has been transmitted. This value corresponds to the
point in time, when it has been received in the slave device. Based on the returned
timestamp, the master device can calculate the time offset between the master and the slave
device clock.
Compensating the time drift between the master and the slave device clocks is in the
responsibility of the master device
Reads one ODT entry of a DAQ list defined by the DAQ list pointer. The DAQ list pointer is
auto post incremented within one and the same ODT (See WRITE_DAQ).
READ_DAQ is possible for elements in PREDEFINED and configurable DAQ lists. Therefore
the DAQ_LIST_NUMBER used in the previous SET_DAQ_PTR can be in the range
[0,1,..MAX_DAQ-1].
Positive Response:
The size of an ODT entry has to fulfill the rules for granularity and maximum value.
(ref. GET_DAQ_RESOLUTION_INFO).
Positive Response:
Bit
7 6 5 4 3 2 1 0
PRESCALER_SUPPORTED
TIMESTAMP_SUPPORTED
BIT_STIM_SUPPORTED
RESUME_SUPPORTED
PID_OFF_SUPPORTED
DAQ_CONFIG_TYPE
OVERLOAD_EVENT
OVERLOAD_MSB
Flag Description
DAQ_CONFIG_TYPE 0 = static DAQ list configuration
1 = dynamic DAQ list configuration
PRESCALER_SUPPORTED 0 = Prescaler not supported
1 = prescaler supported
RESUME_SUPPORTED 0 = DAQ lists can not be set to RESUME mode.
1 = DAQ lists can be set to RESUME mode.
BIT_STIM_SUPPORTED 0 = bitwise data stimulation not supported
1 = bitwise data stimulation supported
TIMESTAMP_SUPPORTED 0 = time stamped mode not supported
1 = time stamped mode supported
PID_OFF_SUPPORTED 0 = Identification Field can not be switched off
1 = Identification Field may be switched off
Bit
7 6
OVERLOAD_EVENT
OVERLOAD_MSB
0 0 No overload indication
0 1 overload indication in MSB of PID
1 0 overload indication by Event Packet
1 1 not allowed
For indicating an overrun situation, the slave may set the Most Significant Bit (MSB) of the
PID of the next successfully transmitted packet. When the MSB of the PID is used, the
maximum number of (absolute or relative) ODT numbers is limited and has to be in the
range :
0x00<= ODT_NUMBER(DAQ with overrun_msb)<=0x7C
Alternatively the slave may transmit an „EV_DAQ_OVERLOAD„ event packet. The slave
must take care not to overflow another cycle with this additional packet.
MAX_DAQ is the total number of DAQ lists available in the slave device. It includes the
predefined DAQ lists that are not configurable (indicated with PREDEFINED at
GET_DAQ_LIST_INFO) and the ones that are configurable. If DAQ_CONFIG_TYPE =
dynamic, MAX_DAQ equals MIN_DAQ+DAQ_COUNT.
MIN_DAQ is the number of predefined DAQ lists. For predefined DAQ lists,
DAQ_LIST_NUMBER is in the range [0,1,..MIN_DAQ-1].
DAQ_COUNT is the number of dynamically allocated DAQ lists.
MAX_DAQ-MIN_DAQ is the number of configurable DAQ lists. For configurable DAQ lists,
DAQ_LIST_NUMBER is in the range [MIN_DAQ,MIN_DAQ+1,..MAX_DAQ-1].
Bit
7 6 5 4 3 2 1 0
Identification_Field_Type_1
Identification_Field_Type_0
Address_Extension_DAQ
Address_Extension_ODT
Optimisation_Type_3
Optimisation_Type_2
Optimisation_Type_1
Optimisation_Type_0
The Optimisation_Type is defined as follows:
Bit
3 2 1 0
Optimisation_Type_3
Optimisation_Type_2
Optimisation_Type_1
Optimisation_Type_0
Optimisation
Type
0 0 0 0 OM_DEFAULT
0 0 0 1 OM_ODT_TYPE_16
0 0 1 0 OM_ODT_TYPE_32
0 0 1 1 OM_ODT_TYPE_64
0 1 0 0 OM_ODT_TYPE_ALIGNMENT
0 1 0 1 OM_MAX_ENTRY_SIZE
The Optimisation_Type flags indicate the Type of Optimisation Method the master preferably
should use.
Bit
5 4
Address_Extension_DAQ
Address_Extension_ODT
Address_Extension
Type
0 0 address extension can be different within one and the same ODT
0 1 address extension to be the same for all entries within one ODT
1 0 Not allowed
1 1 address extension to be the same for all entries within one DAQ
The ADDR_EXTENSION flag indicates whether the address extension of all entries within
one ODT or within one DAQ must be the same.
The Identification_Field_Type is defined as follows:
Bit
7 6
Identification_Field_Type_1
Identification_Field_Type_0
Identification Field
Type
The Identification_Field_Type flags indicate the Type of Identification Field the slave will use
when transferring DAQ Packets to the master. The master has to use the same Type of
Identification Field when transferring STIM Packets to the slave.
Turning off the transfer of the Identification Field is only allowed if the Identification Field
Type is “absolute ODT number”.
Positive Response:
For the address of the element described by an ODT entry, the following has to be fulfilled :
For every size of the element described by an ODT entry, the following has to be fulfilled :
The MAX_ODT_ENTRY_SIZE_x parameters indicate the upper limits for the size of the
element described by an ODT entry.
For every size of the element described by an ODT entry the following has to be fulfilled :
TIMESTAMP_FIXED
Size_2
Size_1
Size_0
Unit_3
Unit_2
Unit_1
Bit
2 1 0
Size_2
Size_1
Size_0
Timestamp size
[bytes]
0 0 0 No time stamp
0 0 1 1
0 1 0 2
0 1 1 Not allowed
1 0 0 4
The TIMESTAMP_FIXED flag indicates that the Slave always will send DTO Packets in time
stamped mode.
Bit
7 6 5 4
Unit_3
Unit_2
Unit_1
Unit_0
Timestamp unit
The timestamp will increment by TIMESTAMP_TICKS per unit and wrap around if an
overflow occurs.
Positive Response:
Bit
7 6 5 4 3 2 1 0
EVENT_FIXED
PREDEFINED
STIM
DAQ
x
Flag Description
PREDEFINED 0 = DAQ list configuration can be changed
1 = DAQ list configuration is fixed
EVENT_FIXED 0 = Event Channel can be changed
1 = Event Channel is fixed
3 2
STIM
DAQ
DAQ_LIST_TYPE
0 0 Not allowed
0 1 only DIRECTION = DAQ supported
1 0 only DIRECTION = STIM supported
1 1 both DIRECTIONS supported (but not simultaneously)
If DAQ lists are configured statically, MAX_ODT specifies the number of ODTs for this DAQ
list and MAX_ODT_ENTRIES specifies the number of ODT entries in each ODT.
FIXED_EVENT indicates the number of the fixed event channel to be used for this DAQ list.
Positive Response:
Bit
7 6 5 4 3 2 1 0
STIM
DAQ
x
The DAQ and STIM flags indicate what kind of DAQ list can be allocated to this event
channel :
3 2
STIM
DAQ
EVENT_CHANNEL_TYPE
0 0 Not allowed
0 1 only DAQ lists with DIRECTION = DAQ supported
1 0 only DAQ lists with DIRECTION = STIM supported
1 1 both kind of DAQ lists (simultaneously)
This command clears all DAQ lists and frees all dynamically allocated DAQ lists, ODTs and
ODT entries.
At the start of a dynamic DAQ list configuration sequence, the master always first has to
send a FREE_DAQ.
This command allocates a number of DAQ lists for this XCP slave device.
If there’s not enough memory available to allocate the requested DAQ lists an
ERR_MEMORY_OVERFLOW will be returned as negative response.
The master has to use ALLOC_DAQ in a defined sequence together with FREE_DAQ,
ALLOC_ODT and ALLOC_ODT_ENTRY. If the master sends an ALLOC_DAQ directly after
an ALLOC_ODT without a FREE_DAQ in between, the slave returns an ERR_SEQUENCE
as negative response.
If the master sends an ALLOC_DAQ directly after an ALLOC_ODT_ENTRY without a
FREE_DAQ in between, the slave returns an ERR_SEQUENCE as negative response.
This command allocates a number of ODTs and assigns them to the specified DAQ list.
This command can only be used for configurable DAQ lists, so the range for
DAQ_LIST_NUMBER is [MIN_DAQ, MIN_DAQ+1,..MIN_DAQ+DAQ_COUNT-1].
If the specified list is not available, ERR_OUT_OF_RANGE will be returned.
If there’s not enough memory available to allocate the requested ODTs an
ERR_MEMORY_OVERFLOW will be returned as negative response.
The master has to use ALLOC_ODT in a defined sequence together with FREE_DAQ,
ALLOC_DAQ and ALLOC_ODT_ENTRY. If the master sends an ALLOC_ODT directly after
a FREE_DAQ without an ALLOC_DAQ in between, the slave returns an ERR_SEQUENCE
as negative response.
If the master sends an ALLOC_ODT directly after an ALLOC_ODT_ENTRY without a
FREE_DAQ in between, the slave returns an ERR_SEQUENCE as negative response.
This command allocates a number of ODT entries and assigns them to the specific ODT in
this specific DAQ list.
This command can only be used for configurable DAQ lists, so the range for
DAQ_LIST_NUMBER is [MIN_DAQ, MIN_DAQ+1,..MIN_DAQ+DAQ_COUNT-1].
If the specified list is not available, ERR_OUT_OF_RANGE will be returned.
SET_MTA
PROGRAM_CLEAR
PROGRAM
PROGRAM_MAX or PROGRAM_NEXT
The following commands are optional (for instance to verify memory contents):
UPLOAD
BUILD_CHECKSUM
If non-volatile memory programming requires the download of additional code, the download
has to be finished before the PROGRAM_START command is executed. The MTA must
point to the entry point of the downloaded routine.
Bit
7 6 5 4 3 2 1 0
MASTER_BLOCK_MODE
SLAVE_BLOCK_MODE
INTERLEAVED_MODE
x
The MASTER_BLOCK_MODE flag indicates whether the Master Block Mode is available
during Programming.
The INTERLEAVED_MODE flag indicates whether the Interleaved Mode is available during
Programming.
The SLAVE_BLOCK_MODE flag indicates whether the Slave Block Mode is available during
Programming.
The communication parameters MAX_CTO, MAX_BS, MIN_ST and QUEUE_SIZE may
change when the slave device is in memory programming mode. The new communication
parameters MAX_CTO_PGM, MAX_BS_PGM, MIN_ST_PGM and QUEUE_SIZE_PGM are
returned in the positive response.
Parameter Description
MTA The MTA points to the start of a memory sector inside the slave.
Memory sectors are described in the ASAM MCD 2MC slave device
description file.
If multiple memory sectors shall be cleared in a certain sequence, the master
device must repeat the PROGRAM_CLEAR service with a new MTA.
In this case the master must keep the order information given by the Clear
Sequence Number of the sectors.
Clear range The Clear Range indicates the length of the memory part to be cleared.
The PROGRAM_CLEAR service clears a complete sector or multiple sectors
at once.
Parameter Description
MTA The MTA has no influence on the clearing functionality
clear range This parameter should be interpreted bit after bit:
basic use-cases:
0x00000001 : clear all the calibration data area(s)
0x00000002 : clear all the code area(s) (the boot area is not covered)
0x00000004 : clear the NVRAM area(s)
0x00000008 .. 0x00000080: reserved
This command is used to program data inside the slave. Depending on the access mode
(defined by PROGRAM_FORMAT) 2 different concepts are supported.
The end of the memory segment is indicated, when the number of data elements is 0.
The end of the overall programming sequence is indicated by a PROGRAM_RESET
command. The slave device will go to disconnected state. Usually a hardware reset of the
slave device is executed.
This command may support block transfer similar to the commands DOWNLOAD and
DOWNLOAD_NEXT.
This optional command indicates the end of a non-volatile memory programming sequence.
It may or may not have a response. It either case, the slave device will go to the
disconnected state.
This command may be used to force a slave device reset for other purposes.
Positive response:
Bit
7 6 5 4 3 2 1 0
NON_SEQ_PGM_SUPPORTED
COMPRESSION_SUPPORTED
NON_SEQ_PGM_REQUIRED
COMPRESSION_REQUIRED
ENCRYPTION_SUPPORTED
ENCRYPTION_REQUIRED
FUNCTIONAL_MODE
ABSOLUTE_MODE
Bit
1 0
FUNCTIONAL_MODE
ABSOLUTE_MODE
clear/programming mode
0 0 Not allowed
0 1 Only Absolute mode supported
1 0 Only Functional mode supported
1 1 Both modes supported
The COMPRESSION_x flags indicate which compression state of the incoming data the
slave can process. The answer is a summary (OR operation) for all programmable segments
and/or sectors.
Bit
3 2
COMPRESSION_SUPPORTED
COMPRESSION_REQUIRED
compression
0 0 Not supported
0 1 supported
1 0
1 1 Supported and required
Bit
5 4
ENCRYPTION_SUPPORTED
ENCRYPTION_REQUIRED
encryption
0 0 Not supported
0 1 supported
1 0
1 1 Supported and required
The NON_SEQ_PGM_x flags indicate whether the slave can process different kind of
sequence regarding the incoming data. The answer is a summary (OR operation) for all
programmable segments and/or sectors.
Bit
7 6
NON_SEQ_PGM_SUPPORTED
NON_SEQ_PGM_REQUIRED
0 0 Not supported
0 1 supported
1 0
1 1 Supported and required
Positive response:
The Clear Sequence Number and Program Sequence Number describe, in which subsequential
order the master has to clear and program flash memory sectors. Each sequence number must
be unique. Sectors, which do not have to be programmed, can be skipped in the programming
flow control.
Example 1: In this example the memory must be cleared from small to great sector numbers
and then reprogrammed from great to small sector numbers.
Example 2: In this example the memory sectors must be alternately cleared and
reprogrammed from small to great sector numbers.
If Mode = 0 , this command returns the start address for this SECTOR in SECTOR_INFO.
If Mode = 1, this command returns the length of this SECTOR in SECTOR_INFO.
This optional command is used to indicate the begin of a code download as a precondition
for non-volatile memory programming. The MTA points to the begin of the volatile memory
location where the code will be stored. The parameter Codesize specifies the size of the
code that will be downloaded. The download itself is done by using subsequent standard
commands like SET_MTA and DOWNLOAD.
Codesize is expressed in BYTE, WORD or DWORD depending upon AG.
The slave device has to make sure that the target memory area is available and it is in a
operational state which permits the download of code. If not, a ERR_GENERIC will be
returned.
This command describes the format of following, uninterrupted data transfer. The data
format is set direct at begin of the programming sequence and is valid till end of this
sequence. The sequence will be terminated by other commands e.g. SET_MTA.
If this command isn’t transmitted at begin of a sequence, unmodified data and absolute
address access method is supposed.
The master will not perform the reformatting. The master just is getting the values that
identify the reformatting methods from the ASAM MCD-MC2 description file and passing
them to the slave.
Affected Commands
PROGRAM, PROGRAM_MAX, PROGRAM_NEXT, SET_MTA
Negative Response:
If the number of data elements does not match the expected value, the error
code ERR_SEQUENCE will be returned. The negative response will contain the
expected number of data elements.
Depending upon AG, 1 or 3 alignment bytes must be used in order to meet alignment
requirements.
ELEMENT is BYTE, WORD or DWORD, depending upon AG.
The data block with the fixed length of MAX_CTO-1 elements contained in the CTO will be
programmed into non-volatile memory, starting at the MTA. The MTA will be post-
incremented by MAX_CTO-1.
This command does not support block transfer and it may not be used within a block transfer
sequence.
With Verification Mode = 00 the master can request the slave to start internal test
routines to check whether the new flash contents fits to the rest of the flash. Only
the result is of interest.
With Verification Mode = 01, the master can tell the slave that he will be sending
a Verification Value to the slave.
The definition of the Verification Mode is project specific. The master is getting
the Verification Mode from the project specific programming flow control and
passing it to the slave.
The tool needs no further information about the details of the project specific
check routines. The XCP parameters allow a wide range of project specific
adaptions.
The Verification Type is specified in the project specific programming flow control.
The master is getting this parameter and passing it to the slave.
The definition of the Verification Value is project specific and the use is defined in
the project specific programming flow control.
1.7.1 Definitions
1.7.1.1 Error
When the master sends a command CMD to the slave, no error occurs if the slave within a
specified time answers with a positive response RES.
A Time-out Error occurs if the slave doesn’t answer with any response within a specified time.
An Error Code Error occurs if the slave answers within a specified time with a negative response
ERR.
When trying to recover from an Error, the master first has to perform a Pre-Action and then
an Action.
The Pre-Action brings the slave in a well defined state that allows the master to perform the
Action.
The XCP Protocol supports the following kind of Pre-Actions :
• Wait t7
• SYNCH
• GET_SEED / UNLOCK
• SET_MTA
• SET_DAQ_PTR
• START_STOP_x
• Reinitialise DAQ
With the Action, the master tries to recover from the Error State.
The XCP Protocol supports the following kind of Actions :
• Display error
• Retry other syntax
• Retry other parameter
• Use ASAM MCD 2MC Description File
• Use alternative
• Repeat 2 times
• Repeat ∞ times
• Restart session
• Terminate session
Error and Event messages are classified according to their Severity Level.
The XCP Protocol defines the following Severity Levels :
Severity Description
S0 Information
S1 Warning / Request
S2 Resolvable Error
S3 Fatal Error
The Severity Level gives the master information about a possible Transition in the State-
machine and for deciding about an appropriate reaction upon the ERR or EV.
A Time-out Error occurs if the slave within a specified time doesn’t answer with any
response to a command sent from master to slave.
When sending a command, the master has to start a timer. For each command, the
maximum value the timer can reach is given by the Time-Out Value tx. If the master receives
an answer before the timer reaches its maximal value, the master has to reset the timer. If
the timer reaches its maximum value without the master receiving an answer from the slave,
the master has to detect this as a Time-Out Error.
The XCP Protocol supports 6 different Time-Out Values t1 till t6.
The master can get the values for t1 till t6 from the ASAM MCD 2MC Description File.
The specific tx for each command is indicated in the chapter “Error Handling Matrix”.
Master Slave
start Timer Request k
Response k
reset Timer
Request k+1
Time-Out tx
SYNCH
ERR_CMD_SYNCH
Time-Out tx
SYNCH
ERR_CMD_SYNCH
Response k
Request k+1
If the Master detects a Time-out in the Standard Communication Model, the master has to
perform the Pre-Action and Action. This sequence (pre-action, action) has to be tried 2
times.
If the master then still detects a Time-out Error, the master can decide about an appropriate
reaction by himself.
In the usual case, the (pre-action, action) consists of a SYNCH command to re-synchronize
command execution between master and slave followed by a repetition of the command.
For some special commands, the pre-action brings the slave in a well defined state e.g. by
sending again SET_MTA or SET_DAQ_PTR before repeating the command.
If the Master detects a Time-out in the Block Communication Model, the master has to perform
the same Error Handling as for the Standard Communication Model.
In Master Block Transfer Mode, the master has to start the timer used for Time-out detection
when sending the last frame of a block that builds a command.
Master Slave
Request k_0
Request k_1
start Timer Request k_2
Response k
reset Timer
Time-Out tx
In Master Block Transfer Mode, the master has to use the same Time-Out Value tx it uses
when sending the same command in Standard Communication mode.
When repeating a command, the master always has to repeat the complete block that builds the
command.
In Slave Block Transfer Mode, the master has to reset the timer used for Time-out detection
when receiving the last frame of a block that builds a response.
Master Slave
start Timer Request k
Response k_0
Response k_1
Response k_2
reset Timer
Time-Out tx Response k_0
In Slave Block Transfer Mode, the master has to use the same Time-Out Value tx it uses
when receiving the same response in Standard Communication mode.
If the Master detects a Time-out in the Interleaved Communication Model, the master
has to perform the same Error Handling as for the Standard Communication Model.
Master Slave
start Timer Request k
Response k
reset Timer
Response k+1
Time-Out tx SYNCH
ERR_CMD_SYNCH
Response k+1
The master gets the default values for t1 till t6 from the ASAM MCD 2MC Description File.
For special purposes, XCP allows to overrule these Time-Out Values.
With EV_CMD_PENDING, the slave can request the master to restart the time-out detection.
For bypassing, it might be necessary to change the Time-Out Values used by the slave.
The setting of these values is done by standard calibration methods. No special XCP
commands are needed for this.
With EV_CMD_PENDING, the slave can request the master to restart the time-out detection.
Master Slave
start Timer Request k
Time-Out tx
EV_CMD_PENDING
restart Timer
Time-Out tx
EV_CMD_PENDING
restart Timer
Time-Out tx
EV_CMD_PENDING
restart Timer
Response k
reset Timer
The EV_CMD_PENDING allows the slave to inform the master that the request was
correctly received and the parameters in the request are valid. However, the slave currently
is not able of generating a response yet.
If the master receives an EV_CMD_PENDING from the slave, the master shall not repeat
the request.
If the master receives an EV_CMD_PENDING from the slave, the master has to restart the
timer used for time-out detection.
As soon as the slave has been able to process the request, it has to send a (positive or
negative) response RES or ERR to the master.
An Error Code Error occurs if the slave answers within a specified time with a negative response
ERR.
If the master sends a command which belongs to a not supported resource, the slave responds
with an ERR_CMD_UNKNOWN.
If the master receives an ERR when sending a CMD, it has to check the “Error Handling Matrix”
that for each CMD defines a specific “Pre-Action” and “Action” for a specific ERR.
If the master after performing the “Pre-Action” and “Action” still detects an Error Code Error, the
master can decide about an appropriate reaction by himself.
If for a specific CMD, the specific ERR is not mentioned in the “Error Handling Matrix”, the
master has to check the Severity of this ERR in the “Table of Error Codes” and decide about
an appropriate reaction.
If an error occurs during a multi-command sequence, the master can decide about an
appropriate reaction.
The Error packet codes in the table below may be sent as an asynchronous packet with PID
0xFE.
The Error code 0x00 is used for synchronization purposes (ref. description of SYNCH).
For referencing to them in the higher level *.AML (ref. Part 4 “Interface to ASAM MCD 2MC Description
File”), they are grouped under the tag “Common_Parameters” in a file XCP_common_vX_Y.aml.
(vX_Y being the current XCP Protocol Layer Version Number).
uint; /* T1 [ms] */
uint; /* T2 [ms] */
uint; /* T3 [ms] */
uint; /* T4 [ms] */
uint; /* T5 [ms] */
uint; /* T6 [ms] */
uint; /* T7 [ms] */
uchar; /* MAX_CTO */
uint; /* MAX_DTO */
enum { /* BYTE_ORDER */
"BYTE_ORDER_MSB_LAST" = 0,
"BYTE_ORDER_MSB_FIRST" = 1
};
taggedstruct { /* optional */
"GET_COMM_MODE_INFO" = 0xFB,
"GET_ID" = 0xFA,
"SET_REQUEST" = 0xF9,
"GET_SEED" = 0xF8,
"UNLOCK" = 0xF7,
"SET_MTA" = 0xF6,
"UPLOAD" = 0xF5,
"SHORT_UPLOAD" = 0xF4,
"BUILD_CHECKSUM" = 0xF3,
"TRANSPORT_LAYER_CMD" = 0xF2,
"USER_CMD" = 0xF1,
"DOWNLOAD" = 0xF0,
"DOWNLOAD_NEXT" = 0xEF,
"DOWNLOAD_MAX" = 0xEE,
"SHORT_DOWNLOAD" = 0xED,
"MODIFY_BITS" = 0xEC,
"SET_CAL_PAGE" = 0xEB,
"GET_CAL_PAGE" = 0xEA,
"GET_PAG_PROCESSOR_INFO" = 0xE9,
"GET_SEGMENT_INFO" = 0xE8,
"GET_PAGE_INFO" = 0xE7,
"SET_SEGMENT_MODE" = 0xE6,
"GET_SEGMENT_MODE" = 0xE5,
"COPY_CAL_PAGE" = 0xE4,
"CLEAR_DAQ_LIST" = 0xE3,
"SET_DAQ_PTR" = 0xE2,
"WRITE_DAQ" = 0xE1,
"SET_DAQ_LIST_MODE" = 0xE0,
"GET_DAQ_LIST_MODE" = 0xDF,
"START_STOP_DAQ_LIST" = 0xDE,
"START_STOP_SYNCH" = 0xDD,
"GET_DAQ_CLOCK" = 0xDC,
"READ_DAQ" = 0xDB,
"GET_DAQ_PROCESSOR_INFO" = 0xDA,
"GET_DAQ_RESOLUTION_INFO" = 0xD9,
"GET_DAQ_LIST_INFO" = 0xD8,
"GET_DAQ_EVENT_INFO" = 0xD7,
"FREE_DAQ" = 0xD6,
"ALLOC_DAQ" = 0xD5,
"ALLOC_ODT" = 0xD4,
"ALLOC_ODT_ENTRY" = 0xD3,
"PROGRAM_START" = 0xD2,
"PROGRAM_CLEAR" = 0xD1,
"PROGRAM" = 0xD0,
"PROGRAM_RESET" = 0xCF,
"GET_PGM_PROCESSOR_INFO" = 0xCE,
"GET_SECTOR_INFO" = 0xCD,
"PROGRAM_PREPARE" = 0xCC,
})*;
“ BLOCK” taggedstruct {
uchar; /* MAX_BS */
uchar; /* MIN_ST */
};
};
enum { /* DAQ_CONFIG_TYPE */
"STATIC" = 0,
"DYNAMIC" = 1
};
uint; /* MAX_DAQ */
uint; /* MAX_EVENT_CHANNEL */
uchar; /* MIN_DAQ */
enum { /* OPTIMISATION_TYPE */
"OPTIMISATION_TYPE_DEFAULT" = 0,
"OPTIMISATION_TYPE_ODT_TYPE_16" = 1,
"OPTIMISATION_TYPE_ODT_TYPE_32" = 2,
"OPTIMISATION_TYPE_ODT_TYPE_64" = 3,
"OPTIMISATION_TYPE_ODT_TYPE_ALIGNMENT" = 4,
"OPTIMISATION_TYPE_MAX_ENTRY_SIZE" =5
};
enum { /* ADDRESS_EXTENSION */
"ADDRESS_EXTENSION_FREE" = 0,
"ADDRESS_EXTENSION_ODT" = 1,
"ADDRESS_EXTENSION_DAQ" = 3
};
enum { /* GRANULARITY_ODT_ENTRY_SIZE_DAQ */
"GRANULARITY_ODT_ENTRY_SIZE_DAQ_BYTE" = 1,
"GRANULARITY_ODT_ENTRY_SIZE_DAQ_WORD" = 2,
"GRANULARITY_ODT_ENTRY_SIZE_DAQ_DWORD" = 4,
"GRANULARITY_ODT_ENTRY_SIZE_DAQ_DLONG" = 8
};
uchar; /* MAX_ODT_ENTRY_SIZE_DAQ */
enum { /* OVERLOAD_INDICATION */
"NO_OVERLOAD_INDICATION" = 0,
"OVERLOAD_INDICATION_PID" = 1,
"OVERLOAD_INDICATION_EVENT" = 2
};
taggedstruct { /* optional */
"PRESCALER_SUPPORTED";
"RESUME_SUPPORTED";
enum { /* GRANULARITY_ODT_ENTRY_SIZE_STIM */
"GRANULARITY_ODT_ENTRY_SIZE_STIM_BYTE" = 1,
"GRANULARITY_ODT_ENTRY_SIZE_STIM_WORD" = 2,
"GRANULARITY_ODT_ENTRY_SIZE_STIM_DWORD" = 4,
"GRANULARITY_ODT_ENTRY_SIZE_STIM_DLONG" = 8
};
uchar; /* MAX_ODT_ENTRY_SIZE_STIM */
};
uint; /* TIMESTAMP_TICKS */
enum { /* TIMESTAMP_SIZE */
"NO_TIME_STAMP" = 0,
"SIZE_BYTE" = 1,
"SIZE_WORD" = 2,
"SIZE_DWORD" =4
};
taggedstruct {
"TIMESTAMP_FIXED";
};
};
"PID_OFF_SUPPORTED";
taggedstruct { /* optional */
"DAQ_LIST_TYPE" enum {
"DAQ" = 1, /* DIRECTION = DAQ only */
"STIM" = 2, /* DIRECTION = STIM only */
"DAQ_STIM" = 3 /* both directions possible */
/* but not simultaneously */
};
enum {
"DAQ" = 1, /* only DAQ_LISTs */
/* with DIRECTION = DAQ */
"STIM" = 2, /* only DAQ_LISTs */
/* with DIRECTION = STIM */
"DAQ_STIM" = 3 /* both kind of DAQ_LISTs */
};
uchar; /* MAX_DAQ_LIST */
uchar; /* TIME_CYCLE */
uchar; /* TIME_UNIT */
uchar; /* PRIORITY */
“FIXED_EVENT_LIST” taggedstruct {
(“EVENT” uint)* ;
};
“VARIABLE” taggedstruct {
block “AVAILABLE_EVENT_LIST” taggedstruct {
(“EVENT” uint)*;
};
block “DEFAULT_EVENT_LIST” taggedstruct {
(“EVENT” uint)*;
};
};
}; /************************* end of DAQ_EVENT *******************************/
uchar; /* MAX_SEGMENTS */
taggedstruct { /* optional */
"FREEZE_SUPPORTED";
};
enum {
"PGM_MODE_ABSOLUTE" = 1,
"PGM_MODE_FUNCTIONAL" = 2,
"PGM_MODE_ABSOLUTE_AND_FUNCTIONAL" = 3
};
uchar; /* MAX_SECTORS */
uchar; /* MAX_CTO_PGM */
taggedstruct { /* optional */
ulong; /* Address */
ulong; /* Length */
uchar; /* CLEAR_SEQUENCE_NUMBER */
uchar; /* PROGRAM_SEQUENCE_NUMBER */
uchar; /* PROGRAM_METHOD */
“ BLOCK” taggedstruct {
uchar; /* MAX_BS_PGM */
uchar; /* MIN_ST_PGM */
};
};
};
uchar; /* SEGMENT_NUMBER */
uchar; /* number of pages */
uchar; /* ADDRESS_EXTENSION */
uchar; /* COMPRESSION_METHOD */
uchar; /* ENCRYPTION_METHOD */
taggedstruct { /* optional */
taggedstruct {
"MAX_BLOCK_SIZE" ulong ;
/* maximum block size */
/* for checksum calculation */
"EXTERNAL_FUNCTION" char[256]; /* Name of the Checksum function */
/* including file extension */
/* without path */
};
};
enum { /* ECU_ACCESS_TYPE */
"ECU_ACCESS_NOT_ALLOWED" = 0,
"ECU_ACCESS_ WITHOUT_XCP_ONLY" =1,
"ECU_ACCESS_ WITH_XCP_ONLY" = 2,
"ECU_ACCESS_ DONT_CARE" =3
};
enum { /* XCP_READ_ACCESS_TYPE */
"XCP_READ_ACCESS_NOT_ALLOWED" = 0,
"XCP_READ_ACCESS_ WITHOUT_ECU_ONLY" = 1,
"XCP_READ_ACCESS_ WITH_ECU_ONLY" = 2,
“XCP_READ_ACCESS_ DONT_CARE" =3
};
taggedstruct {
"INIT_SEGMENT" uchar; /* references segment that initialises this page */
};
}; /* end of optional */
taggedstruct Common_Parameters {