Open gitMichael opened 3 years ago
I would think the core issue is the time between when STM32L0 internally comes back from STOP mode and when the uart driver then is able to service the peripheral. The first character will be latched in the "receive data register", but it looks like the 2nd character and perhaps 3rd one will be lost.
The relevant code is in system/STM32L0xx/Source/stm32l0_system, stm32l0_system_sleep().
One possible fix for 115200 could be to use WUS == 10 for the USART instead of WUS == 11 in stm32l0_uart.c, stm32l0_uart_configure().
I would think that realistically this UART feature will work only up to 38400. If the baudrate gets too high you need to keep HSI16 alive in STOP, which adds an extra 150uA ...
if you send terminal string e.g. '01234' echo is '0234' with testcode below on a NUCLEO-L073RZ. Switching of DMA in variant.cpp doesn't change anything. With 230400 Bd echo is '034', but at 56700 Bd and lower everything is OK ('01234'). Where start searching?