Any methods to check data in uart tx fifo has already been sent

wxd2024
Posts: 9
Joined: Wed Jun 19, 2024 7:48 am

Any methods to check data in uart tx fifo has already been sent

Postby wxd2024 » Tue Aug 20, 2024 12:41 pm

Greetings,

Is there any methods to check the data that is written into uart tx fifo has been sent out by the hardware after calling uart_hal_tx_fifo_write(). It seems UART_TX_DONE interrupt just indicates tx fifo is empty instead of assuring the data has been actually sent out.

Regards

aliarifat794
Posts: 200
Joined: Sun Jun 23, 2024 6:18 pm

Re: Any methods to check data in uart tx fifo has already been sent

Postby aliarifat794 » Tue Aug 20, 2024 1:45 pm

The ESP32 UART peripheral provides a UART_TX_DONE status bit, which is set when both the TX FIFO and the TX shift register are empty. This indicates that all the data has been transmitted.
https://docs.espressif.com/projects/esp ... /uart.html
https://esp32.com/viewtopic.php?t=10469

wxd2024
Posts: 9
Joined: Wed Jun 19, 2024 7:48 am

Re: Any methods to check data in uart tx fifo has already been sent

Postby wxd2024 » Tue Aug 20, 2024 4:30 pm

Dear aliarifat794

Thanks a lot for the help. Both checking UART_TX_DONE status bit and adding a delay before sending the next byte are promising solutions. For checking the status bit, could you give some hints on how to get it, since I can't find any info in the idf document.

Best regards

MicroController
Posts: 1726
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Any methods to check data in uart tx fifo has already been sent

Postby MicroController » Tue Aug 20, 2024 9:00 pm

wxd2024 wrote:
Tue Aug 20, 2024 12:41 pm
It seems UART_TX_DONE interrupt just indicates tx fifo is empty instead of assuring the data has been actually sent out.
To me it seems that there is a difference between the UART_TXFIFO_EMPTY and the UART_TX_DONE interrupts.

wxd2024
Posts: 9
Joined: Wed Jun 19, 2024 7:48 am

Re: Any methods to check data in uart tx fifo has already been sent

Postby wxd2024 » Wed Aug 21, 2024 5:12 am

Yes, I think so. Maybe there is some other reasons causing my problem. I will check it again.

Who is online

Users browsing this forum: Bing [Bot] and 91 guests