2019-05-08 08:25 AM
I'm using a Nucleo F429ZI, and want to use the VBAT mode when the controller loses VDD. Are there any flags that are specifically set or reset when the controller enters or leaves VBAT mode? I read in a reference manual that a power-down reset is what triggers the controller to enter VBAT mode, and I think the RCC_FLAG_PORRST indicates this. However, my understanding is that this flag can be set whether or not there is a battery connected. I'm wondering if there is a specific way to know about: when the controller enters or leaves VBAT mode, or when the controller re-powers up after a case where the battery runs out, etc.
2019-05-08 03:02 PM
> Are there any flags that are specifically set or reset when the controller enters or leaves VBAT mode?
No.
> I'm wondering if there is a specific way to know about: when the controller enters or leaves VBAT mode,
No.
> or when the controller re-powers up after a case where the battery runs out, etc.
No.
At least not in a comfortable form of an unambiguous flag, you'd like to have it.
Of course, you can measure VBAT periodically and store result to VBAT-powered memory, e.g. RTC registers or or the backup-RAM, or other nonvolatile memory; and then upon restart have a look whether VBAT is still high enough and compare with the previously stored value - but beware, measuring VBAT has its cost in form of current drawn from battery during measurement.
JW