
DocID024597 Rev 5
RM0351
Low-power universal asynchronous receiver transmitter (LPUART)
1411
41.4.11
Wakeup from Stop mode using LPUART
The LPUART is able to wake up the MCU from Stop mode when the UESM bit is set and the
LPUART clock is set to HSI16 or LSE (refer to the
Reset and clock control (RCC) section
.
•
LPUART source clock is HSI
If during stop mode the HSI clock is switched OFF, when a falling edge on the LPUART
receive line is detected, the LPUART interface requests the HSI clock to be switched
ON. The HSI clock is then used for the frame reception.
–
If the wakeup event is verified, the MCU wakes up from low-power mode and data
reception goes on normally.
–
If the wakeup event is not verified, the HSI clock is switched OFF again, the MCU
is not waken up and stays in low-power mode and the clock request is released.
•
LPUART source clock is LSE
Same principle as described in case of LPUART source clock is HSI with the difference
that the LSE is ON in stop mode, but the LSE clock is not propagated to LPUART if the
LPUART is not requesting it. The LSE clock is not OFF but there is a clock gating to
avoid useless consumption.
When the LPUART clock source is configured to be f
LSE
or f
HSI
, it is possible to keep
enabled this clock during STOP mode by setting the UCESM bit in LPUART_CR3 control
register.
Note:
When LPUART is used to wakeup from stop with LSE is selected as LPUART clock source,
and desired baud rate is 9600 baud, the bit UCESM bit in LPUART_CR3 control register
must be set.
The MCU wakeup from Stop mode can be done using the standard RXNE interrupt. In this
case, the RXNEIE bit must be set before entering Stop mode.
Alternatively, a specific interrupt may be selected through the WUS bit fields.
In order to be able to wake up the MCU from Stop mode, the UESM bit in the LPUART_CR1
control register must be set prior to entering Stop mode.
When the wakeup event is detected, the WUF flag is set by hardware and a wakeup
interrupt is generated if the WUFIE bit is set.
Note:
Before entering Stop mode, the user must ensure that the LPUART is not performing a
transfer. BUSY flag cannot ensure that Stop mode is never entered during a running
reception.
The WUF flag is set when a wakeup event is detected, independently of whether the MCU is
in Stop or in an active mode.
When entering Stop mode just after having initialized and enabled the receiver, the REACK
bit must be checked to ensure the LPUART is actually enabled.
When DMA is used for reception, it must be disabled before entering Stop mode and re-
enabled upon exit from Stop mode.
The wakeup from Stop mode feature is not available for all modes. For example it doesn’t
work in SPI mode because the SPI operates in master mode only.