Main Content

Generate ASAP2 and CDF Calibration Files

Generate and customize an ASAP2 file and a CDF (Calibration Data Format) file for a model by using the Generate Calibration Files tool. By default, the tool generates the latest supported version of the A2L file according to ASAM MCD-2 MC standards. You can choose to generate a different version. You can customize the options for calibration files, such as the version for the A2L file and the schema type, for the CDF file. For more information on the ASAM MCD-2 MC (ASAP2) standard and the ASAM CDF Standards, see the ASAM website at

Open Generate Calibration Files Tool

  1. Open the model.

  2. Open the Simulink Coder app.


    For AUTOSAR models, open the AUTOSAR Component Designer app. And for Simulink Real-Time models, open the Simulink Coder app.

  3. Generate code for the model.

  4. On the C Code tab, select Share > Generate Calibration Files.


For AUTOSAR models, select Autosar > Share > Generate Calibration Files.

Using the tool, you can generate A2L and cdfx files at the same time for a model. You can use the tool for models configured with an ERT-based, GRT-based, Simulink Real-Time, AUTOSAR Classic, or AUTOSAR Adaptive system target file. The tool remembers the last used settings, such as the version of the ASAP2 file, include or exclude comments, turn off or on the ASAP2 file and CDF file generation. Simulink saves these settings in the MATLAB preferences. The settings will override the default settings.

For AUTOSAR classic models, the tool allows you to include or exclude RTE elements into the ASAP2 file by using the Include AUTOSAR RTE elements option.

ASAP2 File Generation

ASAP2 defines the description format of the internal ECU variables used for tuning parameters and measuring signal data as an application executes. To generate an ASAP2 file:

  1. By default the Generate ASAP2 option is enabled. If it is not enabled, slide the Generate ASAP2 slider to the on position to enable A2L generation.

  2. To change the name of the A2L file, in the File name field, specify the name.

  3. By default, the code generator uses the build folder for the folder path of the selected model. If you want to specify a different folder path for the A2L file, you can do that in the Folder path field.

  4. To replace ECU addresses in the A2L file, in the Symbol file field, provide a symbol file associated with the application executable. Otherwise, clear the Address replacement field.

    The tool supports an ELF, PDB, DWARF, or executable file as a symbol file to replace the ECU addresses.

  5. Set Version to the required version of the A2L file to be generated. The default version is 1.71.

  6. To exclude comments in the A2L file, clear Include comments.

  7. For AUTOSAR classic models, to exclude RTE elements in the A2L file, clear Include AUTOSAR RTE elements.

  8. Click Generate.

To generate the A2L file programmatically, use the coder.asap2.export function.

CDF File Generation

ASAM CDF defines the data description format for storing the ECU parameter values and the associated meta data. The ASAM CDF files use XML, which can be easily validated, edited, imported, and exported by calibration tools and XML editors. To generate a CDF file by using the tool:

  1. Slide the Generate CDF slider to the on position.

  2. To change the name of the CDF file, specify it in the File name field.

  3. By default, the code generator selects the build folder for the folder path of the selected model. If you want to specify a different folder path for the CDF file, in the Folder path field, specify the path.

  4. Use the Schema type field to set to XSD (XML Schema Definition) or DTD (Document Type Definition). The DTD schema type is the default.

To generate the CDF file programmatically, use coder.cdf.export function.


CDF file generation is disabled for Simulink Real-Time system target file.

Create a Host-Based ASAM-ASAP2 Data Definition File for Data Measurement and Calibration

This model shows ASAP2 data export. ASAP2 is a data definition standard proposed by the Association for Standardization of Automation and Measuring Systems (ASAM).

Open Example Model

Open the example model ASAP2Demo.


See the ASAP2 File Generation to customize and generate the ASAP2 file.

See Also

| |

Related Topics