2020-12-08 07:07 AM
I have a minimal prototype circuit (breadboard actually) with this schematic:
The firmware initializes a few peripherals (including the RTC) and enters an infinite loop calling __WFI(). Nothing else happens and nothing else outside the BOOT0 pulldown is connected.
I am applying 3.0V to VBAT with a power supply, measuring current with an HP 6.5 digit meter.
When VDD (3.3V) is applied, I am observing 31uA draw from VBAT. When VDD is removed, current draw from VBAT drops to about 1uA, which is expected and normal.
Why the high current draw when the system is powered? Something is really off here!!!
UPDATE: The offending peripheral is the ADC. Looking at the errata, there is a mention of increased current consumption when PC0..5 pins are configured as analog, but this isn't the case here. The ADC channels are PA0 and PA1.
2020-12-08 07:53 AM
It turns out that the culprit is VBAT monitoring via the internal SAR ADC. 31uA is a lot of current, and there is no way to buffer the voltage source since it's wired internally. So the only viable approach is to enable it once in a blue moon, sample the reading and disable it immediately.
Now that I think about it, one could disable internal VBAT monitoring and wire VBAT to a proper buffer, then the ADC ... but that's extra BOM :(
2020-12-08 11:06 AM
:)
JW
2020-12-08 03:13 PM
Thanks, @Community member that's a nice way to say "RTFM" :>