Main Content


Generate ASAP2 (A2L) file according to ASAM MCD-2 MC standards



coder.asap2.export(modelName) generates an ASAP2 (A2L) file for modelName.


coder.asap2.export(modelName,Name,Value) specifies additional options for ASAP2 (A2L) creation with one or more Name, Value pair arguments. For example, you can specify a location where to save the A2L file. You can provide the symbol file of the model to replace ECU addresses in the A2L file.


collapse all

Generate an A2L file for the selected model and save it in the build folder of the model.

% Generate A2L file for model

Generate an A2L file for the selected model and save it with the custom name specified.

% Export A2L file and save it as

Generate an A2L file for the selected model and save it in the specified folder.

% Export A2L file to specified path

Generate an A2L file for the selected model with ECU addresses based on the ELF symbol file associated with the executable.

% Generate A2L file for model

Generate a specific version of the A2L file for the selected model. The description format of the data changes with respect to the version of the A2L file.

% Generate A2L file with version 1.71

Generate an A2L file for the selected model and exclude the comments.

% Generate A2L file with comments excluded

Generate an A2L file for the selected model and exclude the A2ML and IF_DATA sections.

% Generate A2L file with A2ML and IF_DATA excluded

Specify the name of the model class instance. The objName is declared in the global namespace.

% Use custom specified name as object name in A2L file

% Specify the name of model class instance declared inside the namespace. Here instance customObj
% is declared in customNameSpace

Create a custom base object and specify the fields. Customize the contents of the A2L file by using custom base object.

% Create custom base object and provide fields you want to modify
obj = coder.asap2.UserCustomizeBase;
obj.HeaderComment = 'Header comment';
obj.ModParComment = 'Mod Par comment';
obj.ModCommonComment = 'Mod Common comment';
obj.ASAP2FileName = 'File name';
obj.ByteOrder = 'BYTE_ORDER MSB_LAST';

% Generate A2L file with custom base created

Input Arguments

collapse all

Name of the model.

Example: 'MyModel','nav_app'

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'MapFile','model.elf' generates A2L file for the model with debug mapping information from the model.elf file.

Full path to a folder in which to place an exported A2L file.

Example: 'Folder','/home/temp/prjct/'

Name for the exported 2L file to save it in the folder.

Example: 'FileName','test_car'

Name of the model symbol file that contains symbols of generated code. For example, the addresses of variables used in generated code.

Example: 'MapFile','model.elf'

A2L file format based on ASAM MCD-2 MC standard defined by ASAM. There are multiple versions of the ASAM MCD-2 MC standard. Specify the version of A2L that you want.

Example: 'Version','1.61' or 'Version','1.31'

Generate the A2L file by including or excluding comments.

Example: 'Comments',true

Generate the A2L file by including or excluding A2ML and IF_DATA sections.

Example: 'GenerateXCPInfo',true

Custom model instance name in an A2L file. This argument is applicable only for Adaptive AUTOSAR models.

Example: 'ModelClassInstanceName','customObj' or 'ModelClassInstanceName','customNameSpace::customObj'

Generate an A2L file by following indentation.

Example: 'IndentFile',true

Create a user base and customize the ASAP2 fields such as:

  • ASAP2FileName

  • ByteOrder

  • HeaderComment

  • ModParComment

  • ModCommonComment

Example: 'CustomizationObject',obj

Introduced in R2021a