ARM Cortex microcontroller

ARM does not manufacture any processors / controllers itself, but only develops so-called "IP cores" that are licensed by manufacturers such as Atmel, Infineon, ST, NXP, TI and many others. These manufacturers add memory and peripherals to the core. The advantage of this model is that this means that a large number of processors with a wide variety of equipment are available, all of which can be programmed with the same instruction set (and thus the same compiler).

Common to all ARM cores is the 32-bit RISC architecture. In order to save memory space, ARM has developed the Thumb instruction set in addition to the ARM instruction set (32-bit instruction), which, with a few exceptions, encodes all instructions in 16-bit [1]. The instruction set, however, buys the advantage of the saved memory with a somewhat slow execution speed. The Cortex-M controllers can only execute thumb instructions. The predecessors of the Cortex series are the ARM7 microcontrollers, which either only know the ARM instruction set or both. Thumb-capable controllers can be identified by the T in the name, e.g. ARM7TDMI.

Due to their comparably simple wiring and low power consumption, the ARM Cortex microcontrollers are a real alternative to 8-bit controllers such as the AVR, which also have a higher level of performance.

This article is primarily about the ARM Cortex-M microcontrollers, less about ARM Cortex-A processors, which are used in smartphones, Raspberry Pi and the like. can be used.

There are the following variants of the Cortex-M microcontroller core, listed from the most energy-efficient to the most powerful (list not necessarily up-to-date! It's best to always consult the manufacturer's website).

Overview [edit]

ARM currently has these cores in its range:

Cortex-M0As the cheapest and most energy-efficient variant, there is the Cortex-M0 Core with a significantly smaller command set than, for example, the Cortex-M3. This is the smallest processor in the series and competes with 8-bit controllers
Cortex-M0 +The M0 + is the optimized variant of the Cortex-M0 and fully compatible with it, but extends it, for example, with a single-cycle I / O port and optional features of the Cortex-M3, e.g. an MPU
Cortex-M23This core is the last to appear with the ARMv8-M instruction set and the Trustzone extension (e.g. for IoT) and is comparable to the Cortex-M3
Cortex-M3The first Cortex microcontroller and the all-rounder among the Cortex-Ms. The performance is roughly comparable to that of its predecessor, the ARM7TDMI
Cortex-M33The controller is comparable to the Cortex-M4, but has the newer ARMv8-M command set and the Trustzone extension (e.g. for IoT) and is comparable to the Cortex-M4
Cortex-M4A high-performance Cortex-M3 with DSP extensions and an optional single-precision FPU
Cortex-M7The most powerful controller in the series, which has many features that previously only had application processors, including a double-precision FPU, instruction and data caches and a 6-stage pipeline with jump prediction

The list is sorted by capability. Programs are binary-compatible with "larger" cores, so a program compiled for a Cortex-M0 can also be executed by a Cortex-M7.

Manufacturer [edit]

ARM Cortex M0 [edit]

ARM Cortex M0 + [edit]

ARM Cortex M23 [edit]

ARM Cortex M3 [edit]

  • EFM32 Tiny Gecko, EFM32 Gecko, EFM32 Leopard Gecko and EFM32 Giant Gecko from Silicon Labs, see EFM32 here in the Wiki
  • LPC13xx / LPC15xx / LPC17xx / LPC18xx from NXP or the already very detailed one, see LPC1xxx here in the wiki. There is already a code base for these controllers.
  • TIVA from Texas Instruments (formerly Stellaris, formerly Luminary Micro)
  • SAM3N, SAM3S, SAM3U, SAM3A and SAM3X series from Atmel
  • STM32 series F1 / F2 / L1 / W from STMicroelectronics, see STM32 here in the wiki
  • TMPM330 from Toshiba
  • FM3 from Spansion (formerly Fujitsu)
  • HT32 from Holtek Semiconductor
  • PSOC5 from Cypress

ARM Cortex M4 [edit]

  • RA from Renesas, see Renesas Advanced here on the wiki
  • Kinetis Series from Freescale (now NXP)
  • LPC43xx from NXP (Dual Core: M4F + up to 2 Cortex-M0)
  • LPC54xxx from NXP (Dual Core: M4F + up to a Cortex-M0 +)
  • LPC4xxx from NXP
  • EFM32-Wonder Gecko from Silicon Labs, see EFM32 here in the wiki
  • STM32F3 from STMicro, see STM32 here in the wiki
  • STM32F4 from STMicro, see STM32 here in the wiki
  • Tiva C Series, TM4C from Texas Instruments. Texas Instruments used to call these controllers Stellaris LM4F Series. In 2013, TI began a major renaming process, which even included new type designations. For example, the LM4F230H5QR became the TM4C123GH6PM. At the same time, TI began the name Stellaris from data sheets, software libraries and the like and through Tiva to replace. See also [2].
  • XMC4000 from Infineon, see XMCxxxx here in the wiki, article on the XMC4500
  • FM4 from Spansion (formerly Fujitsu)
  • SAML, SAME, SAMN and SAMS from Atmel

ARM Cortex M33 [edit]

ARM Cortex M7 [edit]

The latest variant of the Cortex M series is the M7, which has numerous features compared to the M4 that bridge the gap to application processors: a double precision FPU, code and data cache, a 6-stage pipeline with branch prediction, and among other things Dash a significantly higher computing power. Controllers based on the Cortex M7 are available from Atmel, NXP and ST, among others.

ARM7TDMI [edit]

The predecessor of the Cortex-M cores is the ARM7TDMI. Controller families of this class are still widely used:

More information on the ARM architecture can be found in Wikipedia, further links in the link collection.

Compiler & software [edit]

GCC [edit]

One of the most popular compilers for ARM processors is the GCC. It can generate both ARM and thumb code. More on this under ARM GCC.

C / C ++ IDEs [edit]

Free development environments (mostly GCC-based):

  • CooCox IDE (Eclipse based)
  • GNU ARM Eclipse (Eclipse Plugin)
  • EmBlocks IDE (Based on Code :: Blocks)
    • Compiler: GNU ARM-GCC (included in the installation), RealView and IAR
    • Hardware: STlink (with "Live data"), openOCD, Jlink.
    • Project Import: CoIDE, uVision, Atmel studio, MplabX, Mplab 8
    • OS aware debugging
    • Supports a large number of controllers (manufacturers):
      • Atmel ARM
      • NXP-ARM
      • STMicro-ARM
      • EnergyMicro-ARM
    • No restrictions
    • Here is the Download '
  • emIDE Windows, complete Visual Studio-like development environment (based on Code :: Blocks) with GCC and Debugger (support for Segger adapters)
  • mbed: a free online development environment based on the ARM Realview compiler, with an extensive C ++ library for the controller functions, integrated version management, and many example programs. Projects can be exported for Keil / IAR / GCC and further processed offline; the library functions are open source and can also be used commercially.
  • winIDEAOpen With winIDEAOpen, iSystem now provides a free development environment for all Cortex-M components. The GNU GCC is used as the compiler and is also installed at the same time. The IDE is quite intuitive and comes with extensive help. The whole thing works with that GCC without code size limit and a test tool (testIDEA) is also integrated. On the hardware side, in addition to the iSystem iTag50 [5], the Segger J-Link Debug Probes and the ST-Link from ST are also supported. On the iSystem website you can also find some nice example projects for various boards [6]. Support for the ARM and IAR compilers will be added soon. Here is the Download '
  • Infineon offers for his XMC Processor families also offer a free, professionally maintained C / C ++ development environment, without restrictions on certain types or memory sizes - all available XMC 1000 and 4000 processors are supported. If you also get one of the cheap XMC evaluation boards (XMC 1100 Bootkit, XMC 4500 Relax (lite) Kit or similar), you have a first development system including a reusable HW debugger. The development environment is based on Eclipse, but has numerous extensions including code generation (so-called apps), which can do a lot of things at the beginning, because you can easily configure the peripherals with them graphically. This is not unimportant for processors whose user manual is a few hundred pages (or for those switching from 8-bit or other 32-bit). The generated code is template-based, easy to read and can later be used and optimized for your own developments if you have more experience. However, you then lose the opportunity to get updates of the generated codes from the apps, which Infineon also provides free of charge. The software is called Digital Application Virtual Engineer (DAVE) and can be downloaded free of charge for Windows after registration. Within Dave you can then download apps and many examples (without further registration and costs) completely or selectively (for certain processors). The current stable version is v3. A new DAVE environment v4 is in the works, a beta version can be downloaded. This new v4 variant will also have a separate SDK to be able to write apps for Dave himself (e.g. component manufacturers who want to simplify the connection to the XMC for customers). Beginners should start with v3 so as not to stumble over bugs in Beta v4 (see also the XMC forum).
  • NXP offers for his LPC Processor families one free C / C ++ development environment. The Eclipse-based development environment (LPCXpresso) is activated for up to 8kB after installation and for 256kB after a simple and free registration. LPCXpresso is available for Windows, Linux and Mac.
  • ST offers for his STM32 Processor family one free C / C ++ development environment. The Eclipse-based development environment can be downloaded from the homepage after registering. [7]

Commercial development environments (partly free with restrictions) for ARM-based microcontrollers are e.g. B .:

  • Atollic TrueStudio (Windows), Eclipse-based incl. Compiler and linker for almost all ARMs, now also free with many examples and without code size limitation, but with other restrictions
  • Cosmic Software (Windows), up to 64kB free of charge
  • Crossworks ARM (including toolchains based on GCC and Clang, for Windows, Mac OS and Linux)
  • IAR Embedded Workbench for ARM (Windows)
  • MDK-ARM from Keil / ARM (Windows), Lite version up to 32kB free of charge,
  • MDK-STM32 from KEIL Especially for STM32x0 free of charge without any restrictions
  • SiSy MC ++ (Windows), demo version, no code limit

Compiler for other programming languages ​​[edit]

Interpreter [edit]

ARM / XSCALE / CORTEX Instruction Set Simulator [edit]

The Lauterbach company offers an instruction set simulator for ARM cores under item number LA-8809. The demo version is free for evaluation. There are restrictions on the number of debug symbols that can be loaded. The simulator supports all common ARM derivatives and loads all common debug formats, such as those of the RealView, IAR and TI compilers, or the free GCC tools. Corresponding debugging tools are available for the simulator, but these can be purchased.

Debug and programming interfaces (JTAG / SWD) [edit]

All ARM-based processors use a uniform JTAG interface that can be used for debugging and memory access. However, the procedures for writing to the flash ROM are not standardized. Therefore you have to pay attention to whether the JTAG software used has programming routines for the respective controller.

SWD (Serial Wire Debug) is a new debug and programming interface introduced with the Cortex microcontrollers that requires fewer pins than JTAG. Here, the debug bandwidth or speed is "swapped" for more available pins for in-circuit debugging. Most controllers of the Cortex-M0 & M3 series can be programmed using JTAG as well as SWD, but there are also copies (e.g. EFM32 from Silicon Labs, XMC1100 from Infineon) which only support SWD.

A document from ARM provides an overview of the recommended pin assignments for JTAG and SWD.

In addition, there are manufacturer-specific interfaces such as SPD (Single Pin Debug) from Infineon, or pre-installed serial bootloaders, e.g. with the STM32 or also with the Infineon XMC, which then e.g. via a separate tool without additional hardware - apart from a commercially available serial interface adapter - can be programmed.

Many development boards also contain an on-board debug adapter for direct connection to USB, so that no external SWD or JTAG adapter is necessary. Some also allow you to break off this adapter and continue to use it for your own developments, so after purchasing an evaluation kit you do not need to buy another adapter later.

Favorable examples to get started [edit]

In the past, simple JTAG adapters for the parallel port were the easiest way to get started. These were compatible with the "Wiggler" and you could easily build them yourself. OpenOCD (together with GDB) or Crossworks ARM are used as software. With the disappearance of the parallel port on conventional computers, the attractiveness of this variant has decreased significantly.

There are also OpenOCD-compatible JTAG adapters for USB, for example based on the FTDI chips and their built-in options for efficiently implementing "Bitbang" protocols (MPSSE - Multiprotocol Synchronous Serial Engine). Furthermore, OpenOCD can also control most of the other programming devices mentioned here.

Inexpensive development kits (approx. € 25 for evaluation board including USB-JTAG / SWD programmer and debugger) are available from NXP, e.g. Watterott. See also the documentation from NXP for the LPCXpresso development kits (PDF), or this one description.

From ST there are inexpensive MBED / Arduino compatible Nucleo development kits (approx. 12 €) e.g. [8]. The integrated ST-Link debugger can also program other chips using SWD and OpenOCD software. The slightly more expensive Discoveryboards, e.g. [9], have more external components on-board, while the Nucleo Board can be expanded using shields. A UART interface can only be achieved via USB as standard with Nucleo boards; solder bridges must be set for Discovery boards with ST-Link V2-1.

Infineon also offers Arduino-compatible boards + shields with the XMC1100 processor and a flange-mounted debugger (from around € 16). There are also inexpensive XMC4500 kits that also offer Ethernet, SPI Flash and SDCard slot options. At the lower end there is an XMC1100 kit including debugger from around 5 €, this board for the keychain is aptly called "XMC 2 Go". Prices can vary greatly depending on the distributor. See also here XMC starter kits. In addition, kits are already being offered in connection with sensors for evaluation, such as the "3D 2 Go" board with an XMC1100 processor and the new 3D magnetic field sensor from Infineon, to name an example: 3D sensor kit.

Silicon Labs has starter kits with an integrated J-Link (debugger) from around € 25, e.g. the EFM32 Tiny Gecko Starter Kit at Mouser

The J-Link "Emulator" from Segger is supported by many software packages and is available for "non-commercial" use by students, radio amateurs and hobbyists for around € 50 (J-Link-Edu). Its scope is limited to flashing memory and debugging. Bonus: In addition to the limited hardware breakpoints in the processor (number depends on the MCU), additional flash breakpoints are possible (but must be supported by the debug IDE used). The very well maintained debugger software supports almost all ARM processors. The trace option as it is available with the PRO variant is not available. For the price, however, you get a full-fledged tool with broad support and the option of combining both SWD and JTAG in one device. But if you are planning to buy a kit from ST, NXP, Infineon or similar, you can also get a CPU board for similar costs - so it makes sense to look through the documentation of the Evalkits carefully beforehand.

The ULINK2 from Keil / ARM is also a really good device. Unfortunately it is not that cheap and his collaboration is limited to the Arm / Keil IDE µVision. However, it does not require any special USB drivers but cleverly uses the functionality of the HID drivers of the operating system. This makes it immediately ready for use on any Windows operating system.

As an alternative to writing to the flash via JTAG, a serial bootloader is often included in the controller. With ST, they are activated via a special pin on the MPU and, thanks to compression and the intelligent removal of redundant information during transmission, are just as fast as JTAG / SWD adapters.

CMSIS - ARM Cortex Software Libraries [edit]

The ARM Cortex Microcontroller Software Interface Standard (CMSIS) is a manufacturer-independent hardware abstraction layer for the Cortex-M processor series. This enables consistent and simple software interfaces for the processor and the peripherals, and thus simplifies software reuse.

CMSIS consists of the following components:

  • CMSIS-CORE: Provides an interface to the Cortex-M0, Cortex-M3, Cortex-M4, SC000 and SC300 processor cores and peripheral registers.
  • CMSIS-DSP: DSP library with over 60 functions in fixed-point (fractional q7, q15, q31) and single precision floating-point (32-bit) implementation
  • CMSIS-RTOS API: Standardized programming interface for real-time operating systems for thread control, resource and time management. There are implementations e.g. from Keil (RTX)
  • CMSIS-SVD: System View Description - XML ​​files that contain the programmer's view of the complete microcontroller system including peripheral devices

The standard is scalable for Cortex-M microcontrollers: From the smallest 4 KB MCU to MCUs with sophisticated communication peripherals such as Ethernet or USB. For example, the "Core Peripheral Functions" requires less than 1 KB code and less than 10 bytes of RAM.


More information on the ARM CMSIS website.

See also [edit]

Web links [edit]

Literature [edit]

  • ARM Systems Developer's Guide (2004) ISBN 1558608745 Leaf through the book Program examples from the book, including FFT, FIR / IIR filter, division, root
  • ARM Assembly Language - an Introduction (2007) ISBN 1847536964 Leaf through the book Publisher page "Book on demand"
  • ARM computer architectures for system-on-chip design (2002) ISBN 3826608542
  • Co-Verification of Hardware and Software for Arm Soc Design (2004) ISBN 0750677309
  • ARM System-on-Chip Architecture (2000) ISBN 0201675196 Leaf through the book
  • ARM Architecture Reference Manual ISBN 0201737191 Leaf through the book
  • Measuring, controlling and regulating with ARM microcontrollers ISBN 3772340172 Leaf through the book
  • Programming Arm Microcontrollers: Using C and the Lpc2100 Family (2005? / From December 1, 2008) ISBN 0321263359
  • Arm Assembly: Fundamentals and Techniques (as of March 1, 2009) ISBN 1439806101
  • Reliable Embedded Systems: Using 8051 and ARM Microcontrollers (2007) ISBN 0321252918 600 pages with CD table of contents
  • C and C ++ for embedded systems (including ARM Cortex-M3) mitp-Verlag 2008 ISBN 382665949X
  • The Definitive Guide to the Arm Cortex-M0 (Joseph Yiu) Newnes Verlag ISBN 0123854776
  • The Definitive Guide to the Arm Cortex-M3 (Joseph Yiu) Newnes Verlag ISBN 185617963X