XCP Master configuration examples
In this topic:
•Integration with VECTOR CANoe
•Integration with VECTOR CANape
In this section, some popular XCP master applications and required configuration setup are described. Integration examples could be found in winIDEA examples/XCP folder.
XCP support in CANoe is optional. CANoe option .XCP or .AMD is required to activate XCP support. Please contact Vector for further information. |
To startup with CANoe, correctly defined ASAM 2MC configuration file (A2L) is crucial for correct configuration. A2L File Generator is a good starting point.
CANoe includes a specialized ASAP2 file viewer, which allows A2L file preview. Appropriate tool is required to create/modify the ASAP2 file (i.e. ASAP2 editor).
However, it could easily be adjusted by a simple text-editor (since A2L file is a text file).
Essential sections of A2L file are:
•IF_DATA XCP section
•MEASUREMENT section
The IF_DATA_XCP section describes the essential XCP plugin properties. Use complete IF_DATA_XCP section in your target ECU A2L file to enable correct XCP data exchange.
This section provides a very important part, so-called Event list. The Event list contain one or more events.
Events are placeholders for variable observation. Each event has a unique ID. Max 255 could be used with the XCP plugin. From the master point of view, all events are trigger-based events (not cyclic); it means, XCP message would be transmitted to the master only if variable change is detected by XCP plugin. Setting the event type to cyclic in A2L file doesn’t make sense: their behavior is predefined in XCP plugin and is based on the event ID.
However, inside the emulator, changes are detected by the internal loop, which is cyclic. Following table describes event’s internal cycle interval:
Event ID |
Event name |
Sampling cycle time |
---|---|---|
0 |
max_rate |
fastest possible rate (min 100 µs cycle) |
1 |
1ms_loop |
1 ms |
2 |
10ms_loop |
10 ms |
3 |
100ms_loop |
100 ms |
4 |
1s_loop |
1 s |
The MEASUREMENT section defines observed variables measurement and their relation to XCP events. This part should be adjusted to actual ECU memory layout and desired observation cycle time.
Example:
/begin MEASUREMENT iXcpCounter_100ms ""
UWORD NO_COMPU_METHOD 0 0 0 65535
ECU_ADDRESS 0x20000068
FORMAT "%.15"
/begin IF_DATA CANAPE_EXT
100
LINK_MAP "iXcpCounter_100ms" 0x20000068 0x0 0 0x0 1 0x8F 0x0
DISPLAY 0 0 65535
/end IF_DATA
/end MEASUREMENT
If the target ECU memory layout changes, the A2L file should be updated somehow. Vector provides special tools for such purposes. For example, the ASAP2 Updater reads an ASAP2 source file and updates the address and data type information on the basis of the entries in a linker map file. The most prevalent linker MAP formats are supported, such as IEEE, COFF, ELF and the ASCII map formats of many compilers. |
Integration with CANape is somehow similar to integration with CANoe with more measurement setup flexibility. Following screenshots may show/help how to prepare a measurement environment.
Prepare target application, turn on BlueBox emulator, start winIDEA and run the XCP plug-in. |
In CANape, start a new configuration |
Create a new device from an existing database. |
Use a predefined WINIDEA_XCPSERVER.A2L database. |
After CANape loads the database file, it immediately tries to establish the communication with the winIDEA XCP plugin. If successful, the XCP plugin updates master (client) info and number of received XCP commands. CANape updates its own status, too. CANape allows manual communication manipulation to XCP server (bring online/offline, activate/deactivate device) |
If connection fails, review the TCP/IP communication options in CANape and diagnostic info on the XCP plugin.
Single master connection to XCP slave is allowed only! If you experience trouble with connection establishment, simply put ECU offline. |
Register linker map file with WINIDEA_XCPSERVER in device configuration. That's the way LINKER and CANape exchange target ECU memory and variable addresses. If the source code of the ECU is modified, a map file would be modified as well (when the project is recompiled and re-linked). CANape detects such map file modification and refreshes the A2L file automatically. |
Now edit the A2L file with the internal database editor. It allows variable definition and other ECU parameters. Variables could be simply linked to a map file. |
Configure measurement. Now you are ready to select the desired event(s) and attach variable(s). |
Prepare measurement windows. |
Select observed variables. |
Start measurement. |
DAQ progress is updated on the XCP plugin status window. During measurement, full debug/trace control is possible in winIDEA (Stop, Step, Step over, Run, Run until return..) |