This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

FP calculation error in Interrupts of STM32F051, Keil C-Compiler V5

HI,
I've inherited (the original author left the company) complex C code, to be compiled with Keil C V5, -o1, for a STM32F051R8. The problem: during Interrupts are FP calculations made. Timing dependent (very stringent) sometimes these FP calculations give wrong values, about a factor of 100. If I do dummy FP calculations in a routine which is called by the Interrupt routine - the FP values are of type 'volatile float' therefore the code is generated and not optimized away - and don't use these results, the above mentioned FP errors vanish.
Has anybody an answer for such behavior? I don't like to include that 'fix' when I don't know how it works and cures the 'fix' the behavior for all timings?
Any answer appreciated, Hans

PS: That was the reason for my last question about Interrupt enable/disable.