I am thinking to charge a capacitor using ( GPIO connected to Transistor base : A Switch ) drawing current from Vcc
Once fault is generated Switch will get activated and charge the capacitot and keep the switch open till power is available.
Once power is OFF, this capacitor will be drained by resistor connected to it to ground. ( Now I need to make sure the discharging time of this cap should be 30 seconds. need to control time constant )
On Powering ON micro will check for status of the capacitor charge using another GPIO; if it fully drained means 30 seconds of power off time has been done
Else will consider fault condition persists. ( In fault condition Vcc is available with some LED indication )
Does this look good on paper??