cancel
Showing results for 
Search instead for 
Did you mean: 

UART and STOP 2 Low Power mode [stm32L496VG]

deckhard
Associate III

Hi,

UART stops transmitting (both IT and polling modes) after entering and exiting from STOP 2 mode.

Although I'm renabling the UART when I'm exiting STOP 2 I don't see the data received on the other side.

When I'm connected to MCU via JTAG everything works well because the JTAG blocks the MCU from entering STOP 2. Once I disconnect the JTAG and reset the device, it does enter STOP 2 mode but the UART stops funciotioning.

Any thoughts?

Anything else I need to enable when I exit STOP 2?

If that matters, I use RTC as the wake up source, and the STOP 2 mode is configured with WFI.

Thanks!

5 REPLIES 5
TDK
Guru

You're likely just missing something on re-initialization after it exits stop mode. stm32l4xx_hal_pwr.c lists the requirements after exiting stop mode.

If you feel a post has answered your question, please click "Accept as Solution".
deckhard
Associate III

Thanks.

Any idea on how to save the state of GPIO's prior to entering STOP 2 mode, and then read the IO state when exiting low power?

TDK
Guru

From the reference manual:

> SRAM1, SRAM2 and register contents are preserved.

So save stuff there. Or you could save to flash if you have a page available.

Also from the manual:

> In the Stop 2 mode, all I/O pins keep the same state as in the Run mode.

So no need to re-initialize GPIO pins.

If you feel a post has answered your question, please click "Accept as Solution".
Mohamed Aymen HZAMI
ST Employee

Hello,

When entering STOP2 mode the UART is clocked off so after the Wake-up you need to re-clock the UART, then will work well, you can also refer to the online training here, and you can refer to the pwr controller of the training here.

Best Regards,

Mohamed Aymen.

deckhard
Associate III

Do you think that STOP2 can work as the sleep mode when using FreeRTOS' tickless idle feature?

obviously one would have to rewrite the preSleepProcess and postSleepProcess functions, but theoretically would going in and out of STOP2 using so rapidly using the IDLE task would still hold the OS's scheduler performance and everything else?

Do you know of an example for that?