cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32L4] [USARTx] How to configure USART as a wakeup source

sunny
Associate II
Posted on August 08, 2016 at 06:14

Hi,

I am using USART interface - Rx as Interrupt and am configuring the Rx as 1-byte receive interrupts.

Is there a way by which, this interface can be configured explicitly as a wake-up source like we get the interrupts on the GPIOs configured as interrupts ?

Thanks,

Sunny

#stm32l4 #wakeup #usart
2 REPLIES 2
Walid FTITI_O
Senior II
Posted on August 09, 2016 at 14:38

Hi bhayani.sunny

You should,

first, 

check  the reference manual of the STM32L4 (RM035)1. In 36.5.17 section “Wakeup from Stop mode using USARTâ€�, it is mentioned how the USART can wakeup from stop mode and the configuration that should be done on both RCC and USART peripherals.

I recommend also the “UART_WakeUpFromStopâ€� example in 

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubel4.html

 at this path: STM32Cube_FW_L4_V1.5.0\Projects\STM32L432KC-Nucleo\Examples\UART\UART_WakeUpFromStop

-Hannibal-

sunny
Associate II
Posted on August 19, 2016 at 06:47

Hi Hannibal,

Thank you for the reply.

I referred the code that you have mentioned.

But, I am trying to enter SLEEP mode, and from that, I am missing UART bytes. I observed that, most of the times, I am missing 2nd byte in the UART when the system is in SLEEP.

Can you please give pointers for the same.

I checked the HAL files for UART, but I did not see API's for SLEEP mode (STOP mode API's are present).

Thanks,

Sunny