2015-09-16 02:22 AM
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 thatvadd.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 #hal2015-09-19 02:22 AM
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.