AnsweredAssumed Answered

STM32F3-Discovery: trigging FPU_IRQHandler with overflow

Question asked by adam.at.epsilon on Sep 16, 2015
Latest reply on Sep 19, 2015 by adam.at.epsilon
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.

Outcomes