Page 1 of 1

Floating point in ISR?

Posted: Fri Dec 30, 2016 7:24 pm
by cmason
Is use of floating point instructions disallowed in interrupt routines?

Thanks,

-c

Re: Floating point in ISR?

Posted: Mon Jan 02, 2017 2:03 pm
by ESP_Sprite
It's not a good idea, no. The floating point registers aren't saved on ISR entry, so using floats in an interrupt means that the fpu registers as used by the currently running thread are corrupted. If there's no such thread, I'm not exactly sure what happens, but my guess would be a coprocessor exception resulting in a panic.

We're aware of this restriction, we're brooding on a nice way to fix it in the future, but for now, please do not use floating point stuff in ISRs.

Re: Floating point in ISR?

Posted: Wed Jul 07, 2021 11:12 am
by Martin Schultz
Is it already possible to use floating point in ISR? It's been 4 years since the creation of this topic and I still have this restriction on my esp-wroom-32d.

Re: Floating point in ISR?

Posted: Thu Jul 08, 2021 1:23 am
by ESP_Sprite
There's an option in menuconfig now to enable the FPU inside an ISR (ref)