Hi all
I currently have a project where i send and receive commands over UART to another chip. When i receive a message over UART, a callback is triggered and I continuously read the serial terminal using "uart_fifo_read(uart_dev_test, &c, 1) " until the end of the line is found. Why is it that when the when the buffer reaches over 300 bytes, i seem to miss characters over the UART line?
static char serial_response[1000];
void serial_cb(const struct device *dev, void *user_data)
{
if (!uart_irq_update(uart_dev_test))
{
return;
}
uint8_t c;
uart_fifo_read(uart_dev_test, &c, 1);
rx_buf[0] = c;
// Check to see if buffer is full
if (((strlen(serial_response) + strlen(rx_buf)) > 1000))
{
LOG_WRN("Response buffer full");
}
else
{
strcat(serial_response, rx_buf);
}
clearCharArray(rx_buf, sizeof(rx_buf));
if ((c == ASCII_NEW_LINE || c == ASCII_CARRIAGE_RETURN))
{
// Do something
}