2014-07-23 05:26 PM
STM32F4xxx Reference Manual, DM00031020 rev 6, has the �FPU� interrupt vector at position 81, address 0x00000184 (or 0x08000184 depending on how one views low ROM). I found no documentation about what this vector is for. I can only assume that it has something to do with the ARM fp co-processor included in ST�s F4xxx parts.
Would someone please say what this vector is all about.I was able to catch fp instructions with a Usage Fault Exception interrupt. Then (1) enable the fp co-processors, (2) save fp registers leftover from another task and (3) restore the saved fp registers for the current task. Inelegant, but it works. IIRC, the full save restore took fewer than 150 clocks from instruction trap to restarting the trapped instruction. #fpu #stm32f42014-07-23 05:34 PM
I haven't reviewed the FPU documentation (it's a lame implementation), but if it's like others then it probably traps math errors like Division by Zero (or other +/- Infinity Events), loading NaN (Not a Number),etc
FPU_IRQHandler()2014-07-23 05:42 PM
http://infocenter.arm.com/help/topic/com.arm.doc.ddi0439b/BEHHEDBH.html
Rev 4, Pg 2412014-07-24 12:02 AM
''(it's a lame implementation)''
In what way(s) please?2014-07-24 08:10 AM
''(it's a lame implementation)'' In what way(s) please?
Given the functionality of 1980's silicon for the 8087 (45K transistors) and 68881/2 (155/176K transistors) it's a pretty sorry subset. The biggest problem is it's 32-bit, and doesn't hold intermediate values to any level of precision. The aforementioned chips hold computations at 80-bit precision (68-bit mantissa), and supported transcendental functions such as exponential, logarithmic or trigonometric calculations, along with BCD. Now I'm sure there are floating point applications where you can flush precision down the toilet at each turn, but you also have a whole class of people who use floating point to solve computational problems they don't understand, to paper over range/magnitude flaws they don't want to deal with, and are then surprised when the numbers coming out the end are wrong, or more dangerously don't know enough to realize they are wrong.2014-07-24 05:49 PM
Thanks clive1. In my 3 years looking at ST M3/M4 parts I never came across the PM0214 Programming manual.
I hope I have no reason to use the FPU vector. It would be almost useful if the various causes to interrupt could be turned off in the FPSCR. It gets saved and restored on a task by task basis along with s0-s31. Messing with a bit in the word at SETENA+8, although possible, is getting real close to my threshold of pain. More so because I can see little use for this interrupt.