CMSIS  
Common Microcontroller Software Interface Standard
 
Loading...
Searching...
No Matches
Introduction

The CMSIS (Common Microcontroller Software Interface Standard) is a set of APIs, software components, tools, and workflows that help to simplify software re-use, reduce the learning curve for microcontroller developers, speed-up project build and debug, and thus reduce the time to market for new applications.

CMSIS started as a vendor-independent hardware abstraction layer Arm® Cortex®-M based processors and was later extended to support entry-level Arm Cortex-A based processors. To simplify access, CMSIS defines generic tool interfaces and enables consistent device support by providing simple software interfaces to the processor and the peripherals.

CMSIS has been created to help the industry in standardization. It enables consistent software layers and device support across a wide range of development tools and microcontrollers. CMSIS is not a huge software layer that introduces overhead and does not define standard peripherals. The silicon industry can therefore support the wide variations of Arm Cortex processor-based devices with this common standard.

CMSIS Components

CMSIS Components Overview

CMSIS Base Software Components

  • Provide software abstractions for basic level functionalities of a device.
  • Maintained in the same GitHub repository and delivered as one CMSIS Software Pack with the name Arm::CMSIS.
    CMSIS-CoreStandardized access to Arm Cortex processor coresGuide | GitHub | Pack
    CMSIS-DriverGeneric peripheral driver interfaces for middlewareGuide | GitHub | Pack
    CMSIS-RTOS2Common API for real-time operating systemsGuide | GitHub | Pack

CMSIS Extended Software Components

  • Implement specific functionalities optimized for execution on Arm processors.
  • Maintained in separate GitHub repositories and delivered in standalone CMSIS-Packs.
    CMSIS-DSPOptimized compute functions for embedded systemsGuide | GitHub | Pack
    CMSIS-NNEfficient and performant neural network kernelsGuide | GitHub | Pack
    CMSIS-ViewEvent Recorder and Component Viewer technologyGuide | GitHub | Pack
    CMSIS-CompilerRetarget I/O functions of the standard C run-time libraryGuide | GitHub | Pack

CMSIS Tools

  • Provide useful utilities for software development workflows with CMSIS-based components.
  • Maintained in separate GitHub repositories.
    CMSIS-ToolboxA set of command-line tools to work with software packsGuide | GitHub
    CMSIS-StreamTools and methods for optimizing DSP/ML block data streamsGuide | GitHub
    CMSIS-DAPFirmware for debug units interfacing to CoreSight Debug Access PortGuide | GitHub
    CMSIS-ZoneDefines methods to describe system resources and to partition themGuide | GitHub

CMSIS Specifications

  • Define methodologies and workflows for embedded software development.
    CMSIS-PackDelivery mechanism for software components and device/board supportGuide | GitHub
    CMSIS-SVDPeripheral description of a device for debug viewGuide | GitHub

Benefits

The benefits of the CMSIS are:

  • CMSIS reduces the learning curve, development costs, and time-to-market. Developers can write software quicker through a variety of easy-to-use, standardized software interfaces.
  • Consistent software interfaces improve the software portability and re-usability. Generic software libraries and interfaces provide consistent software framework.
  • It provides interfaces for debug connectivity, debug peripheral views, software delivery, and device support to reduce time-to-market for new microcontroller deployment.
  • It allows to use the compiler of your choice, as it is compiler independent and thus supported by mainstream compilers.
  • It enhances program debugging with peripheral information for debuggers and ITM channels for printf-style output.
  • CMSIS is delivered in CMSIS-Pack format which enables fast software delivery, simplifies updates, and enables consistent integration into development tools.
  • CMSIS-Zone will simplify system resource and partitioning as it manages the configuration of multiple processors, memory areas, and peripherals.
  • IDE and Continuous Integration (CI) are important workflows for embedded software developers. The CMSIS-Toolbox provides command-line build tools with CMake backend and integration into IDEs such as VS Code.

Development

CMSIS is defined in close cooperation with various silicon and software vendors and provides a common approach to interface to peripherals, real-time operating systems, and middleware components. It is intended to enable the combination of software components from multiple vendors.

CMSIS is open-source and collaboratively developed. The repository for the base components is github.com/Arm-software/CMSIS_6.

Coding Rules

The CMSIS uses the following essential coding rules and conventions:

  • Compliant with ANSI C (C99) and C++ (C++03).
  • Uses ANSI C standard data types defined in **<stdint.h>**.
  • Variables and parameters have a complete data type.
  • Expressions for #define constants are enclosed in parenthesis.
  • Conforms to MISRA 2012 (but does not claim MISRA compliance). MISRA rule violations are documented.

In addition, the CMSIS recommends the following conventions for identifiers:

  • CAPITAL names to identify Core Registers, Peripheral Registers, and CPU Instructions.
  • CamelCase names to identify function names and interrupt functions.
  • Namespace_ prefixes avoid clashes with user identifiers and provide functional groups (i.e. for peripherals, RTOS, or DSP Library).

The CMSIS is documented within the source files with:

  • Comments that use the C or C++ style.
  • Doxygen compliant function comments that provide:
    • brief function overview.
    • detailed description of the function.
    • detailed parameter explanation.
    • detailed information about return values.

Doxygen comment example:

/**
* @brief Enable Interrupt in NVIC Interrupt Controller
* @param IRQn interrupt number that specifies the interrupt
* @return none.
* Enable the specified interrupt in the NVIC Interrupt Controller.
* Other settings of the interrupt such as priority are not affected.
*/

Validation

The various components of CMSIS are validated using mainstream compilers. To get a diverse coverage, Arm Compiler v6 (based on LLVM front-end) and GCC are used in the various tests. For each component, the section Validation describes the scope of the various verification steps.

CMSIS components are compatible with a range of C and C++ language standards. The CMSIS components comply with the Application Binary Interface (ABI) for the Arm Architecture. This ensures C API interfaces that support inter-operation between various toolchains.

As CMSIS defines API interfaces and functions that scale to a wide range of processors and devices, the scope of the run-time test coverage is limited. However, several components are validated using dedicated test suites (CMSIS-Driver, and CMSIS-RTOS v2).

The CMSIS source code is checked for MISRA C:2012 conformance. MISRA deviations are documented with reasonable effort, however Arm does not claim MISRA compliance as there is today for example no guideline enforcement plan. The CMSIS source code is not checked for MISRA C++:2008 conformance as there is a risk that it is incompatible with C language standards, specifically warnings that may be generated by the various C compilers.

Migration from CMSIS v5

The functionality of invidivdual CMSIS v6 software components is kept primarily same as in CMSIS v5.9.0. However, some CMSIS components are now delivered in their standalone CMSIS packs and may also have different naming, structure and dependencies.

While use of CMSIS-Pack concept greatly helps to abstract many of this changes from users, there are still some simple adaptation required to fully enable CMSIS v6 support in software developed based on CMSIS v5 structure. Following migration guides explain necessary steps for such porting:

License

CMSIS is provided free of charge by Arm under the Apache 2.0 License.