際際滷

際際滷Share a Scribd company logo
ARM Cortex-M3 Architecture and
Programmer's Model
Akshay Raut
C-DAC Hyderabadby Ganesh Naik
AGENDA
 What is an Embedded System
 Characteristics of an Embedded System
 Components of an Embedded System
 ARM Cortex-M3 Fundamentals/Overview
 Registers
 Operation Modes
 Exceptions and Interrupts
 Vector tables
What is an Embedded System
 An embedded system is computer system designed
for specific control functions
 Embedded systems contain either microcontrollers
or digital signal processors
 Examples
 Digital Watches, Calculaters, MP3 Players, Digital
Cameras, Avionics etc
Characteristics of an Embedded System
 Cost effective
 Reliable
 Safety
 Real time critical
 Limitations against General Purpose Computers
 Memory
 Power consumption
 Response time
Components of an Embedded System
 Hardware
 Hardware specific to a specific task
 Constraints regarding power consumption
 Software
 Software that drives the hardware
 Constriants regarding memory usage, execution time etc
Microprocessor, Microcomputer and
Micorcontroller
 The microprocessor is a digital integrated circuit
device that can be programmed with a series of
instructions to perform specified functions on data
 A microcomputer is a microprocessor with memory
device
 A microcontroller is a microprocessor with memory
as well as other peripheral devices
RISC Vs CISC
Pipelining is ComplexInstructions are pipelinable
Small Register BankLarge Register bank
Memory values can be used as
operands in instructions
Load/Store Architecture
Several formats of instructionsFew formats of instructions
Variable length instructionsFixed width instructions
CISCRISC
RISC Vs CISC
Compiler
Processor
Code Generation
Greater
Complexity
CISC
Compiler
Processor
Code Generation
Greater
Complexity
RISC
ARM History
 ARM  Acorn RISC Machine(19831985)
 Acorn Computers Limited, Cambridge, England
 ARM  Advanced RISC Machine 1990
 ARM Limited, 1990
 ARM has been licensed to many semiconductor
manufacturers
ARM History
 Key component of many 32  bit embedded systems
 Portable Consumer devices
 ARM1 prototype in 1985
 One of the ARMs most successful cores is the
ARM7TDMI, provides high code density and low
power consumption
 ARM is Physical hardware design company
 ARM licenses its cores out and other companies
make processors based on its cores
Companies licensing with ARM

3com

Agilent Technologies

Altera

Epson

Freescale

Fijitsu

NEC

Nokia

Intel

IBM

Microsoft
 Motorola
 Panasonic
 Qualcomm
 Sharp
 Sanyo
 Sun Microsystems
 Sony
 Symbian
 Texas Instruments
 Toshiba
 Wipro
ARM Cortex-M3 Register Set
ARM Cortex-M3 Register Set
 Registers
 Registers: R0-R15
 R0-R12: General Purpose Registers
 R13: The Stack Pointer
 R14: The Link Register
 R15: The Program Counter
 Special Registers
 Program Status Registers
 Interrupt Mask Registers
 Control Register
Registers: R0-R15
 R0-R12: General Purpose Registers
 All are 32 bits registers
 Stores data or address
 Divided into two subsets
 General Purpose Registers: R0-R7
 Also called Low Registers
 Accessible by all 16-bit Thumb and all 32-bit Thumb-2 Instructions
 General Purpose Registers: R8-R12
 Also called High Registers
 Accessible by some 16-bit Thumb and all 32-bit Thumb-2 Instructions
Registers: R0-R15 (cont..)
 R13: The Stack Pointer (SP)
 Has two banked 32-bit Stack Pointers
 Main Stack Pointer (MSP) or SP_main
 Process Stack Pointer (PSP) or SP_process
 Allows two different separate stack memories to be set
up
 Register R13 allows to access the current Stack Pointer
 Note: Banked  Only one is visible at a time.
Registers: R0-R15 (cont..)
 Main Stack Pointer (MSP) or SP_main
 Default Stack Pointer after power up
 Used by code that requires privileged access
 Ex. Exception Handler
 Process Stack Pointer (PSP) or SP_process
 Used by code that does not require privileged access
 Base-level application code
Cortex-M3 Stack model
 Cortex-M3 Stack model
 When and why to use Stack
 PUSH and POP Operations
 PUSH and POP Operations are word alligned and
thus bits 0 and 1 of SP are hardwired to 0
Registers: R0-R15 (cont..)
 R14: The Link Register
 Used to store the return address when subroutine or
function is called
 Bit 0 of Link Register indicates ARM/Thumb state
 Ex.
Registers: R0-R15 (cont..)
 R15: The Program Counter
 Points to the instruction to be executed
 Because of pipeline, value inside PC is normally
different than the address of executing instruction (2
 4 bytes ahead)
 Writing to PC causes branching to the location
 Bit 0 of Program Counter indicates ARM/Thumb
state
Special Registers
 Program Status Registers
 Subdivided into three status registers
 Application Program Status Registers (APSR)
 Interrupt Program Status Registers (IPSR)
 Execution Program Status Registers (EPSR)
 Interrupt PSR and Execution PSR are read only
 All the PSRs can be accessed together or seperately
 Combined PSR is named as xPSR and while accessing use name
PSR
 Requires special register access instructions (MSR and MRS)
Special Registers
Special Registers
Special Registers (cont..)
 Interrupt Mask Registers
 PRIMASK
 FAULTMASK
 BASEPRI
 Used to disable exceptions and interrupts
 PRIMASK and BASEPRI are used for temporarily disabling
interrupts in timing-critical tasks
 FAULTMASK is used for temporarily disabling fault
handling when a task has crashed (fault conditions)
Special Registers (cont..)
Special Registers (cont..)
 In Assembly language MRS and MSR instructions are used
to access these registers
 A number of functions are also provided in the device driver
libraries
Special Registers (cont..)
 The Control Register
 Used to define privilege level and SP selection
 Has only 2 bits
 CONTROL[1]
 CONTROL[0]
Special Registers (cont..)
 CONTROL[1]
 Gives the stack status
 It is always 0 in handler mode
 Either 0 or 1 in thread/base level
 Writable when the core is in thread mode and privileged level
 Writing to this bit is not allowed in user state and handler mode
Special Registers (cont..)
 CONTROL[0]
 Gives the mode status
 This bit is writable only in privileged state
 To change this bit when in user state, triger an interrupt and
change this in exception handler
Special Registers (cont..)
Special Registers (cont..)
 Accessing the CONTROL register
 In C, CMSIS functions are available in device driver
libraries
 X = __get_CONTROL();
 __set_CONTROL(x);
 In Assembly MRS and MSR instructions are used
 MRS R0, CONTROL
 MSR CONTROL, R0
Special Registers (cont..)
 Accessing the CONTROL register
 In C, CMSIS functions are available in device driver
libraries
 X = __get_CONTROL();
 __set_CONTROL(x);
 In Assembly MRS and MSR instructions are used
 MRS R0, CONTROL
 MSR CONTROL, R0
Operation Modes
 Cortex M3 supports two modes and two access
levels
 Modes
 Handler Mode
 Thread Mode
 Access Levels
 Privileged Level
 User Level
Operation Modes
 Handler Mode
 Processer running in handler mode can be with
privileged level
Operation Modes
 Thread Mode
 Processor running in Thread mode can be with
privileged as well as user access level
 After reset processor is in thread mode with
privileged access level
Operation Modes
 Privileged Access Level
 Can access System Control Space (SCS) which
is a part of memory region for configuration
registers and debubbing components
 Can access special register access instructions
(MSR and MRS)
 Software in this access level can switch into
user access level using control register
 On Exception, processor always switch to
privileged state and return to previous state
Operation Modes
 User Access Level
 Access to System Control Space is blocked
 Cannot access special register access
instructions (MSR and MRS)
 Software in this access level cannot switch into
privileged access level directly
 Software can switch into privileged level from
exception handler
Operation Modes
Exception and Interrupts
 Supports large number of exceptions and
interrupts
Vector Tables
 Used to determine the starting address of an exception
handler
 The vector table in Cortex-M3 is relocatable which is
controlled by relocation register in NVIC
 After reset the relocation register is reset to 0 and vector
table is located at address 0x00000000
 Location 0x00000000 stores the starting value for Main
Stack Pointer
 LSB of the exception indicates whether the exception is
the executed in Thumb state
Vector Tables
Thank you

More Related Content

What's hot (20)

AMBA BUS.pptx
AMBA BUS.pptxAMBA BUS.pptx
AMBA BUS.pptx
SHABANASALIM4
Arm architecture
Arm architectureArm architecture
Arm architecture
MinYeop Na
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architecture
Dr.YNM
Unit vi (2)
Unit vi (2)Unit vi (2)
Unit vi (2)
Siva Nageswararao
Arm modes
Arm modesArm modes
Arm modes
abhi165
ARM Architecture
ARM ArchitectureARM Architecture
ARM Architecture
Dwight Sabio
ARM 32-bit Microcontroller Cortex-M3 introduction
ARM 32-bit Microcontroller Cortex-M3 introductionARM 32-bit Microcontroller Cortex-M3 introduction
ARM 32-bit Microcontroller Cortex-M3 introduction
anand hd
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLER
sravannunna24
ARM Microcontroller and Embedded Systems (17EC62) ARM 32 bit Microcontrol...
ARM Microcontroller and Embedded Systems (17EC62)  ARM  32 bit Microcontrol...ARM Microcontroller and Embedded Systems (17EC62)  ARM  32 bit Microcontrol...
ARM Microcontroller and Embedded Systems (17EC62) ARM 32 bit Microcontrol...
Shrishail Bhat
SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)
SUNODH GARLAPATI
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
Sudhanshu Janwadkar
The ARM Architecture: ARM : ARM Architecture
The ARM Architecture: ARM : ARM ArchitectureThe ARM Architecture: ARM : ARM Architecture
The ARM Architecture: ARM : ARM Architecture
sreea4
Arm processors' architecture
Arm processors'   architectureArm processors'   architecture
Arm processors' architecture
Dr.YNM
ARM Introduction
ARM IntroductionARM Introduction
ARM Introduction
Ramasubbu .P
Slow peripheral interfaces (i2 c spi uart)
Slow peripheral interfaces (i2 c  spi uart)Slow peripheral interfaces (i2 c  spi uart)
Slow peripheral interfaces (i2 c spi uart)
PREMAL GAJJAR
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
Mathivanan Natarajan
Arm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_armArm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_arm
Prashant Ahire
Lect 3 ARM PROCESSOR ARCHITECTURE
Lect 3  ARM PROCESSOR ARCHITECTURE Lect 3  ARM PROCESSOR ARCHITECTURE
Lect 3 ARM PROCESSOR ARCHITECTURE
Dr.YNM
ARM architcture
ARM architcture ARM architcture
ARM architcture
Hossam Adel
Unit II Arm 7 Introduction
Unit II Arm 7 IntroductionUnit II Arm 7 Introduction
Unit II Arm 7 Introduction
Dr. Pankaj Zope
Arm architecture
Arm architectureArm architecture
Arm architecture
MinYeop Na
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architecture
Dr.YNM
Arm modes
Arm modesArm modes
Arm modes
abhi165
ARM Architecture
ARM ArchitectureARM Architecture
ARM Architecture
Dwight Sabio
ARM 32-bit Microcontroller Cortex-M3 introduction
ARM 32-bit Microcontroller Cortex-M3 introductionARM 32-bit Microcontroller Cortex-M3 introduction
ARM 32-bit Microcontroller Cortex-M3 introduction
anand hd
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLER
sravannunna24
ARM Microcontroller and Embedded Systems (17EC62) ARM 32 bit Microcontrol...
ARM Microcontroller and Embedded Systems (17EC62)  ARM  32 bit Microcontrol...ARM Microcontroller and Embedded Systems (17EC62)  ARM  32 bit Microcontrol...
ARM Microcontroller and Embedded Systems (17EC62) ARM 32 bit Microcontrol...
Shrishail Bhat
SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)
SUNODH GARLAPATI
The ARM Architecture: ARM : ARM Architecture
The ARM Architecture: ARM : ARM ArchitectureThe ARM Architecture: ARM : ARM Architecture
The ARM Architecture: ARM : ARM Architecture
sreea4
Arm processors' architecture
Arm processors'   architectureArm processors'   architecture
Arm processors' architecture
Dr.YNM
ARM Introduction
ARM IntroductionARM Introduction
ARM Introduction
Ramasubbu .P
Slow peripheral interfaces (i2 c spi uart)
Slow peripheral interfaces (i2 c  spi uart)Slow peripheral interfaces (i2 c  spi uart)
Slow peripheral interfaces (i2 c spi uart)
PREMAL GAJJAR
Arm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_armArm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_arm
Prashant Ahire
Lect 3 ARM PROCESSOR ARCHITECTURE
Lect 3  ARM PROCESSOR ARCHITECTURE Lect 3  ARM PROCESSOR ARCHITECTURE
Lect 3 ARM PROCESSOR ARCHITECTURE
Dr.YNM
ARM architcture
ARM architcture ARM architcture
ARM architcture
Hossam Adel
Unit II Arm 7 Introduction
Unit II Arm 7 IntroductionUnit II Arm 7 Introduction
Unit II Arm 7 Introduction
Dr. Pankaj Zope

Similar to Arm cm3 architecture_and_programmer_model (20)

MPU Chp2.pptx
MPU Chp2.pptxMPU Chp2.pptx
MPU Chp2.pptx
EE2k2016YasirJavaid
Comparison between RISC architectures: MIPS, ARM and SPARC
Comparison between RISC architectures: MIPS, ARM and SPARCComparison between RISC architectures: MIPS, ARM and SPARC
Comparison between RISC architectures: MIPS, ARM and SPARC
Apurv Nerlekar
ARM7TDMI-S_CPU.ppt
ARM7TDMI-S_CPU.pptARM7TDMI-S_CPU.ppt
ARM7TDMI-S_CPU.ppt
MostafaParvin1
Arm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furberArm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furber
asodariyabhavesh
Introduction to ARM Architecture
Introduction to ARM ArchitectureIntroduction to ARM Architecture
Introduction to ARM Architecture
Racharla Rohit Varma
Arm arc-2016
Arm arc-2016Arm arc-2016
Arm arc-2016
Mohammed Gomaa
ARM Architecture and Instruction set.pptx
ARM Architecture and Instruction set.pptxARM Architecture and Instruction set.pptx
ARM Architecture and Instruction set.pptx
gsingh20be20
Topic 2 ARM Architecture and Programmer's Model.pptx
Topic 2 ARM Architecture and Programmer's Model.pptxTopic 2 ARM Architecture and Programmer's Model.pptx
Topic 2 ARM Architecture and Programmer's Model.pptx
pushprajsinhmakwana1
ARM programmer's model.pdf
ARM programmer's model.pdfARM programmer's model.pdf
ARM programmer's model.pdf
Anbuselvi Mathivanan
It very good ppt because it is good ppt method
It very good ppt because it is good ppt methodIt very good ppt because it is good ppt method
It very good ppt because it is good ppt method
rameshkumar638260
ARM_CPSR_Full_Detailed_Presentation.pptx
ARM_CPSR_Full_Detailed_Presentation.pptxARM_CPSR_Full_Detailed_Presentation.pptx
ARM_CPSR_Full_Detailed_Presentation.pptx
hemalathacse1
ARM-Introduction, registers and processor states.ppt
ARM-Introduction, registers and processor states.pptARM-Introduction, registers and processor states.ppt
ARM-Introduction, registers and processor states.ppt
ECEHITS
Embedded systems 101 final
Embedded systems 101 finalEmbedded systems 101 final
Embedded systems 101 final
Khalid Elmeadawy
ARM Processor ppt.pptx
ARM Processor ppt.pptxARM Processor ppt.pptx
ARM Processor ppt.pptx
jayesh205437
arm_3.ppt
arm_3.pptarm_3.ppt
arm_3.ppt
MostafaParvin1
arm
armarm
arm
Pratik Gohel
Unit-I_ES.pdf
Unit-I_ES.pdfUnit-I_ES.pdf
Unit-I_ES.pdf
Bogiri Nagaraju
Unitii armarchitecture-130305014346-phpapp01
Unitii armarchitecture-130305014346-phpapp01Unitii armarchitecture-130305014346-phpapp01
Unitii armarchitecture-130305014346-phpapp01
mannepalli Srinivasulu
Arm
ArmArm
Arm
Senthil Kumar
ARM
ARM ARM
ARM
Ahmed Mahmoud
Comparison between RISC architectures: MIPS, ARM and SPARC
Comparison between RISC architectures: MIPS, ARM and SPARCComparison between RISC architectures: MIPS, ARM and SPARC
Comparison between RISC architectures: MIPS, ARM and SPARC
Apurv Nerlekar
Arm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furberArm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furber
asodariyabhavesh
Introduction to ARM Architecture
Introduction to ARM ArchitectureIntroduction to ARM Architecture
Introduction to ARM Architecture
Racharla Rohit Varma
ARM Architecture and Instruction set.pptx
ARM Architecture and Instruction set.pptxARM Architecture and Instruction set.pptx
ARM Architecture and Instruction set.pptx
gsingh20be20
Topic 2 ARM Architecture and Programmer's Model.pptx
Topic 2 ARM Architecture and Programmer's Model.pptxTopic 2 ARM Architecture and Programmer's Model.pptx
Topic 2 ARM Architecture and Programmer's Model.pptx
pushprajsinhmakwana1
It very good ppt because it is good ppt method
It very good ppt because it is good ppt methodIt very good ppt because it is good ppt method
It very good ppt because it is good ppt method
rameshkumar638260
ARM_CPSR_Full_Detailed_Presentation.pptx
ARM_CPSR_Full_Detailed_Presentation.pptxARM_CPSR_Full_Detailed_Presentation.pptx
ARM_CPSR_Full_Detailed_Presentation.pptx
hemalathacse1
ARM-Introduction, registers and processor states.ppt
ARM-Introduction, registers and processor states.pptARM-Introduction, registers and processor states.ppt
ARM-Introduction, registers and processor states.ppt
ECEHITS
Embedded systems 101 final
Embedded systems 101 finalEmbedded systems 101 final
Embedded systems 101 final
Khalid Elmeadawy
ARM Processor ppt.pptx
ARM Processor ppt.pptxARM Processor ppt.pptx
ARM Processor ppt.pptx
jayesh205437
Unitii armarchitecture-130305014346-phpapp01
Unitii armarchitecture-130305014346-phpapp01Unitii armarchitecture-130305014346-phpapp01
Unitii armarchitecture-130305014346-phpapp01
mannepalli Srinivasulu

Recently uploaded (20)

Cloudera Partner Network Enablement Full.pdf
Cloudera Partner Network Enablement Full.pdfCloudera Partner Network Enablement Full.pdf
Cloudera Partner Network Enablement Full.pdf
Nguy畛n H畉i
Call for Papers - 6th International Conference on Big Data and Machine Learni...
Call for Papers - 6th International Conference on Big Data and Machine Learni...Call for Papers - 6th International Conference on Big Data and Machine Learni...
Call for Papers - 6th International Conference on Big Data and Machine Learni...
IJDKP
Water Industry Process Automation & Control Monthly - April 2025
Water Industry Process Automation & Control Monthly - April 2025Water Industry Process Automation & Control Monthly - April 2025
Water Industry Process Automation & Control Monthly - April 2025
Water Industry Process Automation & Control
Scalling Rails: The Journey to 200M Notifications
Scalling Rails: The Journey to 200M NotificationsScalling Rails: The Journey to 200M Notifications
Scalling Rails: The Journey to 200M Notifications
Gustavo Araujo
Lecture 16 - 17 - NonTraditional Machining Presentation.ppt
Lecture 16 - 17 - NonTraditional Machining Presentation.pptLecture 16 - 17 - NonTraditional Machining Presentation.ppt
Lecture 16 - 17 - NonTraditional Machining Presentation.ppt
INSTITUTE OF ENGINEERING /BKC
02.BigDataAnalytics curso de Legsi (1).pdf
02.BigDataAnalytics curso de Legsi (1).pdf02.BigDataAnalytics curso de Legsi (1).pdf
02.BigDataAnalytics curso de Legsi (1).pdf
ruioliveira1921
CCNA_Product_OverviewCCNA_Productsa.pptx
CCNA_Product_OverviewCCNA_Productsa.pptxCCNA_Product_OverviewCCNA_Productsa.pptx
CCNA_Product_OverviewCCNA_Productsa.pptx
UdayakumarAllimuthu
Unit-03 Cams and Followers in Mechanisms of Machines.pptx
Unit-03 Cams and Followers in Mechanisms of Machines.pptxUnit-03 Cams and Followers in Mechanisms of Machines.pptx
Unit-03 Cams and Followers in Mechanisms of Machines.pptx
Kirankumar Jagtap
DBMS Notes selection projection aggregate
DBMS Notes selection projection aggregateDBMS Notes selection projection aggregate
DBMS Notes selection projection aggregate
Sreedhar Chowdam
Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...
Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...
Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...
Ignacio J. J. Palma Carazo
Intro of Airport Engg..pptx-Definition of airport engineering and airport pla...
Intro of Airport Engg..pptx-Definition of airport engineering and airport pla...Intro of Airport Engg..pptx-Definition of airport engineering and airport pla...
Intro of Airport Engg..pptx-Definition of airport engineering and airport pla...
Priyanka Dange
Disruption channel in business model innovation topic
Disruption channel in business model innovation topicDisruption channel in business model innovation topic
Disruption channel in business model innovation topic
anandraj930873
PLANT CELL REACTORS presenation PTC amity
PLANT CELL REACTORS presenation PTC amityPLANT CELL REACTORS presenation PTC amity
PLANT CELL REACTORS presenation PTC amity
UrjaMoon
Agentic architectures and workflows @ AIware Bootcamp 2024
Agentic architectures and workflows @ AIware Bootcamp 2024Agentic architectures and workflows @ AIware Bootcamp 2024
Agentic architectures and workflows @ AIware Bootcamp 2024
Keheliya Gallaba
Introduction to Forensic Research Digital Forensics
Introduction to Forensic Research Digital ForensicsIntroduction to Forensic Research Digital Forensics
Introduction to Forensic Research Digital Forensics
SaanviMisar
NBA Criteria TIER I and TIER II Comparison
NBA Criteria TIER I and TIER II ComparisonNBA Criteria TIER I and TIER II Comparison
NBA Criteria TIER I and TIER II Comparison
Dr INBAMALAR T M
Distributed renewable energy in Colombia.OECD2023.pdf
Distributed renewable energy in Colombia.OECD2023.pdfDistributed renewable energy in Colombia.OECD2023.pdf
Distributed renewable energy in Colombia.OECD2023.pdf
SantiagoCardonaGallo
GRAPHS AND DISCONTINUITIES POWERPOINT.pptx
GRAPHS AND DISCONTINUITIES POWERPOINT.pptxGRAPHS AND DISCONTINUITIES POWERPOINT.pptx
GRAPHS AND DISCONTINUITIES POWERPOINT.pptx
ChrisPuyoc1
UHV unit-2UNIT - II HARMONY IN THE HUMAN BEING.pptx
UHV unit-2UNIT - II HARMONY IN THE HUMAN BEING.pptxUHV unit-2UNIT - II HARMONY IN THE HUMAN BEING.pptx
UHV unit-2UNIT - II HARMONY IN THE HUMAN BEING.pptx
ariomthermal2031
Project Manager | Integrated Design Expert
Project Manager | Integrated Design ExpertProject Manager | Integrated Design Expert
Project Manager | Integrated Design Expert
BARBARA BIANCO
Cloudera Partner Network Enablement Full.pdf
Cloudera Partner Network Enablement Full.pdfCloudera Partner Network Enablement Full.pdf
Cloudera Partner Network Enablement Full.pdf
Nguy畛n H畉i
Call for Papers - 6th International Conference on Big Data and Machine Learni...
Call for Papers - 6th International Conference on Big Data and Machine Learni...Call for Papers - 6th International Conference on Big Data and Machine Learni...
Call for Papers - 6th International Conference on Big Data and Machine Learni...
IJDKP
Scalling Rails: The Journey to 200M Notifications
Scalling Rails: The Journey to 200M NotificationsScalling Rails: The Journey to 200M Notifications
Scalling Rails: The Journey to 200M Notifications
Gustavo Araujo
Lecture 16 - 17 - NonTraditional Machining Presentation.ppt
Lecture 16 - 17 - NonTraditional Machining Presentation.pptLecture 16 - 17 - NonTraditional Machining Presentation.ppt
Lecture 16 - 17 - NonTraditional Machining Presentation.ppt
INSTITUTE OF ENGINEERING /BKC
02.BigDataAnalytics curso de Legsi (1).pdf
02.BigDataAnalytics curso de Legsi (1).pdf02.BigDataAnalytics curso de Legsi (1).pdf
02.BigDataAnalytics curso de Legsi (1).pdf
ruioliveira1921
CCNA_Product_OverviewCCNA_Productsa.pptx
CCNA_Product_OverviewCCNA_Productsa.pptxCCNA_Product_OverviewCCNA_Productsa.pptx
CCNA_Product_OverviewCCNA_Productsa.pptx
UdayakumarAllimuthu
Unit-03 Cams and Followers in Mechanisms of Machines.pptx
Unit-03 Cams and Followers in Mechanisms of Machines.pptxUnit-03 Cams and Followers in Mechanisms of Machines.pptx
Unit-03 Cams and Followers in Mechanisms of Machines.pptx
Kirankumar Jagtap
DBMS Notes selection projection aggregate
DBMS Notes selection projection aggregateDBMS Notes selection projection aggregate
DBMS Notes selection projection aggregate
Sreedhar Chowdam
Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...
Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...
Analysis of Daylighting in Interior Spaces using the Daylight Factor - A Manu...
Ignacio J. J. Palma Carazo
Intro of Airport Engg..pptx-Definition of airport engineering and airport pla...
Intro of Airport Engg..pptx-Definition of airport engineering and airport pla...Intro of Airport Engg..pptx-Definition of airport engineering and airport pla...
Intro of Airport Engg..pptx-Definition of airport engineering and airport pla...
Priyanka Dange
Disruption channel in business model innovation topic
Disruption channel in business model innovation topicDisruption channel in business model innovation topic
Disruption channel in business model innovation topic
anandraj930873
PLANT CELL REACTORS presenation PTC amity
PLANT CELL REACTORS presenation PTC amityPLANT CELL REACTORS presenation PTC amity
PLANT CELL REACTORS presenation PTC amity
UrjaMoon
Agentic architectures and workflows @ AIware Bootcamp 2024
Agentic architectures and workflows @ AIware Bootcamp 2024Agentic architectures and workflows @ AIware Bootcamp 2024
Agentic architectures and workflows @ AIware Bootcamp 2024
Keheliya Gallaba
Introduction to Forensic Research Digital Forensics
Introduction to Forensic Research Digital ForensicsIntroduction to Forensic Research Digital Forensics
Introduction to Forensic Research Digital Forensics
SaanviMisar
NBA Criteria TIER I and TIER II Comparison
NBA Criteria TIER I and TIER II ComparisonNBA Criteria TIER I and TIER II Comparison
NBA Criteria TIER I and TIER II Comparison
Dr INBAMALAR T M
Distributed renewable energy in Colombia.OECD2023.pdf
Distributed renewable energy in Colombia.OECD2023.pdfDistributed renewable energy in Colombia.OECD2023.pdf
Distributed renewable energy in Colombia.OECD2023.pdf
SantiagoCardonaGallo
GRAPHS AND DISCONTINUITIES POWERPOINT.pptx
GRAPHS AND DISCONTINUITIES POWERPOINT.pptxGRAPHS AND DISCONTINUITIES POWERPOINT.pptx
GRAPHS AND DISCONTINUITIES POWERPOINT.pptx
ChrisPuyoc1
UHV unit-2UNIT - II HARMONY IN THE HUMAN BEING.pptx
UHV unit-2UNIT - II HARMONY IN THE HUMAN BEING.pptxUHV unit-2UNIT - II HARMONY IN THE HUMAN BEING.pptx
UHV unit-2UNIT - II HARMONY IN THE HUMAN BEING.pptx
ariomthermal2031
Project Manager | Integrated Design Expert
Project Manager | Integrated Design ExpertProject Manager | Integrated Design Expert
Project Manager | Integrated Design Expert
BARBARA BIANCO

Arm cm3 architecture_and_programmer_model

  • 1. ARM Cortex-M3 Architecture and Programmer's Model Akshay Raut C-DAC Hyderabadby Ganesh Naik
  • 2. AGENDA What is an Embedded System Characteristics of an Embedded System Components of an Embedded System ARM Cortex-M3 Fundamentals/Overview Registers Operation Modes Exceptions and Interrupts Vector tables
  • 3. What is an Embedded System An embedded system is computer system designed for specific control functions Embedded systems contain either microcontrollers or digital signal processors Examples Digital Watches, Calculaters, MP3 Players, Digital Cameras, Avionics etc
  • 4. Characteristics of an Embedded System Cost effective Reliable Safety Real time critical Limitations against General Purpose Computers Memory Power consumption Response time
  • 5. Components of an Embedded System Hardware Hardware specific to a specific task Constraints regarding power consumption Software Software that drives the hardware Constriants regarding memory usage, execution time etc
  • 6. Microprocessor, Microcomputer and Micorcontroller The microprocessor is a digital integrated circuit device that can be programmed with a series of instructions to perform specified functions on data A microcomputer is a microprocessor with memory device A microcontroller is a microprocessor with memory as well as other peripheral devices
  • 7. RISC Vs CISC Pipelining is ComplexInstructions are pipelinable Small Register BankLarge Register bank Memory values can be used as operands in instructions Load/Store Architecture Several formats of instructionsFew formats of instructions Variable length instructionsFixed width instructions CISCRISC
  • 8. RISC Vs CISC Compiler Processor Code Generation Greater Complexity CISC Compiler Processor Code Generation Greater Complexity RISC
  • 9. ARM History ARM Acorn RISC Machine(19831985) Acorn Computers Limited, Cambridge, England ARM Advanced RISC Machine 1990 ARM Limited, 1990 ARM has been licensed to many semiconductor manufacturers
  • 10. ARM History Key component of many 32 bit embedded systems Portable Consumer devices ARM1 prototype in 1985 One of the ARMs most successful cores is the ARM7TDMI, provides high code density and low power consumption ARM is Physical hardware design company ARM licenses its cores out and other companies make processors based on its cores
  • 11. Companies licensing with ARM 3com Agilent Technologies Altera Epson Freescale Fijitsu NEC Nokia Intel IBM Microsoft Motorola Panasonic Qualcomm Sharp Sanyo Sun Microsystems Sony Symbian Texas Instruments Toshiba Wipro
  • 13. ARM Cortex-M3 Register Set Registers Registers: R0-R15 R0-R12: General Purpose Registers R13: The Stack Pointer R14: The Link Register R15: The Program Counter Special Registers Program Status Registers Interrupt Mask Registers Control Register
  • 14. Registers: R0-R15 R0-R12: General Purpose Registers All are 32 bits registers Stores data or address Divided into two subsets General Purpose Registers: R0-R7 Also called Low Registers Accessible by all 16-bit Thumb and all 32-bit Thumb-2 Instructions General Purpose Registers: R8-R12 Also called High Registers Accessible by some 16-bit Thumb and all 32-bit Thumb-2 Instructions
  • 15. Registers: R0-R15 (cont..) R13: The Stack Pointer (SP) Has two banked 32-bit Stack Pointers Main Stack Pointer (MSP) or SP_main Process Stack Pointer (PSP) or SP_process Allows two different separate stack memories to be set up Register R13 allows to access the current Stack Pointer Note: Banked Only one is visible at a time.
  • 16. Registers: R0-R15 (cont..) Main Stack Pointer (MSP) or SP_main Default Stack Pointer after power up Used by code that requires privileged access Ex. Exception Handler Process Stack Pointer (PSP) or SP_process Used by code that does not require privileged access Base-level application code
  • 17. Cortex-M3 Stack model Cortex-M3 Stack model When and why to use Stack PUSH and POP Operations PUSH and POP Operations are word alligned and thus bits 0 and 1 of SP are hardwired to 0
  • 18. Registers: R0-R15 (cont..) R14: The Link Register Used to store the return address when subroutine or function is called Bit 0 of Link Register indicates ARM/Thumb state Ex.
  • 19. Registers: R0-R15 (cont..) R15: The Program Counter Points to the instruction to be executed Because of pipeline, value inside PC is normally different than the address of executing instruction (2 4 bytes ahead) Writing to PC causes branching to the location Bit 0 of Program Counter indicates ARM/Thumb state
  • 20. Special Registers Program Status Registers Subdivided into three status registers Application Program Status Registers (APSR) Interrupt Program Status Registers (IPSR) Execution Program Status Registers (EPSR) Interrupt PSR and Execution PSR are read only All the PSRs can be accessed together or seperately Combined PSR is named as xPSR and while accessing use name PSR Requires special register access instructions (MSR and MRS)
  • 23. Special Registers (cont..) Interrupt Mask Registers PRIMASK FAULTMASK BASEPRI Used to disable exceptions and interrupts PRIMASK and BASEPRI are used for temporarily disabling interrupts in timing-critical tasks FAULTMASK is used for temporarily disabling fault handling when a task has crashed (fault conditions)
  • 25. Special Registers (cont..) In Assembly language MRS and MSR instructions are used to access these registers A number of functions are also provided in the device driver libraries
  • 26. Special Registers (cont..) The Control Register Used to define privilege level and SP selection Has only 2 bits CONTROL[1] CONTROL[0]
  • 27. Special Registers (cont..) CONTROL[1] Gives the stack status It is always 0 in handler mode Either 0 or 1 in thread/base level Writable when the core is in thread mode and privileged level Writing to this bit is not allowed in user state and handler mode
  • 28. Special Registers (cont..) CONTROL[0] Gives the mode status This bit is writable only in privileged state To change this bit when in user state, triger an interrupt and change this in exception handler
  • 30. Special Registers (cont..) Accessing the CONTROL register In C, CMSIS functions are available in device driver libraries X = __get_CONTROL(); __set_CONTROL(x); In Assembly MRS and MSR instructions are used MRS R0, CONTROL MSR CONTROL, R0
  • 31. Special Registers (cont..) Accessing the CONTROL register In C, CMSIS functions are available in device driver libraries X = __get_CONTROL(); __set_CONTROL(x); In Assembly MRS and MSR instructions are used MRS R0, CONTROL MSR CONTROL, R0
  • 32. Operation Modes Cortex M3 supports two modes and two access levels Modes Handler Mode Thread Mode Access Levels Privileged Level User Level
  • 33. Operation Modes Handler Mode Processer running in handler mode can be with privileged level
  • 34. Operation Modes Thread Mode Processor running in Thread mode can be with privileged as well as user access level After reset processor is in thread mode with privileged access level
  • 35. Operation Modes Privileged Access Level Can access System Control Space (SCS) which is a part of memory region for configuration registers and debubbing components Can access special register access instructions (MSR and MRS) Software in this access level can switch into user access level using control register On Exception, processor always switch to privileged state and return to previous state
  • 36. Operation Modes User Access Level Access to System Control Space is blocked Cannot access special register access instructions (MSR and MRS) Software in this access level cannot switch into privileged access level directly Software can switch into privileged level from exception handler
  • 38. Exception and Interrupts Supports large number of exceptions and interrupts
  • 39. Vector Tables Used to determine the starting address of an exception handler The vector table in Cortex-M3 is relocatable which is controlled by relocation register in NVIC After reset the relocation register is reset to 0 and vector table is located at address 0x00000000 Location 0x00000000 stores the starting value for Main Stack Pointer LSB of the exception indicates whether the exception is the executed in Thumb state