CMSIS Overview

ARM developed the Cortex Microcontroller Software Interface Standard (CMSIS) to allow microcontroller and software vendor to use a consistent software infrastructure to develop software solutions for Cortex-M microcontroller. Let investigate it in detail to understand its advantages.

1. Why was CMSIS born?

Let see the current Cortex-M microcontroller market:

  • More than 15 microcontroller vendors shipping Cortex-M microcontroller products, with some other silicon vendors providing Cortex-M based FPGA and ASICs
  • More than 10 toolchain vendors
  • More than 30 embedded operating systems
  • Additional Cortex-M middleware software providers for codecs, communication protocol stacks, etc.

What a large ecosystem!

At the same time, embedded system are also becoming more and more complex, and the amount of effort in developing and testing software has increased substantially. In addition, the complexity of the embedded systems has also increased the use of third party software solution.

In that situation, ARM worked with various microcontroller vendors, tool vendors, and software solution providers to develop CMSIS, a software framework converting most Cortex-M processors and Cortex-M microcontroller products.

2. What is CMSIS-Core?

It is a set of APIs for application or middleware developers to access the features on the Cortex-M processor regardless of the microcontroller devices or toolchain used. Of course, ARM Cortex-M4 is also supported by CMSIS.

3. Organization of CMSIS-Core

We can define the CMSIS into multiple layers:

  • Core Peripheral Access Layer: Name definitions, address definitions, and helper functions to access core register and core peripherals. It is showed as Core Peripheral Functions.
  • Device Peripheral Access Layer: Name definitions, address definitions of peripheral registers, as well as system implementations including interrupt assignment, exception vector definitions, etc.
  • Access Functions for Peripherals: the driver code for peripheral access. It is showed as Device Peripheral Functions
  • Middle-ware Access Layer: the idea is to develop a set of APIs for interfacing common peripherals such as UART, SPI and Ethernet.

4. Benefits of using CMSIS-Core

Using CMSIS help us a lot because:

  • Software that includes CMSIS is much better portable and reusable. Of course it will help developer to save implementation time.
  • The CMSIS-Core allows faster time to market. CMSIS code is tested by many silicon vendors and software developers around the world, therefore it reduces the validation effort required, as there is no need to develop and test your own processor feature access functions

For developer of embedded OS and middleware, the advantage of CMSIS is significant:

  • embedded OS and middle can be implemented independent to processor and toolchain
  • they can event start their work before future products are released, and still confident about product
  • without CMSIS, middleware might need to include a small set of driver functions for accessing processor peripherals as the interrupt controller. Due to arrangement increases the program size, it might cause compatibility issues with other software products

5. How to use CMSIS-Core?

Typically you need to do following things to use CMSIS-Core in your project

  • Add source file to project:
    • Device-specific, toolchain-specific startup code, in the form of assembly or C
    • Device-specific device initialization code (e.g., system_<device>.c)
    • Additional vendor-specific source files for peripheral access functions
  • Add header files into search path of the project:
    • A device-specific header file for peripheral registers definitions and interrupt assignment definitions (e.g., <device>.h)
    • A device-specific header file for functions in the device initialization code (e.g., system_<device>.h)
    • A number of processor-specific header files (e.g., core_cm4.h)

Now with the clear understanding about CMSIS, we can start our implementation more effectively.

6. Reference

The content in this post is triggered from The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors.

Thanks author Joseph Yiu very much for a great book.

Leave a Reply

Your email address will not be published. Required fields are marked *