Cortex M4 Technical Reference Manual
User Manual:
Open the PDF directly: View PDF
.
Page Count: 117
Cortex-M4
Revision r0p0
Technical Reference Manual
Copyright © 2009, 2010 ARM Limited. All rights reserved.
ARM DDI 0439B (ID030210)
Cortex-M4
Technical Reference Manual
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Release Information
The following changes have been made to this book.
Change History
Date
Issue
Confidentiality
Change
22 December 2009
A
Non-Confidential, Restricted Access
First release for r0p0
02 March 2010
B
Non-Confidential
Second release for r0p0
Proprietary Notice
Words and logos marked with ® or ™ are registered trademarks or trademarks of ARM® Limited in the EU and other
countries, except as otherwise stated in this proprietary notice. Other brands and names mentioned herein may be the
trademarks of their respective owners.
Neither the whole nor any part of the information contained in, or the product described in, this document may be
adapted or reproduced in any material form except with the prior written permission of the copyright holder.
The product described in this document is subject to continuous developments and improvements. All particulars of the
product and its use contained in this document are given by ARM Limited in good faith. However, all warranties implied
or expressed, including but not limited to implied warranties of merchantability, or fitness for purpose, are excluded.
This document is intended only to assist the reader in the use of the product. ARM Limited shall not be liable for any
loss or damage arising from the use of any information in this document, or any error or omission in such information,
or any incorrect use of the product.
Where the term ARM is used it means “ARM or any of its subsidiaries as appropriate”.
Some material in this document is based on IEEE 754-2008 IEEE Standard for Binary Floating-Point Arithmetic. The
IEEE disclaims any responsibility or liability resulting from the placement and use in the described manner.
Confidentiality Status
This document is Non-Confidential. The right to use, copy and disclose this document may be subject to license
restrictions in accordance with the terms of the agreement entered into by ARM and the party that ARM delivered this
document to.
Unrestricted Access is an ARM internal classification.
Product Status
The information in this document is Final (information on a developed product).
Web Address
http://www.arm.com
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
ii
Contents
Cortex-M4 Technical Reference Manual
Preface
About this book ........................................................................................................... ix
Feedback .................................................................................................................... xi
Chapter 1
Introduction
1.1
1.2
1.3
1.4
1.5
Chapter 2
About the programmers model ................................................................................ 3-2
Modes of operation and execution ........................................................................... 3-3
Instruction set summary ........................................................................................... 3-4
System address map ............................................................................................. 3-14
Write buffer ............................................................................................................ 3-17
Exclusive monitor ................................................................................................... 3-18
Bit-banding ............................................................................................................. 3-19
Processor core register summary .......................................................................... 3-21
Exceptions ............................................................................................................. 3-23
System Control
4.1
ARM DDI 0439B
ID030210
About the functions .................................................................................................. 2-2
Interfaces ................................................................................................................. 2-5
Programmers Model
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
Chapter 4
1-2
1-3
1-4
1-5
1-6
Functional Description
2.1
2.2
Chapter 3
About the processor .................................................................................................
Features ...................................................................................................................
Interfaces .................................................................................................................
Configurable options ................................................................................................
Product documentation ............................................................................................
About system control ............................................................................................... 4-2
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
iii
Contents
4.2
4.3
Chapter 5
Register summary .................................................................................................... 4-3
Register descriptions ............................................................................................... 4-5
Memory Protection Unit
5.1
5.2
5.3
Chapter 6
About the MPU ........................................................................................................ 5-2
MPU functional description ...................................................................................... 5-3
MPU programmers model ........................................................................................ 5-4
Nested Vectored Interrupt Controller
6.1
6.2
6.3
Chapter 7
About the NVIC ........................................................................................................ 6-2
NVIC functional description ..................................................................................... 6-3
NVIC programmers model ....................................................................................... 6-4
Floating Point Unit
7.1
7.2
7.3
Chapter 8
Debug
8.1
8.2
8.3
Chapter 9
About the ITM ........................................................................................................ 10-2
ITM functional description ...................................................................................... 10-3
ITM programmers model ....................................................................................... 10-4
Trace Port Interface Unit
11.1
11.2
11.3
Appendix A
About the DWT ........................................................................................................ 9-2
DWT functional description ...................................................................................... 9-3
DWT Programmers Model ....................................................................................... 9-4
Instrumentation Trace Macrocell Unit
10.1
10.2
10.3
Chapter 11
About debug ............................................................................................................ 8-2
About the AHB-AP ................................................................................................... 8-6
About the Flash Patch and Breakpoint Unit (FPB) .................................................. 8-9
Data Watchpoint and Trace Unit
9.1
9.2
9.3
Chapter 10
About the FPU ......................................................................................................... 7-2
FPU Functional Description ..................................................................................... 7-3
FPU Programmers Model ........................................................................................ 7-9
About the Cortex-M4 TPIU .................................................................................... 11-2
TPIU functional description .................................................................................... 11-3
TPIU programmers model ..................................................................................... 11-5
Revisions
Glossary
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
iv
List of Tables
Cortex-M4 Technical Reference Manual
Table 3-1
Table 3-2
Table 3-3
Table 4-1
Table 4-2
Table 4-3
Table 4-4
Table 5-1
Table 6-1
Table 6-2
Table 7-1
Table 7-2
Table 7-3
Table 7-4
Table 8-1
Table 8-2
Table 8-3
Table 8-4
Table 8-5
Table 8-6
Table 8-7
Table 9-1
Table 10-1
Table 10-2
Table 11-1
Table 11-2
Table 11-3
Table 11-4
Table 11-5
ARM DDI 0439B
ID030210
Change History ............................................................................................................................... ii
Cortex-M4 instruction set summary ............................................................................................ 3-4
Cortex-M4 DSP instruction set summary .................................................................................... 3-8
Memory regions ........................................................................................................................ 3-14
System control registers ............................................................................................................. 4-3
ACTLR bit assignments .............................................................................................................. 4-5
CPUID bit assignments ............................................................................................................... 4-6
AFSR bit assignments ................................................................................................................ 4-7
MPU registers ............................................................................................................................. 5-4
NVIC registers ............................................................................................................................. 6-4
ICTR bit assignments .................................................................................................................. 6-5
FPU instruction set ...................................................................................................................... 7-4
Default NaN values ..................................................................................................................... 7-6
QNaN and SNaN handling .......................................................................................................... 7-7
Cortex-M4F Floating Point system registers ............................................................................... 7-9
Cortex-M4 ROM table identification values ................................................................................. 8-3
Cortex-M4 ROM table components ............................................................................................ 8-3
SCS identification values ............................................................................................................ 8-4
Debug registers ........................................................................................................................... 8-5
AHB-AP register summary .......................................................................................................... 8-6
CSW bit assignments .................................................................................................................. 8-7
FPB register summary .............................................................................................................. 8-10
DWT register summary ............................................................................................................... 9-4
ITM register summary ............................................................................................................... 10-4
ITM_TPR bit assignments ......................................................................................................... 10-5
TPIU registers ........................................................................................................................... 11-5
TPIU_ACPR bit assignments .................................................................................................... 11-6
TPIU_FFSR bit assignments .................................................................................................... 11-7
TPIU_FFCR bit assignments .................................................................................................... 11-7
TRIGGER bit assignments ........................................................................................................ 11-8
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
v
List of Tables
Table 11-6
Table 11-7
Table 11-8
Table 11-9
Table 11-10
Table 11-11
Table A-1
Table A-2
ARM DDI 0439B
ID030210
Integration ETM Data bit assignments ...................................................................................... 11-9
ITATBCTR2 bit assignments .................................................................................................. 11-10
Integration ITM Data bit assignments ..................................................................................... 11-10
ITATBCTR0 bit assignments .................................................................................................. 11-11
TPIU_ITCTRL bit assignments ............................................................................................... 11-12
TPIU_DEVID bit assignments ................................................................................................. 11-12
Issue A ........................................................................................................................................ A-1
Differences between issue A and issue BC ................................................................................ A-1
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
vi
List of Figures
Cortex-M4 Technical Reference Manual
Figure 2-1
Figure 3-1
Figure 3-2
Figure 3-3
Figure 4-1
Figure 4-2
Figure 4-3
Figure 6-1
Figure 7-1
Figure 8-1
Figure 8-2
Figure 10-1
Figure 11-1
Figure 11-2
Figure 11-3
Figure 11-4
Figure 11-5
Figure 11-6
Figure 11-7
Figure 11-8
Figure 11-9
Figure 11-10
Figure 11-11
ARM DDI 0439B
ID030210
Cortex-M4 block diagram ............................................................................................................ 2-2
System address map ................................................................................................................ 3-14
Bit-band mapping ...................................................................................................................... 3-20
Processor register set ............................................................................................................... 3-21
ACTLR bit assignments .............................................................................................................. 4-5
CPUID bit assignments ............................................................................................................... 4-6
AFSR bit assignments ................................................................................................................ 4-6
ICTR bit assignments .................................................................................................................. 6-4
FPU register bank ....................................................................................................................... 7-3
CoreSight discovery .................................................................................................................... 8-2
CSW bit assignments .................................................................................................................. 8-7
ITM_TPR bit assignments ......................................................................................................... 10-5
TPIU block diagram .................................................................................................................. 11-3
TPIU_ACPR bit assignments .................................................................................................... 11-6
TPIU_FFSR bit assignments .................................................................................................... 11-6
TPIU_FFCR bit assignments .................................................................................................... 11-7
TRIGGER bit assignments ........................................................................................................ 11-8
Integration ETM Data bit assignments ...................................................................................... 11-9
ITATBCTR2 bit assignments .................................................................................................... 11-9
Integration ITM Data bit assignments ..................................................................................... 11-10
ITATBCTR0 bit assignments .................................................................................................. 11-11
TPIU_ITCTRL bit assignments ............................................................................................... 11-11
TPIU_DEVID bit assignments ................................................................................................. 11-12
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
vii
Preface
This preface introduces the Cortex-M4 Technical Reference Manual (TRM). It contains the
following sections:
•
About this book on page ix
•
Feedback on page xi.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
viii
Preface
About this book
This book is for the Cortex-M4 processor.
Product revision status
The rnpn identifier indicates the revision status of the product described in this manual, where:
rn
Identifies the major revision of the product.
pn
Identifies the minor revision or modification status of the product.
Intended audience
This manual is written to help system designers, system integrators, verification engineers, and
software programmers who are implementing a System-on-Chip (SoC) device based on the
Cortex-M4 processor.
Using this book
This book is organized into the following chapters:
Chapter 1 Introduction
Read this for a description of the components of the processor, and of the product
documentation.
Chapter 2 Functional Description
Read this for a description of the functionality of the processor.
Chapter 3 Programmers Model
Read this for a description of the processor register set, modes of operation, and
other information for programming the processor.
Chapter 4 System Control
Read this for a description of the registers and programmers model for system
control.
Chapter 5 Memory Protection Unit
Read this for a description of the Memory Protection Unit (MPU).
Chapter 6 Nested Vectored Interrupt Controller
Read this for a description of the interrupt processing and control.
Chapter 7 Floating Point Unit
Read this for a description of the Floating Point Unit (FPU)
Chapter 8 Debug
Read this for information about debugging and testing the processor core.
Chapter 9 Data Watchpoint and Trace Unit
Read this for a description of the Data Watchpoint and Trace (DWT) unit.
Chapter 10 Instrumentation Trace Macrocell Unit
Read this for a description of the Instrumentation Trace Macrocell (ITM) unit.
Chapter 11 Trace Port Interface Unit
Read this for a description of the Trace Port Interface Unit (TPIU).
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
ix
Preface
Glossary
Read this for definitions of terms used in this book.
Conventions
Conventions that this book can use are described in:
•
Typographical
Typographical
The typographical conventions are:
italic
Highlights important notes, introduces special terminology, denotes
internal cross-references, and citations.
bold
Highlights interface elements, such as menu names. Denotes signal
names. Also used for terms in descriptive lists, where appropriate.
monospace
Denotes text that you can enter at the keyboard, such as commands, file
and program names, and source code.
monospace
Denotes a permitted abbreviation for a command or option. You can enter
the underlined text instead of the full command or option name.
monospace italic
Denotes arguments to monospace text where the argument is to be
replaced by a specific value.
monospace
Denotes language keywords when used outside example code.
< and >
Enclose replaceable terms for assembler syntax where they appear in code
or code fragments. For example:
ADD Rd, Rn,
Additional reading
This section lists publications by ARM and by third parties.
See Infocenter, http://infocenter.arm.com, for access to ARM documentation.
ARM publications
This book contains information that is specific to this product. See the following documents for
other relevant information:
•
ARMv7-M Architecture Reference Manual (ARM DDI 0403)
•
ARM Cortex-M4 Integration and Implementation Manual (ARM DII 0239)
•
ARM ETM-M4 Technical Reference Manual (ARM DDI 0440)
•
ARM AMBA® 3 AHB-Lite Protocol (v1.0) (ARM IHI 0033)
•
ARM AMBA™ 3 APB Protocol Specification (ARM IHI 0024)
•
ARM CoreSight™ Components Technical Reference Manual (ARM DDI 0314)
•
ARM Debug Interface v5 Architecture Specification (ARM IHI 0031)
•
ARM Embedded Trace Macrocell Architecture Specification (ARM IHI 0014).
Other publications
This section lists relevant documents published by third parties:
•
IEEE Standard Test Access Port and Boundary-Scan Architecture 1149.1-2001 (JTAG)
•
IEEE Standard IEEE Standard for Binary Floating-Point Arithmetic 754-2008.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
x
Preface
Feedback
ARM welcomes feedback on this product and its documentation.
Feedback on this product
If you have any comments or suggestions about this product, contact your supplier and give:
•
The product name.
•
The product revision or version.
•
An explanation with as much information as you can provide. Include symptoms and
diagnostic procedures if appropriate.
Feedback on this manual
If you have comments on content then send e-mail to errata@arm.com. Give:
•
the title
•
the number, ARM DDI 0439
•
the page number(s) to which your comments refer
•
a concise explanation of your comments.
ARM also welcomes general suggestions for additions and improvements.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
xi
Chapter 1
Introduction
This chapter introduces the processor and instruction set. It contains the following sections:
•
About the processor on page 1-2
•
Features on page 1-3
•
Interfaces on page 1-4
•
Configurable options on page 1-5
•
Product documentation on page 1-6
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
1-1
Introduction
1.1
About the processor
The Cortex-M4 processor is a low-power processor that features low gate count, low interrupt
latency, and low-cost debug. The Cortex-M4F is a processor with the same capability as the
Cortex-M4 processor, and includes floating point arithmetic functionality (see Chapter 7
Floating Point Unit). Both processors are intended for deeply embedded applications that
require fast interrupt response features.
Throughout this document the name Cortex-M4 refers to both Cortex-M4 and Cortex-M4F
processors unless otherwise indicated.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
1-2
Introduction
1.2
Features
The Cortex-M4 processor incorporates:
ARM DDI 0439B
ID030210
•
A processor core
•
A Nested Vectored Interrupt Controller (NVIC) closely integrated with the processor core
to achieve low latency interrupt processing
•
Multiple high-performance bus interfaces
•
A low-cost debug solution with the optional ability to:
— implement breakpoints and code patches
— implement watchpoints, tracing, and system profiling
— support printf style debugging.
— bridge to a Trace Port Analyzer (TPA)
•
An optional Memory Protection Unit (MPU).
•
A Floating Point Unit (FPU) unit, in the Cortex-M4F processor.
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
1-3
Introduction
1.3
Interfaces
The processor has the following external interfaces:
•
multiple memory and device bus interfaces
•
ETM interface
•
trace port interface
•
debug port interface.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
1-4
Introduction
1.4
Configurable options
You can configure your Cortex-M4 implementation to include the following optional
components:
•
MPU. See Chapter 5 Memory Protection Unit.
•
FPB. See Chapter 8 Debug.
•
DWT. See Chapter 9 Data Watchpoint and Trace Unit.
•
ITM. See Chapter 10 Instrumentation Trace Macrocell Unit.
•
ETM. See the ETM-M4 Technical Reference Manual.
•
AHB-AP. See Chapter 8 Debug.
•
HTM interface. See AHB Trace Macrocell interface on page 2-6.
•
TPIU. See Chapter 11 Trace Port Interface Unit.
•
WIC. See Low power modes on page 6-3.
•
Debug Port. See Debug port AHB-AP interface on page 2-6
•
FPU. See Chapter 7 Floating Point Unit.
•
Bit-banding, see Bit-banding on page 3-19
Note
You can only configure trace functionality in the following combinations:
•
no trace functionality
•
ITM and DWT
•
ITM, DWT, and ETM
•
ITM, DWT, ETM, and HTM.
You can configure the features provided in the DWT independently.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
1-5
Introduction
1.5
Product documentation
This section describes the processor books, how they relate to the design flow, and the relevant
architectural standards and protocols.
See Additional reading on page x for more information about the books described in this
section.
1.5.1
Documentation
The Cortex-M4 documentation is as follows:
Technical Reference Manual
The Technical Reference Manual (TRM) describes the functionality and the
effects of functional options on the behavior of the Cortex-M4 processor. It is
required at all stages of the design flow. Some behavior described in the TRM
might not be relevant because of the way that the Cortex-M4 processor is
implemented and integrated. If you are programming the Cortex-M4 processor
then contact:
•
•
the implementor to determine:
—
the build configuration of the implementation
—
what integration, if any, was performed before implementing the
processor
the integrator to determine the pin configuration of the SoC that you are
using.
Integration and Implementation Manual
The Integration and Implementation Manual (IIM) describes:
•
The available build configuration options and related issues in selecting
them.
•
How to configure the Register Transfer Level (RTL) with the build
configuration options
•
How to integrate the processor into a SoC. This includes a description of
the integration kit and describes the pins that the integrator must tie off to
configure the macrocell for the required integration.
•
How to implement the processor into your design. This includes
floorplanning guidelines, Design for Test (DFT) information, and how to
perform netlist dynamic verification on the processor.
•
The processes to sign off the integration and implementation of the design.
The ARM product deliverables include reference scripts and information about
using them to implement your design.
Reference methodology documentation from your EDA tools vendor
complements the IIM.
The IIM is a confidential book that is only available to licensees.
ETM-M4 Technical Reference Manual
The ETM-M4 Technical Reference Manual (TRM) describes the functionality
and behavior of the Cortex-M4 Embedded Trace Macrocell. It is required at all
stages of the design flow. Typically the ETM-M4 is integrated with the
Cortex-M4 processor prior to implementation as a single macrocell.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
1-6
Introduction
Cortex-M4 User Guide Reference Material
This document provides reference material that ARM partners can configure and
include in a User Guide for an ARM Cortex-M4 processor. Typically:
•
each chapter in this reference material might correspond to a section in the
User Guide
•
each top-level section in this reference material might correspond to a
chapter in the User Guide.
However, you can organize this material in any way, subject to the conditions of
the licence agreement under which ARM supplied the material.
1.5.2
Design Flow
The processor is delivered as synthesizable RTL. Before it can be used in a product, it must go
through the following process:
Implementation
The implementor configures and synthesizes the RTL to produce a hard
macrocell. This might include integrating RAMs into the design.
Integration The integrator connects the implemented design into a SoC. This includes
connecting it to a memory system and peripherals.
Programming
The system programmer develops the software required to configure and
initialize the processor, and tests the required application software.
Each stage in the process can be performed by a different party. Implementation and integration
choices affect the behavior and features of the processor.
For MCUs, often a single design team integrates the processor before synthesizing the complete
design. Alternatively, the team can synthesise the processor on its own or partially integrated,
to produce a macrocell that is then integrated, possibly by a separate team.
The operation of the final device depends on:
Build configuration
The implementor chooses the options that affect how the RTL source files are
pre-processed. These options usually include or exclude logic that affects one or
more of the area, maximum frequency, and features of the resulting macrocell.
Configuration inputs
The integrator configures some features of the processor by tying inputs to
specific values. These configurations affect the start-up behavior before any
software configuration is made. They can also limit the options available to the
software.
Software configuration
The programmer configures the processor by programming particular values into
registers. This affects the behavior of the processor.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
1-7
Introduction
Note
This manual refers to implementation-defined features that are applicable to build configuration
options. Reference to a feature that is included means that the appropriate build and pin
configuration options are selected. Reference to an enabled feature means one that has also been
configured by software.
1.5.3
Architecture and protocol information
The processor complies with, or implements, the specifications described in:
•
ARM architecture
•
Bus architecture
•
Debug
•
Embedded Trace Macrocell.
This book complements architecture reference manuals, architecture specifications, protocol
specifications, and relevant external standards. It does not duplicate information from these
sources.
ARM architecture
The processor implements the ARMv7-M architecture profile. See the ARMv7-M Architecture
Reference Manual.
Bus architecture
The processor provides three primary bus interfaces implementing a variant of the AMBA 3
AHB-Lite protocol. The processor implements an interface for CoreSight and other debug
components using the AMBA 3 APB protocol. See
•
the ARM AMBA 3 AHB-Lite Protocol (v1.0)
•
the ARM AMBA 3 APB Protocol Specification.
Debug
The debug features of the processor implement the ARM debug interface architecture. See the
ARM Debug Interface v5 Architecture Specification.
Embedded Trace Macrocell
The trace features of the processor implement the ARM Embedded Trace Macrocell
architecture. See the ARM Embedded Trace Macrocell Architecture Specification.
Floating Point Unit
The Cortex-M4F processor implements single precision floating-point data processing as
defined by the FPv4-SP architecture, that is part of the ARMv7-M architecture. It provides
floating-point computation functionality that is compliant with the ANSI/IEEE Std 754-2008,
IEEE Standard for Binary Floating-Point Arithmetic. See the ARMv7M Architecture Reference
Manual and Chapter 7 Floating Point Unit.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
1-8
Chapter 2
Functional Description
This chapter introduces the processor and its external interfaces. It contains the following sections:
•
About the functions on page 2-2
•
Interfaces on page 2-5.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
2-1
Functional Description
2.1
About the functions
Figure 2-1 shows the structure of the Cortex-M4 processor.
Cortex-M4 processor
†
Nested
Vectored
Interrupt
Controller
(NVIC)
Interrupts and
power control
‡
Cortex-M4 or
Cortex-M4F
processor core
Embedded
Trace
Macrocell
(ETM)
‡
Wake-up
Interrupt
Controller
(WIC)
‡ Serial-Wire
or JTAG
Debug Port
(SW-DP or
SWJ-DP)
Serial-Wire or
JTAG Debug
Interface
‡
‡
Flash Patch
Breakpoint
(FPB)
‡
Data
Watchpoint
and Trace
(DWT)
Memory
Protection
Unit (MPU)
‡
‡
AHB
Access Port
(AHB-AP)
ICode
AHB-Lite
instruction
interface
Bus Matrix
DCode
AHB-Lite
data
interface
System
AHB-Lite
system
interface
‡
Instrumentation
Trace Macrocell
(ITM)
Trace Port
Interface Unit
(TPIU)
Trace Port
Interface
‡ CoreSight
ROM table
PPB APB
debug system
interface
† For the Cortex-M4F processor, the core includes a Floating Point Unit (FPU)
‡ Optional component
Figure 2-1 Cortex-M4 block diagram
The Cortex-M4 processor features:
•
ARM DDI 0439B
ID030210
A low gate count processor core, with low latency interrupt processing that has:
—
A subset of the Thumb instruction set, defined in the ARMv7-M Architecture
Reference Manual.
—
Banked Stack Pointer (SP).
—
Hardware divide instructions, SDIV and UDIV.
—
Handler and Thread modes.
—
Thumb and Debug states.
—
Support for interruptible-continued instructions LDM, STM, PUSH, and POP for low
interrupt latency.
—
Automatic processor state saving and restoration for low latency Interrupt Service
Routine (ISR) entry and exit.
—
Support for ARMv6 big-endian byte-invariant or little-endian accesses.
—
Support for ARMv6 unaligned accesses.
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
2-2
Functional Description
•
•
•
•
•
ARM DDI 0439B
ID030210
Floating Point Unit (FPU) in the Cortex-M4F processor providing:
—
32-bit instructions for single-precision (C float) data-processing operations.
—
Combined Multiply and Accumulate instructions for increased precision (Fused
MAC).
—
Hardware support for conversion, addition, subtraction, multiplication with
optional accumulate, division, and square-root.
—
Hardware support for denormals and all IEEE rounding modes.
—
32 dedicated 32-bit single precision registers, also addressable as 16 double-word
registers.
—
Decoupled three stage pipeline.
Nested Vectored Interrupt Controller (NVIC) closely integrated with the processor core
to achieve low latency interrupt processing. Features include:
—
External interrupts, configurable from 1 to 240.
—
Bits of priority, configurable from 3 to 8.
—
Dynamic reprioritization of interrupts.
—
Priority grouping. This enables selection of preempting interrupt levels and non
preempting interrupt levels.
—
Support for tail-chaining and late arrival of interrupts. This enables back-to-back
interrupt processing without the overhead of state saving and restoration between
interrupts.
—
Processor state automatically saved on interrupt entry, and restored on interrupt exit,
with no instruction overhead.
—
Optional Wake-up Interrupt Controller (WIC), providing ultra-low power sleep
mode support.
Memory Protection Unit (MPU). An optional MPU for memory protection, including:
—
Eight memory regions.
—
Sub Region Disable (SRD), enabling efficient use of memory regions.
—
The ability to enable a background region that implements the default memory map
attributes.
Bus interfaces:
—
Three Advanced High-performance Bus-Lite (AHB-Lite) interfaces: ICode,
DCode, and System bus interfaces.
—
Private Peripheral Bus (PPB) based on Advanced Peripheral Bus (APB) interface.
—
Bit-band support that includes atomic bit-band write and read operations.
—
Memory access alignment.
—
Write buffer for buffering of write data.
—
Exclusive access transfers for multiprocessor systems.
Low-cost debug solution that features:
—
Debug access to all memory and registers in the system, including access to
memory mapped devices, access to internal core registers when the core is halted,
and access to debug control registers even while SYSRESETn is asserted.
—
Serial Wire Debug Port (SW-DP) or Serial Wire JTAG Debug Port (SWJ-DP) debug
access, or both.
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
2-3
Functional Description
ARM DDI 0439B
ID030210
—
Optional Flash Patch and Breakpoint (FPB) unit for implementing breakpoints and
code patches.
—
Optional Data Watchpoint and Trace (DWT) unit for implementing watchpoints,
data tracing, and system profiling.
—
Optional Instrumentation Trace Macrocell (ITM) for support of printf style
debugging.
—
Optional Trace Port Interface Unit (TPIU) for bridging to a Trace Port Analyzer
(TPA), including Single Wire Output (SWO) mode.
—
Optional Embedded Trace Macrocell (ETM) for instruction trace.
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
2-4
Functional Description
2.2
Interfaces
The processor contains the following external interfaces:
•
bus interfaces
•
ETM interface on page 2-6
•
AHB Trace Macrocell interface on page 2-6
•
Debug port AHB-AP interface on page 2-6.
2.2.1
Bus interfaces
The processor contains four external Advanced High-performance Bus (AHB)-Lite bus
interfaces:
ICode memory interface
Instruction fetches from Code memory space, 0x00000000 to 0x1FFFFFFF, are performed over this
32-bit AHB-Lite bus.
The Debugger cannot access this interface. All fetches are word-wide. The number of
instructions fetched per word depends on the code running and the alignment of the code in
memory.
DCode memory interface
Data and debug accesses to Code memory space, 0x00000000 to 0x1FFFFFFF, are performed over
this 32-bit AHB-Lite bus. Core data accesses have a higher priority than debug accesses on this
bus. This means that debug accesses are waited until core accesses have completed when there
are simultaneous core and debug access to this bus.
Control logic in this interface converts unaligned data and debug accesses into two or three
aligned accesses, depending on the size and alignment of the unaligned access. This stalls any
subsequent data or debug access until the unaligned access has completed.
Note
ARM strongly recommends that any external arbitration between the ICode and DCode AHB
bus interfaces ensures that DCode has a higher priority than ICode.
System interface
Instruction fetches, and data and debug accesses, to address ranges 0x20000000 to 0xDFFFFFFF and
0xE0100000 to 0xFFFFFFFF are performed over this 32-bit AHB-Lite bus.
For simultaneous accesses to this bus, the arbitration order in decreasing priority is:
•
data accesses
•
instruction and vector fetches
•
debug.
The system bus interface contains control logic to handle unaligned accesses, FPB remapped
accesses, bit-band accesses, and pipelined instruction fetches.
Private Peripheral Bus (PPB)
Data and debug accesses to external PPB space, 0xE0040000 to 0xE00FFFFF, are performed over
this 32-bit Advanced Peripheral Bus (APB) bus. The Trace Port Interface Unit (TPIU) and
vendor specific peripherals are on this bus.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
2-5
Functional Description
Core data accesses have higher priority than debug accesses, so debug accesses are waited until
core accesses have completed when there are simultaneous core and debug access to this bus.
Only the address bits necessary to decode the External PPB space are supported on this
interface.
2.2.2
ETM interface
The ETM interface enables simple connection of an ETM to the processor. It provides a channel
for instruction trace to the ETM. See the ARM Embedded Trace Macrocell Architecture
Specification.
2.2.3
AHB Trace Macrocell interface
The AHB Trace Macrocell (HTM) interface enables a simple connection of the AHB trace
macrocell to the processor. It provides a channel for the data trace to the HTM.
Your implementation must include this interface to use the HTM interface. You must set
TRCENA to 1 in the Debug Exception and Monitor Control Register (DEMCR) before you
enable the HTM to enable the HTM port to supply trace data. See the ARMv7-M Architecture
Reference Manual.
2.2.4
Debug port AHB-AP interface
The processor contains an Advanced High-performance Bus Access Port (AHB-AP) interface
for debug accesses. An external Debug Port (DP) component accesses this interface. The
Cortex-M4 system supports three possible DP implementations:
•
The Serial Wire JTAG Debug Port (SWJ-DP). The SWJ-DP is a standard CoreSight debug
port that combines JTAG-DP and Serial Wire Debug Port (SW-DP).
•
The SW-DP. This provides a two-pin interface to the AHB-AP port.
•
No DP present. If no debug functionality is present within the processor, a DP is not
required.
The two DP implementations provide different mechanisms for debug access to the processor.
Your implementation must contain only one of these components.
Note
Your implementation might contain an alternative implementer-specific DP instead of SW-DP
or SWJ-DP. See your implementer for details.
For more detailed information on the DP components, see the CoreSight Components Technical
Reference manual.
For more information on the AHB-AP, see Chapter 8 Debug.
The DP and AP together are referred to as the Debug Access Port (DAP).
For more detailed information on the debug interface, see the ARM Debug Interface v5
Architecture Specification.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
2-6
Chapter 3
Programmers Model
This chapter describes the processor programmers model. It contains the following sections:
•
About the programmers model on page 3-2
•
Modes of operation and execution on page 3-3
•
Instruction set summary on page 3-4.
•
System address map on page 3-14
•
Write buffer on page 3-17
•
Bit-banding on page 3-19
•
Processor core register summary on page 3-21
•
Exceptions on page 3-23.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
3-1
Programmers Model
3.1
About the programmers model
The ARMv7-M Architecture Reference Manual provides a complete description of the
programmers model. This chapter gives an overview of the Cortex-M4 processor programmers
model that describes the implementation-defined options. It also contains the ARMv7-M
Thumb instructions it uses and their cycle counts for the processor. In addition:
•
Chapter 4 summarizes the system control features of the programmers model
•
Chapter 5 summarizes the MPU features of the programmers model
•
Chapter 6 summarizes the NVIC features of the programmers model
•
Chapter 7 summarizes the FPU features of the programmers model
•
Chapter 8 summarizes the Debug features of the programmers model.
•
Chapter 9 summarizes the DWT features of the programmers model
•
Chapter 10 summarizes the ITM features of the programmers model
•
Chapter 11 summarizes the TPIU features of the programmers model.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
3-2
Programmers Model
3.2
Modes of operation and execution
This section briefly describes the modes of operation and execution of the Cortex-M4 processor.
See the ARMv7-M Architecture Reference Manual for more information.
3.2.1
Operating modes
The processor supports two modes of operation, Thread mode and Handler mode:
3.2.2
•
The processor enters Thread mode on Reset, or as a result of an exception return.
Privileged and Unprivileged code can run in Thread mode.
•
The processor enters Handler mode as a result of an exception. All code is privileged in
Handler mode.
Operating states
The processor can operate in one of two operating states:
3.2.3
•
Thumb state. This is normal execution running 16-bit and 32-bit halfword aligned Thumb
instructions.
•
Debug State. This is the state when the processor is in halting debug.
Privileged access and user access
Code can execute as privileged or unprivileged. Unprivileged execution limits or excludes
access to some resources. Privileged execution has access to all resources. Handler mode is
always privileged. Thread mode can be privileged or unprivileged.
ARM DDI 0439B
ID030210
Copyright © 2009, 2010 ARM Limited. All rights reserved.
Non-Confidential, Unrestricted Access
3-3
Programmers Model
3.3
Instruction set summary
This section provides information on:
•
Cortex-M4 instructions
•
Load/store timings on page 3-11
•
Binary compatibility with other Cortex processors on page 3-12.
3.3.1
Cortex-M4 instructions
The processor implements the ARMv7-M Thumb instruction set. Table 3-1 shows the
Cortex-M4 instructions and their cycle counts. The cycle counts are based on a system with zero
wait states.
Within the assembler syntax, depending on the operation, the field can be replaced with
one of the following options:
•
a simple register specifier, for example Rm
•
an immediate shifted register, for example Rm, LSL #4
•
a register shifted register, for example Rm, LSL Rs
•
an immediate value, for example #0xE000E000.
For brevity, not all load and store addressing modes are shown. See the ARMv7-M Architecture
Reference Manual for more information.
Table 3-1 uses the following abbreviations in the Cycles column:
P
The number of cycles required for a pipeline refill. This ranges from 1 to 3
depending on the alignment and width of the target instruction, and whether the
processor manages to speculate the address early.
B
The number of cycles required to perform the barrier operation. For DSB and DMB,
the minimum number of cycles is zero. For ISB, the minimum number of cycles
is equivalent to the number required for a pipeline refill.
N
The number of registers in the register list to be loaded or stored, including PC or
LR.
W
The number of cycles spent waiting for an appropriate event.
Table 3-1 Cortex-M4 instruction set summary
Operation
Description
Assembler
Cycles
Move
Register
MOV Rd,
1
16-bit immediate
MOVW Rd, #
1
Immediate into top
MOVT Rd, #
1
To PC
MOV PC, Rm
1+P
Add
ADD Rd, Rn,
1
Add to PC
ADD PC, PC, Rm
1+P
Add with carry
ADC Rd, Rn,
1
Form address
ADR Rd,
Source Exif Data:
File Type : PDF
File Type Extension : pdf
MIME Type : application/pdf
PDF Version : 1.7
Linearized : Yes
Page Mode : UseOutlines
XMP Toolkit : Adobe XMP Core 4.0-c316 44.253921, Sun Oct 01 2006 17:14:39
Creator Tool : FrameMaker 8.0
Modify Date : 2010:03:02 11:59:29Z
Create Date : 2010:03:02 11:59:29Z
Copyright : Copyright © 2009, 2010 ARM Limited. All rights reserved.
Producer : Acrobat Distiller 8.1.0 (Windows)
Format : application/pdf
Title : Cortex-M4 Technical Reference Manual
Creator : ARM Limited
Description : ARM Cortex-M4 Technical Reference Manual (TRM). This guide contains documentation for the Cortex-M4 processor, the programmer’s model, instruction set, registers, memory map, floating point, multimedia, trace and debug support. Components include ETM, MPU, NVIC, FPB, DWT, ITM, AHB, TPIU, VFP.
Document ID : uuid:3f981cdf-7ae1-4ccd-857f-780190e8a953
Instance ID : uuid:647d0461-5ec4-4cc4-9d4c-644d5b40b22a
Page Count : 117
Subject : ARM Cortex-M4 Technical Reference Manual (TRM). This guide contains documentation for the Cortex-M4 processor, the programmer’s model, instruction set, registers, memory map, floating point, multimedia, trace and debug support. Components include ETM, MPU, NVIC, FPB, DWT, ITM, AHB, TPIU, VFP.
Author : ARM Limited
Keywords : Cortex-M, Specialist, Technologies, Classic
EXIF Metadata provided by EXIF.tools