cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable FPU Exception interrupt handler in STM32H7

Kilian Nötzold
Associate III

Hello,

I try to use the FPU exception interrupt handler in STM32H743ZIT but the FPU interrupt is not coming.

I initialized the interrupt in this way:

HAL_NVIC_SetPriority(FPU_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(FPU_IRQn);

Than provoke a division by zero FPU Exception.

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

In the debugger I can see that the in the FPSCR register the DZC bit is now 1. But the FPU interrupt is not pending. When I manually set the interrupt to pending the handler is called.

In the ACTLR register the FPEXCODIS is 0 so exception outputs should be enabled.

So were else I need to enable the FPU exceptions?

Thanks

2 REPLIES 2
Kilian Nötzold
Associate III

No one else facing this issue?

I have attached a test project for the STM32H743ZI-Nucleo Board.

When it running the green LED1 is blinking. If the user button is pressed a division by zero is provoked.

In case the division by zero bit in the FPSCR register is set the blue LED2 goes on

In case the FPU IRQ is called the red LED3 goes on (this is not happening because of the issue)

For those who may come across this thread: probably due to "FPU interrupt not present" erratum, probably not yet published at the time when this thread was started.

Slightly related to https://community.st.com/s/question/0D53W000007XQl9SAG/division-by-zero-exception-flag-not-set-in-stm32h7-fpu