2018-11-03 01:20 PM
I have FW with implementation 2 uart IT, I2C, FATFS, MSC etc.
If I do not use IWDG everything is good, works fine I tested it 72 hour without freezing or other problems FW is worked smooth.
But if I set IWDG after few hours running (4-8h) IWDG reset MCU.
I tried add everywhere:
HAL_IWDG_Refresh(&hiwdg)
And I tried IWDG set to maximum (Reload = 4095, Prescale to 256 ) but happens the same.
Please help, thank you
2018-11-03 01:31 PM
I am not sure that the callstack remains visible after a reset.
However,
you cant add HAL_IWDG_Refresh everywhere, that is the point of the watchdog.
It is supposed to be running in the foreground only.
and not in any tasks.
If you could make a variable, declared globally... kept in a place which is not overwritten by reset.
then in all of your tasks, just write a different constant to the variable...
coming out of reset, you will know which module was last running.
2018-11-03 01:47 PM
Well one could fish through memory/stack in Reset Handler before your startup code trashes it. Won't know where it was, or registers. Instrument your code so you understand the flow. Write waypoint data into a known location.
Consider using a TIM to implement a faux watchdog, and have it Fault with diagnostic if you haven't kicked it frequently enough.
Have a periodic interrupt record profiling information.
>>I tried add everywhere
Kinda defeats the point.