Professional Documents
Culture Documents
ARM-based processor
1
ARM Partnership Model
2
Architecture Versions
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, (virtual memory ,MMUs),
enhanced Java support and a secure program execution environment.
Example products highend mobile phones.
e.g. Cortex M3
A microcontroller contains
many different blocks
3
Introduction to ARM Cortex-M Processors
ARM and the microcontroller vendors
After a company licenses the Cortex-M processor design, ARM
provides the design source code of the processor in Verilog-HDL.
ARM also provides other (IP) products, and some can be used by
these companies in their microcontroller products .
Additional debug components for linking debug systems in multi-
processor design (ARM CoreSight IP products)
Cortex-M System Design Kit (CMSDK), a design kit for Cortex-M
processor.
This allows chip designers to start using the Cortex-M processors
quickly and reduces the total chip development effort with
reusable IP.
10
11
12
4
About the ARM ecosystem
ARM is working with
silicon vendors,
ARM solutions devlopper
ARM products userd.
design services providers,
distributors, training providers, academic researchers
13
14
15
5
General information about the Cortex-M3
andCortex-M4 processors
Block diagram of the Cortex-M3 and Cortex-M4 processor
16
17
Load-store architecture
if data in memory is to be
processed,
it has to be loaded from the
memory to registers in the
register bank,
processed inside the
processor,
and then written back to the
memory, if needed.
6
Programmer’s model : Registers
R0 e R12 :R0 to R12 are general purpose registers.
(R0 e R7) are also called low registers. Due to the limited available space in
the instruction set, many 16-bit instructions can only access the low
registers.
The high registers (R8 e R12) can be used with 32-bit instructions, and a
few with 16-bit instructions, like MOV (move).
The initial values of R0 to R12 are undefined.
R13, stack pointer (SP) : the stack via PUSH and POP operations.
Physically there are two different Stack Pointers:
the Main Stack Pointer (default) ,It is selected after reset, or when the
processor is in Handler Mode.
The other Stack Pointer is called the Process Stack Pointer (PSP, or
SP_process in some ARM docThe PSP can only be used in Thread Mode.
The selection of SP is determined by a special register called CONTROL
Both MSP and PSP are 32-bit, but the lowest two bits of the Stack
Pointers (either MSP or PSP) are always zero, and writes to these two
bits are ignored 19
In some assembly tools, such as the ARM assembly you can use either
uppercase, or lowercase,or mixed cases (Table).
20
7
Programmer’s model : Registers
Combined xPSR
23
CONTROL register
The CONTROL register defines:
• The selection of stack pointer (Main Stack Point/Process Stack Pointer)
• Access level in Thread mode (Privileged/Unprivileged)
The CONTROL register can only be modified in the privileged access level and
can be read in both privileged and unprivileged access levels. The definition of
eachbit field in the CONTROL register is shown in Table After reset, the
CONTROL register is 0. This means the Thread mode uses the Main Stack
Pointer as Stack Pointer and Thread mode has privileged accesses A program
in unprivileged access level cannot switch itself back to privileged access level.
This is essential in order to provide a basic security usage model.
24
8
Bit Fields in CONTROL Register
Bit Function
nPRIV (bit 0) Defines the privileged level in Thread mode:
When 0 (default), it is privileged level when in Thread mode.
When 1, it is unprivileged when in Thread mode.
SPSEL (bit 1) Defines the Stack Pointer selection:
When 0 (default), Thread mode uses Main Stack Pointer (MSP).
When 1, Thread mode uses Process Stack Pointer (PSP).
FPCA (bit 2) Floating Point Context Active – (available in Cortex-M4)
- uses this bit to determine if registers in the floating point unit need
to be saved when an exception has occurred.
- When 0 (default), the FPU has not been used in the current context
and therefore no need to save floating point registers.
- When 1, the current context has used floating point
instructions and therefore need to save floating point registers.
The FPCA bit is set automatically when a floating point instruction is
executed. This bit is clear by hardware on exception entry.
25
26