Hi. I need to send and receive data from UART asynchronously. In order make non-blocking uart_write_bytes() calls, I need to extract an event signaling the starvation of the TX ring buffer (or the TX fifo if 'tx_buffer_size' == 0), and pass it upstream, so that more data can be queued.
Among the eventd generated by the current driver implementation, there is nothing like a UART_TX_DONE.
I am unable to tap into the uart_rx_intr_handler_default() ISR and handle UART_TX_DONE_INT myself, because it's a private implementation and rightfully so.
I am wondering if there is the API has a way to extract a "TX done" event in a simple manner. I was considering launching a task for the sole purpose of calling uart_wait_tx_done() and generate an useful event upon return, but that is way overkill, massively slow and sacrifices RAM to another task for no good reason.
Thanks in advance for any suggestion.
Is the current uart driver missing an UART_TX_DONE event?
Re: Is the current uart driver missing an UART_TX_DONE event?
To followup on the topic: we ended up rolling our own very lean UART driver.
The FIFO status is tracked by a dedicated ISR routine, and interrupt register status is managed with uart_enable_intr_mask(), uart_disable_intr_mask() and uart_clear_intr_status().
Which is a shame because we can't rely on uart_driver_install() and any of the driver/uart.h functions that require the driver, losing lots of features.
My opinion still stands: driver/uart.h should provide an event type signalling the starvation of the TX FIFO/TX buffer. It's a much needed functionality for asynchronous application code.
The FIFO status is tracked by a dedicated ISR routine, and interrupt register status is managed with uart_enable_intr_mask(), uart_disable_intr_mask() and uart_clear_intr_status().
Which is a shame because we can't rely on uart_driver_install() and any of the driver/uart.h functions that require the driver, losing lots of features.
My opinion still stands: driver/uart.h should provide an event type signalling the starvation of the TX FIFO/TX buffer. It's a much needed functionality for asynchronous application code.
Re: Is the current uart driver missing an UART_TX_DONE event?
Hi.
I have the same problem, unable to fire the UART_TX_DONE_INT_ST_M interrupt...
Could you confirm this bug ?
Does anyone have a patch for a solution ?
I have the same problem, unable to fire the UART_TX_DONE_INT_ST_M interrupt...
Could you confirm this bug ?
Does anyone have a patch for a solution ?
Re: Is the current uart driver missing an UART_TX_DONE event?
Has this problem been solved?
Who is online
Users browsing this forum: No registered users and 89 guests