SlideShare une entreprise Scribd logo
1  sur  22
ARM® Cortex™ M Bootup & CMSIS -
Part 2 / 3
Raahul Anand Raghavan, Lead Systems Architect,
Glyton Solutions
!1
Agenda
• Before We Proceed!
• System Init & Boot Sequence
• ISR / Vector Table
• What happens on a RESET ?
• Typical Cortex M boot up sequence
• CMSIS Core - System Init & Boot Perspective
• EFM® 32 ARM® Cortex M0+ Starter Kit
• Simplicity Studio IDE
• Hands On!
• Project & Folder structure
• Linker description
• EFM®32 CMSIS Start-Up , System Configuration & Application functionality
• Setting Breakpoints & Inspecting entry
• Whats in Part 3 ?
!2
Before We Proceed!
• This is part 2 of a 3 part presentation which would practically introduce
ARM® Cortex M boot up / system initialization & CMSIS interface
• Presentation is introductory and in depth coverage of topics is out of the
scope
• Involves Cortex M0 based EVM and a suitable IDE
• Code snapshots illustrated here are adopted from sample projects
packaged along with Simplicity Studio IDE by Silicon Labs
• Official Documentation from ARM®, Silicon Labs will override information
provided here. Treat official TRM’s as complete guides on Subject Matter
• ARM® Cortex™ M trademark - ARM Ltd
• EFM®32, Silicon Labs SDK etc are registered trademarks
!3
ISR / Vector Table
!4SP
Reset Handler
NMI
Hard Fault
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
Reserved
SVC
Reserved
PendSV
SysTick
External 0
.
External 1
.
External 495
0x00
0x04
0x08
0x0C
0x10
.
.
.
.
.
0x28
0x2C
0x30
0x34
0x38
0x3C
0x40
.
.
.
0x800
AddressException No
__isr_vector:	
.long __StackTop /* Top
of Stack */	
.long Reset_Handler /*
Reset Handler */	
.long NMI_Handler /* NMI
Handler */	
.long HardFault_Handler /* Hard
Fault Handler */	
.long Default_Handler /*
Reserved */	
.long Default_Handler /*
Reserved */	
.long Default_Handler /*
Reserved */	
.long Default_Handler /*
Reserved */	
.long Default_Handler /*
Reserved */	
.long Default_Handler /*
Reserved */	
.long Default_Handler /*
Reserved */	
.long SVC_Handler /*
SVCall Handler */	
.long Default_Handler /*
Reserved */	
.long Default_Handler /*
Reserved */	
.long PendSV_Handler /*
PendSV Handler */	
.long SysTick_Handler /*
SysTick Handler */	
!
/* External interrupts */	
.long DMA_IRQHandler /* 0 - DMA
*/	
.long GPIO_EVEN_IRQHandler /* 1
- GPIO_EVEN */	
.long TIMER0_IRQHandler /* 2 -
TIMER0 */	
.long ACMP0_IRQHandler /* 3 -
ACMP0 */	NA
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
.
.
.
.
CMSIS Startup File — startup_<device>.s — startup_gcc_efm32zg.s
What happens on a RESET ?
• Power on
• MCU brought out of reset
• ISR vector table placed @ 0x00
• MCU Core registers
• MSP loaded with address from 0x00
• PC loaded with reset_handler address from 0x04
• reset_handler
• Call SystemInit()
• Copy code from flash to RAM (EFM®32)
• Jump to __start / _mainCRTStartup for handling C runtime initialization
• Once CRT is setup, Jump to main(), application code entry point
!5
User ApplicationCRTCMSIS
Typical ARM® Cortex M Boot up Sequence
!6
• Typical boot up sequence pans across 3 stages
• CMSIS Start up code
• CRT Setup
• User application code (Uses Various CMSIS Interfaces to access MCU functionalities)
Reset_Handler
_start!
_mainCRTStartup!
main()!
SystemInit()
Copy Code from Flash to
RAM
exit!
(no return)
CMSIS Core API - System Init & Boot Perspective
CMSIS-Core
HAL(Systick,NVIC,SCB,MPU,FPU),system initialization,system
exception names,CPU specific intrinsic functions etc
System & Clock
Interrupts & Exceptions
NVIC_
Core Registers Access
CPU intrstruction
intrinsics
Systick
• SystemInit()
• SystemCoreClock
Update()
• System Core
Clock
• ClearPendingIRQ
• DecodePriority
• DisableIRQ
• EnableIRQ
• EncodePriority
• GetActive
• GetPendingIRQ
• GetPriority
• GetPriorityGrouping
• SetPendingIRQ
• SetPriority
• SetPriorityGrouping
• SystemReset
• __disable_fault_irq
• __disable_irq
• __enable_fault_irq
• __enable_Irq
• __get_APSR
• __get_BASEPRI
• __get_CONTROL
• __get_FAULTMASK
• __get_FPSCR
• __get_IPSR
• __get_MSP
• __get_PRIMASK
• __get_PSP
• __get_xPSR
• __set_BASEPRI
• __set_CONTROL
• __set_FAULTMASK
• __set_FPSCR
• __set_MSP
• __set_PRIMASK
• __set_PSP
• __BKPT
• __CKREX
• __CLZ
• __DMB
• __DSB
• __ISB
• __LDREXB
• __LDREXH
• __LDREXW
• __NOP
• __RBIT
• __REV
• __REV16
• __REVSH
• __ROR
• __SEV
• __SSAT
• __STREXB
• __STREXH
• __STREXW
• __USAT
• __WFE
• __WFI
• Systick_Config
EFM® 32 ARM® Cortex M0+ Starter Kit
!8
• Zero Gecko MCU from Silicon Labs, based on 32 Bit ARM® Cortex M0+
Architecture
• 32KB Flash - On chip
• 4KB RAM - On Chip
• On Board J-Link JTAG emulator
• Supports USB debugging and downloads to on chip flash
• Supports ARM® Standard 20 PIN DEBUG header which can be
configured in 3 different ways (IN/OUT/MCU)
• AEM (Advanced Energy monitoring) for precise voltage and current
consumption
• Support several on chip peripherals and low energy (energy efficient)
interfaces
Simplicity Studio IDE
!9
• Free IDE from Silicon Labs
• Comes loaded with a variety of tools for Cortex M (Not Limited to)
based MCU implementation from Silicon Labs
• Build and Binary file generation using GNU ARM toolchain
• Download binaries to flash using J-Link debugger (On Board in
this case)
• Debug Support (Core Register Watch, Breakpoints, single
stepping etc)
• Device Energy monitoring
• Refer to official documentation from Silicon Labs for complete
info
Sample Project in Simplicity Studio & Folder Structure
• EFM® 32 specific port of both
• startup_<device>.s > startup_gcc_efm32zg.s
• system_<device>.c > system_efm32zg.c
• Driver implementation
• Display and logic for retargeting IO (Redirect prinf() to Display)
• Capacitive touch & Utilities required
• EFM® 32 On Chip controllers & Peripherals
• Clock Management Unit (CMU),ADC,RTC,USART
• GPIO Configuration
• Build Artifacts folders for active build configuration
• Linker definition (*.ld)
• map file, hex and binaries
• Application Logic & Implementation
• main() entry point
• Invokes calls to CHIP_init() and other CMSIS interfaces as required
!10
Linker Description - 1 (STK3200_touch.ld)
!11
/* Linker script for Silicon Labs EFM32ZG devices */	
/* */	
/* This file is subject to the license terms as defined in ARM's */	
/* CMSIS END USER LICENSE AGREEMENT.pdf, governing the use of */	
/* Example Code. */	
/* */	
/* Silicon Laboratories, Inc. 2014 */	
MEMORY	
{	
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 32768	
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 4096	
}	
!
ENTRY(Reset_Handler)	
!SECTIONS	
{	
.text :	
{	
KEEP(*(.isr_vector))	
*(.text*)	
! KEEP(*(.init))	
KEEP(*(.fini))	
! /* .ctors */	
*crtbegin.o(.ctors)	
*crtbegin?.o(.ctors)	
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)	
*(SORT(.ctors.*))	
*(.ctors)	
! /* .dtors */	
*crtbegin.o(.dtors)	
*crtbegin?.o(.dtors)	
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)	
*(SORT(.dtors.*))	
*(.dtors)	
! *(.rodata*)	
! KEEP(*(.eh_frame*))	
} > FLASH	
• Defines Origin (Start Address and length)
for both FLASH & RAM
• Defines FLASH packaging
• isr_vector symbol is at the start
• KEEP directive ensures the specific
section is placed and will not be
removed even if there is no reference
• E N T RY ( R e s e t _ H a n d l e r ) d e fi n e s
reset_handler as entry point in the
image
Linker Description - 2 (STK3200_touch.ld)
!12
.ARM.extab : 	
{	
*(.ARM.extab* .gnu.linkonce.armextab.*)	
} > FLASH	
!
__exidx_start = .;	
.ARM.exidx :	
{	
*(.ARM.exidx* .gnu.linkonce.armexidx.*)	
} > FLASH	
.data : AT (__etext)	
{	
__data_start__ = .;	
*(vtable)	
*(.data*)	
. = ALIGN (4);	
*(.ram)	
! . = ALIGN(4);	
/* preinit data */	
PROVIDE_HIDDEN (__preinit_array_start = .);	
KEEP(*(.preinit_array))	
PROVIDE_HIDDEN (__preinit_array_end = .);	
! . = ALIGN(4);	
/* init data */	
PROVIDE_HIDDEN (__init_array_start = .);	
KEEP(*(SORT(.init_array.*)))	
KEEP(*(.init_array))	
PROVIDE_HIDDEN (__init_array_end = .);	
! . = ALIGN(4);	
/* finit data */	
PROVIDE_HIDDEN (__fini_array_start = .);	
KEEP(*(SORT(.fini_array.*)))	
KEEP(*(.fini_array))	
PROVIDE_HIDDEN (__fini_array_end = .);	
! . = ALIGN(4);	
/* All data end */	
__data_end__ = .;	
!} > RAM	
Defines FLASH packaging
• Defines sections that need to get placed in
RAM
Linker Description - 3 (STK3200_touch.ld)
!13
.heap :	
{	
__end__ = .;	
end = __end__;	
_end = __end__;	
*(.heap*)	
__HeapLimit = .;	
} > RAM	
!
/* .stack_dummy section doesn't contains any symbols. It is only	
* used for linker to calculate size of stack sections, and assign	
* values to stack symbols later */	
.stack_dummy :	
{	
*(.stack)	
} > RAM	
!
/* Set stack top to end of RAM, and stack limit move down by	
* size of stack_dummy section */	
__StackTop = ORIGIN(RAM) + LENGTH(RAM);	
__StackLimit = __StackTop - SIZEOF(.stack_dummy);	
PROVIDE(__stack = __StackTop);	
!
/* Check if data + heap + stack exceeds RAM limit */	
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")	
!
/* Check if FLASH usage exceeds FLASH size */	
ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !")	
}
Defines RAM sections
STACK definition.
Remember STACK grows down!!
ASSERTION’s to ensure there is no overflow
while adding sections to both FLASH & RAM
At the time of linking and image generation
in case if the size of sections to be placed
either in RAM or FLASH exceeds the size of
RAM or FLASH, then it gets asserted by
Linker
EFM®32 CMSIS Start-Up Code - 1
!14
Vector Table definition!
which is placed !
@ address starting !
from 0x00!
Refer pervious slides!
on Linker description
CMSIS Core files !
implementation.!
Based on standard!
Templates!
startup_<device>.s!
system_<device>.c
startup_gcc_efm32zg.s!
basically implements!
vector table , reset handler!
which in turn does !
systeminit
EFM®32 CMSIS Start-Up Code - 2
!15
SystemInit - Can be used to initialize
any specific system initialization as
soon as reset handler starts execution
This section performs FLASH to RAM
copy. __data_start__ & __data_end__
are defined in linker definition.Refer to
previous slides on LD
Once copy is done (FLASH>RAM) ,
jump to CRT entry point _start which in
turn will setup application stack, heap,
etc and then call applications main()
entry point
Remember sequence of steps when
MCU comes out of RESET
Load MSP with address in 0x00!
PC starts execution from address
placed in 0x04 (reset_handler) !
(Refer linker description file)
Reset_Handler starts execution
EFM®32 CMSIS System Configuration Code
!16
system_efm32zg.c implements!
CMSIS interfaces for majority !
clock configuration. As we had!
seen in the previous slide!
SystemInit(void) gets called from!
Reset_handler!
!
!
Interfaces defined here deal !
with a variety of other clock !
related functionality which can be !
invoked after entering main() also in!
a bare metal scenario when there is no!
embedded OS involved
EFM®32 Application Entry Point
!17
main() - Typical C Application entry
which implements application logic
CHIP_Init() performs any additional
MCU specific initialization!
!
DISPLAY_Init(), RETARGET_(),
CAPSENSE_Init() etc implement various
driver level interfaces which in turn call
CMSIS interfaces as required
Setting Breakpoints and Inspecting Entry Points - 1
!18
• Connect EFM® 32 kit to IDE!
• We can set PC = 0x0!
• In the Debug window, we can see that
0x0 is mapped to __isr_vector() just
as expected!
• So address 0x04 contains the actual
a d d r e s s o f r e s e t h a n d l e r
implementation!
• Remember, __isr_vector holds
addresses and not actual function
implementation
Setting Breakpoints and Inspecting Entry Points - 2
!19
• S e t a b r e a k p o i n t i n
Reset_Handler!
• Inspect PC and we can see
that PC = 0x2E50 and not
0x04!
• T h e a b o v e c o n fi r m s
__isr_vector contains
address and not actual
implementation!
• We can also confirm this /
c r o s s c h e c k w i t h
STK3200_touch.map file
generated
Setting Breakpoints and Inspecting Entry Points - 3
!20
• mainCRTStartup()
which setups CRT
application stack ,
heap etc
• Reset_handler
Setting Breakpoints and Inspecting Entry Points - 4
!21
• mainCRTStartup()
which setups CRT
application stack ,
heap etc
• Reset_handler
• main() , application
entry point !
• Continues to setup
required peripheral
driver which
internally use
various CMSIS
interface calls as
required
Whats in Part 3?
!22
• ARM® Cortex M debug architecture
• Expand further on CMSIS DAP
• Fundamentals of
• Breakpoints (H/W & S/W)
• Watchpoints
• Instruction Trace
• EFM®32 On board Segger J-Link debugger
• Concludes

Contenu connexe

Tendances

AAME ARM Techcon2013 003v02 Software Development
AAME ARM Techcon2013 003v02  Software DevelopmentAAME ARM Techcon2013 003v02  Software Development
AAME ARM Techcon2013 003v02 Software DevelopmentAnh Dung NGUYEN
 
AAME ARM Techcon2013 002v02 Advanced Features
AAME ARM Techcon2013 002v02 Advanced FeaturesAAME ARM Techcon2013 002v02 Advanced Features
AAME ARM Techcon2013 002v02 Advanced FeaturesAnh Dung NGUYEN
 
AAME ARM Techcon2013 005v02 System Startup
AAME ARM Techcon2013 005v02 System StartupAAME ARM Techcon2013 005v02 System Startup
AAME ARM Techcon2013 005v02 System StartupAnh Dung NGUYEN
 
Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.
Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.
Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.Atollic
 
Reliability, Availability and Serviceability on Linux
Reliability, Availability and Serviceability on LinuxReliability, Availability and Serviceability on Linux
Reliability, Availability and Serviceability on LinuxSamsung Open Source Group
 
AAME ARM Techcon2013 001v02 Architecture and Programmer's model
AAME ARM Techcon2013 001v02 Architecture and Programmer's modelAAME ARM Techcon2013 001v02 Architecture and Programmer's model
AAME ARM Techcon2013 001v02 Architecture and Programmer's modelAnh Dung NGUYEN
 
SOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC ToolsSOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC ToolsA B Shinde
 
ARM Processor architecture
ARM Processor  architectureARM Processor  architecture
ARM Processor architecturerajkciitr
 
1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC
1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC 1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC
1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC IEEE SSCS AlexSC
 
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC 02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC IEEE SSCS AlexSC
 
introduction to embedded systems part 1
introduction to embedded systems part 1introduction to embedded systems part 1
introduction to embedded systems part 1Hatem Abd El-Salam
 
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203Linaro
 
Introduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM ProcessorIntroduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM ProcessorDarling Jemima
 
LCA13: ARMv8 Status and Updates
LCA13: ARMv8 Status and UpdatesLCA13: ARMv8 Status and Updates
LCA13: ARMv8 Status and UpdatesLinaro
 

Tendances (20)

AAME ARM Techcon2013 003v02 Software Development
AAME ARM Techcon2013 003v02  Software DevelopmentAAME ARM Techcon2013 003v02  Software Development
AAME ARM Techcon2013 003v02 Software Development
 
Micro controller
Micro controllerMicro controller
Micro controller
 
AAME ARM Techcon2013 002v02 Advanced Features
AAME ARM Techcon2013 002v02 Advanced FeaturesAAME ARM Techcon2013 002v02 Advanced Features
AAME ARM Techcon2013 002v02 Advanced Features
 
AAME ARM Techcon2013 005v02 System Startup
AAME ARM Techcon2013 005v02 System StartupAAME ARM Techcon2013 005v02 System Startup
AAME ARM Techcon2013 005v02 System Startup
 
Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.
Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.
Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.
 
Day1
Day1Day1
Day1
 
Reliability, Availability and Serviceability on Linux
Reliability, Availability and Serviceability on LinuxReliability, Availability and Serviceability on Linux
Reliability, Availability and Serviceability on Linux
 
AAME ARM Techcon2013 001v02 Architecture and Programmer's model
AAME ARM Techcon2013 001v02 Architecture and Programmer's modelAAME ARM Techcon2013 001v02 Architecture and Programmer's model
AAME ARM Techcon2013 001v02 Architecture and Programmer's model
 
CPU Architecture
CPU ArchitectureCPU Architecture
CPU Architecture
 
SOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC ToolsSOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC Tools
 
Unit vi (1)
Unit vi (1)Unit vi (1)
Unit vi (1)
 
ARM Processor architecture
ARM Processor  architectureARM Processor  architecture
ARM Processor architecture
 
1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC
1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC 1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC
1: Interfacing using ARM Cortex M4 || IEEE SSCS AlexSC
 
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC 02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
 
introduction to embedded systems part 1
introduction to embedded systems part 1introduction to embedded systems part 1
introduction to embedded systems part 1
 
Processors selection
Processors selectionProcessors selection
Processors selection
 
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203
 
EC8791 UML-model train controller
EC8791 UML-model train controllerEC8791 UML-model train controller
EC8791 UML-model train controller
 
Introduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM ProcessorIntroduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM Processor
 
LCA13: ARMv8 Status and Updates
LCA13: ARMv8 Status and UpdatesLCA13: ARMv8 Status and Updates
LCA13: ARMv8 Status and Updates
 

En vedette

Chuchon luque, edwin arturo
Chuchon luque, edwin arturoChuchon luque, edwin arturo
Chuchon luque, edwin arturoAries2015
 
La tecnología en la sociedad contemporánea
La tecnología en la sociedad contemporáneaLa tecnología en la sociedad contemporánea
La tecnología en la sociedad contemporáneaRodrigo Juarez
 
Resume_Aug_2015_Amended_1
Resume_Aug_2015_Amended_1Resume_Aug_2015_Amended_1
Resume_Aug_2015_Amended_1Jonathan Mix
 
世界報紙頭條1101
世界報紙頭條1101世界報紙頭條1101
世界報紙頭條1101中 央社
 
کاربرد هیدرولیک برای خودروها
کاربرد هیدرولیک برای خودروهاکاربرد هیدرولیک برای خودروها
کاربرد هیدرولیک برای خودروهاmansour abolghasemi
 
Relacion entre ciencia, cultura y tecnología
Relacion entre ciencia, cultura y tecnologíaRelacion entre ciencia, cultura y tecnología
Relacion entre ciencia, cultura y tecnologíaRodrigo Juarez
 
Royal Enfield India Social Media Analysis Q4 2015
Royal Enfield India Social Media Analysis Q4 2015Royal Enfield India Social Media Analysis Q4 2015
Royal Enfield India Social Media Analysis Q4 2015Unmetric
 
Documento: El Salvador año político 2015-2016
Documento: El Salvador año político 2015-2016Documento: El Salvador año político 2015-2016
Documento: El Salvador año político 2015-2016FUSADES
 
Consecuencias impacto ambiental (contaminacion)
Consecuencias impacto ambiental (contaminacion)Consecuencias impacto ambiental (contaminacion)
Consecuencias impacto ambiental (contaminacion)Nohemi Castillo
 
Tailoring your tone. Charity content marketing conference, 28 April 2016
Tailoring your tone. Charity content marketing conference, 28 April 2016Tailoring your tone. Charity content marketing conference, 28 April 2016
Tailoring your tone. Charity content marketing conference, 28 April 2016CharityComms
 
Construcción de una pirámide de población
Construcción de una pirámide de poblaciónConstrucción de una pirámide de población
Construcción de una pirámide de poblaciónDaniel Gómez Valle
 
A project report on advertising effectiveness
A project report on advertising effectivenessA project report on advertising effectiveness
A project report on advertising effectivenessProjects Kart
 

En vedette (16)

Cristo rey-b
Cristo rey-bCristo rey-b
Cristo rey-b
 
Chuchon luque, edwin arturo
Chuchon luque, edwin arturoChuchon luque, edwin arturo
Chuchon luque, edwin arturo
 
La tecnología en la sociedad contemporánea
La tecnología en la sociedad contemporáneaLa tecnología en la sociedad contemporánea
La tecnología en la sociedad contemporánea
 
Resume_Aug_2015_Amended_1
Resume_Aug_2015_Amended_1Resume_Aug_2015_Amended_1
Resume_Aug_2015_Amended_1
 
世界報紙頭條1101
世界報紙頭條1101世界報紙頭條1101
世界報紙頭條1101
 
کاربرد هیدرولیک برای خودروها
کاربرد هیدرولیک برای خودروهاکاربرد هیدرولیک برای خودروها
کاربرد هیدرولیک برای خودروها
 
Relacion entre ciencia, cultura y tecnología
Relacion entre ciencia, cultura y tecnologíaRelacion entre ciencia, cultura y tecnología
Relacion entre ciencia, cultura y tecnología
 
Solsystemet
SolsystemetSolsystemet
Solsystemet
 
Royal Enfield India Social Media Analysis Q4 2015
Royal Enfield India Social Media Analysis Q4 2015Royal Enfield India Social Media Analysis Q4 2015
Royal Enfield India Social Media Analysis Q4 2015
 
Modal verbs
Modal verbsModal verbs
Modal verbs
 
Documento: El Salvador año político 2015-2016
Documento: El Salvador año político 2015-2016Documento: El Salvador año político 2015-2016
Documento: El Salvador año político 2015-2016
 
Poblacion nueva
Poblacion nuevaPoblacion nueva
Poblacion nueva
 
Consecuencias impacto ambiental (contaminacion)
Consecuencias impacto ambiental (contaminacion)Consecuencias impacto ambiental (contaminacion)
Consecuencias impacto ambiental (contaminacion)
 
Tailoring your tone. Charity content marketing conference, 28 April 2016
Tailoring your tone. Charity content marketing conference, 28 April 2016Tailoring your tone. Charity content marketing conference, 28 April 2016
Tailoring your tone. Charity content marketing conference, 28 April 2016
 
Construcción de una pirámide de población
Construcción de una pirámide de poblaciónConstrucción de una pirámide de población
Construcción de una pirámide de población
 
A project report on advertising effectiveness
A project report on advertising effectivenessA project report on advertising effectiveness
A project report on advertising effectiveness
 

Similaire à ARM® Cortex™ M Bootup_CMSIS_Part_2_3

Improving app performance using .Net Core 3.0
Improving app performance using .Net Core 3.0Improving app performance using .Net Core 3.0
Improving app performance using .Net Core 3.0Richard Banks
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013Wave Digitech
 
Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationAmrutaMehata
 
Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOSICS
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptxPratik Gohel
 
Auditing the Opensource Kernels
Auditing the Opensource KernelsAuditing the Opensource Kernels
Auditing the Opensource KernelsSilvio Cesare
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scopeArshit Rai
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scopeArshit Rai
 
Week1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC BeginWeek1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC Begin敬倫 林
 
Let's Play STM32
Let's Play STM32Let's Play STM32
Let's Play STM32Jay Chen
 
Tank water level & monitoring solution based on the STM32L476 MCU
Tank water level & monitoring solution based on the STM32L476 MCUTank water level & monitoring solution based on the STM32L476 MCU
Tank water level & monitoring solution based on the STM32L476 MCUJulio César Carrasquel
 
Virtual platform
Virtual platformVirtual platform
Virtual platformsean chen
 
Track 5 session 3 - st dev con 2016 - mechanisms for trusted code execution...
Track 5   session 3 - st dev con 2016 - mechanisms for trusted code execution...Track 5   session 3 - st dev con 2016 - mechanisms for trusted code execution...
Track 5 session 3 - st dev con 2016 - mechanisms for trusted code execution...ST_World
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -evechiportal
 
Developing micro controller applications
Developing micro controller applicationsDeveloping micro controller applications
Developing micro controller applicationsSteve Mylroie
 
(SAS) UNIX X Command Tips and Tricks
(SAS) UNIX X Command Tips and Tricks(SAS) UNIX X Command Tips and Tricks
(SAS) UNIX X Command Tips and TricksDavid Horvath
 
New Zephyr features: LWM2M / FOTA Framework - SFO17-113
New Zephyr features: LWM2M / FOTA Framework - SFO17-113New Zephyr features: LWM2M / FOTA Framework - SFO17-113
New Zephyr features: LWM2M / FOTA Framework - SFO17-113Linaro
 
Lcu14 101- coresight overview
Lcu14 101- coresight overviewLcu14 101- coresight overview
Lcu14 101- coresight overviewLinaro
 

Similaire à ARM® Cortex™ M Bootup_CMSIS_Part_2_3 (20)

Improving app performance using .Net Core 3.0
Improving app performance using .Net Core 3.0Improving app performance using .Net Core 3.0
Improving app performance using .Net Core 3.0
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organization
 
Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOS
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptx
 
Auditing the Opensource Kernels
Auditing the Opensource KernelsAuditing the Opensource Kernels
Auditing the Opensource Kernels
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scope
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scope
 
Week1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC BeginWeek1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC Begin
 
Let's Play STM32
Let's Play STM32Let's Play STM32
Let's Play STM32
 
Tank water level & monitoring solution based on the STM32L476 MCU
Tank water level & monitoring solution based on the STM32L476 MCUTank water level & monitoring solution based on the STM32L476 MCU
Tank water level & monitoring solution based on the STM32L476 MCU
 
Virtual platform
Virtual platformVirtual platform
Virtual platform
 
Track 5 session 3 - st dev con 2016 - mechanisms for trusted code execution...
Track 5   session 3 - st dev con 2016 - mechanisms for trusted code execution...Track 5   session 3 - st dev con 2016 - mechanisms for trusted code execution...
Track 5 session 3 - st dev con 2016 - mechanisms for trusted code execution...
 
STM -32
STM -32STM -32
STM -32
 
learning STM -32
learning STM -32 learning STM -32
learning STM -32
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
 
Developing micro controller applications
Developing micro controller applicationsDeveloping micro controller applications
Developing micro controller applications
 
(SAS) UNIX X Command Tips and Tricks
(SAS) UNIX X Command Tips and Tricks(SAS) UNIX X Command Tips and Tricks
(SAS) UNIX X Command Tips and Tricks
 
New Zephyr features: LWM2M / FOTA Framework - SFO17-113
New Zephyr features: LWM2M / FOTA Framework - SFO17-113New Zephyr features: LWM2M / FOTA Framework - SFO17-113
New Zephyr features: LWM2M / FOTA Framework - SFO17-113
 
Lcu14 101- coresight overview
Lcu14 101- coresight overviewLcu14 101- coresight overview
Lcu14 101- coresight overview
 

Dernier

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsBert Jan Schrijver
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...masabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 

Dernier (20)

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 

ARM® Cortex™ M Bootup_CMSIS_Part_2_3

  • 1. ARM® Cortex™ M Bootup & CMSIS - Part 2 / 3 Raahul Anand Raghavan, Lead Systems Architect, Glyton Solutions !1
  • 2. Agenda • Before We Proceed! • System Init & Boot Sequence • ISR / Vector Table • What happens on a RESET ? • Typical Cortex M boot up sequence • CMSIS Core - System Init & Boot Perspective • EFM® 32 ARM® Cortex M0+ Starter Kit • Simplicity Studio IDE • Hands On! • Project & Folder structure • Linker description • EFM®32 CMSIS Start-Up , System Configuration & Application functionality • Setting Breakpoints & Inspecting entry • Whats in Part 3 ? !2
  • 3. Before We Proceed! • This is part 2 of a 3 part presentation which would practically introduce ARM® Cortex M boot up / system initialization & CMSIS interface • Presentation is introductory and in depth coverage of topics is out of the scope • Involves Cortex M0 based EVM and a suitable IDE • Code snapshots illustrated here are adopted from sample projects packaged along with Simplicity Studio IDE by Silicon Labs • Official Documentation from ARM®, Silicon Labs will override information provided here. Treat official TRM’s as complete guides on Subject Matter • ARM® Cortex™ M trademark - ARM Ltd • EFM®32, Silicon Labs SDK etc are registered trademarks !3
  • 4. ISR / Vector Table !4SP Reset Handler NMI Hard Fault Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved SVC Reserved PendSV SysTick External 0 . External 1 . External 495 0x00 0x04 0x08 0x0C 0x10 . . . . . 0x28 0x2C 0x30 0x34 0x38 0x3C 0x40 . . . 0x800 AddressException No __isr_vector: .long __StackTop /* Top of Stack */ .long Reset_Handler /* Reset Handler */ .long NMI_Handler /* NMI Handler */ .long HardFault_Handler /* Hard Fault Handler */ .long Default_Handler /* Reserved */ .long Default_Handler /* Reserved */ .long Default_Handler /* Reserved */ .long Default_Handler /* Reserved */ .long Default_Handler /* Reserved */ .long Default_Handler /* Reserved */ .long Default_Handler /* Reserved */ .long SVC_Handler /* SVCall Handler */ .long Default_Handler /* Reserved */ .long Default_Handler /* Reserved */ .long PendSV_Handler /* PendSV Handler */ .long SysTick_Handler /* SysTick Handler */ ! /* External interrupts */ .long DMA_IRQHandler /* 0 - DMA */ .long GPIO_EVEN_IRQHandler /* 1 - GPIO_EVEN */ .long TIMER0_IRQHandler /* 2 - TIMER0 */ .long ACMP0_IRQHandler /* 3 - ACMP0 */ NA 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 . . . . CMSIS Startup File — startup_<device>.s — startup_gcc_efm32zg.s
  • 5. What happens on a RESET ? • Power on • MCU brought out of reset • ISR vector table placed @ 0x00 • MCU Core registers • MSP loaded with address from 0x00 • PC loaded with reset_handler address from 0x04 • reset_handler • Call SystemInit() • Copy code from flash to RAM (EFM®32) • Jump to __start / _mainCRTStartup for handling C runtime initialization • Once CRT is setup, Jump to main(), application code entry point !5
  • 6. User ApplicationCRTCMSIS Typical ARM® Cortex M Boot up Sequence !6 • Typical boot up sequence pans across 3 stages • CMSIS Start up code • CRT Setup • User application code (Uses Various CMSIS Interfaces to access MCU functionalities) Reset_Handler _start! _mainCRTStartup! main()! SystemInit() Copy Code from Flash to RAM exit! (no return)
  • 7. CMSIS Core API - System Init & Boot Perspective CMSIS-Core HAL(Systick,NVIC,SCB,MPU,FPU),system initialization,system exception names,CPU specific intrinsic functions etc System & Clock Interrupts & Exceptions NVIC_ Core Registers Access CPU intrstruction intrinsics Systick • SystemInit() • SystemCoreClock Update() • System Core Clock • ClearPendingIRQ • DecodePriority • DisableIRQ • EnableIRQ • EncodePriority • GetActive • GetPendingIRQ • GetPriority • GetPriorityGrouping • SetPendingIRQ • SetPriority • SetPriorityGrouping • SystemReset • __disable_fault_irq • __disable_irq • __enable_fault_irq • __enable_Irq • __get_APSR • __get_BASEPRI • __get_CONTROL • __get_FAULTMASK • __get_FPSCR • __get_IPSR • __get_MSP • __get_PRIMASK • __get_PSP • __get_xPSR • __set_BASEPRI • __set_CONTROL • __set_FAULTMASK • __set_FPSCR • __set_MSP • __set_PRIMASK • __set_PSP • __BKPT • __CKREX • __CLZ • __DMB • __DSB • __ISB • __LDREXB • __LDREXH • __LDREXW • __NOP • __RBIT • __REV • __REV16 • __REVSH • __ROR • __SEV • __SSAT • __STREXB • __STREXH • __STREXW • __USAT • __WFE • __WFI • Systick_Config
  • 8. EFM® 32 ARM® Cortex M0+ Starter Kit !8 • Zero Gecko MCU from Silicon Labs, based on 32 Bit ARM® Cortex M0+ Architecture • 32KB Flash - On chip • 4KB RAM - On Chip • On Board J-Link JTAG emulator • Supports USB debugging and downloads to on chip flash • Supports ARM® Standard 20 PIN DEBUG header which can be configured in 3 different ways (IN/OUT/MCU) • AEM (Advanced Energy monitoring) for precise voltage and current consumption • Support several on chip peripherals and low energy (energy efficient) interfaces
  • 9. Simplicity Studio IDE !9 • Free IDE from Silicon Labs • Comes loaded with a variety of tools for Cortex M (Not Limited to) based MCU implementation from Silicon Labs • Build and Binary file generation using GNU ARM toolchain • Download binaries to flash using J-Link debugger (On Board in this case) • Debug Support (Core Register Watch, Breakpoints, single stepping etc) • Device Energy monitoring • Refer to official documentation from Silicon Labs for complete info
  • 10. Sample Project in Simplicity Studio & Folder Structure • EFM® 32 specific port of both • startup_<device>.s > startup_gcc_efm32zg.s • system_<device>.c > system_efm32zg.c • Driver implementation • Display and logic for retargeting IO (Redirect prinf() to Display) • Capacitive touch & Utilities required • EFM® 32 On Chip controllers & Peripherals • Clock Management Unit (CMU),ADC,RTC,USART • GPIO Configuration • Build Artifacts folders for active build configuration • Linker definition (*.ld) • map file, hex and binaries • Application Logic & Implementation • main() entry point • Invokes calls to CHIP_init() and other CMSIS interfaces as required !10
  • 11. Linker Description - 1 (STK3200_touch.ld) !11 /* Linker script for Silicon Labs EFM32ZG devices */ /* */ /* This file is subject to the license terms as defined in ARM's */ /* CMSIS END USER LICENSE AGREEMENT.pdf, governing the use of */ /* Example Code. */ /* */ /* Silicon Laboratories, Inc. 2014 */ MEMORY { FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 32768 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 4096 } ! ENTRY(Reset_Handler) !SECTIONS { .text : { KEEP(*(.isr_vector)) *(.text*) ! KEEP(*(.init)) KEEP(*(.fini)) ! /* .ctors */ *crtbegin.o(.ctors) *crtbegin?.o(.ctors) *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) *(SORT(.ctors.*)) *(.ctors) ! /* .dtors */ *crtbegin.o(.dtors) *crtbegin?.o(.dtors) *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) *(SORT(.dtors.*)) *(.dtors) ! *(.rodata*) ! KEEP(*(.eh_frame*)) } > FLASH • Defines Origin (Start Address and length) for both FLASH & RAM • Defines FLASH packaging • isr_vector symbol is at the start • KEEP directive ensures the specific section is placed and will not be removed even if there is no reference • E N T RY ( R e s e t _ H a n d l e r ) d e fi n e s reset_handler as entry point in the image
  • 12. Linker Description - 2 (STK3200_touch.ld) !12 .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } > FLASH ! __exidx_start = .; .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } > FLASH .data : AT (__etext) { __data_start__ = .; *(vtable) *(.data*) . = ALIGN (4); *(.ram) ! . = ALIGN(4); /* preinit data */ PROVIDE_HIDDEN (__preinit_array_start = .); KEEP(*(.preinit_array)) PROVIDE_HIDDEN (__preinit_array_end = .); ! . = ALIGN(4); /* init data */ PROVIDE_HIDDEN (__init_array_start = .); KEEP(*(SORT(.init_array.*))) KEEP(*(.init_array)) PROVIDE_HIDDEN (__init_array_end = .); ! . = ALIGN(4); /* finit data */ PROVIDE_HIDDEN (__fini_array_start = .); KEEP(*(SORT(.fini_array.*))) KEEP(*(.fini_array)) PROVIDE_HIDDEN (__fini_array_end = .); ! . = ALIGN(4); /* All data end */ __data_end__ = .; !} > RAM Defines FLASH packaging • Defines sections that need to get placed in RAM
  • 13. Linker Description - 3 (STK3200_touch.ld) !13 .heap : { __end__ = .; end = __end__; _end = __end__; *(.heap*) __HeapLimit = .; } > RAM ! /* .stack_dummy section doesn't contains any symbols. It is only * used for linker to calculate size of stack sections, and assign * values to stack symbols later */ .stack_dummy : { *(.stack) } > RAM ! /* Set stack top to end of RAM, and stack limit move down by * size of stack_dummy section */ __StackTop = ORIGIN(RAM) + LENGTH(RAM); __StackLimit = __StackTop - SIZEOF(.stack_dummy); PROVIDE(__stack = __StackTop); ! /* Check if data + heap + stack exceeds RAM limit */ ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") ! /* Check if FLASH usage exceeds FLASH size */ ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !") } Defines RAM sections STACK definition. Remember STACK grows down!! ASSERTION’s to ensure there is no overflow while adding sections to both FLASH & RAM At the time of linking and image generation in case if the size of sections to be placed either in RAM or FLASH exceeds the size of RAM or FLASH, then it gets asserted by Linker
  • 14. EFM®32 CMSIS Start-Up Code - 1 !14 Vector Table definition! which is placed ! @ address starting ! from 0x00! Refer pervious slides! on Linker description CMSIS Core files ! implementation.! Based on standard! Templates! startup_<device>.s! system_<device>.c startup_gcc_efm32zg.s! basically implements! vector table , reset handler! which in turn does ! systeminit
  • 15. EFM®32 CMSIS Start-Up Code - 2 !15 SystemInit - Can be used to initialize any specific system initialization as soon as reset handler starts execution This section performs FLASH to RAM copy. __data_start__ & __data_end__ are defined in linker definition.Refer to previous slides on LD Once copy is done (FLASH>RAM) , jump to CRT entry point _start which in turn will setup application stack, heap, etc and then call applications main() entry point Remember sequence of steps when MCU comes out of RESET Load MSP with address in 0x00! PC starts execution from address placed in 0x04 (reset_handler) ! (Refer linker description file) Reset_Handler starts execution
  • 16. EFM®32 CMSIS System Configuration Code !16 system_efm32zg.c implements! CMSIS interfaces for majority ! clock configuration. As we had! seen in the previous slide! SystemInit(void) gets called from! Reset_handler! ! ! Interfaces defined here deal ! with a variety of other clock ! related functionality which can be ! invoked after entering main() also in! a bare metal scenario when there is no! embedded OS involved
  • 17. EFM®32 Application Entry Point !17 main() - Typical C Application entry which implements application logic CHIP_Init() performs any additional MCU specific initialization! ! DISPLAY_Init(), RETARGET_(), CAPSENSE_Init() etc implement various driver level interfaces which in turn call CMSIS interfaces as required
  • 18. Setting Breakpoints and Inspecting Entry Points - 1 !18 • Connect EFM® 32 kit to IDE! • We can set PC = 0x0! • In the Debug window, we can see that 0x0 is mapped to __isr_vector() just as expected! • So address 0x04 contains the actual a d d r e s s o f r e s e t h a n d l e r implementation! • Remember, __isr_vector holds addresses and not actual function implementation
  • 19. Setting Breakpoints and Inspecting Entry Points - 2 !19 • S e t a b r e a k p o i n t i n Reset_Handler! • Inspect PC and we can see that PC = 0x2E50 and not 0x04! • T h e a b o v e c o n fi r m s __isr_vector contains address and not actual implementation! • We can also confirm this / c r o s s c h e c k w i t h STK3200_touch.map file generated
  • 20. Setting Breakpoints and Inspecting Entry Points - 3 !20 • mainCRTStartup() which setups CRT application stack , heap etc • Reset_handler
  • 21. Setting Breakpoints and Inspecting Entry Points - 4 !21 • mainCRTStartup() which setups CRT application stack , heap etc • Reset_handler • main() , application entry point ! • Continues to setup required peripheral driver which internally use various CMSIS interface calls as required
  • 22. Whats in Part 3? !22 • ARM® Cortex M debug architecture • Expand further on CMSIS DAP • Fundamentals of • Breakpoints (H/W & S/W) • Watchpoints • Instruction Trace • EFM®32 On board Segger J-Link debugger • Concludes