cancel
Showing results for 
Search instead for 
Did you mean: 

F4 FPU interrupt vector

picguy2
Associate II
Posted on July 24, 2014 at 02:26

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 #stm32f4
5 REPLIES 5
Posted on July 24, 2014 at 02:34

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()
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on July 24, 2014 at 02:42

http://infocenter.arm.com/help/topic/com.arm.doc.ddi0439b/BEHHEDBH.html

Rev 4, Pg 241

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/programming_manual/DM00046982.pdf

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
John F.
Senior
Posted on July 24, 2014 at 09:02

''(it's a lame implementation)''

In what way(s) please?

Posted on July 24, 2014 at 17:10

''(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.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
picguy2
Associate II
Posted on July 25, 2014 at 02:49

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.