AUTOSAR Blockset enables you to configure run-time calibration of adaptive application data based on XCP slave communication and ASAP2 (A2L) file generation. The XCP and ASAP2 capabilities are defined outside the Adaptive Platform (AP) specification, which as of Release 19-11 does not address data calibration.
As part of generating and deploying adaptive code, you can configure interfaces for XCP slave communication in the generated C++ code and export A2L files containing model data for measurement and calibration.
Before deploying adaptive code:
In the Configuration Parameters dialog box, you can configure the model to generate XCP slave function calls in adaptive C++ code and to generate an XCP section in an ASAP2 (A2L) file.
In the ASAP2 Generator app, you can generate an ASAP2 (A2L) file that contains model data for measurement and calibration.
To enable the communication capability, use the AUTOSAR adaptive model configuration
parameter Transport
layer to select an XCP transport layer. When Transport
layer is set to a value other than None
,
Simulink® adds XCP slave function calls to the generated C++ code. By default, the
MathWorks® XCP Slave stack is used.
Selecting an XCP transport layer enables other XCP parameters. This image shows the XCP slave model configuration parameters.
Using the model configuration parameters, you can:
Specify the transport layer that you want to use for communication.
Specify the target machine IP address and port number. You can use the port for only one application.
Optionally, enable verbose messages for XCP slave.
Optionally, instead of the MathWorks XCP slave, you can use a custom XCP slave implementation based
on the Ethernet transport layer. To use a custom XCP slave, provide
implementations for the functions declared in the XCP slave header file by
using the custom XCP slave API commands. The XCP slave header file is
located in the MATLAB® installation folder
.matlabroot
/toolbox/coder/autosar/adaptive
Add custom XCP slave details in Configuration
Parameters > Code Generation >
Build process > Toolchain
Settings > Toolchain details or add the
details manually to the CMakeLists.txt
file.
An ASAP2 (A2L) file is a non-object-oriented description of the data used for measurement and calibration. To generate an A2L file:
Select Code perspective for the model.
To open the ASAP2 Generator app, on the AUTOSAR tab, click Share > Export ASAP2. By default, the app selects the build folder of the respective model.
To replace ECU addresses in the A2L file, provide a symbol file associated with the adaptive application executable in the Select symbol file field. Otherwise, clear Address replacement.
Click Generate.
An A2L file with the same name as the model is generated.
You can also generate an ASAP2 (A2L) file by using the function autosar.code.exporta2l
. For
example:
% Generate a2l file for AUTOSAR adaptive model autosar.code.exporta2l('myModel')