Hi there,
We are experiencing a issue with receiving a complete string via UART. Some bytes are just missing on occasion. UART settings are set up as follow: Baud 19200, 8 Data bits, 1 stop bit, zero parity.
Within our application, our uart receive functionality is implemented as follow:
- Task thread created for receiving
- Within while loop, call UART_read(........, ........., 1U), which continuously reads one byte of data on the uart specified.
- This character is then stored on a buffer, and the while loop should starts over again.
However with this implementation, when multiple bytes are sent to the board, some bytes are just missing. When sending the bytes one by one, the receive function works perfectly. Do you have any suggestions what the issue might be? I have also tried using different terminal prorgams, but the issue is still the same. Here is an example when trying to transmit '0xA3 0xBC 0x02 0xBC 0x02' from RealTerm to the board:
In the above image it is clear that the final bytes is missing. Other times, some bytes in the middle are missing. However, when transmitting the bytes indivudually, as '0xA3' then '0xBC' then ...... '0x02', the bytes are received successfully and placed on the buffer :
A suspicion I have, is that the UART_read API is called too late sometimes when transmitting complete strings, which might cause a byte to go missing? How would you then suggest to change the code in order to immediately store a character on the buffer when an intterupt is received, without having to call the uart_read API?
Do you perhaps have other suggestions what the cause of the issue might be? I look forward to hearing a reply
Kind regards,
Johnny