IWDG not stopping on debug when CAN Receive interrupt triggered
I'm having a significant problem debugging my board with CAN traffic. Whenever the debugger is paused, and a CAN message is received via interrupt, the independent watchdog is being reset. As far as I can tell, I'm disabling that peripheral on debug correctly, but anytime I set a breakpoint, the IWDG is resetting the MCU. If my board does NOT receive any CAN messages, everything works as expected.
Relevant Information
- MCU: STM32F091VB
- Development Environment: IAR Embedded Workbench 9.30
- Debug Probe: STLink/V2
Below is my code for disabling peripherals for debugging:
//Halt Interrupts on Debug stop
__HAL_RCC_DBGMCU_CLK_ENABLE();
__HAL_FREEZE_IWDG_DBGMCU();
__HAL_FREEZE_WWDG_DBGMCU();
__HAL_FREEZE_TIM1_DBGMCU();
__HAL_FREEZE_TIM2_DBGMCU();
__HAL_FREEZE_TIM3_DBGMCU();
__HAL_FREEZE_TIM16_DBGMCU();
__HAL_FREEZE_CAN_DBGMCU();Disabling the watchdog entirely appeared to work, but pausing in the debugger only allows me to debug the CAN interrupt, so it seems when the debugger is paused, the MCU gets stuck in the CAN interrupt.