Page 1 of 1

Using UHCI and regular UART at same time

Posted: Thu Oct 16, 2025 6:12 pm
by alex000090
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.

Re: Using UHCI and regular UART at same time

Posted: Fri Oct 17, 2025 8:25 am
by MicroController
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.)

Re: Using UHCI and regular UART at same time

Posted: Sat Oct 18, 2025 5:52 pm
by alex000090
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.