diff --git a/targets/TARGET_STM/serial_api.c b/targets/TARGET_STM/serial_api.c index 37c848664e..3dbd1e26c4 100644 --- a/targets/TARGET_STM/serial_api.c +++ b/targets/TARGET_STM/serial_api.c @@ -536,7 +536,9 @@ HAL_StatusTypeDef init_uart(serial_t *obj) #if defined(LPUART1_BASE) if (huart->Instance == LPUART1) { if (obj_s->baudrate <= 9600) { +#if ((MBED_CONF_TARGET_LPUART_CLOCK_SOURCE) & USE_LPUART_CLK_LSE) HAL_UARTEx_EnableClockStopMode(huart); +#endif HAL_UARTEx_EnableStopMode(huart); } else { HAL_UARTEx_DisableClockStopMode(huart);