Optimize Code for ARM Cortex-M Processors

You can configure your model to replace generic code with ARM® CMSIS code that is optimized for ARM Cortex®-M processors.

To measure the effects of optimization, you can perform Execution profiling before and after completing this procedure. For more information, see Replace Code for Embedded Targets (Embedded Coder).

To enable the code replacement libraries for ARM Cortex-M processors:

  1. (Optional) To see the code replacement libraries that the code generation process will, enter:

    crviewer('ARM Cortex-M')

    Code Replacement Viewer opens and displays the code replacement libraries.

  2. In the model, click the Model Configuration Parameters button.

  3. In the Configuration Parameters dialog box, expand Code Generation, and select the Interface pane.

  4. Set the Code replacement library parameter to ARM Cortex-M, and click OK.