This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

PIL Execution Using the MATLAB Coder App

You can use processor-in-the-loop (PIL) executions with STMicroelectronics® STM32F4-Discovery™ board to verify the generated code that you deploy to the target hardware by using a MATLAB® Coder™ procedure. You can profile algorithm performance and speed of your generated code on the target hardware. To verify generated code with the MATLAB Coder app, you must have MATLAB Coder and an Embedded Coder® license.

This PIL execution is also available with these hardware support packages.

  • Embedded Coder Support Package for BeagleBone® Black Hardware

  • Embedded Coder Support Package for ARM® Cortex®-A Processors

  • Embedded Coder Support Package for ARM Cortex-M Processors

You can set up PIL execution with the MATLAB Coder app.

To open the MATLAB Coder app, see Open the MATLAB Coder App and Select Source Files (MATLAB Coder).

To configure the build type and hardware board:

  1. Configure the build type and hardware board. On the Generate Code page, in the Generate dialog box:

    • Set the Build type to Static Library.

    • Clear the Generate code only check box.

    • Set the Hardware Board to STM32F4-Discovery.

  2. If necessary, modify the settings for your board. To modify the settings, click Settings > All Settings, and then click Hardware.

    Specify the stack usage of the generated code in the Memory > Stack usage max parameter. The memory of the hardware board is limited, and a default value of 20000 is beyond the stack size available in the hardware. We recommend you to set the value to 512. However, specify an appropriate stack usage based on your algorithm.

  3. To generate the library, click Generate.

  4. Set up your PIL execution. To open the Verify Code dialog box, click Verify Code.

    Because the hardware board is not MATLAB Host Computer, the Verify Code dialog box is configured for PIL execution.

    In the Verify Code dialog box:

    • Enter the name of the test file for PIL execution.

    • Select Generated code.

  5. To start the PIL execution, click Run Generated Code.

  6. To stop the PIL execution, click Stop.

For another example of PIL verification, see the Processor-in-the-Loop Verification of MATLAB Functions example in the documentation of the Embedded Coder Support Package for STMicroelectronics Discovery Boards.

To install the Embedded Coder Support Package for STMicroelectronics Discovery Boards, see Supported Hardware (Embedded Coder).