Guidelines for Writing High Integrity Software in C (The MISRA-C:2012 Guidelines)

Course category
Training area
Course code
MC-102
Duration
1 days
Additional information
Available for on-site delivery only. Can be delivered remotely or Face-to-Face.

Using C for embedded development requires a sound understanding of the programming language being used. This is a one day intensive course that introduces coding guidelines developed specifically for use on embedded projects using the C language. This course covers a set of rules in detail, set in the context of C. The latter part of the course looks at the commercial support for the guidelines.

The guidelines used are the MISRA-C:2012 guidelines, developed by the Motor Industry Software Reliability Association (MISRA) for the use of the C language in vehicle based software (www.misra.org.uk). However, these guidelines are applicable to any project using C that has safety requirements or the need to develop high quality code. The MISRA-C:2012 guidelines are suitable for projects up to Safety Integrity Level (SIL) 3.

A one-day course covering the MISRA-C:2012 guidelines in detail and their applicability as a coding standard for embedded development using C.

Course objectives:

  • To provide an understanding of the essentials of the MISRA-C programming guidelines
  • To assess the usefulness of the guidelines as a company standard
  • To give you the confidence to apply these guidelines to your next project

Delegates will learn:

  • The rational behind each of the MISRA-C guidelines
  • The usefulness of each rule in the guidelines
  • Examples of code that fails the rules

Pre-requisites:

Who should attend:

The course is designed for real-time engineers currently, or about to be, programming in C. It is also applicable for project managers and QA personnel (assuming the appropriate background).

Duration:

  • One day

Course materials:

  • Delegate Handbook

Course workshop:

The course will demonstrate commercial tools currently supporting the checking of MISRA-C:2012 guidelines.

Introduction to the MISRA-C Guidelines:

  • Background
  • Scope
  • The rules

The C Programming Language:

  • The new C standard
  • Key characteristics of C

How the Guidelines apply to Types and Operators:

  • C base types
  • Variables
  • Basic Operators

Control Flow:

  • If, if/else, if/else if
  • Switch
  • While, do/while
  • Break, continue, goto

Functions:

  • Subprograms
  • Parameters
  • Different types of variable storage

Pointers and Arrays:

  • Pointers
  • Arrays
  • The relationship between pointers and arrays

Structures and Dynamic Memory Management:

  • Structures
  • Unions
  • Dynamic memory management

Program Structure:

  • Structuring software into logical compilation units

The C Pre-Processor:

  • Macros
  • Conditional Compilation

The Standard C Library

Target Specific Types:

  • Signed, unsigned, short and long
  • Promotion and conversion

Real-Time Specifics:

  • Accessing hardware: I/O mapped; memory mapped addressing polling; interrupts and vectored interrupts; interrupt expansion controllers;

Target Specific Considerations:

  • Portability