Lost on UART RX timeout
Posted: Wed Jul 13, 2022 7:03 pm
First let me explain what I am trying to do:
I have UART0 running on default pins and have its driver installed with buffers for both RX and TX. No event queue. This works.
Now what I need: some warning on RX timeout! (Do not care about FIFO full and friends).
It seams that default driver does not have an event for TOUT (that's why I have not created an event queue). So I guess interrupt is the way to go, right?
An interrupt that simple use xSemaphoreGiveFromISR on rx timeout will be all I need.
I understand that I must first use uart_isr_free to release current interrupt handler and use uart_isr_register to enable mine.
But isn't this going to break the UART driver previously installed? Do I have to manage TX/RX buffers by myself if I decide to use a custom interrupt? If so, why do people still use uart_driver_install before releasing it?
I have found VERY FEW examples on UART interrupt and despite they set rx_timeout_thresh they all seam to be ignoring it once inside the interrupt code (apart of cleaning it).
Can someone please point me to one real documentation/example for the timeout feature?
Thanks!
I have UART0 running on default pins and have its driver installed with buffers for both RX and TX. No event queue. This works.
Now what I need: some warning on RX timeout! (Do not care about FIFO full and friends).
It seams that default driver does not have an event for TOUT (that's why I have not created an event queue). So I guess interrupt is the way to go, right?
An interrupt that simple use xSemaphoreGiveFromISR on rx timeout will be all I need.
I understand that I must first use uart_isr_free to release current interrupt handler and use uart_isr_register to enable mine.
But isn't this going to break the UART driver previously installed? Do I have to manage TX/RX buffers by myself if I decide to use a custom interrupt? If so, why do people still use uart_driver_install before releasing it?
I have found VERY FEW examples on UART interrupt and despite they set rx_timeout_thresh they all seam to be ignoring it once inside the interrupt code (apart of cleaning it).
Can someone please point me to one real documentation/example for the timeout feature?
Thanks!