Calibrate Generated Code and Monitor Signals Through XCP and Third-Party Tools

When you create an external mode target application that uses an ASAM MCD-1 XCP communication channel, you can also generate an ASAP2 file that provides a description of the Simulink® Coder™ XCP slave configuration. The description enables third-party calibration tools such as ETAS® INCA and Vector CANape® to connect to the external mode target application. You can use the third-party tools to calibrate generated code and monitor signals in environments supported by the third-party tools, for example, a vehicle, a test bench, or a virtual environment on a PC.

Use this workflow.

  1.  Configure your model.

  2.  Generate the target application and ASAP2 file.

  3. Import the ASAP2 file into your third-party tool.

  4. Manually run the external mode application on your target hardware.

  5. Through XCP, connect the third-party tool to the target application.

  6. Using the third-party tool, perform data acquisition and calibration of generated code.

If you select model configuration parameter Generate code only, then the build process does not generate the ASAP2 file. Before step 3:

  1. Compile the generated code manually.

  2. Use the coder.xcp.a2l.addCoderXCPInfo function to create the ASAP2 file, modelName_CoderXCPSlave.a2l.

By default, the build process:

  • Runs rtw.asap2MergeMdlRefs to merge the ASAP2 files generated from referenced models into a single ASAP2 file.

  • Runs rtw.asap2SetAddress to replace placeholder address strings with addresses extracted from the debug symbol file specified for model configuration parameter Mex-file arguments.

If you do not want to merge ASAP2 files from referenced models or perform address string replacement, run coder.xcp.a2l.addCoderXCPInfo as shown:

coder.xcp.a2l.addCoderXCPInfo(buildFolder, 'MergeMdlRefs', false, ...
                              'SetAddress', false);

If you want to specify a GRT system target file for code generation, use the manual approach.

See Also

Related Topics