Professional Documents
Culture Documents
Cortex M Architecture 32bit Devices by ARM
Cortex M Architecture 32bit Devices by ARM
x1-4
Cortex-A9
Performance
Cortex-A8
Cortex-R4(F)
Cortex-M3
SC300
Cortex-M1
Cortex-M0
CORTEX-M3
Cortex-M3 Architecture
* Cortex-M3 Release 2
Memory Protection
Unit (MPU)
8-Region
Embedded Trace
Macrocell (ETM)
for Instruction
Trace
Debug Access
Port: JTAG or
Serial Wire
Instrumentation
Trace Macrocell
(ITM ) for Data
Trace via Single
Wire Output
2x AHB-Lite Buses
I_CODE (Instruction Code Bus)
D_CODE (Data / Coefficients Code Bus)
1x AHB-Lite Buses
SYSTEM (SRAM & Fast Peripherals)
1x APB Bus
ARM Peripheral Bus (Internal & Slow Peripherals)
Central Core:
1.25 DMIPS/MHz
1 Cycle Multiply
Hardware Divide
Relative DMIPS/MHz
High Performance
1,4
1,2
1
0,8
0,6
0,4
0,2
0
ARM7 (Thumb) ARM7 (ARM)
Cortex-M3
Cortex-M3
Sleep
CPU can be clock gated
NVIC remains sensitive to interrupts
Cortex-M3
Wake-up
Deep
Sleep
NVIC
WIC
External interrupts
Deep sleep
Processor Modes
Privilege Levels
fRFMEA
analysis
SYSTICK
NMI
ARM
CortexM3
*optional
f
R
D
I
fRCPU_a
rmcm3
ARM CoreSight is a complete on-chip debug and real-time trace solution for
the entire system-on-chip (SoC)
Configurable to adapt for market requirements
2 wire interface
Offers extra functionality over JTAG using less I/O
CORTEX-M1
10
ARM Cortex-M1
3 stage pipeline
Delivers 0.8 DMIPS/MHz
Capable of up to 200MHz
11
Configurable debug
12
Multiplier
13
FPGA type
Speed
Area (LUTS)
65nm
Xilinx Virtex-5
200 MHz
1900
90nm
Altera Stratix II
Xilinx Virtex-4
150 MHz
2300
100 MHz
2900
Xilinx Spartan-3
80 MHz
2600
Actel Fusion
70 MHz
4300 tiles
65nm
90nm
130nm
14
Example
Thumb
Thumb-2
OS & system
ADC
ADD
BIC
BL
AND
ASR
NOP
BX
CMN
CMP
SEV
WFE
WFI
YIELD
EOR
LDM
LDR
LDRB
LDRH
LDRSB
LDRSH
LSL
LSR
MOV
MUL
MVN
DMB
NEG
ORR
POP
PUSH
ROR
RSB
DSB
SBC
STM
STR
STRB
STRH
SUB
ISB
SVC
TST
BKPT
BLX
CPS
CPY
MRS
REV
REV16
REVSH
SXTB
SXTH
UXTB
MSR
UXTH
15
ADR
Cortex-M1 ISA
CORTEX-M0
16
SYSTICK Timer
PendSV (Pending System Call)
Configurable debug
18
Optional OS extensions
1, 8, 16, 24 or 32 interrupts
Multiplier options
Software compatibility
4 or 2 breakpoints, 2 or 1 watchpoints
JTAG or SWD interface
Energy Efficiency
Excellent static power results using ARM Physical IP Metro 180ULL libraries and PMK
Easy integration to power management unit via Wake-up Interrupt Controller
8-bit or 16-bit
ARM Cortex-M0
Time
ENERGY
COST
ENERGY
EFFICIENT
Power
Power
Time
20
Thumb
Thumb-2
OS & system
ADC
ADD
BIC
BL
AND
ASR
NOP
BX
CMN
CMP
SEV
WFE
WFI
YIELD
EOR
LDM
LDR
LDRB
LDRH
LDRSB
LDRSH
LSL
LSR
MOV
MUL
MVN
DMB
NEG
ORR
POP
PUSH
ROR
RSB
DSB
SBC
STM
STR
STRB
STRH
SUB
ISB
SVC
TST
BKPT
BLX
CPS
CPY
MRS
REV
REV16
REVSH
SXTB
SXTH
UXTB
MSR
UXTH
21
ADR
Cortex-M0 ISA
CORTEX-M - ARCHITECTURE
22
23
24
Processor Mode
Handler Mode
Used to handle exceptions. The processor returns to Thread mode when it has
finished exception processing.
Thread Mode
25
Used to execute application software. The processor enters Thread mode when it
comes out of reset.
Privilege Levels
Unprivileged
The software:
has limited access to the MSR and MRS instructions, and cannot use the CPS
instruction
Privileged
The software can use all the instructions and has access to all resources.
26
Register File
Thread/Handler
R0
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13 (MSP)
R14 (LR)
PC
PSR
PRIMASK
FAULTMASK*
BASEPRI*
CONTROL
27
Thread
R13 (PSP)
Special-purpose registers
PSR
PRIMASK
FAULTMASK
BASEPRI
CONTROL
*Not available in Cortex-M0 / Cortex-M1
For example:
APSR
MSR PSR, r0
MRS r1, IPSR
N Z C V Q
IPSR
EPSR
PSR
28
EXCEPTION NUMBER
ICI/IT T
ICI/IT
N Z C V Q ICI/IT T
ICI/IT
EXCEPTION NUMBER
Memory Access
In a typical system:
29
Memory Map
FFFFFFFF
E0100000
APB
External PPB
E0040000
M3 Instruction
Core Data
SCS + NVIC
E0000000
External Device
Debug
Debug
Bus Matrix
with
Bit-Bander
Aligner
and Patch
1GB
INTERNAL PPB
A0000000
SYSTEM
SYSTEM AHB
AHB
ICODE AHB
External RAM
DCODE AHB
1GB
EX
60000000
BB
Peripheral
GB
40000000
EX+BB
RAM
GB
20000000
HX
Code ROM/RAM
GB
00000000
30
Thumb-2 Technology
New 32-bit Thumb instructions for improved performance and code size.
One 32-bit instruction replaces multiple 16-bit opcodes.
32-bit instructions are handled in the same mode ~ no interworking required
ARM
Thumb
Thumb-2
31
Software Compatibility
Thumb-2
32
ARM9 class
Cortex-M0
Cortex-M3
Cortex-R4
Cortex-A9
ADD
ADR
AND
ASR
BFC
BFI
BIC
CDP
CLREX
CMP
CLZ
B
CBNZ
CBZ
CMN
DBG
EOR
LDC
LDMIA
BKPT
BLX
ADC
ADD
ADR
LDMDB
LDR
LDRB
LDRBT
BX
CPS
AND
ASR
LDRD
LDREX
LDREXB
BIC
LDRH
LDRHT
LDRSB
LDREXH
DMB
LDRSBT
DSB
CMN
CMP
EOR
LDRSHT
LDRSH
LDRT
MCR
ISB
LDR
LDRB
LDM
LSL
LSR
MLS
MCRR
MRS
LDRH
LDRSB
LDRSH
MLA
MOV
MOVT
MRC
MSR
LSL
LSR
MOV
MRRC
MUL
MVN
BL
NOP
NOP
REV
MUL
MVN
ORR
ORN
ORR
PLD
PLDW
REV16
REVSH
POP
PUSH
ROR
PLI
POP
PUSH
RBIT
SEV
SXTB
RSB
SBC
STM
REV
REV16
REVSH
ROR
SXTH
UXTB
STR
STRB
STRH
RRX
RSB
SBC
SBFX
UXTH
WFE
SUB
SVC
TST
SDIV
SEV
SMLAL
SMULL
WFI
YIELD
SSAT
STC
STMIA
STR
STRB
STRBT
CORTEX-M0
STMDB
STRD
STREX
STREXB
STREXH
STRH
STRHT
STRT
SUB
SXTB
SXTH
TBB
TBH
TEQ
TST
UBFX
UDIV
UMLAL
UMULL
USAT
UXTB
UXTH
WFE
WFI
YIELD
IT
CORTEX-M3
Present in ARM7TDMI
33
Supervisor privilege
34
E0100000
M3 Instruction
Core Data
SCS + NVIC
E0000000
External Device
Debug
Debug
Bus Matrix
with
Bit-Bander
Aligner
and Patch
1GB
INTERNAL PPB
A0000000
SYSTEM
SYSTEM AHB
AHB
ICODE AHB
External RAM
DCODE AHB
1GB
EX
60000000
BB
Peripheral
GB
40000000
EX+BB
RAM
GB
20000000
HX
Code ROM/RAM
GB
00000000
35
FFFFFFFF
External PPB
E0040000
Vendor Specific
APB
Vector Table
0x34
DEBUG MONITOR
0x30
SVCALL
0x18
USAGE FAULT
0x14
BUS FAULT
0x10
MEM MANAGE
0x0C
HARD FAULT
0x08
NMI
0x04
RESET
0x00
UNDEFINED INSTRUCTIONS
36
Reset, Non Maskable Interrupt (NMI) and Hard Fault have predefined pre-emption.
NVIC catches exceptions and pre-empts current task based on priority
Custom
Handlers
System
Handlers
Exception
37
Name
Priority
Descriptions
Reset
-3 (Highest)
Reset
NMI
-2
Non-Maskable Interrupt
Hard Fault
-1
MemManage Fault
Programmable
Bus Fault
Programmable
Usage Fault
Programmable
11
SVCall
Programmable
12
Debug Monitor
Programmable
14
PendSV
Programmable
15
Systick
Programmable
16
Interrupt #0
Programmable
External Interrupt #0
255
Interrupt #239
Programmable
Exception Model
PC
LR
R12
R3
R2
R1
R0
38
Push
ISR 1
26 Cycles
Cortex-M3
Push
Interrupt Handling
12 Cycles
ISR 1
Pop
Push
16 Cycles
26 Cycles
ISR 2
6 Cycles
Tail-Chaining
ISR 2
Pop
Pop
16 Cycles
65% Saving
Cycle Overhead
12 Cycles
ARM7TDMI
Cortex-M3
39
Push
Push
26 Cycles
26 Cycles
Cortex-M3
Push
Interrupt Handling
12 Cycles
ISR 1
6 Cycles
Tail-Chaining
Pop
ISR 2
16 Cycles
ISR 2
ARM7TDMI
40
ISR 1
Pop
16 Cycles
Pop
12 Cycles
Cortex-M3
12 cycles to ISR entry
Parallel stacking & instruction fetch
Target ISR may be changed until last
cycle (PC is set)
When IRQ1 occurs new target ISR set
ISR 1
Pop
16 Cycles
Cortex-M3
Interrupt Handling
ISR 1
6 Cycles
Tail-Chaining
ISR 2
26 Cycles
ISR 2
ARM7TDMI
41
Push
Pop
16 Cycles
Pop
12 Cycles
Cortex-M3
Hardware un-stacking interruptible
If interrupted only 6 cycles required
to enter ISR2
SYSTICK Timer
Simple 24 Bit down counter
4 Registers
42
Alias Memory
32-Bit Word Alias
Real Memory
01
43
0
1
1. Packet comes in
1 1 4 4 8 8 C C
0
32
Contents of R0
3 3 5 5 A A C C
0
32
Example:
R0[15:0] into R1[31:16]
A A C C 8 8 C C
32
16
Resulting Packet in R1
Note: BFC will clear n adjacent bits in a register, starting at bit m.
e.g.: BFC R0, #4, #8 will clear a byte starting from bit 4.
44
8 register-stored regions
Same regions used for instructions and data
Minimum region size 32 Bytes (max 4GB)
No address translation or Page Tables
45
CORESIGHT
46
Verification Challenges
System verification
47
CoreSight Introduction
On-the-fly debugging
48
Real-Time Debug
Multiple interfaces
49
50
Enables
ETM Interface
51
CoreSight Connectors
52
53
Trace records
Event counters
Exceptions and interrupts
ITM debug messages
ETM instruction trace
54
Trace Records
55
Event Counters
56
57
32 user-defined channels
58
Supported by:
ULINKPro, J-Trace, JTAGjet-Trace
59
Logic Analyzer
Accurate timing
Code analysis
variable change
Supported by:
ULINKPro, J-Trace, JTAGjet-Trace
60
Performance Analyzer
Optimize applications
Supported by:
ULINKPro
61
Execution Profiling
Supported by:
ULINKPro
62
Code Coverage
Supported by:
ULINKPro
63
CMSIS
68
What is CMSIS
CMSIS - Cortex Microcontroller Software Interface Standard
Abstraction layer for all Cortex-M processor based devices
Developed in conjunction with silicon, tools and middleware Partners
69
CMSIS - Structure
70
Goal of CMSIS
Reduce Complexity
Only a small number of files and functions are provided
Register Interface to access simple peripheral functions
Ensure that efficient code can be generated by C compilers
71
core_cm0.h+core_cm0.c
core_cm3.h+core_cm3.c
startup_device.s
72
CMSIS Example
#include <device.h>
73
74
IAR visualSTATE
State machine development tool that
provides advanced verification and
validation utilities and generates very
compact C/C++ code that is 100%
consistent with your system design.
IAR PowerPac
The tightly integrated RTOS and
middleware alternative for your ARM
application with support for USB and
TCP/IP connectivity
75
76
77
78
ATMEL
79
SAM3U Positioning
Worlds First Cortex M3 Flash MCU with High Speed USB device
Optimized for applications requiring USB High Speed
First CM3 MCU with Dual bank Flash with boot bank select
80
81
Packages
QFP / BGA 100
JTAG
Boundary Scan
System Peripherals
EBI
Key Features
SRAM
ITM
Flash
PDC
PLL
PLLUTMI
UART
RC OSC
128kB
SRAM
Flash
Cortex-M3
WDT
3-20MHz
XTAL
12/8/4MHz
16KB
TIC
NVIC
MPU
Unique
ID
SAM-BA Boot
32KB
(8/16-bit)
4-ch
DMA
NAND
NOR
PSRAM
ECC
FFPI
128kB
4k SRAM
FIFO
DMA
PMC
BOD
ROM
SMC
USB Device
High Speed
PIO A/B/C
RTC
RTT
RSTC
RC OSC
32kHz
Supply
Contr
XTAL
32kHz
8 x GPBREG
Backup Unit
Peripheral DMA
Controller: 17 channels
Peripheral Bridge
POR
Peripheral Bridge
APB
PDC
12-bit
ADC
x8
PDC
10-bit
ADC
x8
PDC
PDC
PWM2
x4
I/O
x96
16-bit
Timer
x3
82
PDC
USART USART
PDC
PDC
USART USART
PDC
TWI
PDC
TWI
HSMCI
SDIO
8-bit
SPI
SSC
PCK-MCK 84MHz
Single Supply
1.62 to 3.6V
16-bit
High Speed
Peripheral
SDIO
Memory mapped FPGA or ASSP
USB Device
External Bus
Interface
83
425 Mbps
>500 Mbps out
of 7ns SRAM
MMC interface
384 Mbps
SDIO/SDCard
192 Mbps
SPI
Maximum
bandwidth
48 Mbps
Customer Benefit
84
NXP
85
86
87
LPC1700 Variations
88
LPC1700 Features
Highest bandwidth Ethernet
USB On-The-Go/Host/Device adding to the industrys widest choice of
USB options
Quadrature Encoder Interface and Motor Control Pulse Width Modulator
(PWM) for flexible, motor control with power to spare
Two CAN interfaces
True 12-bit analog-to-digital converter (ADC) and 10-bit digital-to-analog
converter (DAC)
Fast-Mode Plus (1 Mb/s) IC bus, in addition to 4 UARTs, 3 SPI/SSP
buses and an IS bus
Real-Time Clock operating at less than 1 uA
Pin compatibility with the NXP LPC2300 ARM7 microcontrollers series
89
NXP offers
Widest choice
Leads the industry with more than 45 USB-equipped ARM MCUs
LCD
pixels
Simplifies design, reduces board space, lowers cost
Software-compatible across NXP families
Ethernet
Motor Control
90
ST MICROELECTRONICS
92
Performance
Flash
Line
Size USB Access
Line
(bytes)
Access Line
512 K
384 K
STM32F103VE
STM32F103ZE
STM32F101RE
STM32F101VE
STM32F101ZE
STM32F103RD
STM32F103VD
STM32F103ZD
STM32F101RD
STM32F101VD
STM32F101ZD
STM32F103RC
STM32F103VC
STM32F103ZC
STM32F101RC
STM32F101VC
STM32F101ZC
STM32F103CB
STM32F102CB
STM32F101CB
STM32F103RB
STM32F102RB
STM32F101RB
STM32F103VB
STM32F103R8
STM32F102R8
STM32F101R8
STM32F103V8
STM32F101T8
STM32F103C8
STM32F102C8
STM32F101C8
STM32F103T6
STM32F103C6
STM32F103R6
STM32F101T6
STM32F102C6
STM32F101C6
STM32F102R6
STM32F101R6
STM32F103T4
STM32F103C4
STM32F102C4
STM32F103R4
STM32F102R4
STM32F101T4
STM32F101C4
STM32F101R4
256 K
128 K
STM32F103T8
64 K
32 K
16 K
36 pins
QFN
48 pins
LQFP
64 pins
LQFP
STM32F101VB
STM32F101V8
144 pins
*BGA package for
LQFP/BGA* Performance93
line on
Precise Analog:
up to 3x12-bit ADCs @ 1Ms/sec (up to 21channels)
Dual-channel 12-bit DAC with buffered outputs
Safety Support
2V-3.6V Supply
5V tolerant I/Os
CORTEXM3
CPU
72 MHz
Excellent safe
clock modes
Low-power modes
with wake-up
JTAG/SW Debug
Internal RC
Embedded reset
ETM
1 x Systic Timer
DMA
up to 512kB
Flash Memory
Power Supply
Reg 1.8V
POR/PDR/PVD
ARM Lite Hi-Speed Bus
Matrix / Arbiter (max 72MHz)
Flash I/F
6kB-64kB SRAM
XTAL oscillators
32KHz + 4~16MHz
Int. RC oscillators
32KHz + 8MHz
PLL
RTC / AWU
Clock Control
3 to 11* Channels
Bridge
1x SDIO**
1x USB 2.0FS
Bridge
2x6x 16-bit PWM
Synchronized AC Timer
Up to 16 Ext. ITs
51/80/112 I/Os
1x SPI
1x USART/LIN
Smartcard/IrDa
Modem-Ctrl
5x 16-bit Timer
2x Watchdog
(max 72MHz)
-40/+105C
1x bxCAN 2.0B
2x SPI/I2S
(independent &
window)
2x DAC
1/2/4x USART/LIN
Smartcard / IrDa
Modem Control
3x 12-bit ADC
21 channels / 1Msps
1x SPI
Temp Sensor
2x I2C
96
STM32F107
72MHz
CPU
Up to
64KB
SRAM
USB 2.0
OTG FS
2xCAN
2.0B
2x
Audio
Class
IS
Ethernet
IEEE1588
ETM
Main Osc 3-16MHz
Internal 8 MHz RC
and 40 kHz RC
Real Time Clock
New features
STM32F105
2 x Watchdogs
Reset circuitry
2 x 12-bit ADC 1s
Temp sensor
PWM Timer
72MHz
CPU
Up to
64KB
SRAM
USB 2.0
OTG FS
2xCAN
2.0B
2x
Audio
Class
IS
Up to 12 channels DMA
97
Up to 256KB Flash / up
to 64KB SRAM
Ethernet 10/100 MAC
with IEEE1588, MII &
RMII
USB 2.0 FS OTG w/ OTG
PHY
Cortex-M3
CPU
72 MHz
JTAG/SW Debug
ETM
Nested vect IT Ctrl
Preloaded bootloader:
1 x Systic Timer
USART+CAN+USB
DFU
2 x DMA
Up to 16 Ext. ITs
Up to 80 I/Os
LQFP64, LQFP100
-40/+105C
Ethernet MAC
10/100 with
IEEE1588, MII/RMII
1 x USB 2.0FS
OTG with PHY
XTAL oscillators
32KHz + 3~25MHz
Int. RC oscillators
40KHz + 8MHz
3 PLLs
RTC / AWU
Clock Control
1x SPI
1x USART/LIN
Smartcard/IrDa
Modem-Ctrl
Bridge
6 x 16-bit Timer
2 x CAN 2.0B
2x Watchdog
(max 72MHz)
Bridge
Power Supply
Reg 1.8V
POR/PDR/PVD
12 Channels
CRC
64-256kB
Flash Memory
20kB-64kB SRAM
Flash I/F
(independent &
window)
2x SPI / IS
2 x 12bit DAC
2x 12-bit ADC
16 channels /
1Msps
Temp Sensor
4x USART/LIN
Smartcard / IrDa
Modem Control
2x I2C
98
STM32 Evolution
NEXT
NOW
HIGH PERFORMANCE
STM32
Plus !
MIPS/MHz/MEMORY
HIGH BANDWITH
PERIPHS
Q2 10
STM32F10x
16K-512K Flash
Access/Performance
CONNECTIVITY
lines
June
ULTRA LOW POWER 09
LCD
Ultra low static leakage
Ultra low uA/MHz
Low power analog
Q4 09
STM32
Value Line
Factory automation
Audio, Medical
Gaming, Metering
STM32L
Q1 10
COST REDUCTIONS
Lower MHz
Simple Peripherals
STM32
Connectivity
Gluco meter
Gas & power meter
Portable GPS, DAB
Road Tolling
99
TEXAS INSTRUMENTS
LUMINARY
100
Luminary Micros
Stellaris Family of Industrial-Grade 32-bit MCUs
the first 32-bit ARM microcontroller offered for $1.00
the first available ARM Cortex-M3-based microcontrollers in production
the first to bring serious motion control capability to the ARM architecture
the only to integrate 10/100 Ethernet MAC and PHY in an ARM architecture
the largest ARM portfolio in the world
now featuring over 100 (and growing!) compatible family members all available today!
a complete and fully functional StellarisWare Peripheral Driver Library
extensive world-class third-party tools support
optimized for battery-backed applications
104
128
85
137
51
19
6
24
Stellaris
Sandstorm Class
Stellaris
Fury Class
Stellaris
Dust Devil Class
Stellaris
Tempest Class
10mm
10mm
Vendor
MCU Line
Flash Access
Time 20MHz
CPU
Flash Access
Time 25MHz
CPU
Flash Access
Time 50MHz
CPU
Unit of
Measure
Luminary
Micro
Stellaris
1
1
Cycle
ST Micro
STM32
Cycles
Atmel
AVR8
n/a
n/a
Cycles
TI
MSP430
n/a
n/a
n/a
Cycles
TOSHIBA
108
110
M340
M350
M360
M370
OFD
M380
For industrial and HA market. Vop=5V, POR, LVD, int. Osc., OFD,
wide product line up (48pin to 144pin package; up to 512kB
Flash)
M390
111
512KB
M361F10
M350F10
M363F10
M340F10
M330FD
M350FD
M360F10
OFD
M333FD
M340FD
M38yFD
OFD
256KB
M330FY
M370FY
M333FY
M380FY
M38yFY
M390FY
M341FU
128KB
96KB
OFD
OFD
OFD
M332FW
M372FW
M392FW
M38xFW
OFD
M381FW
OFD
112
M330FW
M380FW
M333FW
M390FW
M395FW
M331FU
M38xFS
64pin
OFD
M331FW
OFD
M332FU
M395FY
OFD
M381FU
80pin
100pin
128pin
> 128pin
Vector
Engine
High Speed
& Low Power
FLASH
Up to 2MB NANO
Flash
IEC60730
Class B
USB, CAN, Ethernet
113
Analog IP
MORE INFORMATION
114
More Information
Connected Community
www.OnARM.com
Vendor List
CMSIS 1.20
Tools Overview
Books
ISBN: 978-0-7506-8534-4
ISBN: 978-3-8266-5949-2
Training
115
http://www.arm.com/support/training.html
http://www.doulos.com
END
Thank you
116