3

Is it possible to periodically wake up while you're in VBAT mode with STM32 devices that support it? I want to be able to wake up every so often (say, every 5 minutes) and log the time in the backup SRAM that is provided. The problem is, I can't seem to find anything in the STM32L5 datasheets and application notes that indicate whether or not you can execute instructions while in VBAT mode. I also can't find anything that indicates if you can interrupt while in VBAT mode.

Also, is it possible to interrupt and save information at the very moment that power is lost and then enter VBAT mode? Or does it immediately enter VBAT mode and the hope is that I already had the information saved prior to power loss?

A third question I have, is it possible to configure the RTC to send out a signal every 5 minutes while in VBAT mode (in case I decide to have external circuitry handle things)?

The microcontroller that I am working with is the STM32L552ZE. This is a link to the datasheet: https://www.st.com/resource/en/reference_manual/rm0438-stm32l552xx-and-stm32l562xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

UPDATE:

For those who find themselves wondering this same thing, here is what I found based on Justme's answer:

When the microcontroller is supplied from VBAT, neither external interrupts nor RTC alarm/events exit the microcontroller from the VBAT operation (3.9.7).

I still feel that STM is being a little bit cryptic about what VBAT mode does to the microcontroller, but otherwise, it seems that you cannot execute instructions of any sort while in VBAT mode and the VBAT supply has no physical way of supplying power to the microcontroller.

Dan
  • 45
  • 4

2 Answers2

2

No, code execution with only Vbat is not possible. CPU core is not powered from Vbat.

Vbat domain only consists of RTC, LSE and backup registers.

See section 3.9.7 Vbat operation or section 5.1.6 Power supply scheme.

Justme
  • 147,557
  • 4
  • 113
  • 291
  • Thank you for taking the time to reply.

    What document are you referring to? The stm32l552 reference manual does not have three levels, but only two (section 3 is also the boot section of the documentation).

    – Dan Feb 23 '22 at 16:43
  • The chip datasheet. It tells the specs of the chip. Not the reference manual which tells how to use peripheral registers. Sorry I did not see you linked to reference manual while talked about datasheet - completely different documents. – Justme Feb 23 '22 at 16:52
  • Oh, no worries. I'll check it out! – Dan Feb 23 '22 at 16:55
1

My stm32f1 reference manual says:

When the backup domain is supplied by VBAT (analog switch connected to VBAT because VDD is not present), the following functions are available: PC14 and PC15 can be used as LSE pins only  PC13 can be used as TAMPER pin, RTC Alarm or Second output (refer to Section 6.4.2: RTC clock calibration register (BKP_RTCCR)).

So you could output RTC alarm on the Tamper pin (RTC_OUT / PC13) and use it to enable your main power supply connected to VDD. From there you can probably continue waking up as usual.

The alarm output lasts one clock cycle (25us for 40kHz LSI), so it needs to be captured with a latch, before passing to power supply enable pin.

Radzor
  • 110
  • 7