Jump to content

ARM Cortex-M: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
FossMCU (talk | contribs)
Implementations: Add New Cortex M0 vendors
Development tools: CCS supports stellaris
Line 206: Line 206:
* CrossWorks for ARM by Rowley.<ref>[http://www.rowley.co.uk/arm/index.htm CrossWorks for ARM; Rowley; Development Toolchains.]</ref>
* CrossWorks for ARM by Rowley.<ref>[http://www.rowley.co.uk/arm/index.htm CrossWorks for ARM; Rowley; Development Toolchains.]</ref>
* Sourcery CodeBench by Mentor Graphics.<ref>[http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/ Sourcery CodeBench; Mentor Graphics; Development Toolchains.]</ref>
* Sourcery CodeBench by Mentor Graphics.<ref>[http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/ Sourcery CodeBench; Mentor Graphics; Development Toolchains.]</ref>
* Code Composer Studio by Texas Instruments.<ref>http://www.ti.com/tool/ccstudio</ref>
* YAGARTO (GNU for ARM).<ref>[http://www.yagarto.de/ YAGARTO (GNU for ARM); Development Toolchains.]</ref><ref>[http://kernel.ozandroid.info/?p=125 Building GCC From Scratch; Development Toolchains.]</ref>
* YAGARTO (GNU for ARM).<ref>[http://www.yagarto.de/ YAGARTO (GNU for ARM); Development Toolchains.]</ref><ref>[http://kernel.ozandroid.info/?p=125 Building GCC From Scratch; Development Toolchains.]</ref>

{{Col-break|width=50%}}
{{Col-break|width=50%}}
;Debugging tools ([[Joint Test Action Group|JTAG]] / SWD):
;Debugging tools ([[Joint Test Action Group|JTAG]] / SWD):

Revision as of 12:01, 20 September 2012

The ARM Cortex-M is a group of 32-bit RISC ARM processor cores licensed by ARM Holdings. The cores are intended for microcontroller applications, and consists of the Cortex-M0, Cortex-M0+, Cortex-M1, Cortex-M3, Cortex-M4.[1][2][3][4][5]

ARM Cortex-M0 / Cortex-M3 ICs from NXP and Energy Micro

Overview

ARM license

ARM Holdings does not manufacture nor sell CPU devices based on its own designs, but rather, licenses the processor architecture to interested parties. ARM offers a variety of licensing terms, varying in cost and deliverables. To all licensees, ARM provides an integratable hardware description of the ARM core, as well as complete software development toolset, and the right to sell manufactured silicon containing the ARM CPU.

Silicon customization

Integrated device manufacturers (IDM) receive the ARM Processor IP as synthesizable RTL (written in Verilog). In this form, they have the ability to perform architectural level optimizations and extensions. This allows the manufacturer to achieve custom design goals, such as higher clock speed, very low power consumption, instruction set extensions, optimizations for size, debug support, etc.

Instruction sets

The Cortex-M0 / M0+ / M1 implement the ARMv6-M architecture,[6] the Cortex-M3 implements the ARMv7-M architecture,[7] and the Cortex-M4 implements the ARMv7E-M architecture.[7] The architectures are binary instruction upward compatible from ARMv6-M to ARMv7-M to ARMv7E-M. Binary instructions available for the Cortex-M0 / M0+ / M1 can execute without modification on the Cortex-M3 and Cortex-M4. Binary instructions available for the Cortex-M3 can execute without modification on the Cortex-M4.[6][7]

All four Cortex-M cores implement a common instruction subset that consists of: Thumb subset, Thumb-2 subset, and multiply. The Cortex-M0 / M0+ / M1 include all older Thumb instructions, except new instructions (CBZ, CBNZ, IT) which were added in ARMv7-M architecture. The Cortex-M0 / M0+ / M1 include a minor subset of Thumb-2 instructions (BL, DMB, DSB, ISB, MRS, MSR).[6][7]

The Cortex-M0 / M0+ / M1 were designed to be the smallest size possible, thus having the least instructions of the Cortex-M family. The Cortex-M3 adds 3 Thumb instructions and all Thumb-2 instructions, plus a 10-12 cycle hardware divide and saturated math instructions. The Cortex-M4 adds DSP instructions and an optional single-precision floating-point unit.[6][7] If the Cortex-M4 has the floating point unit, then it is known as the Cortex-M4F.

ARM Cortex-M Instruction Sets [6][7]
ARM
Cortex-M
Thumb Thumb-2 Hardware
Multiply
Hardware
Divide
Saturated
Math
DSP
Extensions
Floating
Point
ARM
Architecture
Cortex-M0 [1]
Most
Subset
1 or 32 cycle
No No No No
ARMv6-M [6]
Cortex-M0+ [2]
Most
Subset
1 or 32 cycle
No No No No
ARMv6-M [6]
Cortex-M1 [3]
Most
Subset
3 or 33 cycle
No No No No
ARMv6-M [6]
Cortex-M3 [4]
Entire Entire 1 cycle Yes Yes No No
ARMv7-M [7]
Cortex-M4 [5]
Entire Entire 1 cycle Yes Yes Yes
Optional
ARMv7E-M [7]
  • Note: The Cortex-M0 / M0+ / M1 doesn't include these Thumb instructions: CBZ, CBNZ, IT; nor does it include a divide instruction.[6][7]
  • Note: The Cortex-M0 / M0+ / M1 only include these Thumb-2 instructions: BL, DMB, DSB, ISB, MRS, MSR.[6][7]
  • Note: If a smaller silicon die size is required, the Cortex-M0 / M0+ / M1 can implement a smaller yet slower multiply instruction.

Optional components

The Integrated Device Manufacturers (IDM) have numerous options to configure the contents of their ARM silicon die. To determine which components have been included in an ARM IC chip, consult its datasheet and manufacturer.

  • SysTick Timer. It is a 24-bit system timer that extends the functionality of both the processor and the Nested Vectored Interrupt Controller (NVIC). When present, it also provides an additional configurable priority SysTick interrupt.[6][7][8]
  • Bit Banding. It maps a complete word of memory onto a single bit in the bit-band region. For example, writing to an alias word will set or clear the corresponding bit in the bitband region. This allows every individual bit in the bit-banding region to be directly accessible from a word-aligned address, and individual bits to be toggled from C/C++ without performing a read-modify-write sequence of instructions.[6][7][8]
  • Memory Protection Unit (MPU). It provides support for protecting regions of memory through enforcing privilege and access rules. It supports up to eight different regions, each of which can be split into a further eight equal-size sub-regions.[6][7][8]
ARM Cortex-M Optional Components [6][7]
ARM
Cortex-M
SysTick
Timer
Bit
Banding
Memory Protection
Unit (MPU)
Cortex-M0 [1]
Optional
Optional [9]
No
Cortex-M0+ [2]
Optional
Optional [9]
Optional
Cortex-M1 [3]
Optional
No No
Cortex-M3 [4]
Yes
Optional
Optional
Cortex-M4 [5]
Yes
Optional
Optional
  • Note: Most Cortex-M3 and M4 chips have Bit-Banding and MPU. The Bit-Banding option can be added to the Cortex-M0 / M0+ using the Cortex-M System Design Kit.[9]
  • Note: Software should validate the existence of a feature before attempting to use it.[8]
Additional components may be available [6][7]
  • External interrupts: 0 to 32.
  • Wake-up interrupt controller: Optional.
  • Vector Table Offset Register: Optional.
  • Data endianness: little-endian or big-endian.
  • Instruction fetch width: 16-bit only, or mostly 32-bit.
  • User/Privilege support: Optional.
  • Reset all registers: Optional.
  • Single-cycle I/O port: Optional.
  • Debug Access Port (DAP): Optional.
    • Halting debug support: Optional.
      • Number of watchpoint comparators: 0 to 2.
      • Number of breakpoint comparators: 0 to 4.

Cortex-M0

Features

Key features of the Cortex-M0 core are:[1]

  • ARMv6-M architecture[6]
  • Instruction Sets
    • Thumb (most), missing CBZ, CBNZ, IT.
    • Thumb-2 (subset), only BL, DMB, DSB, ISB, MRS, MSR.
    • 32-bit hardware multiply, 1-cycle or 32-cycles (silicon option)
  • 3-stage pipeline

Implementations

The following IC vendors have developed microcontrollers based on the Cortex-M0 core:

Cortex-M0+

Features

Key features of the Cortex-M0+ core are:[2]

  • ARMv6-M architecture[6]
  • Instruction Sets
    • Thumb (most), missing CBZ, CBNZ, IT.
    • Thumb-2 (subset), only BL, DMB, DSB, ISB, MRS, MSR.
    • 32-bit hardware multiply, 1-cycle or 32-cycles (silicon option)
  • 2-stage pipeline
  • 8 region memory protection unit (MPU) (silicon option)

Implementations

The following IC vendors have licenses for the Cortex-M0+ core:

Cortex-M1

Features

Key features of the Cortex-M1 core are:[3]

  • ARMv6-M architecture[6]
  • Instruction Sets
    • Thumb (most), missing CBZ, CBNZ, IT.
    • Thumb-2 (subset), only BL, DMB, DSB, ISB, MRS, MSR.
    • 32-bit hardware multiply, 3-cycle or 33-cycles (silicon option)

Implementations

The following FPGA vendors support the Cortex-M1 as soft-cores:

Cortex-M3

LPCXpresso Development Board with NXP LPC1343
mbed with NXP LPC1768 microcontroller

Features

Key features of the Cortex-M3 core are:[4][11]

  • ARMv7-M architecture[7]
  • Instruction Sets
    • Thumb (entire)
    • Thumb-2 (entire)
    • 1-cycle 32-bit hardware multiply, 2-12 cycle 32-bit hardware divide, saturated math support
  • 3-stage pipeline with branch speculation
  • 1 to 240 physical interrupts, plus NMI
  • 12 cycle interrupt latency
  • Integrated sleep modes
  • 8 region memory protection unit (MPU) (silicon option)
  • 1.25 DMIPS/MHz
  • 90 nm implementation[12]
    • 32 µW/MHz
    • 0.12 mm2

Implementations

The following IC vendors have developed microcontrollers based on the Cortex-M3 core:

Cortex-M4

Features

Conceptually the Cortex-M4 is a Cortex-M3 plus DSP Instructions, and optional floating-point unit (FPU). If a core contains an FPU, it is known as a Cortex-M4F, otherwise it is a Cortex-M4. Key features of the Cortex-M4 core are:[5]

  • ARMv7E-M architecture[7]
  • Instruction Sets
    • Thumb (entire)
    • Thumb-2 (entire)
    • 1-cycle 32-bit hardware multiply, 2-12 cycle 32-bit hardware divide, saturated math support
    • DSP extension: Single cycle 16/32-bit MAC, single cycle dual 16-bit MAC, 8/16-bit SIMD arithmetic.
    • Floating-Point extension (silicon option): Single-precision floating point unit, IEEE-754 compliant. This is called the FPv4-SP extension.
  • 3-stage pipeline with branch speculation
  • 1 to 240 physical interrupts, plus NMI
  • 12 cycle interrupt latency
  • Integrated sleep modes
  • 8 region memory protection unit (MPU) (silicon option)
  • 1.25 DMIPS/MHz

Implementations

The following IC vendors have developed microcontrollers based on the Cortex-M4 core:

Development tools


Documentation

The amount of documentation for all ARM chips is daunting, especially for newcomers. The documentation for microcontrollers from past decades would easily be inclusive in a single document, but as chips have evolved so has the documentation grown. The total documentation is especially hard to grasp for all ARM chips since it consists of documents from the IC manufacturer and documents from CPU core vendor (ARM Holdings).

A typical top-down documentation tree is: high-level marketing slides, datasheet for the exact physical chip, a detailed reference manual that describes common peripherals and other aspects of physical chips within the same series, reference manual for the exact ARM core processor within the chip, reference manual for the ARM architecture of the core which includes detailed description of all instruction sets.

Documentation Tree (top to bottom)
  1. IC Manufacturer Marketing Slides.
  2. IC Manufacturer Datasheets.
  3. IC Manufacturer Reference Manuals.
  4. ARM Core Reference Manuals.[1][2][3][4][5]
  5. ARM Architecture Reference Manuals.[6][7]

IC Manufacturers usually have additional documents, including: evaluation board user manuals, application notes, getting started with development software, software library documents, errata, and more.

See also

References

  1. ^ a b c d e Cortex-M0 r0p0 Technical Reference Manual; ARM Holdings.
  2. ^ a b c d e Cortex-M0+ r0p0 Technical Reference Manual; ARM Holdings.
  3. ^ a b c d e Cortex-M1 r1p0 Technical Reference Manual; ARM Holdings.
  4. ^ a b c d e Cortex-M3 r2p1 Technical Reference Manual; ARM Holdings.
  5. ^ a b c d e Cortex-M4 r0p1 Technical Reference Manual; ARM Holdings.
  6. ^ a b c d e f g h i j k l m n o p q r s ARMv6-M Architecture Reference Manual; ARM Holdings.
  7. ^ a b c d e f g h i j k l m n o p q r ARMv7-M Architecture Reference Manual; ARM Holdings.
  8. ^ a b c d Cortex-M3 Embedded Software Development; App Note 179; ARM Holdings.
  9. ^ a b c Cortex-M System Design Kit; ARM Holdings.
  10. ^ STMicroelectronics STM32F0 Microcontrollers with Cortex-M0 Core
  11. ^ Sadasivan, Shyam. "An Introduction to the ARM Cortex-M3 Processor" (PDF). ARM Holdings.
  12. ^ "ARM Cortex-M3 Specifications". ARM Holdings.
  13. ^ "OMAP 4 Platform : OMAP4470". Texas Instruments. Retrieved 2012-01-31.
  14. ^ TASKING VX-Toolset; Altium; Development Toolchains.
  15. ^ Atmel Studio; Atmel; Development Toolchains.
  16. ^ TrueSTUDIO; Atollic; Development Toolchains.
  17. ^ GNU Tools for ARM Embedded Processors; Canonical; Development Toolchains.
  18. ^ LPCXpresso and Red Suite; Code Red; Development Toolchains.
  19. ^ Embedded Workbench for ARM; IAR; Development Toolchains.
  20. ^ MDK-ARM; Keil; Development Toolchains.
  21. ^ Ride and RKit for ARM; Raisonance; Development Toolchains.
  22. ^ CrossWorks for ARM; Rowley; Development Toolchains.
  23. ^ Sourcery CodeBench; Mentor Graphics; Development Toolchains.
  24. ^ http://www.ti.com/tool/ccstudio
  25. ^ YAGARTO (GNU for ARM); Development Toolchains.
  26. ^ Building GCC From Scratch; Development Toolchains.
  27. ^ I-jet; IAR; Debug Tools.
  28. ^ RLink Standard; Raisonance; Debug Tools.
  29. ^ RLink Professional; Raisonance; Debug Tools.
  30. ^ J-Link and J-Trace; Segger; Debug Tools.
  31. ^ JTAGjet and JTAGjet-Trace; Signum; Debug Tools.
  32. ^ ST-LINK; STMicroelectronics; Debug Tools.
  33. ^ ST-LINK/V2; STMicroelectronics; Debug Tools.
  34. ^ AK-LINK (OpenOCD-compatible); Artekit; Debug Tools.
  35. ^ OpenOCD; SourceForge; Debug Tools.
  36. ^ CoOS; Real-Time Operating System.
  37. ^ OpenRTOS, SafeRTOS; Real-Time Operating System.
  38. ^ Milos; Real-Time Operating System.
  39. ^ ScmRTOS; Real-Time Operating System.
  40. ^ SDPOS; Real-Time Operating System.
  41. ^ µTasker; Real-Time Operating System.
  42. ^ Unison; Real-Time Operating System.
  43. ^ CMSIS; Software Library.
  44. ^ FatFs; Software Library.
  45. ^ Petit FatFs; Software Library

Further reading

  • The Definitive Guide to the ARM Cortex-M0; 2nd Edition; Joseph Yiu; Newnes; 552 pages; 2011; ISBN 978-0-12-385477-3. (Online Sample)
  • The Definitive Guide to the ARM Cortex-M3; 2nd Edition; Joseph Yiu; Newnes; 479 pages; 2009; ISBN 978-1-85617-963-8. (Online Sample)
Official
Cortex-M
Series
ARM
Website
ARM
Core
ARM
Architecture
M0
M0
M0 r0p0
ARMv6-M
M0+
M0+
M0+ r0p0
ARMv6-M
M1
M1
M1 r1p0
M1 r0p1
ARMv6-M
M3
M3
M3 r2p1
M3 r2p0
M3 r1p1
ARMv7-M
M4
M4
M4 r0p1
M4 r0p0
ARMv7E-M
Other