cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F3-Discovery: trigging FPU_IRQHandler with overflow

adam239955
Associate II
Posted on September 16, 2015 at 11:22

Hi, I am attempting to have interrupts for overflow and underflow of `float` variables by implementing the FPU_IRQHandler function and enabling the interrupts.

Using disassebly & OpenOCD debugger I can see that

vadd.f32

instruction is called. In the debugger I can see that the fl value of my loop goes to ''inf'':

    float fl = 2;

    while (1) {

      fl = fl *2;

    }

And I enable the interrupts like this:

  __HAL_SYSCFG_INTERRUPT_ENABLE(HAL_SYSCFG_IT_FPU_IOC); /*!< Floating Point Unit Invalid operation Interrupt */

  __HAL_SYSCFG_INTERRUPT_ENABLE(HAL_SYSCFG_IT_FPU_DZC); /*!< Floating Point Unit Divide-by-zero Interrupt */

  __HAL_SYSCFG_INTERRUPT_ENABLE(HAL_SYSCFG_IT_FPU_UFC); /*!< Floating Point Unit Underflow Interrupt */

  __HAL_SYSCFG_INTERRUPT_ENABLE(HAL_SYSCFG_IT_FPU_OFC); /*!< Floating Point Unit Overflow Interrupt */

  __HAL_SYSCFG_INTERRUPT_ENABLE(HAL_SYSCFG_IT_FPU_IDC); /*!< Floating Point Unit Input denormal Interrupt */

  __HAL_SYSCFG_INTERRUPT_ENABLE(HAL_SYSCFG_IT_FPU_IXC); /*!< Floating Point Unit Inexact Interrupt */

Yet FPU_IRQHandler is never called during the infinte loop. Setting a breakpoint in FPU_IRQHandler with the debugger doesn't break the program.

#interrupts #interrupts #stm32f3 #fpu #fpu #cube #hal
1 REPLY 1
adam239955
Associate II
Posted on September 19, 2015 at 11:22

Checking the NVIC->IABR register with the debugger show all IABR[0-7] to be zero even though fpscr register says 0x14 so my working theory is that the interrupt was not enabled correctly.