Skip to main content
buff thokoa
Associate II
April 24, 2021
Solved

STM32L0 UART/LPUART wake from STOP MODE

  • April 24, 2021
  • 2 replies
  • 1731 views

Hi,

I am using the MX Cube example in STM32Cube_FW_L0_V1.12.0\Projects\32L0538DISCOVERY\Examples\UART\LPUART_WakeUpFromStop.

I have modified it to use the STM32L0538NUCLEO BSP and to use USART2.

I had to add a HAL_SuspendTick in order to get into STOP mode.

All of that is working and I can get into stop mode. I am then trying to use a terminal to wake up the unit which never works.

Is there something else that has to be done to wake up the MCU via UART in stop mode??

I have added my code

This topic has been closed for replies.
Best answer by buff thokoa

This has been resolved...

The problem was the peripheral clock selection had not been updated

 PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USART2;

 PeriphClkInitStruct.Usart2ClockSelection = RCC_USART2CLKSOURCE_HSI;

2 replies

buff thokoa
buff thokoaAuthorBest answer
Associate II
April 24, 2021

This has been resolved...

The problem was the peripheral clock selection had not been updated

 PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USART2;

 PeriphClkInitStruct.Usart2ClockSelection = RCC_USART2CLKSOURCE_HSI;

ST Technical Moderator
May 10, 2021

Thanks @buff thokoa​  for sharing your solution :)

I marked your answer as Best, this will help other users find that answer faster.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks