Is the current uart driver missing an UART_TX_DONE event?

neta8266
Posts: 2
Joined: Fri Nov 02, 2018 6:10 pm

Is the current uart driver missing an UART_TX_DONE event?

Postby neta8266 » Fri Nov 02, 2018 11:04 pm

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.

neta8266
Posts: 2
Joined: Fri Nov 02, 2018 6:10 pm

Re: Is the current uart driver missing an UART_TX_DONE event?

Postby neta8266 » Mon Nov 05, 2018 1:51 pm

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.

monier
Posts: 1
Joined: Thu Nov 22, 2018 9:23 am

Re: Is the current uart driver missing an UART_TX_DONE event?

Postby monier » Thu Nov 22, 2018 9:31 am

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 ?

bunana
Posts: 2
Joined: Wed Jul 06, 2022 7:36 am

Re: Is the current uart driver missing an UART_TX_DONE event?

Postby bunana » Wed Jul 06, 2022 7:56 am

Has this problem been solved?

Who is online

Users browsing this forum: No registered users and 99 guests