XCP Plug-in brochure
Transcription
XCP Plug-in brochure
XCP plug-in Table of Contents 1 Introduction ............................................................................................................................................................... 2 1.1 Features ............................................................................................................................................................ 2 1.2 Limitations ....................................................................................................................................................... 2 1.3 Performance Characteristics ............................................................................................................................ 2 2 Architecture ............................................................................................................................................................... 4 3 Usage ......................................................................................................................................................................... 5 3.1 General setup ................................................................................................................................................... 5 3.2 Modes of operation .......................................................................................................................................... 8 3.2.1 DAQ ............................................................................................................................................................ 8 3.2.2 Polling ....................................................................................................................................................... 11 3.3 The XCP plugin window ............................................................................................................................... 13 3.4 Measurement sequence .................................................................................................................................. 14 4 XCP Master configuration examples ....................................................................................................................... 15 4.1 Integration with VECTOR CANoe ................................................................................................................ 15 4.1.1 Prepare ASAM2 2MC (A2L) file .............................................................................................................. 15 4.2 Integration with VECTOR CANape .............................................................................................................. 17 CANoe.XCP®, CANoe.AMD®, CANape® are registered trademarks of Vector Informatik GmbH iSYSTEM, February 2013 1/26 1 Introduction The XCP plug-in is a lightweight implementation of an XCP slave. It enables measuring and calibrating of the target The XCP plug-in interfaces between a measurement / calibration tool like CANoe or CANape and the rest of the tools stack down to the target ECU. All microcontrollers, supported by iSYSTEM tools, can be handled by the XCP plug-in. The XCP plug-in enables the measurement and calibration of an ECU without the need of any slave code on the ECU, without performance degradation to the ECU operation and without the need of a physical interface (like CAN, The XCP plug-in supports polled mode access, where access is directed from the XCP master and also high speed data 1.1 Features Synchronous data acquisition (DAQ) Direct memory access (polling) Online memory calibration (read / write access) Timestamped data transfer, generation of event timestamps by the ECU/Emulator 1.2 Limitations Ethernet transport layer supported only Only dynamic DAQ list supported Bypassing is not supported Block mode is not supported Resume mode is not supported Checksum is not supported Dynamic event list (Plug-and play) is not supported 1.3 Performance Characteristics Characteristics Value Timestamp resolution 100 µs Min sampling interval polling 1 ms Min sampling interval DAQ 100 µs Bypassing latency time < 500 µs Max DAQ events 256 iSYSTEM, February 2013 2/26 Characteristics Value Max DAQ per Event 1 Max ODT1 entries 256 Max ODT entry2 size 8 bytes 1 ODT = Object Descriptor T memory. Handled by XCP master and contains one or more ODT entries. 2 An entry in an ODT references data element by its address, the address extension and the size of the element. Handled by XCP master and usually maps to single observed variable. iSYSTEM, February 2013 3/26 2 Architecture Conceptual architecture iSYSTEM, February 2013 4/26 3 Usage The XCP master (i.e. CANoe, CANape) and the XCP slave (winIDEA XCP plugin) must be configured properly to establish communication. The communication protocol (TCP or UDP) and port should match. If the master and slave are in different host you will have to configure the addresses accordingly, by default the communication is setup for localhost connection. 3.1 General setup 1) Enable the XCP plug-in in winIDEA. (Plugins/Options) iSYSTEM, February 2013 5/26 2) Enable the Status Window of the XCP plugin. (Plugins/Options/XCP/Status window) 3) Review the XCP configuration options for both the master and the slave. Generally, the slave functions as a server that sources data and the master (i.e. CANoe) as a client that consumes it. XCP slave configuration: iSYSTEM, February 2013 6/26 XCP master configuration (i.e. CANoe): iSYSTEM, February 2013 7/26 3.2 Modes of operation The XCP plugwrite). In all cases, it is the master (CANoe, CANape) responsibility to set-up the measurement environment. The ASAM 2MC configuration file (extension .A2L) is a good starting point to prepare the measurement environment. A default WINIDEA_XCPSERVER.A2L file is provided by iSYSTEM for easy start-up. On the master side, data acquisition may be configured as DAQ or Polling. DAQ is recommended as data acquisition is much faster and the sampling interval more consistent. 3.2.1 DAQ In DAQ mode, data acquisition is performed by the emulator. For maximum performance, disable »Real time memory-access« under Debug/Options/Memory Access. If real-time memory access is enabled and in use, the debugger and the DAQ aquisition subsystem will compete resources, resulting in a slower or less stable sampling interval. iSYSTEM, February 2013 8/26 Example DAQ configuration in CANoe: In this case, iXcpArray_01 variable will be sampled by emulator at maximum sampling rate. Whenever variable changes, an event is triggered and data streamed to XCP master. When DAQ is running, this is clearly indicated on the XCP's plugin main page. iSYSTEM, February 2013 9/26 3.2.1.1 DAQ Performance issues General performance is indicated in the line »DAQ average/desired sampling time (us)«. Desired sampling time comes from minimum required event sampling time (see table): DAQ event name max_rate 1ms 10ms 100ms 1s user defined DAQ event number 0 1 2 3 4 5-255 Desired sampling rate (ns) max possible rate 1.000 10.000 100.000 1.000.000 1.000.000 If average sampling time exceeds the desired minimum required sampling time, the status line appears in red, clearly warning the end user of irregular sampling conditions. Please take care when deciding on event number. Events 0,1 and 5-255 cause a lot of traffic on the debug port which could lead to irregular measurement conditions. iSYSTEM, February 2013 10/26 3.2.2 Polling When the polling mode is used the memory access requests are generated by the master. The XCP commands (read sequentially by the XCP slave. The statistics are clearly displayed in the Note: Real-time memory access under Debug/Options/Memory Access must be ENABLED in this case. Example Polling configuration in CANoe: iSYSTEM, February 2013 11/26 In this case, every 100 ms a read request is the operation of the plug-in in this mode are shown on the XCP plugin statistics section: Statistics about If realtotal/errors shows the number of unsuccessful attempts. XCP_CMD_DENIED is returned to the master. iSYSTEM, February 2013 12/26 3.3 The XCP plugin window Command buttons to start, stop and configure the XCP plugin. The status line displays the general XCP plugin status (Stopped, Running / Listening). The configuration options display the general XCP plugin configuration (protocol, port, memory access mode, Autostart) The master (client) info displays the master connection status (whether a master is connected or not) The XCP statistics display overall XCP commands statistics. Memory reads, writes and errors are reported separately. The DAQ statistics display the overall DAQ acquisition performance. iSYSTEM, February 2013 13/26 3.4 1. Measurement sequence Prepare measurement configuration on the master side. This includes adoption of memory locations and measurement mode for every observed variable. Start with WINIDEA_XCPSERVER.A2L template, which includes a single observed variable. Link ECU's MAP file with A2L observation variables. For DAQ-based measurement, following events/measurement modes are available by default: max_rate (max sampling rate on the Emulator) 1ms_loop (1ms sampling rate on the Emulator) 10ms_loop (10ms sampling rate on the Emulator) 100ms_loop (100ms sampling rate on the Emulator) 1s_loop (1s sampling rate on the Emulator) Up to 256 events could be used (please add own to .A2L file). Please note, that an event will ONLY be triggered, if ANY of the observed variable(s) has changed. Picture: Example of measurement configuration in CANape 2. 3. 4. 5. Prepare target application. Run the XCP plugin Run the target aplication from winIDEA. Start measurement from the master. Optionaly use debugger Run control to manipulate target execution iSYSTEM, February 2013 14/26 4 XCP Master configuration examples In this section, some popular XCP master applications and required configuration setup are described. Integration examples could be found in winIdea examples/XCP folder. 4.1 Integration with VECTOR CANoe 4.1.1 Prepare ASAM2 2MC (A2L) file To startup with CANoe, correctly defined ASAM 2MC configuration file (A2L) is crucial for correct configuration. Default WINIDEA_XCPSERVER.A2L template is a good starting point. CANoe includes specialised 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 means of 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 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 very important part, so- 4.1.1.1 Usage of XCP Events Events are placeholders for variable observation. Each event has the unique ID. Max 255 could be used with XCP plugin. From the master point of view, all events are trigger-based events (not cyclic); it means, XCP message would be transmitted to master only if variable change is detected by XCP plugin. Setting the event type to cyclic in A2L file sense: their behavior is predefined in XCP plugin and is based on the event ID. iSYSTEM, February 2013 15/26 However, inside the emulator, changes are detected by internal loop, which is cyclic. Following table describes internal cycle interval: Event ID 0 1 2 3 4 5-255 4.1.1.2 Event name max_rate 1ms_loop 10ms_loop 100ms_loop 1s_loop user defined Sampling cycle time fastest possible rate (min 100 µs cycle) 1 ms 10 ms 100 ms 1s same as event 0 (fastest possible rate) The MEASUREMENT section 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: Note: If 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. iSYSTEM, February 2013 16/26 4.2 Integration with VECTOR CANape 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. 1. Prepare target application, turn on BlueBox emulator, start winIdea and run the XCP plug-in iSYSTEM, February 2013 17/26 2. In CANape, start a new configuration iSYSTEM, February 2013 18/26 3. Create new device from existing database Note: Use predefined WINIDEA_XCPSERVER.A2L database iSYSTEM, February 2013 19/26 4. After CANape loads the database file, it immediately tries to establish the communication with winIdea XCP plugin. If succesfull, XCP plugin updates master (client) info and number of received XCP commands. CANape updates its own status, too. CANape allows manual communication manipuation to XCP server (bring online/offline, activate/deactivate device) If connection fails, review the TCP/IP communication options in CANape and diagnostic info on XCP plugin. Please note, single master connection to XCP slave is allowed only! If you experience troubles with connection establishment, simply put ECU offline. iSYSTEM, February 2013 20/26 iSYSTEM, February 2013 21/26 5. Register linker map file with WINIDEA_XCPSERVER in device configuration. That's the way how LINKER and CANape exchange target ECU memory and variable adresses. If the source code of the ECU is modified, map file would be modified as well (when project is recompiled and re-linked). CANape detects such map file modification and refreshes the A2L file automaticaly. iSYSTEM, February 2013 22/26 6. Now edit the A2L file with internal database editor. It allows variable definition and other ECU parameters. Variables could be simply linked to MAP file. iSYSTEM, February 2013 23/26 7. Configure measurement Now you are ready to select desired event(s) and attach variable(s). iSYSTEM, February 2013 24/26 8. Prepare measurement windows and select observed variables. iSYSTEM, February 2013 25/26 9. 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..) iSYSTEM, February 2013 26/26