STM32L0 LPUART not wakeup on stop mode
Hello everyone,
I'm working on a project with an STM32L072CBT6.
In my project, i use a LPUART1 and USART1 to send and receive data. Connected to this i use a DMA to get data.
My projet works fine so i try to implement stop mode to reduce consumption.
In a previous project i have used stop mode and LPUART1 to wake the MCU so i have implement the same line of code for this project.
But for this project, impossible to wake-up my MCU when data occur on my LPUART (i only need LPUART data wakeup the module). My MCU wakeup well when i trigger an external event on interrupt pin but when a data occur on LPUART nothing happen.
If i check all ressources which talk about use LPUART and stop mode my implementation SEEMS to be correct.
I add below information about my implementation.
Any help or directions are appreciated, thanks in advance!





void stm32_low_power_setup(void)
{
//make sure that no UART transfer is on-going
while (__HAL_UART_GET_FLAG(&huart1, USART_ISR_BUSY) == SET) ;
// make sure that UART is ready to receive
while (__HAL_UART_GET_FLAG(&huart1, USART_ISR_REACK) == RESET) ;
//make sure that no UART transfer is on-going
while (__HAL_UART_GET_FLAG(&hlpuart1, USART_ISR_BUSY) == SET) ;
// make sure that UART is ready to receive
while (__HAL_UART_GET_FLAG(&hlpuart1, USART_ISR_REACK) == RESET) ;
HAL_SuspendTick();
__HAL_RCC_PWR_CLK_ENABLE();
HAL_PWREx_EnableUltraLowPower(); // Ultra low power mode
HAL_PWREx_EnableFastWakeUp(); // Fast wake-up for ultra low power mode
HAL_SuspendTick();
__HAL_RCC_GPIOC_CLK_DISABLE();
__HAL_RCC_GPIOH_CLK_DISABLE();
HAL_GPIO_WritePin(ALIM_I2C_GPIO_Port, ALIM_I2C_Pin, 1);
UART_WakeUpTypeDef wakeup;
wakeup.WakeUpEvent = UART_WAKEUP_ON_STARTBIT;
HAL_UARTEx_StopModeWakeUpSourceConfig(&hlpuart1, wakeup);
__HAL_UART_ENABLE_IT(&hlpuart1, UART_IT_WUF);
HAL_UARTEx_EnableStopMode(&hlpuart1);
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON,PWR_STOPENTRY_WFI);
}Best regards,
MLam
