I have a hard fault when running my code, and the result of the hard fault is :
[Hard Fault Handler]
R0 = 4000000
R1 = 1
R2 = 20003fe0
R3 = 40013c00
R12 = 0
LR = 8014acd
PC = 8019474
PSR = 100022c
All values are in hexa. The thing I don't understand is that CFSR tells me there is a precise bus error and that BFSR is valid ... but the value in BFSR is obviously not valid.
It always trigger while entering a timer interrupt, which is coded as this :
if (TIM_GetITStatus(TIM2, TIM_IT_Update) == SET)
[a few lines of code that modify a variable]
if (TIM_GetITStatus(TIM2, TIM_IT_CC3) == SET)
[a few lines of code too, but this is never called, checked with a breakpoint]
I use other timers with no problems, any clue on what's happening ?
[UPDATE] The variable I'm modifying in the interrupt is set as volatile, it seems that if I don't set this variable as volatile, the hard fault doesn't trigger. I'm using TASKING 4.0.