Sunteți pe pagina 1din 19

Introduction to

ARM Cortex- M Processor


ARM7TDMI vs. ARM Cortex-M3

In 2005, ARM introduced Cortex family of processors


Contd.
• The processor differs from the von Neumann architecture
based ARM7 family of processors which use the same
signal buses and memory for both instructions and
data.

• The Cortex-M3 core is based on the Harvard


architecture characterized by separate buses for
instructions and data.
ARM Architecture Versions
Cortex Processor Family
• The Cortex processor family subdivided into three different
profiles. Each profile is optimized for different segments of
embedded systems applications.
• The Cortex-A profile has been designed as a high-end
application processor.
• The Cortex-R is the real-time profile that delivers a
high-performance processor which is the heart of an
application specific device.
• The final profile is Cortex-M or the microcontroller profile.
Unlike earlier ARM CPUs, the Cortex-M processor family
has been designed specifically for use within a small
microcontroller. They allow silicon manufacturers to design
low-cost, low-power devices that can replace existing 8-bit
microcontrollers while still offering 32-bit performance.
Cortex Processors
• A Profile (ARMv7-A): Application processors required to
run complex applications such as high-end embedded
operating systems (OSs), such as Symbian, Linux, and
Windows Embedded, requiring the highest processing
power. Example products include high end mobile phones
and electronic wallets for financial transactions.

• R Profile (ARMv7-R): Real-time, high-performance


processors targeted primarily at the higher end of the
real-time market—those applications, such as high-end
breaking systems and hard drive controllers, in which high
processing power and high reliability are essential and for
which low latency is very important.
Contd.
• M Profile (ARMv7-M): Processors targeting low-cost
applications in which processing efficiency is important
and cost, power consumption, low interrupt latency, and
ease of use are critical.
Examples
Cortex-M Processor
• Microcontrollers: Cortex-M processor family suited for
microcontroller products. These microcontrollers can be used in
consumer products, from toys to electrical appliances, or even
specialized products for Information Technology (IT), industrial, or
even medical systems.
• Automotive: As these processors offer great performance, very high
energy efficiency, and low interrupt latency, they are ideal for many
real-time control systems. In addition, the flexibility of the processor
design (e.g., it supports up to 240 interrupt sources makes it ideal for
highly integrated ASSPs (Application Specific Standard Products)
for the automotive industry).
• Data communications: The processor’s low power and high
efficiency, coupled with instructions in Thumb-2 for bit-field
manipulation, make the Cortex-M3 and Cortex-M4 processors ideal
for many communication applications, such as Bluetooth and
ZigBee.
Cortex-M3 based MCUs
Features of Cortex-M processors

• The Cortex-M3 and Cortex-M4 processors have:


-Three-stage pipeline design
-Harvard bus architecture with unified memory space:
instructions and data use the same address space
- 32-bit addressing, supporting 4GB of memory space
-On-chip bus interfaces based on ARM AMBA (Advanced
Microcontroller Bus Architecture)Technology, which allow
pipelined bus operations for higher throughput.
- An interrupt controller called NVIC (Nested Vectored
Interrupt Controller) supporting up to 240 interrupt requests
and from 8 to 256 interrupt priority levels
Contd.
• The Cortex-M processors are designed with OS applications
in mind. A number of features are available to make OS
implementation easier and make OS operations more efficient
such as a system tick timer, shadowed stack pointer.
• Sleep mode support and various low power features
protection features like programmable memory, or access
permission control.
• Support for bit-data accesses in two specific memory regions
using a feature called Bit Band.
• The Cortex-M processors are very easy to use. In fact, they are
easier than compared to many 8-bit processors.
Instruction Set
• The ISA used in Cortex-M3 and Cortex-M4 processors
provides a wide range of instructions:
o General data processing, including hardware divide
instructions
o Memory access instructions supporting 8-bit, 16-bit, 32-bit,
and 64-bit data, as well as instructions for transferring
multiple 32-bit data
o Instructions for bit field processing
o Multiply Accumulate (MAC) and saturate instructions
o Instructions for branches, conditional branches and function
calls
o Instructions for system control, OS support, etc.
Thumb-2 Instruction Set
• The earlier ARM CPUs (ARM7 and ARM9), supported two
instruction sets. 32-bit ARM or as 16-bit Thumb instruction
sets.

• The ARM instruction set would allow code to be written for


maximum performance, while Thumb code would achieve a
greater code density.

• During development, the programmer had to decide which


function should be compiled with the ARM 32-bit instruction
set and which should be built using the Thumb 16-bit
instruction set.
Code density vs. Performance

C code ARM THUMB


• If (x>=0) CMP r0,#0; • CMP r0,#0;
return x; RSBLT r0,r0,#0; BGE s1;
else MOV pc, lr NEG r0,r0;
return –x; s1: MOV pc, lr
Contd.
• Cortex-M processors are code compatible with the original
Thumb instruction set, they are designed to execute an
extended version of the Thumb instruction set called
Thumb-2.
• Thumb-2 is a blend of 16- and 32-bit instructions that has
been designed to be very C friendly and efficient.
• Focused on small memory system devices such as
microcontrollers, the Cortex-M3 supports only the Thumb-2
instruction set.
• The Thumb-2 instruction set is a superset of the previous
16-bit Thumb instruction set, with additional 16-bit
instructions alongside 32-bit instructions.
Contd.

• The Thumb-2 instruction set is also able to achieve excellent code


density that is comparable to the original 16-bit Thumb
instruction set while delivering more processing performance
than the ARM 32-bit instruction set.
BX LR

It allows more complex operations to be carried out in the


Thumb state, thus allowing higher efficiency by reducing the
number of states switching between ARM state and Thumb
state.
Contd.
• The Cortex-M3 supports only the Thumb-2 instruction set. As
a result, the Cortex-M3 processor is not backward
compatible with traditional ARM processors.

• Nevertheless, the Cortex-M3 processor can execute almost all


the 16-bit Thumb instructions, including all 16-bit Thumb
instructions supported on ARM7 family processors,
making application porting easy.

S-ar putea să vă placă și