IRQ_Handler:
sub lr, lr, #4
stmfd sp!, {lr}
// NEW BLOCK
@- save r5 in stack
stmfd sp!, {r5}
@- move stack pointer to r5
mov r5, r13
@- adjust r5 to point to return address
sub r5, r5, #8
// END
mrs r14, SPSR
stmfd sp!, {r14}
stmfd sp!, {r0}
ldr r14, =LPC_BASE_VIC
ldr r0 , [r14, #VIC_VectAddr]
msr CPSR_c, Mode_SVC
stmfd sp!, { r1-r3, r12, r14 }
mov r14, pc
bx r0
ldmia sp!, { r1-r3, r12, r14 }
msr CPSR_c, #I_Bit | Mode_IRQ
ldmia sp!, {r0}
ldmia sp!, {r14}
msr SPSR_cxsf, r14
// NEW BLOCK
@- restore r5 from stack
ldmia sp!, {r5}
// END
ldmia sp!, {pc}^
--- In l..., "jhvdb" wrote: >
> I wish to use the Watchdog Interrupt to debug the last code position where the
application crashed.
>
> I assume I have to do a "Stack Trace" or "Stack Unwinding"?
> Can anyone please help with an implementation using WINARM for this?
>
> I tried debugged lr, pc and stepped up from the stack pointer but non of the
debugs makes sense to me.
>
> I'm using the following IRQ entry code:
> sub lr, lr, #4
> stmfd sp!, {lr}
> mrs r14, SPSR
> stmfd sp!, {r14}
> stmfd sp!, {r0}
> ldr r14, =LPC_BASE_VIC
> ldr r0 , [r14, #VIC_VectAddr]
> msr CPSR_c, #Mode_SVC
> stmfd sp!, { r1-r3, r12, r14 }
> mov r14, pc
> bx r0
> ldmia sp!, { r1-r3, r12, r14 }
> msr CPSR_c, #I_Bit | Mode_IRQ
> ldmia sp!, {r0}
> ldmia sp!, {r14}
> msr SPSR_cxsf, r14
> ldmia sp!, {pc}^
>
Reply by jhvdb●October 5, 20102010-10-05
I wish to use the Watchdog Interrupt to debug the last code position where the
application crashed.
I assume I have to do a "Stack Trace" or "Stack Unwinding"?
Can anyone please help with an implementation using WINARM for this?
I tried debugged lr, pc and stepped up from the stack pointer but non of the
debugs makes sense to me.