SlideShare a Scribd company logo
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

More Related Content

What's hot

AAME ARM Techcon2013 003v02 Software Development
AAME ARM Techcon2013 003v02  Software DevelopmentAAME ARM Techcon2013 003v02  Software Development
AAME ARM Techcon2013 003v02 Software Development
Anh Dung NGUYEN
 
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
Anh Dung NGUYEN
 
AAME ARM Techcon2013 005v02 System Startup
AAME ARM Techcon2013 005v02 System StartupAAME ARM Techcon2013 005v02 System Startup
AAME ARM Techcon2013 005v02 System Startup
Anh 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
 
Day1
Day1Day1
Reliability, Availability and Serviceability on Linux
Reliability, Availability and Serviceability on LinuxReliability, Availability and Serviceability on Linux
Reliability, Availability and Serviceability on Linux
Samsung 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 model
Anh Dung NGUYEN
 
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
A B Shinde
 
Unit vi (1)
Unit vi (1)Unit vi (1)
Unit vi (1)
Siva Nageswararao
 
ARM Processor architecture
ARM Processor  architectureARM Processor  architecture
ARM Processor architecture
rajkciitr
 
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 1
Hatem Abd El-Salam
 
Processors selection
Processors selectionProcessors selection
Processors selection
Pradeep Shankhwar
 
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
Linaro
 
EC8791 UML-model train controller
EC8791 UML-model train controllerEC8791 UML-model train controller
EC8791 UML-model train controller
RajalakshmiSermadurai
 
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
Darling Jemima
 
LCA13: ARMv8 Status and Updates
LCA13: ARMv8 Status and UpdatesLCA13: ARMv8 Status and Updates
LCA13: ARMv8 Status and Updates
Linaro
 

What's hot (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
 

Viewers also liked

Cristo rey-b
Cristo rey-bCristo rey-b
Cristo rey-b
P Sabana Grande
 
Chuchon luque, edwin arturo
Chuchon luque, edwin arturoChuchon luque, edwin arturo
Chuchon luque, edwin arturo
Aries2015
 
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
Rodrigo Juarez
 
Resume_Aug_2015_Amended_1
Resume_Aug_2015_Amended_1Resume_Aug_2015_Amended_1
Resume_Aug_2015_Amended_1
Jonathan 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ía
Rodrigo Juarez
 
Solsystemet
SolsystemetSolsystemet
Solsystemet
Tommy Sannes
 
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
Unmetric
 
Modal verbs
Modal verbsModal verbs
Modal verbs
fcabanillasa
 
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
FUSADES
 
Poblacion nueva
Poblacion nuevaPoblacion nueva
Poblacion nueva
Nohemi Castillo
 
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 2016
CharityComms
 
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
Daniel 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 effectiveness
Projects Kart
 

Viewers also liked (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
 

Similar to 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.0
Richard Banks
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
Wave 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 organization
AmrutaMehata
 
Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOS
ICS
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptx
Pratik Gohel
 
Auditing the Opensource Kernels
Auditing the Opensource KernelsAuditing the Opensource Kernels
Auditing the Opensource Kernels
Silvio 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 scope
Arshit 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 scope
Arshit 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 STM32
Jay 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 MCU
Julio César Carrasquel
 
Virtual platform
Virtual platformVirtual platform
Virtual platform
sean 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
 
learning STM -32
learning STM -32 learning STM -32
learning STM -32
SeoTechnoscripts
 
STM -32
STM -32STM -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
chiportal
 
Developing micro controller applications
Developing micro controller applicationsDeveloping micro controller applications
Developing micro controller applications
Steve 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 Tricks
David 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-113
Linaro
 
Lcu14 101- coresight overview
Lcu14 101- coresight overviewLcu14 101- coresight overview
Lcu14 101- coresight overview
Linaro
 

Similar to 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...
 
learning STM -32
learning STM -32 learning STM -32
learning STM -32
 
STM -32
STM -32STM -32
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
 

Recently uploaded

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 

Recently uploaded (20)

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 

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