Hi,
in my low-power STM32WL55 application I would like to use the LPUART to receive data (no transmission) while the device is in STOP2 mode. I have two questions about this:
- The reference manual states:
"Before entering low-power mode, make sure that no LPUART transfer is ongoing. Checking the BUSY flag cannot ensure that low-power mode is never entered when data reception is ongoing."
Then how do I check for an ongoing data transfer? The external device connected to the LPUART sends data "spontaneously" so I can't control when this happens, there might be a byte arriving just when I'm entering STOP2 mode. What happens if a reception is ongoing when the device enters STOP2 mode? - I would like to use the HSI oscillator for LPUART reception in STOP2 mode (automatically turning it on when needed). But I would also like to use MSI after wake-up in order to get better flexibility for the CPU frequency (achieving frequencies > 16 MHz, or achieving lower power consumption) by setting STOPWUCK=0. However, keeping both HSI and MSI running results in higher power consumption.
Is it possible to switch the LPUARTs clock from HSI to SYSCLK after wake-up from STOP2 (via LPUART1SEL=1), or will this result in dropping incoming bytes? Does this work only when MSI=16 MHz (like HSI)?
Thanks in advance!