Understanding the Differences and Commonalities of Cortex-M Series Processors

When it comes to Joseph Yiu, many engineers are likely familiar with him. His bestselling series of books on ARM, such as “The Definitive Guide to ARM Cortex-M0” and “The Definitive Guide to ARM Cortex-M3 and Cortex-M4,” are said to be a must-have for many! As a Senior Embedded Technology Manager at ARM, Joseph Yiu has recently completed a series of works introducing Cortex-M processors. In this issue, Joseph will share the key differences between the Cortex-M series processors and how they differ from other ARM series processors, making it easy for you to get started with ARM Cortex-M processors!

How to Differentiate the ARM Processor Family?

Over the years, ARM has developed a considerable number of different processor products. Different ARM processors have different instruction sets, system functionalities, and performance. For many beginners, and even some chip designers with extensive experience but unfamiliar with ARM series processors, it is easy to confuse these products. As shown in the figure below: ARM processor products are divided into classic ARM processor series and the latest Cortex processor series. Depending on the application scope, ARM processors can be classified into three series.

Understanding the Differences and Commonalities of Cortex-M Series Processors

ARM Processor Family

❂ Application Processors

High-end processors aimed at mobile computing, smartphones, servers, and other markets. These processors run at very high clock frequencies (over 1GHz) and support memory management units (MMU) required by full operating systems like Linux, Android, MS Windows, and mobile operating systems. If the product you are planning to develop needs to run one of the aforementioned operating systems, you need to choose ARM application processors.

Understanding the Differences and Commonalities of Cortex-M Series Processors

❂ Real-time Processors

High-performance processor series aimed at real-time applications, such as hard disk controllers, automotive transmission systems, and wireless communication baseband control. Most real-time processors do not support MMU, but typically have MPU, Cache, and other memory features designed for industrial applications. Real-time processors run at relatively high clock frequencies (e.g., 200MHz to >1GHz) with very low response latency. Although real-time processors cannot run complete versions of Linux and Windows, they support a large number of real-time operating systems (RTOS).

Understanding the Differences and Commonalities of Cortex-M Series Processors

❂ Microcontroller Processors

Microcontroller processors are usually designed to be very small in size and have a high energy efficiency. Typically, these processors have short pipelines and low maximum clock frequencies (although there are processors on the market that can run above 200MHz). Moreover, the new Cortex-M processor family is designed to be very easy to use. Therefore, ARM microcontroller processors are very successful and popular in the microcontroller and deeply embedded system markets.

Understanding the Differences and Commonalities of Cortex-M Series Processors

Understanding the Differences and Commonalities of Cortex-M Series Processors

Summary of ARM Processor Features

Overview of the Cortex-M Processor Family

The Cortex-M processor family is more focused on the low-performance end, but these processors are still quite powerful compared to many traditional processors used in microcontrollers. For example, the Cortex-M4 and Cortex-M7 processors are used in many high-performance microcontroller products, with maximum clock frequencies reaching up to 400MHz.

Of course, performance is not the only criterion for choosing a processor. In many applications, low power consumption and cost are key selection indicators. Therefore, the Cortex-M processor family includes various products to meet different needs:

Understanding the Differences and Commonalities of Cortex-M Series Processors

Very small processors aimed at low-cost, ultra-low-power microcontrollers and deeply embedded applications (minimum 12K gates).

Understanding the Differences and Commonalities of Cortex-M Series Processors

Processors optimized for small embedded systems with the highest energy efficiency, similar in size and programming model to the Cortex-M0, but with extended features such as single-cycle I/O interfaces and vector table relocation capabilities.

Understanding the Differences and Commonalities of Cortex-M Series Processors

Processors designed for low-power microcontroller applications, small in area but powerful in performance, supporting a rich instruction set that allows the processor to quickly handle complex tasks, with hardware divider and multiply-accumulate (MAC) instructions. Additionally, the M3 supports comprehensive debugging and tracing features, allowing software developers to quickly develop their applications.

Understanding the Differences and Commonalities of Cortex-M Series Processors

Not only does it have all the features of the Cortex-M3, but it also extends the instruction set for digital signal processing (DSP), such as single-instruction multiple-data (SIMD) instructions and faster single-cycle MAC operations. In addition, it has an optional single-precision floating-point unit that supports the IEEE754 floating-point standard.

Understanding the Differences and Commonalities of Cortex-M Series Processors

High-performance processors developed for high-end microcontrollers and data processing-intensive applications. It has all the instruction functions supported by Cortex-M4, extends support for double-precision floating-point operations, and has extended memory features such as cache and tightly coupled memory (TCM).

Understanding the Differences and Commonalities of Cortex-M Series Processors

A small-sized processor designed for ultra-low-power, low-cost applications, similar to Cortex-M0 but supports various enhanced instruction sets and system-level functional features. The M23 also supports TrustZone security extensions.

Understanding the Differences and Commonalities of Cortex-M Series Processors

Mainstream processor design, similar to the previous Cortex-M3 and Cortex-M4 processors, but with more flexible system design, more efficient energy consumption, and higher performance. The M33 also supports TrustZone security extensions.

Unlike the older classic ARM processors (e.g., ARM7TDMI, ARM9), Cortex-M processors have a very different architecture. For example:

Only ARM Thumb instructions are supported, expanded to support both 16-bit and 32-bit instructions in Thumb-2 version.

The built-in Nested Vector Interrupt Controller (NVIC) is responsible for interrupt processing, automatically handling interrupt priorities, interrupt masking, nested interrupts, and system exception handling.

Interrupt handler functions can be programmed using standard C language, and the nested interrupt handling mechanism avoids the need for software to determine which interrupt requires response handling. At the same time, the interrupt response speed is deterministic, with low latency.

The vector table is the starting address of the interrupt and system exception handler functions instead of a jump instruction.

The register set and certain programming modes have also changed.

These changes mean that many assembly codes written for classic ARM processors need to be modified, and old projects need to be changed and recompiled to migrate to Cortex-M products.

Common Features of Cortex-M Series Processors

There are many similarities between Cortex-M0, M0+, M3, M4, and M7, such as:

Basic programming model

Interrupt response management of the Nested Vector Interrupt Controller (NVIC)

Sleep modes in architecture design: sleep mode and deep sleep mode

Operating system support features

Debugging capabilities

Ease of use

Understanding the Differences and Commonalities of Cortex-M Series Processors

Nested Vector Interrupt Controller of Cortex-M Processors

For example, the Nested Vector Interrupt Controller is a built-in interrupt controller that supports interrupt inputs from many peripherals, one non-maskable interrupt request, one interrupt request from a built-in clock called SysTick, and a certain number of system exception requests. The NVIC manages the priority and masking of these interrupts and exceptions.

Leave a Comment