</>EmbeddedInterview

What are the differences between Cortex-M, Cortex-R and Cortex-A, and why can't a Cortex-M0+ run Linux?

MediumMicrocontrollers & ARM Cortex-M

Short answer: Cortex-A cores are application processors with an MMU, caches and high clock speeds, designed to run Linux or Android. Cortex-R cores are real-time processors with an MPU, tightly coupled memory, fast deterministic interrupts and safety features. Cortex-M cores are microcontroller cores optimised for low cost, low power and simple, fast interrupt handling. A Cortex-M0+ cannot run standard Linux mainly because it has no MMU (Linux needs virtual memory for processes), and typical M0+ parts also have far too little memory (tens of KB of RAM, versus the tens of MB Linux needs).

Cortex-M Cortex-R Cortex-A
Memory protection MPU (optional) MPU (R52 has two stages; R82 has an optional MMU) MMU with virtual memory
Instruction sets Thumb only Arm + Thumb (AArch32); R82 AArch64 AArch64 + AArch32 (A32/T32)
Interrupt controller NVIC (in the core) GIC GIC
Typical clock 10–1000 MHz 400 MHz–1.6 GHz 1–3+ GHz
Typical memory on-chip flash/SRAM TCM + external external DRAM, large caches
Real-time excellent, deterministic excellent weaker (caches, virtual memory, OS)
Example uses MCUs, sensors, IoT car brake/airbag ECUs, SSD controllers, modems phones, gateways, infotainment, Raspberry Pi

Why the Cortex-M0+ is not suitable for Linux

  • No MMU: mainline Linux relies on virtual memory for process isolation, fork(), demand paging and memory-mapped files. A no-MMU Linux (uClinux) exists, but it has been dropped or limited on many architectures and still needs megabytes of RAM.
  • Memory: M0+ chips typically have 8–256 KB of flash and 4–64 KB of RAM. A minimal Linux needs several MB of RAM and storage.
  • Performance: tens of MHz, no caches, no hardware divide.
  • No privilege separation needed by Linux: Armv6-M has only basic privileged/unprivileged modes and an optional, small MPU.

What a Cortex-M0+ is good for: simple sensor nodes, battery-powered devices (very low µA/MHz and deep-sleep currents), smart cards, power management controllers, motor drivers, as a co-processor next to a bigger CPU, and anywhere cost per unit is critical (cents per chip).