Dear All
I am using interrupt-driven UART callback. It is obviously working because I get 4-5 characters from the UART, but the remaining characters I can not get. I know that the characters are being transmitted.
In a nutshell, my UART receiver only can only process 4 characters.
It is an apparent resource issue on my device, but I am not sure what I should try. I have attempted to use CONFIG_MAIN_STACK_SIZE = 4096 and CONFIG_HEAP_MEM_POOL_SIZE = 8192 in prj.conf, but the issue has not been solved. It is unknown to me at this point why the rest of the characters do not generate interrupts.
I tried to get a list of errors by running uart_err_check(dev), but this call always returns 0 (no error). Any other debugging ideas ?
Any ideas are appreciated !
static void uart_callback(const struct device *dev, void *user_data)
{
static uint8_t data[16];
static int numchars;
int ret;
uint8_t err_code;
if (!uart_irq_update(dev)) {
return;
}
if (!uart_irq_rx_ready(dev)) {
return;
}
//stop_reason=uart_rx_stop_reason (dev); // this one is for events, use with DMA
//err_code = uart_err_check(dev); //all err codes are 0x0
/* read until FIFO empty */
while (numchars = uart_fifo_read(dev, &data, 16)) {
ret = ring_buf_put(&my_ring_buf, &data, numchars);
}
} // end of uart_callback()`