Hard fault invalid state
I'm trying to inject a simple wrapper around my timer interrput handler written in C - primarily for debug purposes to simplify debugging the state of registers and stack before the C code gets in and messes up the stack and state pushing all the junk it pushes to selectively save registers it's going to mess with etc. I just injected a little assembly (below) to forward the exception to my "real" handler giving me a break point prior to the 'C' code (vector table set to point to this wrapper).
I can run this in the debugger and I can break on the ldr instruction but if I proceed from there (either continue or single step) I end up in the hard fault hander with HFSR: 0x40000000 and CFSR: 0x20000 which seems to indicate and "invalid state" fault.
I'm fairly new to ARM so I'm sure it's something simple but it's got me beat.
NOTE: If I just set the vector table to point directly to my 'C' function everything works just fine - I end up in the 'C' function and everything operates as expected.
Any help would be appreciated.
Shawn
.section .text.TIM6_IRQHandler_Wrapper
TIM6_IRQHandler_Wrapper:
ldr r0, =TIM6_IRQHandler
add r0, #1
bx r0
.size TIM6_IRQHandler_Wrapper, .-TIM6_IRQHandler_Wrapper