Hi all,
I've started using the CMSIS library (see also: http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/271533/952855.aspx), and everything seems to be working. We are using the arm_rms_f32 function for doing an RMS on an AC voltage and current, and the arm_fir_f32 in an interrupt handler to do a moving-window averaging filter.
We noticed something strange though, every so often the arm_rms_f32 function throws QNAN, when the values in the input array look fine. If we put in a breakpoint when a NAN occurs and have it re-calculate the value, the rms function always comes up with the right answer.
During our debugging, I tried this with an IntMasterDisable/Enable around the function, and this caused it to work just fine and never throw NAN. I don't like the disable-interrupts solution, it seems like there's some bigger problem at work here. Since this has to do with the FPU and DSP logic, I tried a solution that the estimable cb1_mobile threw out for another problem we were having and I now call the functions FPUEnable() and FPULazyStackingEnable() at the start of the code, before I enable Sys/BIOS. This had no effect, unfortunately - it looks like the IntMasterDisable is the only way to get it to work.
Anyone know if my problem is that there are FPU instructions being used in both regular code and the interrupt handler, that my FPU-using function (arm_rms_f32) is being interrupted, or something else? Is there any solution besides holding off all interrupts?
Thanks for the help.
-Ben