2016-06-30 10:39 PM
Hello all,
I use STM32F303VC and plant to use UART to receive data, but the receive size of data are different. Does anyone know how to implement it?Thanks2016-07-01 01:27 AM
Hi,
You can refer to the UART examples under package:STM32Cube_FW_F3_V1.5.0\Projects\STM32303C_EVAL\Examples\UARTRegards2016-07-01 01:39 AM
Use single-character reception, if possible (RX interrupt).
Use a receive buffer sufficient for the maximal message length, including some headroom. Check for buffer index range, message start character and message termination character, in that order. On start character, reset the buffer index to zero. On index overflow, too, but ignore the character. On message termination, copy the message immediately to a processing buffer for further checks/processing. Otherwise, new characters might start to overwrite it in the meantime. The reception and processing of Modbus-ASCII or GPS (NMEA183) are a good examples to google for.