Skip to Main Content Skip to Search
Product Documentation

Develop Models and Code That Comply with MISRA C Guidelines

The Motor Industry Software Reliability Association (MISRA[1] ) has established "Guidelines for the Use of the C Language in Critical Systems" (MISRA C). For general information about MISRA C, see www.misra-c.com.

In 1998, MIRA Ltd. published MISRA C (MISRA C:1998) to provide a restricted subset of a standardized, structured language that met Safety Integrity Level (SIL) 2 and higher. A major update based on feedback was published in 2004 (MISRA C:2004), followed by a minor update in 2007 known as Technical Corrigendum (TC1). In 2007, MISRA also published the MISRA AC AGC standard, "MISRA AC AGC: Guidelines for the Application of MISRA-C:2004 in the Context of Automatic Code Generation." MISRA AC AGC does not change MISRA C:2004 rules, rather it modifies the adherence recommendation. For more information about MISRA C, see www.misra-c.com.

Embedded Coder and Simulink offer capabilities to minimize the potential for MISRA C rule violations, especially rules deemed applicable by MISRA AC AGC.

To configure a model or subsystem so that the code generator is most likely to produce MISRA C:2004 compliant code, use the Code Generation Advisor. For more information, refer to:

The Model Advisor also checks that you developed your model or subsystem to increase the likelihood of generating MISRA C:2004 compliant code. To check your model or subsystem:

  1. Open the Model Advisor.

  2. Navigate to By Product > Embedded Coder.

  3. Run the following checks:

For more information about using the Model Advisor, see Consulting the Model Advisor in the Simulink documentation.

For information about using Embedded Coder software within MISRA C guidelines, see Technical Solution 1-1IFP0W on the MathWorks Web site.


[1] MISRA and MISRA C are registered trademarks of MIRA Ltd., held on behalf of the MISRA Consortium.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS