mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Issue: Serial getc hangs on STM32L053 target

getc() never returns (although new data is available) if the UART received data in the meantime, causing the overrun flag to be set.

A possible fix could be as follows (in mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/serial_api.c):

int serial_getc(serial_t *obj) {
    USART_TypeDef *uart = (USART_TypeDef *)(obj->uart);
    __HAL_UART_CLEAR_IT(&UartHandle, UART_CLEAR_OREF); // <--- add this line
    while (!serial_readable(obj));
    return (int)(uart->RDR & 0xFF);
}

It is likely that other STM32 variants are also affected.

1 comment:

17 Sep 2014

Hi,

can you report this on github, where is mbed SDK. https://github.com/mbedmicro/mbed.

Thanks!