Using UHCI and regular UART at same time

alex000090
Posts: 9
Joined: Tue Dec 24, 2024 9:07 am

Using UHCI and regular UART at same time

Postby alex000090 » Thu Oct 16, 2025 6:12 pm

Dear all,

Could you help me to understand an ability of using the regular UART RX and UHCI RX at same time?
Some more information about the task. Now I use regular UART RX and TX to spelling with my PC with some commands and answers. I want to change RX mode from UART to UCHI after sending some special UART command from the PC to receive some big data to some buffer placed on PSRAM. And I want to change RX mode back after data was received.

Currently I use customized UART according the example: https://github.com/espressif/esp-idf/bl ... ple_main.c
So regularly I use xQueueReceive to queueing and I do "uart_read_bytes" when data is gone. I don't clearly understand how I can add UHCI mode to my scheme.

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

Re: Using UHCI and regular UART at same time

Postby MicroController » Fri Oct 17, 2025 8:25 am

https://docs.espressif.com/projects/esp ... /uhci.html

https://github.com/espressif/esp-idf/tr ... rt_dma_ota

I guess switching back and forth between interrupt-driven and DMA operation is probably not worth the effort. (You may have to uninstall and reinstall the UART driver, but I'm not sure about that.)

For bigger transfers via the regular UART driver you should set a large RX full threshold, e.g. 100 or 120 bytes, to make good use of the UART's RX FIFO. (At 1MBit/s (=100000bytes/s) and with a 100 byte RX threshold, you'd get 1000 UART RX interrupts per second, which isn't that much to handle.)

alex000090
Posts: 9
Joined: Tue Dec 24, 2024 9:07 am

Re: Using UHCI and regular UART at same time

Postby alex000090 » Sat Oct 18, 2025 5:52 pm

Dear MicroController,

Thanks a lot for your answer! Reinstalling the driver seems a bad way for me due to it's regularity. I'll try to use regular UART so.

Who is online

Users browsing this forum: Amazon [Bot], Baidu [Spider], Google [Bot] and 9 guests