cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 FPU exception management

Gpeti
Senior II

Hello,

I'm doing some tests on the STM32H743 FPU (on a Nucleo, from Keil v5 IDE).

I've checked that the FPU is enabled (register CPACR) and I've written a basic division by 0 test .

volatile double test = 0;
test = 1.0 / test;

I checked the assembly code. I've got as expected the following instruction:

VDIV.F64 d0,d0,d1

where d1 contains 0x00...00 (numerical value 0) and d0 contains 0x3FF00...00 (numerical value 1).

The instruction executes but the result (value in d0) remains the same (0x3F00...00) and there is no flag indicating the division by zero exception (flag DZC in FPSCR).

If I do the same test in single precision

volatile float test = 0;
test = 1.0f / test;

the result after

VDIV.F32 s0,s2,s0

in s0 is indeed a float representation for infinity.

What am I missing ?

0 REPLIES 0