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

floating point inside an ISR

We have an application where we need to do some basic floating point operations within an interrupt. I am aware that this is not the most desirable practice, but, my question is, does the compiler create code that is safe/mutually exclusive in respect of the FPU.

We are using the STM32F4 running at 168MHz; an external interrupt occurs at 133kHz, at which point we read some external variables, do some floating point multiplies and add them to accumulators. In the main loop we periodically do some math on the accumulated data that takes aprox 330mS. The interrupt duty cycle is - 2.2uS in interrupt, - 5.3uS in main, so there is a high probability that floating point operations will occur 'concurrently'.

Is there a danger that the floating point operations carried out by the ISR could be corrupted by operations carried out by the main,

Regards
Konrad

0