Trying to make an L031 wake up in 65 µs - how?
I've been trying to get an STM32L031 to periodically wakeup with minimal power consumption. The specs say it can standby at under 0.5 µA, which I can confirm, but also that it can wake up within 65 µs, which I cannot reproduce. I'm seeing a 1.6 ms delay with 300..400 µA current consumption. This seems to indicate that the µC is waiting for Vrefint to stabilise, even though I have the FWU bit set. Below is a minimal example which still does not wake up in 65 µs:
#include <jee.h>
int main() {
MMIO32(Periph::iwdg+0x00) = 0x5555; // unlock PR
MMIO32(Periph::iwdg+0x04) = 1; // max timeout is 800ms
MMIO32(Periph::iwdg+0x00) = 0xCCCC; // start watchdog
constexpr uint32_t scr = 0xE000ED10;
MMIO32(scr) |= (1<<2); // set SLEEPDEEP
MMIO32(Periph::rcc+0x38) |= (1<<28); // PWREN
MMIO32(Periph::pwr) |= (1<<10) | (1<<9) | (1<<1); // FWU, ULP, PDDS
__asm("wfi");
}I changed the option byte to disable BOR, but it did not make a difference. My write-up about this issue can be found here: https://jeelabs.org/2018/low-power-l031/
What am I missing?
