Main Content

Optimize Code forARMCortex-M Processors

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

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

To enable the code replacement libraries forARM 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, open theModelingtab and pressCTRL+Eto open the Configuration Parameters dialog box. Go toHardware Implementation>Hardware boardand ensure that theDevice vendoris set toARM compatibleandDevice typeisARM Cortex.

  3. In the Configuration Parameters dialog box, expandCode Generation, and select theInterfacepane.

  4. ClickSelectof代码替换库parameter. AChoose one or multiple Code replacement libraries for code generationdialog box is opened.

  5. SelectARM Cortex-Mto the selected code replacement libraries-prioritized and clickOK.