I've got a unexpected problem with Interrupts. Would be nice to discuss it.
I use Timer0 to have about 16000 fast interrupts (FIQ) per second. There is a AD-Conversation and a few lines of long long int aritmetic to compute. Inside this FIQ-routine there is a static counter. When it reaches 16000 it is reseted and a Software interrupt (SWI) is generated every second.
The SWI-routine has do to some computations and then to display it all on a special three wire conected display.
The programm does not work with 16000 Timer0 Interrupts per second. It is terminated by Abort-Mode. This comes a little unexpected to my. The effect is gone if i turn down FIQ frequency downto 100Hz. Is it possible that interrupts create a stack overflow?
Should i post my code?
char text[10];
sprintf(text,"%8.d",(D3 * 125) >> 27);
static long long unsigned int ACC3D,D1,D2,D3,D1D,D2D;
George, remember that "%8.d" is a minimum width specifier, not a maximum and that D3 is a 64 bit integer that is probably increasing in value with the number of FIQs.
A 64 bit integer is then being shifted right by 27 bits before being passed to sprintf (who is probably looking at it as a 32 bit integer but it can be still big enough to cause an overflow in your 10 character buffer).
I'd guess would be that you will get a pre-fetch abort when sprintf tries to return to IRQ_Handler because the buffer overflow on "text" trashes the LR that sprintf pushed to the stack.