ESD - CS5 - Introduction To ARMv7M Architecture
ESD - CS5 - Introduction To ARMv7M Architecture
ESZG512/MELZG526/SEZG516
Embedded System Design
Contact Session 5
Contents
• Polling, interrupt, DMA
ARM Cortex-M4:
• Exceptions and Interrupts
• Exception handlers in C
• Exception entry behavior
• Exception return behavior
Interrupt
Whenever any device needs its service, the device notifies the
microcontroller by sending it an interrupt signal.
Upon receiving an interrupt signal, the microcontroller interrupts
whatever it is doing and serves the device.
The program which is associated with the interrupt is called the
interrupt service routine (ISR) or interrupt handler.
The advantage of interrupts is that the microcontroller can serve
many devices (not all at the same time)
Each device can get the attention of the microcontroller based on the assigned priority.
The limiting factor for the data transfer is the time to recognize,
process and return from the interrupt.
5
DMA
It is a device that can initiate and control, bus accesses between I/O
devices and memory and between two memory areas.
Using a DMA controller is reasonably simple, provided the
programming defines exactly the data transfer operations that the
processor expects.
Low latency I/O data transfer method.
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors” 7
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors” 8
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors” 10
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors” 11
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors” 12
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors” 13
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors” 14
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors” 17
18
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors”
When pushing context to the stack, the hardware saves eight 32-bit
words, comprising xPSR, Return Address, LR(R14), R12, R3, R2,
R1, and R0.
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors” 21
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors” 22
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors” 24
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors” 28
30
Source: ARMv7M Architecture Reference Manual
When used in this way, the processor intercepts the value written to
the PC. This value is the EXC_RETURN value.
Source: Joseph Yiu, “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors” 34
Lab Access:
Mr. Vishal (08322580217/ 7720893522)
Email ID: vishal@wilp.bits-pilani.ac.in
Thank you
36