RCC_FLAG_IWDGRST Always 0
Hello,
I am working on adding an IWDG to firmware on a STM32F070CBT6TR. The Watchdog resets perfectly fine. I cause the watchdog to reset the MCU by not resetting the timer. I then try to read the RCC_FLAG_IWDGRST and it is always 0. This is what my main looks like before trying to read the flag.
bool g_wd_caused_reset = false;
int main(void)
{
// MCU Configuration----------------------------------------------------------
NVIC_SetVectorTable(); // Reset vecter table
__HAL_REMAPMEMORY_SRAM(); // Remap boot address to SRAM
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET)
{
g_wd_caused_reset = true;
}
...
...
}My expectation is that RCC_FLAG_IWDGRST would read 1 after the watchdog causes a reset, but I never see g_wd_caused_reset == true.
My IWDG is configured to reset after ~26 seconds.
Any help is appreciated,
Thank you.
