Universal Measurement and Calibration Protocol (ASAM Standard)XCP is based on the ASAM A public specification, which has been developed by experts in a defined consensus-driven development process and was released by officials that represent a significant share of the industry for which it is targeted, giving the specification the necessary legitimacy to be called a 'Standard'.standard CAN The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.Calibration Protocol (CAN Calibration Protocol (ASAM Standard)CCP). The first version 1.01 of CAN Calibration Protocol (ASAM Standard)CCP was standardized in 1995. The latest and current version 2.01 of CAN Calibration Protocol (ASAM Standard)CCP was finished in 1999. Though still used in many existing ECU implementations, CAN Calibration Protocol (ASAM Standard)CCP has some disadvantages. One disadvantage is that timestamping for The process of recording data from internal ECU memory and external sensors.measurement data is not available. Furthermore, some features were not specified very concisely, for example flash reprogramming.
In the early 2000s, The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration interfaces were developed using microcontroller specific debug adapters (Joint Test Action Group (IEEE Standard)JTAG) or Serial Peripheral InterfaceSPI, which were commonly available for microcontrollers. These interfaces provided much higher data transmission rates than the highest CAN baud rate of 1 MBaud and were attached to a The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration system (typically a PC) via Ethernet. Therefore, the need for an abstraction of CAN Calibration Protocol (ASAM Standard)CCP was recognized.
ASAM Standard
The initial version of Universal Measurement and Calibration Protocol (ASAM Standard)XCP has been developed in 2003.It was designed for use in the automotive industry, primarily for the areas of ECU development, The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration and testing. Since then, the protocol has widely spread and is supported by many tools on the market. Basically all leading tools in the The process of recording data from internal ECU memory and external sensors.measurement & The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration area support Universal Measurement and Calibration Protocol (ASAM Standard)XCP.
Two reasons for the protocol’s success have been stability and backward-compatibility. Over the years, only extensions were added, which do not break the compatibility to earlier versions.
The version history of Universal Measurement and Calibration Protocol (ASAM Standard)XCP currently consists of 4 releases:
Universal Measurement and Calibration Protocol (ASAM Standard)XCP 1.0 (2003):
Specification of the base standard features measurement & calibration, synchronous stimulation, page switching, reprogramming.
Specification of the transport layers for CAN, Ethernet (UDP and TCP/IP), SPI and USB.
Universal Measurement and Calibration Protocol (ASAM Standard)XCP 1.1 (2008):
Addition of the transport layer for FlexRay.
Universal Measurement and Calibration Protocol (ASAM Standard)XCP 1.2 (2013):
Adition of the A2L-IF_DATA description for calculation of the estimated ECU resource consumptions.
Universal Measurement and Calibration Protocol (ASAM Standard)XCP 1.3 (2015):
Addition of the base standard features ECU States, Bypassing Error Handling and Time Correlation.
Universal Measurement and Calibration Protocol (ASAM Standard)XCP 1.4 (2017):
New DAQ mode: packed DAQ with reduced transmission of timestamp data, improvement of DAQ data consistency e.g. for multicore processors, slave enforced calibration page switching and resource state changes, additions due to ASAM MCD-1 POD.
Universal Measurement and Calibration Protocol (ASAM Standard)XCP 1.5 (2017):
New associated standard "Software Debugging over XCP" has been added to XCP, which allows to carry out typical debugging use cases without the need to connect a debug adapter to the ECU.
Motivation
ECU The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration is a mission critical task for the development of automotive ECUs. Universal Measurement and Calibration Protocol (ASAM Standard)XCP avoids the need to create specific ECU implementations for specific The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tasks. Essentially, the protocol supports all typical The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tasks without the need to recompile to ECU application.
Universal Measurement and Calibration Protocol (ASAM Standard)XCP ensures interoperability between The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration systems and ECUs. Two typical customer-supplier collaboration scenarios are supported:
an OEM calibrates a vehicle consisting of multiple ECUs from different suppliers
a supplier provides its ECU to OEMs, and the OEMs use different calibration systems
Application Areas
Universal Measurement and Calibration Protocol (ASAM Standard)XCP can be used in all stages of ECU development, such as function development, ECU The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration and testing of ECUs. As Universal Measurement and Calibration Protocol (ASAM Standard)XCP is able to realize high data rates and short The process of recording data from internal ECU memory and external sensors.measurement cycle times in the microsecond range, Universal Measurement and Calibration Protocol (ASAM Standard)XCP is very helpful when analyzing the dynamic behavior of electromechanical systems relevant for automotive use cases such as engine or transmission systems or electric drives.
Besides The process of recording data from internal ECU memory and external sensors.measurement data acquisition and The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration use cases, Universal Measurement and Calibration Protocol (ASAM Standard)XCP is also used for reprogramming in early stages of ECU development where the required diagnostic services have not been implemented yet.
Technical Content
Introduction
A key functionality of ASAM Measurement, Calibration and DiagnosticsMCD-1 Universal Measurement and Calibration Protocol (ASAM Standard)XCP is to enable read and write access to the memory of the ECU. Read access, commonly called "The process of recording data from internal ECU memory and external sensors.measurement" in the A public specification, which has been developed by experts in a defined consensus-driven development process and was released by officials that represent a significant share of the industry for which it is targeted, giving the specification the necessary legitimacy to be called a 'Standard'.standard, lets users measure the time response of an internal ECU variable. ECUs are systems with discrete time behavior, whose variables only change at specific time intervals. One of the great strengths of Universal Measurement and Calibration Protocol (ASAM Standard)XCP lies in acquiring measured values from Random Access MemoryRAM only at specific periodic points of time or at specific events. This time or event driven access, commonly called "event-synchronous The process of recording data from internal ECU memory and external sensors.measurement", allows users to directly evaluate the ECU's behavior over time with recorded values from internal variables and external sensors.
The access is address-oriented meaning the communication between master (i.e. the The process of recording data from internal ECU memory and external sensors.measurement & The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tool) and slave (i.e. the ECU) references addresses in memory. So, the The process of recording data from internal ECU memory and external sensors.measurement of a variable is essentially implemented as a request of the master to the slave (i.e. “Give me the value of memory location 0x1234").
Write access, commonly called "The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration" in the A public specification, which has been developed by experts in a defined consensus-driven development process and was released by officials that represent a significant share of the industry for which it is targeted, giving the specification the necessary legitimacy to be called a 'Standard'.standard, lets the user optimize parameters of the ECU's algorithms. The The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration of a parameter is essentially implemented as a request of the master to the slave (i.e. “Set the value at address 0x9876 to 5”).
An Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave does not necessarily need to be an ECU. The Universal Measurement and Calibration Protocol (ASAM Standard)XCP protocol may be implemented in different environments. Two examples are either from a model-based development environment to hardware-in-the-loop or software-in-the-loop environments to hardware interfaces that are used to access ECU memory via debug interfaces, such as Joint Test Action Group (IEEE Standard)JTAG, NEXUS and Data AcquisitionDAP.
The properties and memory addresses of parameters are described in the ASAM MCD-2 MC LanguageA2L-Is a description about how information is encoded and structured and given a specific syntax for storage in a computer file.file format, which is standardized with ASAM Measurement, Calibration and DiagnosticsMCD-2 Measurement and CalibrationMC. This means that access to a specific parameter does not need to be hardcoded into the ECU application. In other words, the ECU contains only a generic Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave protocol stack, which responds to memory access service requests from the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration system. Different The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration and The process of recording data from internal ECU memory and external sensors.measurement tasks can be performed by different configurations of the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration system without recompiling and reprogramming the ECU software.
Universal Measurement and Calibration Protocol (ASAM Standard)XCP was designed with these main objectives:
Minimal resource usage in the ECU
Efficient communication
Simple Slave implementation
Plug-and-play configuration with just a small number of parameters
Scalability: XCP is also very scalable in its implementation, it is not necessary to implement every command described by the standard
Transferability: XCP can be implemented on major bus systems and is open for future bus systems
Communication Model
Universal Measurement and Calibration Protocol (ASAM Standard)XCP is based on the Master-Slave principle. The ECU is the slave and the The process of recording data from internal ECU memory and external sensors.measurement & The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tool is the master. A slave may only communicate with one master at any given time. On the other hand, the master can simultaneously communicate with many slaves.
XCP message format
XCP handler and XCP resources
Universal Measurement and Calibration Protocol (ASAM Standard)XCP data is exchanged between the master and slave in a message-based way. The Universal Measurement and Calibration Protocol (ASAM Standard)XCP packet is embedded in a frame of the transport layer (in the case of Universal Measurement and Calibration Protocol (ASAM Standard)XCP on Ethernet with User Datagram Protocol (IETF Standard)UDP in a User Datagram Protocol (IETF Standard)UDP packet). The frame consists of three parts: the Universal Measurement and Calibration Protocol (ASAM Standard)XCP header, the Universal Measurement and Calibration Protocol (ASAM Standard)XCP packet and the Universal Measurement and Calibration Protocol (ASAM Standard)XCP tail.
In the following figure, the Universal Measurement and Calibration Protocol (ASAM Standard)XCP packet section inside the Universal Measurement and Calibration Protocol (ASAM Standard)XCP message is shown in red. The Universal Measurement and Calibration Protocol (ASAM Standard)XCP header and Universal Measurement and Calibration Protocol (ASAM Standard)XCP tail depend on the transport protocol.
The Universal Measurement and Calibration Protocol (ASAM Standard)XCP packet is independent of the used transport protocol. It always contains three components: “Identification Field”, “Timestamp Field” and the payload in the “Data Field”. Each Identification Field begins with the Packet Identifier (PID).
The type of communication via Universal Measurement and Calibration Protocol (ASAM Standard)XCP packets is subdivided into one range for commands (Command Transfer ObjectCTO) and one range for sending synchronous data (Data Transfer ObjectDTO).
The acronyms used here are short for:
Command
Command Packet
Description
RES
Command Response Packet
positive response
ERR
Error
negative response
EV
Event Packet
asynchronous event
SERV
Service Request Packet
service request
DAQ
Data Acquisition
send periodic measured values
STIM
Stimulation
periodic stimulation of the slave
Commands are exchanged via CTOs (Command Transfer Objects). For example, the master initiates contact in this direction. The slave must respond to a CMD with RES or ERR. The other Command Transfer ObjectCTO messages are sent asynchronously. The Data Transfer Objects (Data Transfer ObjectDTO) are used to transfer synchronous The process of recording data from internal ECU memory and external sensors.measurement and The process to input data into a test system during test execution.stimulation data.
Standard Commands
The Universal Measurement and Calibration Protocol (ASAM Standard)XCP A public specification, which has been developed by experts in a defined consensus-driven development process and was released by officials that represent a significant share of the industry for which it is targeted, giving the specification the necessary legitimacy to be called a 'Standard'.standard commands establish and terminate communication, identify the ECU implementation (version check), unlock protected resources, obtain the current session state, and provide read access to the ECU memory. In order to speed up memory downloads, the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration system can cache the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration memory and optimize the memory downloads by sending only the differing memory parts of a parameter set. This requires that the cache and the ECU memory must be identical. To ensure this, Universal Measurement and Calibration Protocol (ASAM Standard)XCP specifies commands for calculation of memory checksums.
Some of the A public specification, which has been developed by experts in a defined consensus-driven development process and was released by officials that represent a significant share of the industry for which it is targeted, giving the specification the necessary legitimacy to be called a 'Standard'.standard commands are:
Set up Connection With Slave
Disconnect From Slave
Get Current Session Status From Slave
Get Communication Mode Info
Get Identification From Slave
Request to Save to Non-volatile Memory
Get Seed for Unlocking a Protected Resource
Send Key for Unlocking a Protected Resource
Set Memory Transfer Address in Slave
Upload From Slave to Master
Build Checksum Over Memory Range
Data Acquisition (Measurement)
Read-Service Based Data Acquisition (Polling)
To read the memory locations of interest, the simplest way to acquire The process of recording data from internal ECU memory and external sensors.measurement data from the ECU is to send (typically) periodic requests from the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master to the slave. The drawback to these periodic requests is that at least two messages are generated for each signal (command and response), and the acquisition time is not synchronized with the cycle time of the ECU tasks that execute the control algorithms.
Synchronous Data Acquisition (DAQ)
To overcome these disadvantages of the polling mode, Universal Measurement and Calibration Protocol (ASAM Standard)XCP offers the synchronous data acquisition mode. In the control flow of an ECU algorithm, Universal Measurement and Calibration Protocol (ASAM Standard)XCP Data AcquisitionDAQ events can be defined by inserting a function call to the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave protocol stack, which triggers the sampling of The process of recording data from internal ECU memory and external sensors.measurement data. In other words, to use this Data AcquisitionDAQ mode requires the ECU code to be instrumented.
Note: The Automotive Open System ArchitectureAUTOSAR A document, which describes in detail the interfaces and behavior of a technical system for the purpose of implementing, integrating and operating the system.specification defines the Universal Measurement and Calibration Protocol (ASAM Standard)XCP BSW module which implements the Universal Measurement and Calibration Protocol (ASAM Standard)XCP protocol stack and the internal routines to trigger the sampling of The process of recording data from internal ECU memory and external sensors.measurement data.
When the algorithm in the slave reaches the location of such a sampling event, the Universal Measurement and Calibration Protocol (ASAM Standard)XCP Slave collects the values of the The process of recording data from internal ECU memory and external sensors.measurement parameters, saves these values in a buffer and sends them to the master. This setup requires that the slave knows which variables should be measured for which event. The slave obtains this information during the Data AcquisitionDAQ configuration phase, where the master sends specific commands which define the requested The process of recording data from internal ECU memory and external sensors.measurement variables and their associated Universal Measurement and Calibration Protocol (ASAM Standard)XCP events. After the completion of the configuration phase, the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master starts the The process of recording data from internal ECU memory and external sensors.measurement data acquisition, and the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave sends the The process of recording data from internal ECU memory and external sensors.measurement data without further explicit read requests to the master.
An event does not have to be cyclic and time-equidistant. In the case of an engine controller, for example, the event might be angle-synchronous. This makes the time interval between two events dependent on the engine angular velocity. Singular events, such as arbitrary activations of a switch by the driver, are by no means equidistant in time.
Universal Measurement and Calibration Protocol (ASAM Standard)XCP provides the feature to “timestamp” the acquired The process of recording data from internal ECU memory and external sensors.measurement data sample. It is assumed that an ECU has an internal clock which can be used to timestamp the The process of recording data from internal ECU memory and external sensors.measurement data at the moment when it is transferred from the ECU memory to a transmission send buffer.
The commands used for Data AcquisitionDAQ configuration are:
Set Pointer to ODT Entry
Write Element in ODT Entry
Set Mode for DAQ List
Start/Stop/Select DAQ List
Start/Stop DAQ Lists (Synchronously)
Write Multiple Elements in ODT
Read Element From ODT Entry
Get General Information on DAQ Processor
Get General Information on DAQ Processing Resolution
Get Mode From DAQ List
Get Specific Information for an Event Channel
DTO CTR Properties
Clear DAQ List Configuration
Get Specific Information for a DAQ List
Clear Dynamic DAQ Configuration
Allocate DAQ Lists
Allocate ODTs to a DAQ List
Allocate ODT Entries to an ODT
STIM Data Transmission
The STIM feature is very similar to Data AcquisitionDAQ, but works in the opposite direction. Using STIM, the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tool is able to overwrite values of variables of the control algorithm in a task synchronous way. This feature can be used to implement a bypass, where parts of the ECU's control algorithms are calculated outside the ECU by an external bypassing system, see the chapter about "Bypassing" below for further information.
A STIM configuration is set up using exactly the same commands as a Data AcquisitionDAQ The process of recording data from internal ECU memory and external sensors.measurement configuration.
Time Correlation
Universal Measurement and Calibration Protocol (ASAM Standard)XCP offers services to read the current value of the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave clock of the ECU. This enables the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tool to correlate The process of recording data from internal ECU memory and external sensors.measurement data from different ECUs when displaying them together in one graphical chart. The command to get the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave clock is GET_DAQ_CLOCK_FROM_SLAVE.
Due to limitations in the implementation of the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master and Universal Measurement and Calibration Protocol (ASAM Standard)XCP slaves as well as limitations of the communication infrastructure, the achievable accuracy using the above mentioned legacy time correlation technique is limited. Today, there is a strong need for reliable synchronization accuracy in the single-digit microsecond range or even below that.
As a consequence, the protocol and transport layer specifications have been extended thoroughly with the advanced time correlation technique. As a central improvement, an Universal Measurement and Calibration Protocol (ASAM Standard)XCP master is now able to obtain a detailed view of the clock system related to an Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave, i.e. the number of different clocks and their characteristics. Along with three basic techniques, advanced time correlation offers all the features needed to improve time synchronization significantly.
The first technique uses Universal Measurement and Calibration Protocol (ASAM Standard)XCP native methods to improve time synchronization. The basic idea of this technique is to generate an Universal Measurement and Calibration Protocol (ASAM Standard)XCP master initiated event (GET_DAQ_CLOCK_MULTICASTcommand) that simultaneously occurs at the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slaves connected to one transport layer. Each Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave has to sample its timestamps at the moment when this event occurs. The initiation of the event is thereby carried out periodically by an Universal Measurement and Calibration Protocol (ASAM Standard)XCP master. This approach allows correlating the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave’s timestamps among each other, eliminating the need of knowing the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master time as the global reference time. To obtain best accuracy, two requirements have to be satisfied:
Participating slaves have to sample their timestamps instantaneously with the occurrence of the event.
The latency between the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master and the participating Universal Measurement and Calibration Protocol (ASAM Standard)XCP slaves should be the same to ensure a simultaneous occurrence of the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master initiated event at each Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave.
The generation of the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master initiated event that has to occur simultaneously at the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slaves requires broadcast-like mechanism. The method of generating such a broadcast message might be specific for each transport layer and is consequently part of a transport layer A document, which describes in detail the interfaces and behavior of a technical system for the purpose of implementing, integrating and operating the system.specification.
Due to the broadcast characteristic of the GET_DAQ_CLOCK_MULTICAST command and the fact that the command has to be understood as an Universal Measurement and Calibration Protocol (ASAM Standard)XCP master initiated event, the processing of this command differs to classical commands. Instead of sending a positive response as the counterpart to the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master initiated command, an Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave supporting this feature reacts on aGET_DAQ_CLOCK_MULTICAST command by sending information relevant for time correlation as part of an EV_TIME_SYNC event packet to its Universal Measurement and Calibration Protocol (ASAM Standard)XCP master. Therefore, the EV_TIME_SYNCevent packet has been significantly extended.
To ensure backward compatibility, the legacy formats for EV_TIME_SYNC events as well as the response to GET_DAQ_CLOCK command have to be used after connect. An Universal Measurement and Calibration Protocol (ASAM Standard)XCP master supporting the advanced time correlation technique may enable the needed features in an Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave using the response format (RESPONSE_FMT) flag in SET_PROPERTIES of the TIME_CORRELATION_PROPERTIES command. Once the advanced time correlation features have been enabled, the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave shall use the extended response formats for these messages.
The use of the second technique presumes the availability of an Universal Measurement and Calibration Protocol (ASAM Standard)XCP unrelated time synchronization technique, e.g. the Precision Time Protocol (PTP) as defined in the Institute of Electrical and Electronics EngineersIEEE 1588 A public specification, which has been developed by experts in a defined consensus-driven development process and was released by officials that represent a significant share of the industry for which it is targeted, giving the specification the necessary legitimacy to be called a 'Standard'.standard (Institute of Electrical and Electronics EngineersIEEE A public specification, which has been developed by experts in a defined consensus-driven development process and was released by officials that represent a significant share of the industry for which it is targeted, giving the specification the necessary legitimacy to be called a 'Standard'.Standard for a precision clock synchronization protocol for networked The process of recording data from internal ECU memory and external sensors.measurement and control systems, Feb. 2009). In this use case it is assumed that the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave’s clock is either synchronized[1] or syntonized[2] to a grandmaster clock. In such a use case, the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master first needs to know that the timestamps sent by an Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave are synchronized to a grandmaster clock at all. Second, it is necessary to also obtain the information, to which grandmaster clock the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave is synchronized/syntonized to. This information is required to handle systems with more than one grandmaster clock. With introduction of the advanced time correlation technique, Universal Measurement and Calibration Protocol (ASAM Standard)XCP nodes are aware of time synchronization carried out through well-established, Universal Measurement and Calibration Protocol (ASAM Standard)XCP unrelated standards.
Therefore, each clock known to the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave features a unique identifier. When a clock is synchronized/syntonized to a grandmaster clock, the slave’s clocks’ attributes have to be updated to reflect this state change. Based on the information of the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave’s synchronization state and the information to which grandmaster clock the clock is synchronized to – by evaluating the unique clock identifiers – the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master is able to determine hierarchies of synchronized clocks.
The third technique addresses the requirements of resource limited Universal Measurement and Calibration Protocol (ASAM Standard)XCP slaves that do not offer the possibility to synchronize clocks. In such a use case, the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave can offer timestamp tuples to the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master, i.e. its local timestamp and the timestamp of the globally synchronized clock that was valid when the local timestamp was read. Based on this technique, the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master is aware of the relation between clocks of the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave, and finally is able to perform precise clock correlation within the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master.
[1] Two clocks are synchronized to a specified uncertainty if they have the same epoch and their measurements of the time of a single event at an arbitrary time differ by no more than that uncertainty.
[2] Two clocks are syntonized if the duration of the second is the same on both. They may or may not share the same timestamp unit/timestamp size Is a finite ordered list of elements.tuple. They may or may not share the same epoch.
Calibration (CAL)
Calibration RAM
ECU parameters are constant parameters that are adjusted and optimized during the development of the ECU or an ECU One of multiple, interchangeable sets of data or functions in an ECU.variant. This is an iterative process, in which the optimal value of a parameter is found by repeated measurements and changes. To make parameters modifiable at runtime during ECU’s development, additional Random Access MemoryRAM memory is needed.
The most frequently used approach to modifying parameters at runtime (“online calibration”) is to create the parameters in the available Random Access MemoryRAM memory.
This code defines the parameter “factor” as a Random Access MemoryRAM variable with the initial value 0.5. During compiling and linking of the code, memory space is reserved for the object “factor” in Random Access MemoryRAM and the associated Random Access MemoryRAM address appears in the linker-2D-table with three axes.map file. The initial value 0.5 is stored in flash memory and at the relevant location in the hex file. The addresses of the initial values in flash memory are defined by parameterization of the linker, but they do not appear in the linker-2D-table with three axes.map file.
During booting of the ECU, all Random Access MemoryRAM variables are initialized once with their initial values from flash memory. The initialization is usually executed in the start-up code of the compiler manufacturer and the application programmer does not need to be concerned with it. The application uses the values of parameters located in Random Access MemoryRAM and they can be modified via normal Universal Measurement and Calibration Protocol (ASAM Standard)XCP memory accesses.
From the perspective of the ECU software, The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration parameters in Random Access MemoryRAM are unchangeable, i.e. the application itself does not change them. Many compilers discover this fact by code analysis and simply optimize the necessary Random Access MemoryRAM memory space away. Normally, it is therefore also necessary to prevent the compiler from optimizing by using the “volatile” attribute.
From the perspective of the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tool, the Random Access MemoryRAM area in which the parameters are located is referred to as The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration Random Access MemoryRAM (memory that can be calibrated).
The basic commands to access ECU memory are:
Download From Master to Slave
Download From Master to Slave (Block Mode)
Download From Master to Slave (Fixed Size)
Download From Master to Slave (Short Version)
Modify Bits
ECU Memory Layout
The logical memory layout of the ECU (Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave) is described by objects called memory segments. Memory segments have attributes which describe the content and access type to the parameters, for example DATA+Random Access MemoryRAM or CODE+FLASH. A segment is described using the ASAM Measurement, Calibration and DiagnosticsMCD-2 Measurement and CalibrationMC keyword MEMORY_SEGMENT, which contains information like name, address, size and offsets for mirrored segments. The Universal Measurement and Calibration Protocol (ASAM Standard)XCP specific information is inside an IF_DATA section, such as page definitions.
Parameters which are adjustable by the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration system have to be located in data memory segments that are physically located in Random Access MemoryRAM. Addresses of parameters and memory segments are logical addresses which may be mapped to physical memory addresses by means of memory management units (Memory Management UnitMMU). These MMUs offer the possibility to adjust parameters located in a flash memory segment by remapping (using an address translation) to a physical Random Access MemoryRAM area. It is not necessary to change the ECU control algorithm implementation because it uses logical addresses to access parameters.
Page Switching (PAG)
Universal Measurement and Calibration Protocol (ASAM Standard)XCP introduces the concept of pages which make the implemented address translations accessible for the Universal Measurement and Calibration Protocol (ASAM Standard)XCP Page Switching service commands. If these services are implemented, the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tool is able to control the active page. If it switches a memory segment from a Flash page to a Random Access MemoryRAM page, a parameter located in this memory segment can be adjusted during the execution of the control algorithm, also known as online The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration.
Page switching
The access for the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tool and the ECU algorithm can be changed independently.
This access enables modifications of large parameters (e.g. maps) without jeopardizing the data consistency during write operations to the ECU memory. This consistency is realized by first switching the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tool access to the Random Access MemoryRAM page, then writing the data to the ECU and after that switching the ECU access to the Random Access MemoryRAM page. This solution requires of course, that the switching action is implemented as an atomic operation.
Note: This concept depends on the ECU controller features and the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave implementation and may not be supported by all ECUs.
The page switching commands are:
Set Calibration Page
Get Calibration Page
Get General Information on PAG Processor
Get Specific Information for a SEGMENT
Get Specific Information for a PAGE
Set Mode for a SEGMENT
Get Mode for a SEGMENT
Copy Page
Bypassing
Bypassing can be implemented by simultaneously making use of Synchronous Data Acquisition and Synchronous Data The process to input data into a test system during test execution.Stimulation (STIM). For Bypassing, at least two Data AcquisitionDAQ lists are required for transferring data between the ECU and the bypassing tool, i.e. one Data AcquisitionDAQ list for reading variables (Data Acquisition) and one Data AcquisitionDAQ list for writing variables (STIM). Furthermore, specific event channels are required, which control the bypassing process.
Bypassing
The figure shows an example of a simple bypass that uses a Data AcquisitionDAQ event channel and a STIM event channel. In the ECU, the inputs of the bypass function are sampled and sent to the bypassing tool as Data AcquisitionDAQ data before the original function is executed. Typically, the inputs of the bypass function are identical to the inputs of the original function. Once the bypassing tool receives the Data AcquisitionDAQ data triggers, it starts the execution of the bypass function. The output of the bypassing function is then sent back to the ECU as STIM data. Meanwhile, the ECU finished the execution of the original function. The STIM data is fed back to the ECU, typically by overwriting the outputs of the original function. This bypassing process runs in Property of a subsystem, which is subject to timing constraints in such a way that it must be capable to respond to events from its environment timely enough so that the overall system remains stable and performs as specified.real-time. Consequently, the bypassing tool including the Data AcquisitionDAQ and STIM communication must execute in at least the same time than the ECU executes the original function.
The adaption of the ECU code to support a bypass is called a bypass hook. For safety reasons, a bypass hook may need to be activated before it is functional. The mechanism to enable a bypass hook is implementation-specific and not part of the Universal Measurement and Calibration Protocol (ASAM Standard)XCP A public specification, which has been developed by experts in a defined consensus-driven development process and was released by officials that represent a significant share of the industry for which it is targeted, giving the specification the necessary legitimacy to be called a 'Standard'.standard. If required, bypass hooks can be activated using means of Universal Measurement and Calibration Protocol (ASAM Standard)XCP, e.g. by writing to a specific The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration parameter.
Flash Programming (PGM)
Flashing means writing data into an area of flash memory. Writing data into Flash requires precise knowledge of the ECU memory layout. Flash memory is subdivided into multiple sectors (physical sections) which are described by a start address and length. To distinguish them from one another, each of the sectors get a consecutive identification number. The information about the flash sectors is also part of the ASAM MCD-2 MC LanguageA2L file.
Flashing can be implemented by a method that is called “flash kernels”. A flash kernel is executable code that is sent to the Slave’s Random Access MemoryRAM area and is then executed to carry out the actual flash process. The kernel handles the communication with the Universal Measurement and Calibration Protocol (ASAM Standard)XCP Master and access to the Flash memory. It might contain the algorithm that is responsible for erasing the flash memory. For security and space reasons, this code is typically not stored permanently in the ECU’s flash memory.
The flash process with Universal Measurement and Calibration Protocol (ASAM Standard)XCP is roughly subdivided into three areas:
Preparation (e.g. for checking versions to avoid that unsuitable content is written to memory)
Execution (the new content is sent to the ECU and written to memory)
Post-processing (e.g. checksum checking, etc.)
Anyone who compares the flashing operation of Universal Measurement and Calibration Protocol (ASAM Standard)XCP with flashing over diagnostic protocols will realize that the process-specific elements, such as serial number handling with Is data which provides information about other data. metadata, have rather limited functionality. The A public specification, which has been developed by experts in a defined consensus-driven development process and was released by officials that represent a significant share of the industry for which it is targeted, giving the specification the necessary legitimacy to be called a 'Standard'.standard is mainly used during development and does not cover the more complex process steps that are necessary in Denotes the final stages of the assembly line in vehicle production.end-of-line flashing. Therefore, when using Universal Measurement and Calibration Protocol (ASAM Standard)XCP for flashing the memory of an ECU, it is important to determine whether the content that is to be written to memory is relevant to the ECU. There are no special commands for version checking or other safety features in Universal Measurement and Calibration Protocol (ASAM Standard)XCP that would avoid writing invalid content to the ECU.
The programming commands are:
Indicate the Beginning of a Programming Sequence
Clear a Part of Non-volatile Memory
Program a Non-volatile Memory Segment
Indicate the End of a Programming Sequence
Get General Information on PGM Processor
Get Specific Information for a SECTOR
Prepare Non-volatile Memory Programming
Set Data Format Before Programming
Program a Non-volatile Memory Segment (Block Mode)
Program a Non-volatile Memory Segment (fixed size)
Program Verify
ECU States
The idea of the ECU States concept in Universal Measurement and Calibration Protocol (ASAM Standard)XCP is to make the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave status more visible for the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master during the Universal Measurement and Calibration Protocol (ASAM Standard)XCP session. Using this concept the slave is able to inform the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master about changes of the ECU state in the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave. It is possible that certain resources can have an active or inactive state. An ECU state describes the status of all resources. In consequence the status of the slave can change more dynamically and would be still visible for the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master.
This concept is very important for the use case that the ECU and Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave are different instances and the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave can run without an active ECU. In this use case a specific connection between protocol handler and ECU exists.
This concept is based on the already existing resource definition of the Universal Measurement and Calibration Protocol (ASAM Standard)XCP A document, which describes in detail the interfaces and behavior of a technical system for the purpose of implementing, integrating and operating the system.specification with four different resource categories CAL/PAG, Data AcquisitionDAQ, STIM and PGM which are represented in the resource information and is available via the CONNECT response. The RESOURCE parameter bit field defines which resources are available in general, and the ECU state defines which resources are currently active.
Universal Measurement and Calibration Protocol (ASAM Standard)XCP offers two mechanisms to provide the current ECU state to the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master:
Mandatory: The XCP slave reports the current state to the XCP master in the response to the GET_STATUS command.
Optional: If the XCP slave supports asynchronous event messages, it can use the event EV_ECU_STATE_CHANGE to inform the XCP master about a state change and the new STATE_NUMBER. The XCP slave sends the event message to the XCP master once. With the next GET_STATUS request the XCP master receives the STATE_NUMBER again.
With both mechanisms the Universal Measurement and Calibration Protocol (ASAM Standard)XCP master receives the current STATE_NUMBER. The meaning of the specific state is defined in Universal Measurement and Calibration Protocol (ASAM Standard)XCP IF_DATA section of the ASAM MCD-2 MC LanguageA2L file.
STATE_NUMBER communication
For the resource Data AcquisitionDAQ, STIM and PGM it is possible to define that these resources are active or not active. The CAL/PAG resource can be described with a higher granularity within MEMORY_ACCESS sections. The reason for this is that it could happen that the memory, which is the base for the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration, is not completely located in the ECU or in the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave. It could happen that only some parts of the memory are accessible for certain states. Therefore it is possible to define which segment / page of the memory is read- and/or writeable in a specific state.
The MEMORY_ACCESS definition is not needed if the resource CAL/PAG is not available for a specific state. The page access definition of a memory segment is the base for this concept. AnECU_STATE keeps or restricts this access for the given page. The restrictions concerning switching Universal Measurement and Calibration Protocol (ASAM Standard)XCP and/or ECU pages are defined by the MEMORY_SEGMENT section of the ASAM MCD-2 MC LanguageA2L file.
Transmission of Asynchronous ECU Events
The slave can inform the master of an asynchronous event by sending an Event Packet (EV). The implementation of this feature is optional. It enables the slave to report a disturbance, such as the failure of a specific functionality.
The following asynchronous events are defined:
Start in Resume Mode
End of DAQ Clearing
End of DAQ Storing
End of CAL Storing
Request to Restart Time-out Detection
Indication of DAQ Overload
Indication of Autonomous Disconnect
Transfer of Timestamp and Synchronization
Indication of Timeout at STIM
Entering Sleep Mode
Leaving Sleep Mode
ECU state changed
User-defined Event
Transport Layer Specific Event
ECU Description
Using the ASAM A public specification, which has been developed by experts in a defined consensus-driven development process and was released by officials that represent a significant share of the industry for which it is targeted, giving the specification the necessary legitimacy to be called a 'Standard'.standard MCD2-Measurement and CalibrationMC (also known as ASAP2), the Universal Measurement and Calibration Protocol (ASAM Standard)XCP slave interface of an ECU can be modeled by the IF_DATA sections. Universal Measurement and Calibration Protocol (ASAM Standard)XCP specifies the Universal Measurement and Calibration Protocol (ASAM Standard)XCP IF_DATA section using the ASAP2 Meta Language (ASAM MCD-2 MC MetalanguageAML). The Universal Measurement and Calibration Protocol (ASAM Standard)XCP IF_DATA contains sections which describe:
Communication parameters (for example communication timeouts, CAN-IDs for communications, etc.)
Implemented service commands
XCP slave resources for the features DAQ, STIM, CAL, PAG and PGM
The Universal Measurement and Calibration Protocol (ASAM Standard)XCP IF_DATA is structured into:
Common parameters, describing the protocol layer and the available features
The transport layers.
The The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tool uses this information to establish communication, visualize the implemented Universal Measurement and Calibration Protocol (ASAM Standard)XCP features and informs the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration engineer about ECU resource limitations.
A typical task is the configuration of data acquisition. Using the IF_DATA information, the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tool shows the available Universal Measurement and Calibration Protocol (ASAM Standard)XCP The process of recording data from internal ECU memory and external sensors.measurement events. The user configures the sampling rate for a signal by assigning an Universal Measurement and Calibration Protocol (ASAM Standard)XCP The process of recording data from internal ECU memory and external sensors.measurement event. Furthermore the The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tool is able to display the Data AcquisitionDAQ resource consumption, i.e. how many Data AcquisitionDAQ space is currently used, and how many signals may be additionally configured.
Relation to Other Standards
ASAM Universal Measurement and Calibration Protocol (ASAM Standard)XCP is closely related to ASAM Measurement, Calibration and DiagnosticsMCD-2-Measurement and CalibrationMC (also known as ASAP2), which is a description format for internal ECU variables. The ECU specific protocol parameters are described by the ASAP2 Meta Language within so called interface descriptions.
Universal Measurement and Calibration Protocol (ASAM Standard)XCP on FlexRay requires the information of the FlexRay network cluster the ECU is part of. The “XCP on FlexRay” IF_DATA section references the Field Bus Exchange FormatFIBEX file (ASAM Measurement, Calibration and DiagnosticsMCD-2 NET) and the network cluster to get knowledge of the FlexRay communication parameters.
Universal Measurement and Calibration Protocol (ASAM Standard)XCP is closely related to the Universal Measurement and Calibration Protocol (ASAM Standard)XCP BSW module A document, which describes in detail the interfaces and behavior of a technical system for the purpose of implementing, integrating and operating the system.specification of Automotive Open System ArchitectureAUTOSAR 4.0, which actually implements the protocol stack and defines an RTE interface for sampling Universal Measurement and Calibration Protocol (ASAM Standard)XCP The process of recording data from internal ECU memory and external sensors.measurement data.
Industry Adoption
All major The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration tool supplier support Universal Measurement and Calibration Protocol (ASAM Standard)XCP, typically for all bus systems supported by the A public specification, which has been developed by experts in a defined consensus-driven development process and was released by officials that represent a significant share of the industry for which it is targeted, giving the specification the necessary legitimacy to be called a 'Standard'.standard. The tools are used for The process of recording data from internal ECU memory and external sensors.measurement, rapid prototyping and The process of ECU parameter tuning. Tests with ECU hardware and software in the loop are carried out. ECU internal variables and external sensor data is recorded and analyzed. The values of internal ECU parameters are determined as a result of this process.calibration throughout all development phases of an ECU. Another common usage scenario for Universal Measurement and Calibration Protocol (ASAM Standard)XCP is data logging for fleet testing or other post-production investigation activities, where data loggers need read-only access to data on ECUs. .
Moreover, some tool vendors use the opportunity of Universal Measurement and Calibration Protocol (ASAM Standard)XCP for "Plug & Play" of The process of recording data from internal ECU memory and external sensors.measurement tools via reading out the Universal Measurement and Calibration Protocol (ASAM Standard)XCP configuration (ASAP2) via Universal Measurement and Calibration Protocol (ASAM Standard)XCP.
As mentioned above, Universal Measurement and Calibration Protocol (ASAM Standard)XCP is integrated into the Automotive Open System ArchitectureAUTOSAR basic software architecture. Basic software module vendors offer Automotive Open System ArchitectureAUTOSAR-compliant Universal Measurement and Calibration Protocol (ASAM Standard)XCP implementations.
Besides the use in automotive development, Universal Measurement and Calibration Protocol (ASAM Standard)XCP is also used in other areas such as development of rail systems, combustion chain saws and other applications that make use of embedded controllers.
List of Deliverables
The A public specification, which has been developed by experts in a defined consensus-driven development process and was released by officials that represent a significant share of the industry for which it is targeted, giving the specification the necessary legitimacy to be called a 'Standard'.standard includes the following deliverables:
Base Standard
Standard document for the base standard
Standard documents for the associated standards
XCP on CAN and CAN FD
XCP on FlexRay
XCP on Ethernet (UDP and TCP/IP)
XCP on SxI (serial communication links)
XCP on USB
ASAP2 Meta language declarations for the ECU specific protocol parameters
A sample source code package for the implementation of a Seed&Key DLL
Further Reading
XCP – The Standard Protocol for ECU Development; Andreas Patzer; Rainer Zaiser; Vector Informatik; 2013; www.vector.com/xcp-book