
















































Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!

















































Example Program Requirements & Design ISR count (^) Main (does initialization, then updates LED based on count) SW RGB LED Global Variable ISR Task
▪ Can see registers, stack, source code, disassembly (object code) ▪ Note: Compiler may generate code for function entry ▪ Place breakpoint on Handler function declaration line in source code, not at first line of function code
ENTERING AN EXCEPTION HANDLER
▪ Load Multiple (LDM), Store Multiple (STM), Push, Pop, MULS (32 cycles for some CPU core implementations)
▪ abandons the instruction ▪ responds to the interrupt ▪ executes the ISR ▪ returns from interrupt ▪ restarts the abandoned instruction
3. Switch to Handler/Privileged Mode
Thread Mode. MSP or PSP. Handler Mode MSP Reset Starting Exception Processing Exception Processing Completed
Handler and Privileged Mode Mode changed to Handler. Was already using MSP
4. Load PC With Address Of Exception Handler
Memory Address Value 0x0000_0000 Initial Stack Pointer 0x0000_0004 Reset 0x0000_0008 NMI_IRQHandler … IRQ0_Handler IRQ1_Handler … Reset: … NMI_IRQHandler: … IRQ0_Handler: … IRQ1_Handler:
Can Examine Vector Table With Debugger
Exception number IRQ number Vector Offset Initial SP 0x 1 Reset 0x 2 - 14 NMI 0x 3 - 13 HardFault 0x0C 4 Reserved 0x 5 6 7 8 9 10 11 - 5 SVCall 0x2C 12 Reserved 13 14 - 2 PendSV 0x 15 - 1 SysTick 0x3C 16 0 IRQ0 0x 17 1 IRQ1 0x 18 2 IRQ2 0x
.. 16+n n IRQn 0x40+4n