SlideShare a Scribd company logo
Introduction to STM32
Course Objective After completing this course, you will answer: What is ARM Cortex Processor? What is the STM32 SoC? What are STM32 building blocks? Amr Ali Abdel-Naby@2011 Introduction to STM32
Course Notes Set your cell phone to vibrate. I assume you know computer architecture. Ask any time. Amr Ali Abdel-Naby@2011 Introduction to STM32
Course References The Definitive Guide to the ARM Cortex-M3, 2 nd  Edition www.arm.com www.st.com/stm32 www.doulos.com Amr Ali Abdel-Naby@2011 Introduction to STM32
Course Outline Introduction Cortex Overview CMSIS STM32 System Architecture Peripherals Low Power Operation Safety Features The Flash Module Development Tools Amr Ali Abdel-Naby@2011 Introduction to STM32
Course Outline Introduction Cortex Overview CMSIS STM32 System Architecture Peripherals Low Power Operation Safety Features The Flash Module Development Tools Amr Ali Abdel-Naby@2011 Introduction to STM32
CPU, Processor, and SoC Amr Ali Abdel-Naby@2011 Introduction to STM32
About ARM ARM = Advanced/Acorn RISC Machine Founded in 1990 CPU IPs, physical IPs, compilers, SoC infrastructure… Dominates 75% of embedded market Amr Ali Abdel-Naby@2011 Introduction to STM32
ARM Customers IDMs/IC vendors like: Amr Ali Abdel-Naby@2011 Introduction to STM32
ARM Overview Amr Ali Abdel-Naby@2011 Introduction to STM32
ARM by Architecture Amr Ali Abdel-Naby@2011 Introduction to STM32
ARM Application Processors Amr Ali Abdel-Naby@2011 Introduction to STM32
ARM Embedded Processors Amr Ali Abdel-Naby@2011 Introduction to STM32
ARM Secure/Specialities Processors Amr Ali Abdel-Naby@2011 Introduction to STM32
About ST Microelectronics Merge of SG Microelectronica and Thomson Semiconductors Founded in 1987 ICs, smart cards, microcontrollers… Amr Ali Abdel-Naby@2011 Introduction to STM32
Course Outline Introduction Cortex Overview CMSIS STM32 System Architecture Peripherals Low Power Operation Safety Features The Flash Module Development Tools Amr Ali Abdel-Naby@2011 Introduction to STM32
What is Cortex? Next generation ARM Processor Consists of: Classic CPU(s) System peripherals 3 series: A series: for complex applications and OS R series: for real-time systems M series: optimized for cost/power sensitive systems 15 performance levels: 0 lowest Amr Ali Abdel-Naby@2011 Introduction to STM32
Cortex CPU 32-bit RISC 16 registers 3 stages pipeline with branch prediction Load-store architecture Amr Ali Abdel-Naby@2011 Introduction to STM32
CPU Operating Modes Amr Ali Abdel-Naby@2011 Introduction to STM32
Thumb-2 Instruction Set 32-bit performance with 16-bit code density Need for non ANSI-C is minimum Amr Ali Abdel-Naby@2011 Introduction to STM32
Memory Map Amr Ali Abdel-Naby@2011 Introduction to STM32
Unaligned Memory Access Amr Ali Abdel-Naby@2011 Introduction to STM32
Bit Banding Amr Ali Abdel-Naby@2011 Introduction to STM32
Buses Code and Data buses Harvard architecture System bus Cortex control space Private peripheral bus On-chip debug system Bus matrix Connects the 1 st  3 buses to the external world Bus arbiters Amr Ali Abdel-Naby@2011 Introduction to STM32
System Timer 24-bit down counter Auto-reload and end of count interrupt Provide timer tick for OS Has 3 registers: Control & status Enable, select clock source… Reload value Current value Both reload and current registers should be initialized with period Amr Ali Abdel-Naby@2011 Introduction to STM32
Nested Vector Interrupt Controller Very low deterministic interrupt latency Nested interrupts ANSI C programmed Configurable by manufacture to the needed number of interrupts Amr Ali Abdel-Naby@2011 Introduction to STM32
NVIC Exception Entry and Exit Amr Ali Abdel-Naby@2011 Introduction to STM32
Handling Multiple Interrupts A HPI preempts a LPI (12 cycles needed) 6 cycles are needed to fetch new ISR address Tail chaining ensures minimum delay between interrupts in 3 cases: 2 interrupts raised at same time (6 cycles needed) LPI occurs at HPI exit (7 to 18 cycles needed) HPI occurs during push of LPI (6 cycles needed from HPI occurrence) Amr Ali Abdel-Naby@2011 Introduction to STM32
NVIC Configure and Usage Done on 3 steps: Configure the exception vector table Configure the NVIC registers Configure the peripherals Amr Ali Abdel-Naby@2011 Introduction to STM32
Configure the Exception Vector Table Amr Ali Abdel-Naby@2011 Introduction to STM32
Configure the NVIC Registers Set the priority of the interrupt Enable the interrupt source Internal exceptions are configured using system control and system priority User exceptions are configured using IRQ registers Amr Ali Abdel-Naby@2011 Introduction to STM32
Power Modes CPU enters sleep mode either by: WFI Wakes by an interrupt Executes an ISR WFE Wakes by an external event line SLEEPONEXT: Puts CPU back in sleep mode after ISR SEVONPEND: An ISR even if disabled can generate an event  SLEEPDEEP: Halts peripherals as well like PLL Amr Ali Abdel-Naby@2011 Introduction to STM32
CoreSight Debug Support Amr Ali Abdel-Naby@2011 Introduction to STM32
Course Outline Introduction Cortex Overview CMSIS STM32 System Architecture Peripherals Low Power Operation Safety Features The Flash Module Development Tools Amr Ali Abdel-Naby@2011 Introduction to STM32
What is CMSIS? Cortex Microcontroller Software Interface Standard A vendor independent software layer This will ease porting and reusing of software MISRA compliant Amr Ali Abdel-Naby@2011 Introduction to STM32
CMSIS Structure Amr Ali Abdel-Naby@2011 Introduction to STM32
File Structure core_cm3.h Cortex M3 global declarations core_cm3.c Cortex M3 global definitions core_cm3.x are tool independent. <device>.h To be included in application software system_<device>.h Device specific declarations system_<device>.c Device specific definitions Amr Ali Abdel-Naby@2011 Introduction to STM32

More Related Content

PPT
PPTX
STM32 Microcontroller Clocks and RCC block
PDF
Introduction to arm architecture
PPTX
Embedded System Programming on ARM Cortex M3 and M4 Course
PPTX
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
PDF
Unit II Arm 7 Introduction
PDF
ARM CORTEX M3 PPT
PDF
Unit II arm 7 Instruction Set
STM32 Microcontroller Clocks and RCC block
Introduction to arm architecture
Embedded System Programming on ARM Cortex M3 and M4 Course
Mastering Microcontroller : TIMERS, PWM, CAN, RTC,LOW POWER
Unit II Arm 7 Introduction
ARM CORTEX M3 PPT
Unit II arm 7 Instruction Set

What's hot (20)

PPT
Embedded System Basics
PDF
SOC Interconnects: AMBA & CoreConnect
PPT
CAN (Controller Area Network) Bus Protocol
PPT
STM32 MCU Family
PPTX
Wi-Fi Esp8266 nodemcu
PPT
PPT
Controller area network (CAN bus) ppt
PDF
Introduction to Avr Microcontrollers
PPTX
Digital signal processor architecture
PPTX
Arm cortex-m3 by-joe_bungo_arm
PDF
Arm Processor Based Speed Control Of BLDC Motor
PDF
Introduction to Microcontroller
PPTX
Embedded Systems - Training ppt
PPTX
8051 Microcontroller ppt
PPTX
Controller Area Network(CAN)
PPTX
Introduction to Embedded Systems I : Chapter 1
PPT
Embedded Systems : introduction
PPTX
Arm processor
PPT
E.s unit 6
PPTX
PIC Microcontrollers
Embedded System Basics
SOC Interconnects: AMBA & CoreConnect
CAN (Controller Area Network) Bus Protocol
STM32 MCU Family
Wi-Fi Esp8266 nodemcu
Controller area network (CAN bus) ppt
Introduction to Avr Microcontrollers
Digital signal processor architecture
Arm cortex-m3 by-joe_bungo_arm
Arm Processor Based Speed Control Of BLDC Motor
Introduction to Microcontroller
Embedded Systems - Training ppt
8051 Microcontroller ppt
Controller Area Network(CAN)
Introduction to Embedded Systems I : Chapter 1
Embedded Systems : introduction
Arm processor
E.s unit 6
PIC Microcontrollers
Ad

Viewers also liked (20)

PPT
Introduction to embedded systems
PPTX
PPTX
ISTQB Foundation Agile Tester 2014 Training, Agile SW Development
PPT
FreeRTOS Course - Queue Management
PPT
Free FreeRTOS Course-Task Management
PDF
Introduction to Embedded Systems a Practical Approach
PPT
FreeRTOS Course - Semaphore/Mutex Management
PDF
Let's Play STM32
PDF
Stm32 f4 first touch
PPTX
présentation STM32
PPTX
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
PDF
Introduction to Software Test Automation
PPTX
ISTQB Advanced Test Manager Training 2012 - Testing Process
PPTX
ISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
PDF
How to debug mruby (rubyconftw2014)
PDF
Stm32f4硬體週邊介紹
Introduction to embedded systems
ISTQB Foundation Agile Tester 2014 Training, Agile SW Development
FreeRTOS Course - Queue Management
Free FreeRTOS Course-Task Management
Introduction to Embedded Systems a Practical Approach
FreeRTOS Course - Semaphore/Mutex Management
Let's Play STM32
Stm32 f4 first touch
présentation STM32
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
Introduction to Software Test Automation
ISTQB Advanced Test Manager Training 2012 - Testing Process
ISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
How to debug mruby (rubyconftw2014)
Stm32f4硬體週邊介紹
Ad

Similar to Introduction to stm32-part1 (20)

PDF
Arm based controller - basic bootcamp
PPTX
Embedded System Practical Workshop using the ARM Processor
PDF
Arm cm3 architecture_and_programmer_model
PPTX
Introduction to computer architecture .pptx
PPTX
Lecture 1.pptx
PDF
18CS44-MODULE1-PPT.pdf
PPTX
UNIT 3.pptx
PDF
ARM Microcontrollers and Embedded Systems-Module 1_VTU
PPT
Necessity of 32-Bit Controllers
PPTX
Arm arc-2016
PPT
Arm processor
PDF
Introduction to Embedded System
PPT
ARM-Introduction, registers and processor states.ppt
PPT
12429908.ppt
PPTX
Mces MOD 1.pptx
PPT
Study on 32-bit Cortex - M3 Powered MCU: STM32F101
PDF
Embedded systems introduction
PPTX
Introduction_to_Embedded_Systems.pptx wur
PPTX
STM32 Networking for Embedded Technology.pptx
PPTX
ARM Cortex-M3 Training
Arm based controller - basic bootcamp
Embedded System Practical Workshop using the ARM Processor
Arm cm3 architecture_and_programmer_model
Introduction to computer architecture .pptx
Lecture 1.pptx
18CS44-MODULE1-PPT.pdf
UNIT 3.pptx
ARM Microcontrollers and Embedded Systems-Module 1_VTU
Necessity of 32-Bit Controllers
Arm arc-2016
Arm processor
Introduction to Embedded System
ARM-Introduction, registers and processor states.ppt
12429908.ppt
Mces MOD 1.pptx
Study on 32-bit Cortex - M3 Powered MCU: STM32F101
Embedded systems introduction
Introduction_to_Embedded_Systems.pptx wur
STM32 Networking for Embedded Technology.pptx
ARM Cortex-M3 Training

More from Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation) (6)

PDF
Introduction to state machines in Embedded Software Design
PDF
Embedded linux network device driver development
PPTX
Introduction to state machines in Embedded Software Design
Embedded linux network device driver development

Recently uploaded (20)

PDF
Interior Structure and Construction A1 NGYANQI
PPTX
Causes of Flooding by Slidesgo sdnl;asnjdl;asj.pptx
PPTX
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
PDF
Quality Control Management for RMG, Level- 4, Certificate
PDF
Test slideshare presentation for blog post
PPTX
CLASSIFICATION OF YARN- process, explanation
PPTX
Media And Information Literacy for Grade 12
PPTX
CLASS_11_BUSINESS_STUDIES_PPT_CHAPTER_1_Business_Trade_Commerce.pptx
PDF
GREEN BUILDING MATERIALS FOR SUISTAINABLE ARCHITECTURE AND BUILDING STUDY
PPTX
EDP Competencies-types, process, explanation
PPT
pump pump is a mechanism that is used to transfer a liquid from one place to ...
PPTX
Tenders & Contracts Works _ Services Afzal.pptx
PPTX
NEW EIA PART B - Group 5 (Section 50).pptx
DOCX
A Contemporary Luxury Villa in Dubai Jumeirah-2.docx
PDF
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
PPT
robotS AND ROBOTICSOF HUMANS AND MACHINES
PPTX
An introduction to AI in research and reference management
PPTX
AD Bungalow Case studies Sem 2.pptxvwewev
PDF
BRANDBOOK-Presidential Award Scheme-Kenya-2023
PPTX
DOC-20250430-WA0014._20250714_235747_0000.pptx
Interior Structure and Construction A1 NGYANQI
Causes of Flooding by Slidesgo sdnl;asnjdl;asj.pptx
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
Quality Control Management for RMG, Level- 4, Certificate
Test slideshare presentation for blog post
CLASSIFICATION OF YARN- process, explanation
Media And Information Literacy for Grade 12
CLASS_11_BUSINESS_STUDIES_PPT_CHAPTER_1_Business_Trade_Commerce.pptx
GREEN BUILDING MATERIALS FOR SUISTAINABLE ARCHITECTURE AND BUILDING STUDY
EDP Competencies-types, process, explanation
pump pump is a mechanism that is used to transfer a liquid from one place to ...
Tenders & Contracts Works _ Services Afzal.pptx
NEW EIA PART B - Group 5 (Section 50).pptx
A Contemporary Luxury Villa in Dubai Jumeirah-2.docx
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
robotS AND ROBOTICSOF HUMANS AND MACHINES
An introduction to AI in research and reference management
AD Bungalow Case studies Sem 2.pptxvwewev
BRANDBOOK-Presidential Award Scheme-Kenya-2023
DOC-20250430-WA0014._20250714_235747_0000.pptx

Introduction to stm32-part1

  • 2. Course Objective After completing this course, you will answer: What is ARM Cortex Processor? What is the STM32 SoC? What are STM32 building blocks? Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 3. Course Notes Set your cell phone to vibrate. I assume you know computer architecture. Ask any time. Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 4. Course References The Definitive Guide to the ARM Cortex-M3, 2 nd Edition www.arm.com www.st.com/stm32 www.doulos.com Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 5. Course Outline Introduction Cortex Overview CMSIS STM32 System Architecture Peripherals Low Power Operation Safety Features The Flash Module Development Tools Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 6. Course Outline Introduction Cortex Overview CMSIS STM32 System Architecture Peripherals Low Power Operation Safety Features The Flash Module Development Tools Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 7. CPU, Processor, and SoC Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 8. About ARM ARM = Advanced/Acorn RISC Machine Founded in 1990 CPU IPs, physical IPs, compilers, SoC infrastructure… Dominates 75% of embedded market Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 9. ARM Customers IDMs/IC vendors like: Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 10. ARM Overview Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 11. ARM by Architecture Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 12. ARM Application Processors Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 13. ARM Embedded Processors Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 14. ARM Secure/Specialities Processors Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 15. About ST Microelectronics Merge of SG Microelectronica and Thomson Semiconductors Founded in 1987 ICs, smart cards, microcontrollers… Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 16. Course Outline Introduction Cortex Overview CMSIS STM32 System Architecture Peripherals Low Power Operation Safety Features The Flash Module Development Tools Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 17. What is Cortex? Next generation ARM Processor Consists of: Classic CPU(s) System peripherals 3 series: A series: for complex applications and OS R series: for real-time systems M series: optimized for cost/power sensitive systems 15 performance levels: 0 lowest Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 18. Cortex CPU 32-bit RISC 16 registers 3 stages pipeline with branch prediction Load-store architecture Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 19. CPU Operating Modes Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 20. Thumb-2 Instruction Set 32-bit performance with 16-bit code density Need for non ANSI-C is minimum Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 21. Memory Map Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 22. Unaligned Memory Access Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 23. Bit Banding Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 24. Buses Code and Data buses Harvard architecture System bus Cortex control space Private peripheral bus On-chip debug system Bus matrix Connects the 1 st 3 buses to the external world Bus arbiters Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 25. System Timer 24-bit down counter Auto-reload and end of count interrupt Provide timer tick for OS Has 3 registers: Control & status Enable, select clock source… Reload value Current value Both reload and current registers should be initialized with period Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 26. Nested Vector Interrupt Controller Very low deterministic interrupt latency Nested interrupts ANSI C programmed Configurable by manufacture to the needed number of interrupts Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 27. NVIC Exception Entry and Exit Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 28. Handling Multiple Interrupts A HPI preempts a LPI (12 cycles needed) 6 cycles are needed to fetch new ISR address Tail chaining ensures minimum delay between interrupts in 3 cases: 2 interrupts raised at same time (6 cycles needed) LPI occurs at HPI exit (7 to 18 cycles needed) HPI occurs during push of LPI (6 cycles needed from HPI occurrence) Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 29. NVIC Configure and Usage Done on 3 steps: Configure the exception vector table Configure the NVIC registers Configure the peripherals Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 30. Configure the Exception Vector Table Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 31. Configure the NVIC Registers Set the priority of the interrupt Enable the interrupt source Internal exceptions are configured using system control and system priority User exceptions are configured using IRQ registers Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 32. Power Modes CPU enters sleep mode either by: WFI Wakes by an interrupt Executes an ISR WFE Wakes by an external event line SLEEPONEXT: Puts CPU back in sleep mode after ISR SEVONPEND: An ISR even if disabled can generate an event SLEEPDEEP: Halts peripherals as well like PLL Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 33. CoreSight Debug Support Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 34. Course Outline Introduction Cortex Overview CMSIS STM32 System Architecture Peripherals Low Power Operation Safety Features The Flash Module Development Tools Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 35. What is CMSIS? Cortex Microcontroller Software Interface Standard A vendor independent software layer This will ease porting and reusing of software MISRA compliant Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 36. CMSIS Structure Amr Ali Abdel-Naby@2011 Introduction to STM32
  • 37. File Structure core_cm3.h Cortex M3 global declarations core_cm3.c Cortex M3 global definitions core_cm3.x are tool independent. <device>.h To be included in application software system_<device>.h Device specific declarations system_<device>.c Device specific definitions Amr Ali Abdel-Naby@2011 Introduction to STM32

Editor's Notes

  • #2: * 07/16/96 * ##
  • #12: ISA: Instruction Set Architecture VFP: Vector Floating Point Jazelle: Extension to run Java Byte Code on ARM machines ARM ISA: 32-bit instructions Thumb ISA: 16-bit instructions Thumb-2 ISA: ARM + Thumb TrustZone: Security Extensions SIMD: Single Instruction Multiple Data NEON: Advanced SIMD Virtualization: Hardware Virtualization NVIC: Nested Vector Interrupt Controller WIC:Wakeup Interrupt Controller * 07/16/96 * ##
  • #13: They can execute complex operating systems. Phones, notebooks, PDAs, DTVs, set-top boxes… * 07/16/96 * ##
  • #14: Suitable for real-time behavior of power-sensitive applications Control systems, automotive, white goods… * 07/16/96 * ##
  • #15: SIMs, smart cards, electronic IDs, electronic payments… * 07/16/96 * ##
  • #19: N: Negative Z: Zero C: Carry V: Overflow Q: Saturated minimum/maximum result T: Thumb mode ICI: Interrupt continuable instruction  To support deterministic interrupt latency for multi-cycle instructions IT: If then  To support conditional execution (execute or NOP) T: Thumb mode  Always set to 1 ISR #: NVIC is integrated with core * 07/16/96 * ##
  • #20: Flat mode: Out of reset mode = Thread mode + Privileged Operations + Main Stack * 07/16/96 * ##
  • #21: DMIPS = Dhrystone MIPS, free benchmark to compare CPU perfromance * 07/16/96 * ##
  • #23: Aligned access (left, classical ARM) allows efficient access of variables without need of software libraries support but can waste up to 25% of variable space. Unaligned access (right, Cortex ARM) makes more efficient use of memory. Cortex supports both modes by hardware! * 07/16/96 * ##
  • #24: Bit manipulation without bit banding (left, classical ARM) needed a read, modify, write operations to change a single bit Bit banding manipulation (right, Cortex ARM) uses alias region to add * 07/16/96 * ##
  • #28: * 07/16/96 * ##
  • #31: Starts at the bottom of the address range at 0x00000004. Address 0x0000000 is used to store initial SP. The exception vector table stores addresses rather than instructions. The 1 st 15 are for the ones used by the Cortex core itself. * 07/16/96 * ##
  • #33: WFI: Wait for interrupt WFE: Wait for event * 07/16/96 * ##
  • #34: JTAG (classical ARM) only worked when CPU is halted. HW breakpoints are only two. Real-time trace can be supported using an Embedded Trace Module (ETM) at extra cost. CoreSight (Cortex ARM) can work with old JTAG interfaces! Hardware tracers built-in. Up to 8 HW breakpoints. Can debug in sleep modes. Synchronize CPU with timers when halted. * 07/16/96 * ##
  • #35: * 07/16/96 * ##
  • #37: CPAL is implemented by ARM to access the CPU HW MWAL defined by ARM but adapted by silicon vendors to access the SoC devices. It is not implemented yet. DPAL similar to CAPL but defined and implemented by silicon vendors. They use CAPL internally. * 07/16/96 * ##