Microcontroller software interface standard yields new framework

By Reinhard Keil
Monday, 08 November, 2010


Microcontrollers based on the ARM Cortex-M3 processor are becoming very popular in industry. The recent introduction of the Cortex-M0 processor allows even more power- and cost-effective devices as these processors are software compatible and, together with the Cortex Microcontroller Software Interface Standard (CMSIS), porting of software is simplified.

The general-purpose MCU segment is one of the most fragmented markets in the electronics industry. The many microcontroller architectures frequently have a long history - most 8- and 16-bit architectures were invented more than 20 years ago.

Over the years, these architectures have been re-shaped several times to meet the requirements of today’s applications. To aid CPU performance, peripherals such as an arithmetic accelerator or a hardware CORDIC are sometimes added.

Since no peripheral and interface standards exist, programmers must invent solutions over and over again for the same basic problems and adopt existing software algorithms to new hardware.

In such environments, object-oriented programming rarely can be used. Generic software components that are common in the PC world are not available and the lack of programming standards limits software re-use.

Instead, silicon vendors must provide free software frameworks for new devices that are tailored towards specific applications. This slows down the introduction of new devices and increases development costs.

A shortcoming of today’s 8- and 16-bit microcontrollers is the proprietary debug technology that is integrated into many of the devices. In most cases only tests with breakpoints are possible. Data trace capabilities required for the dynamic analysis of running applications are not always available.

This, together with the higher expectations for modern products, is causing software development for deeply embedded applications to become more and more expensive.

These symptoms prevent real innovation. When the standard platform of the PC became available, many new software products appeared on the market and new businesses around such solutions became successful. MCUs could use a standard platform, as well.
The Cortex-M3 processor includes a 32-bit CPU and a new wake-up interrupt controller for low-power designs. Together with the nested vector interrupt controller, the processor delivers fast interrupt response times, with multiple priorities.

A debug access port combined with the serial wire viewer and the embedded trace macrocell provides the trace capabilities needed for non-intrusive software verification of a running system. The MCU's memory protection unit enables reliable software implementations and RTOS kernels.

CMSIS addresses the challenges faced when various software components are deployed to the actual physical processor. The CMSIS will be expanded to include future Cortex-Mx processor cores. It is defined in close cooperation with various silicon vendors.

For wide acceptance in the industry, software vendors such as IAR, Keil, Micrium, Segger and Tasking are also involved. This collaboration has resulted in an easy-to-use and easy-to-learn programming interface.

CMSIS provides a common approach for interfacing to peripherals, RTOSs and middleware components. CMSIS is compatible with several compiler implementations, including GCC, and provides two software layers.

  • Peripheral access layer (CMSIS-PAL): contains name definitions, address definitions and helper functions to access processor core registers and device peripherals. It introduces a consistent way to access core peripherals, exception/interrupt vectors and provides a standard system start-up function. CMSIS-PAL also defines a device independent interface for an RTOS kernel and data trace channels for RTOS kernel-awareness in debuggers and simple printf-style debugging; 
  • Middleware access layer (CMSIS-MAL): provides common methods to access peripherals for the software industry. The layer is adapted by the silicon vendor for the device-specific peripherals used by more complex middleware components such as communication stacks.

The CMSIS is not another complex software layer that forces silicon vendors to produce identical features. The CMSIS-PAL defines common methods to program peripherals. The device peripherals such as I/O port, timer, PWM, A/D, D/A, etc can have different performance and functions.

CMSIS does not prevent direct hardware access since the peripheral registers of a device can be still accessed directly. The CMSIS does not require immense resources and the CMSIS-PAL requires less than 1 KB of code and just four bytes of variable space.

CMSIS-MAL is only required to interface to standard middleware (sophisticated communication stacks) and a hardware abstraction layer (HAL) is common in such components. CMSIS-MAL replaces, therefore, a proprietary middleware HAL and cannot be considered as an additional overhead.

CMSIS provides many benefits such as a consistent software framework and a proven software layer. This enables easy deployment of template code and program examples across the supported compiler vendors.

The Cortex-M3 processor, along with its core peripherals, is consistent across the various silicon vendors and ARM provides a common documentation for these components.

Together with CMSIS, this will allow generic introduction books that are not vendor or device specific. Over time, it is expected that there will be a reduction of the learning curve for application programmers that have previous experience with Cortex-Mx devices from other vendors and now start using a new Cortex-Mx device.

Since the CMSIS layer is identical across all compiler vendors, no adaptations are required when changing a toolchain. It provides standard interfaces that can be used by many silicon and middleware partners and reduces project risks since a CMSIS interface maybe pre-verified and certified.

Once the standard is widely adopted, user source code that uses CMSIS interfaces is easier to understand and easier to verify.

Historically, industries use standards to improve product quality and enable component and cost sharing across projects. In practice, such standards achieve wide acceptance because the synergistic effects provide significant benefits to the user community.

The electronics industry is full of such standards but until today the deeply embedded microcontroller market is still using many proprietary CPU architectures, which has prevented the introduction of efficient software standards.

A standard processor such as the Cortex-M3 allows for not just re-using the same development tools for many projects, together with the CMSIS, it also reduces development costs since software components can be shared across projects more easily.

Silicon vendors can focus more on device features and peripherals, rather than creating a proprietary software layer and basic interface routines.

The common programming techniques that are introduced by CMSIS simplify long-term software maintenance since applications that are using CMSIS interfaces can be easily understood even by new team members.

Related Articles

Australia's largest electronics expo returns to Sydney

Electronex, the annual electronics design and assembly expo, will return to Sydney on 19–20...

The fundamentals of Australian RCM compliance

The following information aims to help readers understand the Australian compliance requirements...

Largest ever Electronex Expo in Melbourne

The Electronics Design and Assembly Expo will return to Melbourne from 10–11 May at the...


  • All content Copyright © 2024 Westwick-Farrow Pty Ltd