Configuring the XCP Group
- Aktualisiert2025-10-31
- 5 Minute(n) Lesezeit
Configure parameters for the XCP group.
Configure an XCP device with the XCP Configurator by importing channel data from an A2L file.
- Enter a unique name for the XCP group.
-
Double-click the XCP group from the list of objects where you
added the group.
The XCP group appears in PAconfigurator (Classic).
- In the Device column, enter the name of the imported XCP file.
- Optional: In the Bus Status column, enter the bus status that is written into the variable at runtime.
-
In the Port Number column, select the
CAN port for the communication between the master and the
slave.
You can use a variable to define the port number dynamically at test runtime.
- In the Name column, select the name of the imported XCP variable.
- Enter the Value of the imported XCP variable.
- Optional:
In the Unit column, select the
dimensions of the XCP variable.
The dimensions of the XCP variable are set in the imported file.
-
Select the Data Type of the XCP
variable.
The data type of the XCP variable are set in the imported file.
-
In the Fractional Part column, enter the
number of decimal places that display in
PAconfigurator.
If you enter 0, no decimal places display in PAconfigurator. If the measurement is performed with higher precision, the exceeding digits are rounded. Figures greater than or equal to five are rounded up.
The decimal places for the XCP variable is set in the imported file.
- In the Fixed Formula column, select the formula in the A2L file.
-
Select one of the following for the Channel
Type of the input/output variable.
Option Description XCP_SINGLE_IN Channel type for input variables that are updated infrequently. With each call of the channel update, an upload is triggered to the control device. The control device sends a corresponding answer. The call is synchronous. Therefore, the channel update finishes after reading the new value of the channel variable from the response of the control device. XCP_SINGLE_OUT Channel type for output variables that are updated once or infrequently. For example, select XCP_SINGLE_OUT for configuration variables that are set only once after the start of a session. The update is synchronous. XCP_CYCLIC_IN Channel type for input variables that are read by the control unit in intervals. The control device defines the update interval of the input variables. The control device can be influenced by assigning the individual channel to a corresponding (XCP) EVENT. The (XCP) EVENT presets the update interval. The frequency group only presets the interval for synchronizing the channel variables with the XCP stack. XCP_CYCLIC_OUT Channel type for an XCP cyclic output value. XCP_MAP_IN Channel type for reading value fields. The value fields can have a different number of dimensions. During implementation in PAtools, a value field is read into a value table through the XCP_MAP_IN channel type. The value table can be one-, two-, or three-dimensional. The value table adapts to the correct dimensions during the reading process. The channel variable you assign in the Name column provides feedback about the progress of the operation.
- -1: An error occurred during the transfer of the value table.
- >0: As soon as the value table is transferred, the assigned channel size contains the number of cells to be transferred. With each cell transferred, the value is decremented by 1. If the value of the variable drops to 0, the transmission is complete.
- 0: During the next cycle, the value table is read again. To prevent a continuous reading of the value table, condition updates to these channels in the operation channel.
XCP_MAP_OUT Channel type for writing a value table to a value block. If the channel variable in the Name column is 1, the transmission process starts with the following steps. - The dimensions of the value table and the number of cells are determined. The value is written to the status variable.
- The channel update starts.
- The status variable decrements by 1 with each transferred cell.
- If all cells are successfully transferred, the value of the status variable is 0.
- The value of the corresponding channel variable is 0.
A new transmission of the value table starts when the following are true.- The channel variable is 0.
- A positive edge change occurs after 1.
XCP_CONTROL Channel type for controlling the behavior of the XCP stack. The following values are possible. - 0 - Init: No open sessions are available to control the device. No communication with the control device occurs.
- 1 - Connect: No connections are available to control the device.
- 2 - Use the GetSeed authentication procedure to make the blocked resources of the control device accessible. The procedure depends on the corresponding control device to determine the resources that are protected.
- 3 - Configured: Start the configuration if you configured cyclic lists.
- 4 - Sleep: Interrupt sending cyclic data for a short time without discarding the configuration. Use the sleep function to reduce the load of the control device.
- 5 - Running: The control device sends the configured cyclic lists. The runtime system processes the cyclic lists.
XCP_STATUS Channel type for the XCP status. XCP_MODIFY_BITS Channel type for XCP outputs with bitmask. -
In the Operation Group column, select an
operation group for the acquisition of the variables in
PAtools.
Define the operation group in an operation table.
- Optional: In the Description column, enter a description of the XCP variable.
- Click Save.
Seed and Key for XCP
Seed and key (seed-key) is a security mechanism that is provided by the XCP specification.
The XCP slave requests a key from the XCP master before granting access to the specification. Then, the XCP master requests a seed from the XCP slave to compute the key. The algorithm that the master uses to compute the key is confidential. The algorithm is encapsulated in a shared object or shared library.
Creating a Shared Object for the Seed-Key Algorithm
An extension to the XCP editor allows you to create a shared object for the seed-key algorithm. The algorithm in the shared object or shared library runs on an Intel CPU.
Introduced in PAtools 2025 Q3
To create a shared object or a shared library for XCP, complete the following steps:
-
Locate the following source files in the
/home/patools/xcp folder on the
PXI controller:
- SeedNKeyXcp.h
- SeedNKeyXcp.c
- Makefile
-
In the SeedNKeyXcp.c file, fill the
XCP_ComputeKeyFromSeed(…)
function with your algorithm.
If you have unique algorithms for different access privileges, use different functions for each access privilege.
The following are example functions that are determined by an access privilege.
- computeKeyFromSeedCalPag(…): calibration access and paging access.
- computeKeyFromSeedDaq(…): acquisition access.
- computeKeyFromSeedStim(…): stimulation access.
- computeKeyFromPgm(…): programming access.
- computeKeyFromSeedDbg(…): debugging access.
-
Execute Makefile.
A shared object named SeedNKeyXcp.so is generated.
- Copy SeedNKeyXcp.so to the /home/patools/xcp folder on the PXI controller.
After you copy SeedNKeyXcp.so to /home/patools/xcp, a seed and key exchange can occur at the start of a test.